Yo, sorry for disturbing.
NPC gives u 5 missions, u need to do all 5 to get the reward, I cant even see this npc in RME.
NPC gives u 5 missions, u need to do all 5 to get the reward, I cant even see this npc in RME.
Code:
<?xml version="1.0"?>
<npc name="Viseriso" script="data/npc/scripts/viseriso.lua" walkinterval="2000">
<health now="200" max="200" />
look type="132" head="57" body="59" legs="40" feet="76" addons="3"/>
<parameters>
<parameter key="message_greet" value="Witaj |PLAYERNAME|. Potrzebuje pomocy, jezeli chcesz mi pomoc - zostan, jezeli nie to zegnam." />
</parameters>
</npc>
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
local item1 = 2033
local item2 = 2193
local item3 = 2393
local item4 = 5791
local item5 = 2517
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
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if(msgcontains(msg, 'soft')) then
selfSay('Nim otrzymasz soft buty musisz dla mnie cos zrobic, mam dla Ciebie 5 zadan. Aby rozpoczac zadanie wpisz misja1.', cid)
end
---------------------------------------------------------
if(msgcontains(msg, 'misja1')) then
selfSay('Potrzebuje zlota. Najtanszym materialem na przetopienie beda golden mugi, przynies mi 40 sztuk.', cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, 'golden') and talkState[talkUser] == 1) then
if (getPlayerStorageValue(cid,100) > 0) then
selfSay('Wykonales juz ta misje.', cid)
else
if(doPlayerRemoveItem(cid, item1, 40) == TRUE) then
setPlayerStorageValue(cid,100,1)
doPlayerAddExperience(cid,1000)
selfSay('O! Udalo Ci sie. Wilkie dzieki!', cid)
else
selfSay('Potrzebuje 40 golden mugow..', cid)
end
end
return true
end
----------------------------------------------------------
if(msgcontains(msg, 'misja2')) then
selfSay('Aby zrobic artefakt potrzebuje jeszce 5 ankh'ow. Przynies mi je, a bedziesz blizej nagrody.', cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, 'ankh') and talkState[talkUser] == 1) then
if (getPlayerStorageValue(cid,100) < 1) then
selfSay('Najpierw przynies mi 5 ankh'ow.', cid)
else
if (getPlayerStorageValue(cid,101) > 0) then
selfSay('Wykonales juz ta misje.', cid)
else
if(doPlayerRemoveItem(cid, item2, 5) == TRUE) then
setPlayerStorageValue(cid,101,1)
doPlayerAddExperience(cid,1500)
selfSay('Wielkie dzieki!', cid)
else
selfSay('Potrzebuje 5 ankh'ow', cid)
end
end
end
return true
end
----------------------------------------------------------
if(msgcontains(msg, 'misja3')) then
selfSay('Wiesz.. razem z bracmi wybieramy sie na polowanie i potrzebujemy broni. Przynies mi 5 giant swordow.', cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, 'giant') and talkState[talkUser] == 1) then
if (getPlayerStorageValue(cid,101) < 1) then
selfSay('Najpierw przynies mi 40 golden mugow i 5 ankhow.', cid)
else
if (getPlayerStorageValue(cid,102) > 0) then
selfSay('Wykonales juz ta misje.', cid)
else
if(doPlayerRemoveItem(cid, item3, 15) == TRUE) then
setPlayerStorageValue(cid,102,1)
doPlayerAddExperience(cid,2000, 1, 1)
selfSay('Wielkie dzieki, calkiem niezle wykonana bron! Jestes coraz blizej.', cid)
else
selfSay('Potrzebuje 5 giant swordow', cid)
end
end
end
return true
end
----------------------------------------------------------
if(msgcontains(msg, 'misja4')) then
selfSay('Moj syn zazyczyl sobie stuffed dragona, przynies mi go jezeli chcesz ukonczyc zadanie!', cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, 'stuffed') and talkState[talkUser] == 1) then
if (getPlayerStorageValue(cid,102) < 1) then
selfSay('Wykonaj moje poprzednie polecenia..', cid)
else
if (getPlayerStorageValue(cid,103) > 0) then
selfSay('Wykonales juz ta misje.', cid)
else
if(doPlayerRemoveItem(cid, item4, 10) == TRUE) then
setPlayerStorageValue(cid,103,1)
doPlayerAddExperience(cid,2500, 1, 1)
selfSay('Wspaniale! Napewno sie ucieszy!', cid)
else
selfSay('Dlugo mam czekac?', cid)
end
end
end
return true
end
----------------------------------------------------------
if(msgcontains(msg, 'misja5')) then
selfSay('Ostatnia rzecza jakiej potrzebuje jest Shield of Honour. Aby ja zdobyc musisz wspiac sie na wyzyny swoich mozliwosci i wygrac turniej na arenie!', cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, 'shield of honour') and talkState[talkUser] == 1) then
if (getPlayerStorageValue(cid,103) < 1) then
selfSay('Wykonaj moje poprzednie zadania.', cid)
else
if (getPlayerStorageValue(cid,104) > 0) then
selfSay('Wykonales juz ta misje.', cid)
else
if(doPlayerRemoveItem(cid, item5, 1) == TRUE) then
setPlayerStorageValue(cid,104,1)
doPlayerAddExperience(cid,3000, 1, 1)
selfSay('Wspaniale! Wykazales sie! Nie wierzylem, ze Ci sie uda. Zasluzyles na nagrode. O to twoje zasluzone 2.500.000 doswiadczenia oraz Amazon Shield. Gratulacje!)', cid)
else
selfSay('Potrzebuje ksiazki ktora ukradli Merry i Pippin..', cid)
end
end
end
return true
end
----------------------------------------------------------
----------------------------------------------------------
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())