Open Tibia Server

Forum Zostalo Stworzone By Pomagać Ludzi± W Grze Tibia Ots


#1 2008-12-25 15:05:20

Michal

Administrator

Zarejestrowany: 2008-12-24
Posty: 51
Punktów :   

NPC Heal ten npc leczy wszystkich graczy za darmo !!!

Wchodzimy w Npc/Scripts/ Tworzymy notatnik , a w nim wpisujemy:

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
-- OTServ event handling functions start
function onCreatureAppear(cid)              npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid)             npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg)     npcHandler:onCreatureSay(cid, type, msg)
    if(cid ~= npcHandler.focus) then
        return false
    end
    if msgcontains(msg, 'heal') then
        health = getCreatureHealth(cid)
        if health < 65 then
            maxhealth = getCreatureMaxHealth(cid)
            ammount = maxhealth - health
            doCreatureAddHealth(cid, ammount)
            selfSay('Let me heal you.')
        else
            selfSay('Sorry, you are not badly hurt')
        end
    end
end
function onThink()                         npcHandler:onThink() end
-- OTServ event handling functions end
npcHandler:addModule(FocusModule:new())

Zapisujemy jako healer.lua

W miejscu --

if health < 65 then

-- masz liczbę 65, oznacza to że może uleczyć gracza dopiero, gdy ma 65 hp. Możesz oczywi¶cie zmienić t± liczbę.


W data/npc tworzymy notatnik , a w nim wpisujemy:

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Healer" script="data/npc/scripts/healer.lua" autowalk="1" floorchange="0" speed="12">
    <health now="100" max="100"/>
    <look type="128" head="0" body="0" legs="0" feet="0" addons="0"/>
</npc>

Zapisujemy jako Healer.xml

Oczywi¶cie musimy ustawić gdzie ma stać nasz Npc

Wiec wchodzimy w data/world/npc.xml


Edytujemy plik Npc.xml

i dodajemy pod:
<npclist>

<npc name="Healer" x="xxx" y="xxx" z="x" dir="2"/>

Niebieski = Położenie Healera - gdzie Healer ma się znajdować

Offline

 

Stopka forum

RSS
Powered by PunBB
© Copyright 2002–2008 PunBB
Polityka cookies - Wersja Lo-Fi


Darmowe Forum | Ciekawe Fora | Darmowe Fora
Noclegi Burgberg noclegi ciechocinek Specialiste boite de vitesses manuelle drewno kominkowe Kalwaria Zebrzydowska