Odp: NPC na zam?wienie.
jeszcze jakby? pom?g? po??czy? to z tym skryptem to by?oby super:
jeszcze jakby? pom?g? po??czy? to z tym skryptem to by?oby super:
Kod:
------STORAGE-------
------200-------
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
local item1 = 7378
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, 'fighting spirit')) then
selfSay('I think you are interested my outfit. I can give you fighting spirit, but bring me first 50 {royal spears}.', cid)
end
---------------------------------------------------------
if(msgcontains(msg, 'royal spears')) then
selfSay('You have collected all royal spears?', cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
if (getPlayerStorageValue(cid,200) > 0) then
selfSay('I cannot give you fighting spirit because you have done mission for me, magician adept or friendly barbarian.', cid)
else
if(doPlayerRemoveItem(cid, item1, 50) == TRUE) then
setPlayerStorageValue(cid,200,1)
doPlayerAddExperience(cid,10000)
doPlayerAddItem(cid, 5884, 1)
selfSay('There are yours fighting spirit. Thank you for help!', cid)
else
selfSay('Sorry man, i need 50 royal spears!', cid)
end
end
return true
end
----------------------------------------------------------
----------------------------------------------------------
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

I TELEPORTUJE NAS W TO MIEJSCE 