Nie tylko o Tibii i OTS...
W data/npc/ tworzysz plik Quest Changer.Xml i spisujesz w nim to:
<npc name="Quest Changer" script="data/npc/scripts/quest.lua" lookdir="3" autowalk="25"> <health now="500" max="500"/> <look type="111" head="0" body="0" legs="0" feet="0"/> <parameters> <parameter key="message_greet" value="Witam |PLAYERNAME|. Zamieniam itemki z questo na nagrody powiec 'pomoc'." /> <parameter key="message_needmoremoney" value="Niemasz tyle kasy." /> <parameter key="message_decline" value="Czy |TOTALCOST| to za duzo dla ciebie?" /> </parameters> </npc>
Potem wejdź w /data/npc scripts stworz plik quest.Lua i wpisz w nim to:
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) end function onThink() npcHandler:onThink() end -- OTServ event handling functions end function creatureSayCallback(cid, type, msg) -- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself. if(npcHandler.focus ~= cid) then return false end addon_need_premium = 'Sorry, you need a premium account to get addons.' addon_have_already = 'Sorry, you already have this addon.' addon_have_not_items = 'Sorry, you don\'t have these items.' addon_give = 'Masz i sie ciesz xD' player_gold = getPlayerItemCount(cid,2148) player_plat = getPlayerItemCount(cid,2152)*100 player_crys = getPlayerItemCount(cid,2160)*10000 player_money = player_gold + player_plat + player_crys if msgcontains(msg, 'pomoc') then selfSay('Zamieniam itemki na nagrody.') elseif msgcontains(msg, 'blue robe') then if getPlayerItemCount(cid,2090) >= 1 then selfSay('Przyniosles mi niebieski klucz?') talk_state = 1 else selfSay('Niemasz tego itemka. Przyjdz jak go bedziesz mial.') talk_state = 0 end elseif msgcontains(msg, 'tak') and talk_state == 1 then talk_state = 0 if getPlayerItemCount(cid,2090) >= 1 then if doPlayerRemoveItem(cid,2090,1) == 1 then selfSay(addon_give) doPlayerAddItem(cid,7428,1) end else selfSay(havent_item) end elseif msgcontains(msg, 'nie') and (talk_state >= 1 and talk_state <= 5) then selfSay('Ok to nara ziom...') talk_state = 0 end -- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself. return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Ostatnio edytowany przez kamildeder (2008-06-19 19:51:08)
Offline
Zarombisty NPC..Jak Bede Mogl To Reput4u
Offline
Nom dobry npc ale gdzies juz go widzialem..na tym forum..ale nie wiem kto tu dal xD
ale ocenka 7/10 :]
PzDr
Offline
Jak takie ladne Komentarze dajcie +(plusika)
Zaraz go zedytuje i wytlumacze
Offline
Ładny skrypcik, trochę pozmieniałem i działa 9/10
Offline
nie widzicie ze to poprostu spocony cyklop wszedzie jest na necie
Offline