Ogłoszenie

Poszukujemy gotowych użytkowników na zostanie Moderatorem. Aby zostać Moderatorem trzeba przejść Test.

#1 2008-07-31 12:56:08

Elite

Nowy

Zarejestrowany: 2008-07-31
Posty: 3

lekarz

czesc na zlecenie gm stworzylem lekarza


NPC Heal

W NPC/scripts/ utwórz plik healer.lua, a w nim:

Kod:

Kod:

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())

W miejscu
Kod:

        if health < 60 then

masz liczbę 60, oznacza to że może uleczyć gracza dopiero, gdy ma 60 hp. Możesz oczywiście zmienić tą liczbę.

W NPC/ utwórz plik Healer.xml, a w nim:

Kod:

Kod:

<?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>

Tibia to bóg...
Sile to podstawa....
Pk to zabawa....
                                 †ELITE†

Offline

 
Witamy na Forum Tibia-24

Stopka forum

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


Darmowe Forum | Ciekawe Fora | Darmowe Fora
www.4zsh.pun.pl www.kakashi.pun.pl www.naszepowolanie.pun.pl www.lifeninjaorganizacja.pun.pl www.qp.pun.pl