Postado Novembro 18, 2012 12 anos Autor tem que fazer em todas as linha, posta o npc pra eu ver como ficou local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} 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 out = {Jam = 181601, Rap = 181602, Ori = 181603, Roc = 181604, Adv = 181605, Bus = 181606, Atl = 181607, Punk = 181608, Mer = 181610, Hik = 181611} if (msgcontains(msg, 'Outfit') or msgcontains(msg, 'outfit') or msgcontains(msg, 'Outfits') or msgcontains(msg, 'outfits')) then selfSay("I sell this outfits..{Jamaican, Rapper, Oriental, Rocket, Adventurer, Bussines, Atletic, Punk, Mercenary e Hiker}, which outfit do you want??", cid) talkState[talkUser] = 2 ----JAMAICAN elseif (msgcontains(msg, 'Jamaican') or msgcontains(msg, 'jamaican')) and talkState[talkUser] == 2 then selfSay("Are you sure which want buy that outfit?", cid) talkState[talkUser] = 3 elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 3 then if getPlayerStorageValue(cid, out.Jam) <= 0 then if getPlayerPremiumDays(cid) <= 365 then if getPlayerMoney(cid) >= 20000 then if getPlayerSex(cid) == 0 then doPlayerAddOutfit(cid, 588, 0) doPlayerRemoveMoney(cid, 20000) setPlayerStorageValue(cid, out.Jam, 1) else doPlayerAddOutfit(cid, 587, 0) doPlayerRemoveMoney(cid, 20000) setPlayerStorageValue(cid, out.Jam, 1) end else selfSay("You need 200dl to buy this outfit!", cid) talkState[talkUser] = 2 return false end else selfSay("Need be premium to buy this Outfit.", cid) talkState[talkUser] = 0 return false end else selfSay("You already have this outfit, so... I have other outfits {Rapper, Oriental, Rocket, Adventurer, Bussines, Atletic, Punk, Mercenary e Hiker}.", cid) talkState[talkUser] = 2 return false end selfSay("So... Here is.", cid) elseif (msgcontains(msg, 'no') or msgcontains(msg, 'nao')) and talkState[talkUser] == 3 then selfSay("So... I have this other outfits {Rapper, Oriental, Rocket, Adventurer, Bussines, Atletic, Punk, Mercenary e Hiker}.", cid) talkState[talkUser] = 2 ----Rapper elseif (msgcontains(msg, 'Rapper') or msgcontains(msg, 'rapper')) and talkState[talkUser] == 2 then selfSay("Are you sure which want buy that outfit?", cid) talkState[talkUser] = 4 elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 4 then if getPlayerStorageValue(cid, out.Rap) <= 0 then if getPlayerPremiumDays(cid) <= 365 then if getPlayerMoney(cid) >= 20000 then if getPlayerSex(cid) == 0 then doPlayerAddOutfit(cid, 512, 0) doPlayerRemoveMoney(cid, 20000) setPlayerStorageValue(cid, out.Rap, 1) else doPlayerAddOutfit(cid, 545, 0) doPlayerRemoveMoney(cid, 20000) setPlayerStorageValue(cid, out.Rap, 1) end else selfSay("You need 200dl to buy this outfit!", cid) talkState[talkUser] = 2 return false end else selfSay("Need be premium to buy this Outfit.", cid) talkState[talkUser] = 0 return false end else selfSay("You already have this outfit, so... I have other outfits {Jamaican, Oriental, Rocket, Adventurer, Bussines, Atletic, Punk, Mercenary e Hiker}.", cid) talkState[talkUser] = 2 return false end selfSay("So... Here is.", cid) elseif (msgcontains(msg, 'no') or msgcontains(msg, 'nao')) and talkState[talkUser] == 4 then selfSay("So... I have this other outfits {Jamaican, Oriental, Rocket, Adventurer, Bussines, Atletic, Punk, Mercenary e Hiker}.", cid) talkState[talkUser] = 2 ----Oriental elseif (msgcontains(msg, 'Oriental') or msgcontains(msg, 'oriental')) and talkState[talkUser] == 2 then selfSay("Are you sure which want buy that outfit?", cid) talkState[talkUser] = 5 elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 5 then if getPlayerStorageValue(cid, out.Ori) <= 0 then if getPlayerPremiumDays(cid) <= 365 then if getPlayerMoney(cid) >= 20000 then if getPlayerSex(cid) == 0 then doPlayerAddOutfit(cid, 586, 0) doPlayerRemoveMoney(cid, 20000) setPlayerStorageValue(cid, out.Ori, 1) else doPlayerAddOutfit(cid, 585, 0) doPlayerRemoveMoney(cid, 20000) setPlayerStorageValue(cid, out.Ori, 1) end else selfSay("You need 200dl to buy this outfit!", cid) talkState[talkUser] = 2 return false end else selfSay("Need be premium to buy this Outfit.", cid) talkState[talkUser] = 0 return false end else selfSay("You already have this outfit, so... I have other outfits {Rapper, Jamaican, Rocket, Adventurer, Bussines, Atletic, Punk, Mercenary e Hiker}.", cid) talkState[talkUser] = 2 return false end selfSay("So... Here is.", cid) elseif (msgcontains(msg, 'no') or msgcontains(msg, 'nao')) and talkState[talkUser] == 5 then selfSay("So... I have this other outfits {Rapper, Jamaican, Rocket, Adventurer, Bussines, Atletic, Punk, Mercenary e Hiker}.", cid) talkState[talkUser] = 2 ----Rocket elseif (msgcontains(msg, 'Rocket') or msgcontains(msg, 'rocket')) and talkState[talkUser] == 2 then selfSay("Are you sure which want buy that outfit?", cid) talkState[talkUser] = 6 elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 6 then if getPlayerStorageValue(cid, out.Roc) <= 0 then if getPlayerPremiumDays(cid) <= 365 then if getPlayerMoney(cid) >= 20000 then if getPlayerSex(cid) == 0 then doPlayerAddOutfit(cid, 605, 0) doPlayerRemoveMoney(cid, 20000) setPlayerStorageValue(cid, out.Roc, 1) else doPlayerAddOutfit(cid, 604, 0) doPlayerRemoveMoney(cid, 20000) setPlayerStorageValue(cid, out.Roc, 1) end else selfSay("You need 200dl to buy this outfit!", cid) talkState[talkUser] = 2 return false end else selfSay("Need be premium to buy this Outfit.", cid) talkState[talkUser] = 0 return false end else selfSay("You already have this outfit, so... I have other outfits {Rapper, Jamaican, Oriental, Adventurer, Bussines, Atletic, Punk, Mercenary e Hiker}.", cid) talkState[talkUser] = 2 return false end selfSay("So... Here is.", cid) elseif (msgcontains(msg, 'no') or msgcontains(msg, 'nao')) and talkState[talkUser] == 6 then selfSay("So... I have this other outfits {Rapper, Jamaican, Oriental, Adventurer, Bussines, Atletic, Punk, Mercenary e Hiker}.", cid) talkState[talkUser] = 2 ----Adventurer elseif (msgcontains(msg, 'Adventurer') or msgcontains(msg, 'adventurer')) and talkState[talkUser] == 2 then selfSay("Are you sure which want buy that outfit?", cid) talkState[talkUser] = 7 elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 7 then if getPlayerStorageValue(cid, out.Adv) <= 0 then if getPlayerPremiumDays(cid) <= 365 then if getPlayerMoney(cid) >= 20000 then if getPlayerSex(cid) == 0 then doPlayerAddOutfit(cid, 495, 0) doPlayerRemoveMoney(cid, 20000) setPlayerStorageValue(cid, out.Adv, 1) else doPlayerAddOutfit(cid, 494, 0) doPlayerRemoveMoney(cid, 20000) setPlayerStorageValue(cid, out.Adv, 1) end else selfSay("You need 200dl to buy this outfit!", cid) talkState[talkUser] = 2 return false end else selfSay("Need be premium to buy this Outfit.", cid) talkState[talkUser] = 0 return false end else selfSay("You already have this outfit, so... I have other outfits {Rapper, Jamaican, Rocket, Oriental, Bussines, Atletic, Punk, Mercenary e Hiker}.", cid) talkState[talkUser] = 2 return false end selfSay("So... Here is.", cid) elseif (msgcontains(msg, 'no') or msgcontains(msg, 'nao')) and talkState[talkUser] == 7 then selfSay("So... I have this other outfits {Rapper, Jamaican, Rocket, Oriental, Bussines, Atletic, Punk, Mercenary e Hiker}.", cid) talkState[talkUser] = 2 ----Bussines elseif (msgcontains(msg, 'Bussines') or msgcontains(msg, 'bussines')) and talkState[talkUser] == 2 then selfSay("Are you sure which want buy that outfit?", cid) talkState[talkUser] = 8 elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 8 then if getPlayerStorageValue(cid, out.Bus) <= 0 then if getPlayerMoney(cid) >= 30000 then if getPlayerSex(cid) == 0 then doPlayerAddOutfit(cid, 513, 0) doPlayerRemoveMoney(cid, 30000) setPlayerStorageValue(cid, out.Bus, 1) else doPlayerAddOutfit(cid, 514, 0) doPlayerRemoveMoney(cid, 30000) setPlayerStorageValue(cid, out.Bus, 1) end else selfSay("You need 300dl to buy this outfit!", cid) talkState[talkUser] = 2 return false end else selfSay("You already have this outfit, so... I have other outfits {Rapper, Jamaican, Rocket, Oriental, Adventurer, Atletic, Punk, Mercenary e Hiker}.", cid) talkState[talkUser] = 2 return false end selfSay("So... Here is.", cid) elseif (msgcontains(msg, 'no') or msgcontains(msg, 'nao')) and talkState[talkUser] == 8 then selfSay("So... I have this other outfits {Rapper, Jamaican, Rocket, Oriental, Adventurer, Atletic, Punk, Mercenary e Hiker}.", cid) talkState[talkUser] = 2 ----Atletic elseif (msgcontains(msg, 'Atletic') or msgcontains(msg, 'atletic')) and talkState[talkUser] == 2 then selfSay("Are you sure which want buy that outfit?", cid) talkState[talkUser] = 9 elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 9 then if getPlayerStorageValue(cid, out.Atl) <= 0 then if getPlayerPremiumDays(cid) <= 365 then if getPlayerMoney(cid) >= 20000 then if getPlayerSex(cid) == 0 then doPlayerAddOutfit(cid, 517, 0) doPlayerRemoveMoney(cid, 20000) setPlayerStorageValue(cid, out.Atl, 1) else doPlayerAddOutfit(cid, 516, 0) doPlayerRemoveMoney(cid, 20000) setPlayerStorageValue(cid, out.Atl, 1) end else selfSay("You need 200dl to buy this outfit!", cid) talkState[talkUser] = 2 return false end else selfSay("Need be premium to buy this Outfit.", cid) talkState[talkUser] = 0 return false end else selfSay("You already have this outfit, so... I have other outfits {Rapper, Jamaican, Rocket, Oriental, Adventurer, Bussines, Punk, Mercenary e Hiker}.", cid) talkState[talkUser] = 2 return false end selfSay("So... Here is.", cid) elseif (msgcontains(msg, 'no') or msgcontains(msg, 'nao')) and talkState[talkUser] == 9 then selfSay("So... I have this other outfits {Rapper, Jamaican, Rocket, Oriental, Adventurer, Bussines, Punk, Mercenary e Hiker}.", cid) talkState[talkUser] = 2 ----Punk elseif (msgcontains(msg, 'Punk') or msgcontains(msg, 'punk')) and talkState[talkUser] == 2 then selfSay("Are you sure which want buy that outfit?", cid) talkState[talkUser] = 10 elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 10 then if getPlayerStorageValue(cid, out.Punk) <= 0 then if getPlayerPremiumDays(cid) <= 365 then if getPlayerMoney(cid) >= 20000 then if getPlayerSex(cid) == 0 then doPlayerAddOutfit(cid, 519, 0) doPlayerRemoveMoney(cid, 20000) setPlayerStorageValue(cid, out.Punk, 1) else doPlayerAddOutfit(cid, 518, 0) doPlayerRemoveMoney(cid, 20000) setPlayerStorageValue(cid, out.Punk, 1) end else selfSay("You need 200dl to buy this outfit!", cid) talkState[talkUser] = 2 return false end else selfSay("Need be premium to buy this Outfit.", cid) talkState[talkUser] = 0 return false end else selfSay("You already have this outfit, so... I have other outfits {Rapper, Jamaican, Rocket, Oriental, Adventurer, Bussines, Punk, Atletic e Mercenary}.", cid) talkState[talkUser] = 2 return false end selfSay("So... Here is.", cid) elseif (msgcontains(msg, 'no') or msgcontains(msg, 'nao')) and talkState[talkUser] == 10 then selfSay("So... I have this other outfits {Rapper, Jamaican, Rocket, Oriental, Adventurer, Bussines, Atletic, Mercenary e Hiker}.", cid) talkState[talkUser] = 2 ----Mercenary elseif (msgcontains(msg, 'Mercenary') or msgcontains(msg, 'mercenary')) and talkState[talkUser] == 2 then selfSay("Are you sure which want buy that outfit?", cid) talkState[talkUser] = 12 elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 12 then if getPlayerStorageValue(cid, out.Mer) <= 0 then if getPlayerPremiumDays(cid) <= 365 then if getPlayerMoney(cid) >= 20000 then if getPlayerSex(cid) == 0 then doPlayerAddOutfit(cid, 524, 0) doPlayerRemoveMoney(cid, 20000) setPlayerStorageValue(cid, out.Mer, 1) else doPlayerAddOutfit(cid, 522, 0) doPlayerRemoveMoney(cid, 20000) setPlayerStorageValue(cid, out.Mer, 1) end else selfSay("You need 200dl to buy this outfit!", cid) talkState[talkUser] = 2 return false end else selfSay("Need be premium to buy this Outfit.", cid) talkState[talkUser] = 0 return false end else selfSay("You already have this outfit, so... I have other outfits {Rapper, Jamaican, Rocket, Oriental, Adventurer, Bussines, Punk, Atletic e Hiker}.", cid) talkState[talkUser] = 2 return false end selfSay("So... Here is.", cid) elseif (msgcontains(msg, 'no') or msgcontains(msg, 'nao')) and talkState[talkUser] == 12 then selfSay("So... I have this other outfits {Rapper, Jamaican, Rocket, Oriental, Adventurer, Bussines, Punk, Atletic e Hiker}.", cid) talkState[talkUser] = 2 ----Hiker elseif (msgcontains(msg, 'Hiker') or msgcontains(msg, 'hiker')) and talkState[talkUser] == 2 then selfSay("Are you sure which want buy that outfit?", cid) talkState[talkUser] = 13 elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 13 then if getPlayerStorageValue(cid, out.Hik) <= 0 then if getPlayerPremiumDays(cid) <= 365 then if getPlayerMoney(cid) >= 20000 then if getPlayerSex(cid) == 0 then doPlayerAddOutfit(cid, 525, 0) doPlayerRemoveMoney(cid, 20000) setPlayerStorageValue(cid, out.Hik, 1) else doPlayerAddOutfit(cid, 523, 0) doPlayerRemoveMoney(cid, 20000) setPlayerStorageValue(cid, out.Hik, 1) end else selfSay("You need 200dl to buy this outfit!", cid) talkState[talkUser] = 2 return false end else selfSay("Need be premium to buy this Outfit.", cid) talkState[talkUser] = 0 return false end else selfSay("You already have this outfit, so... I have other outfits {Rapper, Jamaican, Rocket, Oriental, Adventurer, Bussines, Punk, Atletic e Mercenary}.", cid) talkState[talkUser] = 2 return false end selfSay("So... Here is.", cid) elseif (msgcontains(msg, 'no') or msgcontains(msg, 'nao')) and talkState[talkUser] == 13 then selfSay("So... I have this other outfits {Rapper, Jamaican, Rocket, Oriental, Adventurer, Bussines, Punk, Atletic e Mercenary}.", cid) talkState[talkUser] = 2 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.