Postado Dezembro 22, 2013 12 anos Olá galeraaa.. Estava olhando um servidor baiak agora pouco e vi um npc muito interessante.. Gostaria de implantá-lo em mem u servidor Funciona assim : Player : hi Npc : olá player (x) posso lhe dar um presente de natal. Player : presente Npc : Parabéns você recebeu um presente do papai noel. O presente pode ser entregue uma unica vez por player, e o player precisa ter level 400 ou maior. #Presente varia entre 1 a 10 kk #santa hat (id =6531) #santa doll (id= 6512)
Postado Dezembro 22, 2013 12 anos Santa Claus.xml <?xml version="1.0" encoding="UTF-8"?> <npc name="Santa Claus" script="santa.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="160" head="0" body="112" legs="93" feet="95"/> </npc> santa.lua local PRESENT_STORAGE = 29885 -- Storage ID local gifts = { {30, 6531, 1}, -- 3% pra ganhar Santa Hat {50, 6512, 1}, -- 5% pra ganhar Santa Doll {300, 2160, 10}, -- 30% pra ganhar 10 Crystal Coins {600, 2160, 1}, -- 60% pra ganhar 01 Crystal Coins {500, 2160, 5}, -- 50% pra ganhar 05 Crystal Coins } local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandlear:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function SantaNPC(cid, message, keywords, parameters, node) if(not npcHandler:isFocused(cid)) then return false end if (parameters.present == true) then if (getPlayerStorageValue(cid, PRESENT_STORAGE) == 1) then selfSay("Do not try to trick me! You have already recieved your present...", cid) return true end local item = {} local reward = 0 local count = "" for i = 1, #gifts do item = gifts if (math.random(0,999) < item[1]) then reward = item[2] subType = item[3] if subType > 1 then count = subType .. " " end break end end doPlayerAddItem(cid, reward, subType) setPlayerStorageValue(cid, PRESENT_STORAGE, 1) npcHandler:say('HO-HO-HO! I have ' .. count .. getItemNameById(reward) .. ' for you.', cid) else npcHandler:say('Come back when you start behaving.', cid) end npcHandler:resetNpc() return true end npcHandler:setMessage(MESSAGE_GREET, "HO-HO-HO, Merry Christmas |PLAYERNAME|. I have presents for the good children.") local noNode = KeywordNode:new({'no'}, SantaNPC, {present = false}) local yesNode = KeywordNode:new({'yes'}, SantaNPC, {present = true}) local node = keywordHandler:addKeyword({'present'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Have you been well behaved and good this year?...'}) node:addChildKeywordNode(yesNode) node:addChildKeywordNode(noNode) npcHandler:addModule(FocusModule:new())
Postado Dezembro 22, 2013 12 anos Autor O script seria quase isso.. porem não esta exatamente como eu queria.. falta a configuração dos items e o principal.. players acima do level 400.. memso assim muito obrigado por ajudar.. aguardando novas soluções obrigado ..
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.