szajker123
New Member
- Joined
- May 12, 2012
- Messages
- 195
- Reaction score
- 0
Witam , niewiem czy dobry dzial ale prosze o pomoc poniewaz nie umiem tego zrobic a mianowicie mam skrypt na npc od missji ino ze on dziala tak ze zamiast pisac first mission > yes i jak wykonasz missje dopiero mozesz zrobic kolejną to dziala to tak ze mozesz napisac hi np. tenth mission > yes < ale oczywiscie musisz miec ten item.
wiec jakby ktos mi go przerobil tak to ReP++ > TIBIA 8.54 > TFS 0.3.5 ( by po kolei missje trza bylo robic ) a oto skrypt :
wiec jakby ktos mi go przerobil tak to ReP++ > TIBIA 8.54 > TFS 0.3.5 ( by po kolei missje trza bylo robic ) a oto skrypt :
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandlernCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandlernCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandlernCreatureSay(cid, type, msg) end
function onThink() npcHandlernThink() 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, 'mission')) then
selfSay('Ok, you can started "mission"?', cid)
end
---------------------------------------------------------
if(msgcontains(msg, 'first mission')) then
selfSay('Please bring me 1 "Egg Mission first"', cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, 'Egg') and talkState[talkUser] == 1) then
if (getPlayerStorageValue(cid,1) > 0) then
selfSay('You finished this mission.', cid)
else
if(doPlayerRemoveItem(cid, 10523, 1) == TRUE) then
setPlayerStorageValue(cid,100,1)
doPlayerAddExperience(cid,1000)
selfSay('Thank you! You can started "second mission".. (you received 1000 points of experience)', cid)
else
selfSay('You must have more items', cid)
end
end
return true
end
---------------------------------------------------------
if(msgcontains(msg, 'second mission')) then
selfSay('Please bring me 1 "Order Mission second"', cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, 'Order') and talkState[talkUser] == 1) then
if (getPlayerStorageValue(cid,101) > 0) then
selfSay('You finished this mission.', cid)
else
if(doPlayerRemoveItem(cid, 11253, 1) == TRUE) then
setPlayerStorageValue(cid,101,1)
doPlayerAddExperience(cid,1000)
selfSay('Thank you! You can started "third mission".. (you received 1000 points of experience)', cid)
else
selfSay('You must have more items', cid)
end
end
return true
end
---------------------------------------------------------
if(msgcontains(msg, 'third mission')) then
selfSay('Please bring me 1 "Band Mission third"', cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, 'Band') and talkState[talkUser] == 1) then
if (getPlayerStorageValue(cid,102) > 0) then
selfSay('You finished this mission.', cid)
else
if(doPlayerRemoveItem(cid, 11398, 1) == TRUE) then
setPlayerStorageValue(cid,102,1)
doPlayerAddExperience(cid,1000)
selfSay('Thank you! You can started "fourth mission". (you received 1000 points of experience)', cid)
else
selfSay('You must have more items', cid)
end
end
return true
end
---------------------------------------------------------
if(msgcontains(msg, 'fourth mission')) then
selfSay('Please bring me 1 "Doll Mission fourth"', cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, 'Doll') and talkState[talkUser] == 1) then
if (getPlayerStorageValue(cid,103) > 0) then
selfSay('You finished this mission.', cid)
else
if(doPlayerRemoveItem(cid, 10063, 1) == TRUE) then
setPlayerStorageValue(cid,103,1)
doPlayerAddExperience(cid,10000)
selfSay('Thank you! You can started "fifth mission". (you received 10000 points of experience)', cid)
else
selfSay('You must have more items', cid)
end
end
return true
end
---------------------------------------------------------
if(msgcontains(msg, 'fifth mission')) then
selfSay('Please bring me 1 "Scroll Mission fifth"', cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, 'Scroll') and talkState[talkUser] == 1) then
if (getPlayerStorageValue(cid,104) > 0) then
selfSay('You finished this mission.', cid)
else
if(doPlayerRemoveItem(cid, 11744, 1) == TRUE) then
setPlayerStorageValue(cid,104,1)
doPlayerAddExperience(cid,50000)
selfSay('Thank you! You can started "sixth mission". (you received 50000 points of experience)', cid)
else
selfSay('You must have more items', cid)
end
end
return true
end
---------------------------------------------------------
if(msgcontains(msg, 'sixth mission')) then
selfSay('Please bring me 1 "Fire Hearth mission sixth"', cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, 'Fire hearth') and talkState[talkUser] == 1) then
if (getPlayerStorageValue(cid,105) > 0) then
selfSay('You finished this mission.', cid)
else
if(doPlayerRemoveItem(cid, 2353, 1) == TRUE) then
setPlayerStorageValue(cid,105,1)
doPlayerAddExperience(cid,100000)
selfSay('Thank you! You can started "seventh mission". (you received 100000 points of experience)', cid)
else
selfSay('You must have more items', cid)
end
end
return true
end
---------------------------------------------------------
if(msgcontains(msg, 'seventh mission')) then
selfSay('Please bring me 1 "Amulet Mission seventh"', cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, 'Amulet') and talkState[talkUser] == 1) then
if (getPlayerStorageValue(cid,106) > 0) then
selfSay('You finished this mission.', cid)
else
if(doPlayerRemoveItem(cid, 11252, 1) == TRUE) then
setPlayerStorageValue(cid,106,1)
doPlayerAddExperience(cid,150000)
selfSay('Thank you! You can started "eight mission". (you received 150000 points of experience)', cid)
else
selfSay('You must have more items', cid)
end
end
return true
end---------------------------------------------------------
if(msgcontains(msg, 'eight mission')) then
selfSay('Please bring me 1 "Shield Mission eight"', cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, 'shield') and talkState[talkUser] == 1) then
if (getPlayerStorageValue(cid,107) > 0) then
selfSay('You finished this mission.', cid)
else
if(doPlayerRemoveItem(cid, 11111, 1) == TRUE) then
setPlayerStorageValue(cid,107,1)
doPlayerAddExperience(cid,250000)
selfSay('Thank you! You can started "ninth mission". (you received 250000 points of experience)', cid)
else
selfSay('You must have more items', cid)
end
end
return true
end
---------------------------------------------------------
if(msgcontains(msg, 'ninth mission')) then
selfSay('Please bring me 1 "Sprocket Mission ninth"', cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, 'sprocket') and talkState[talkUser] == 1) then
if (getPlayerStorageValue(cid,108) > 0) then
selfSay('You finished this mission.', cid)
else
if(doPlayerRemoveItem(cid, 10072, 1) == TRUE) then
setPlayerStorageValue(cid,108,1)
doPlayerAddExperience(cid,350000)
selfSay('Thank you! You can started "tenth mission". (you received 350000 points of experience)', cid)
else
selfSay('You must have more items', cid)
end
end
return true
end
---------------------------------------------------------
if(msgcontains(msg, 'tenth mission')) then
selfSay('Please bring me 1 "Mummy Doll Mission Tenth"', cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, 'mummy doll') and talkState[talkUser] == 1) then
if (getPlayerStorageValue(cid,109) > 0) then
selfSay('You finished this mission.', cid)
else
if(doPlayerRemoveItem(cid, 12064, 1) == TRUE) then
setPlayerStorageValue(cid,109,1)
doPlayerAddExperience(cid,500000)
selfSay('Thank you! You finished all missions congratulation ! > Congratulations! Tell that to GOD and get a reward . (you received 500000 points of experience)', cid)
else
selfSay('You must have more items', cid)
end
end
return true
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())