Segue o pedido:
shiny abra.lua
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
if (msgcontains(msg, 'Shiny') or msgcontains(msg, 'shiny')) then --alterado v1.7
selfSay("So you want to train your Abra and Transform in a Shiny Abra? You pokemon need boost +20 and It will cost 200k!", cid)
talkState[talkUser] = 1
elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'Yes')) and talkState[talkUser] == 1 then
if getPlayerSlotItem(cid, 8).uid <= 0 then
selfSay("Sorry, you don't have a pokemon in the main slot!", cid)
talkState[talkUser] = 0
return true
end
--alterado v1.2
if #getCreatureSummons(cid) >= 1 then
selfSay("Go back your pokemon!", cid)
talkState[talkUser] = 0
return true
end
local pb = getPlayerSlotItem(cid, 8).uid
if getItemAttribute(pb, "poke") ~= "Abra" then
selfSay("Put a Abra's pokeball atleast +20 in main slot!", cid)
talkState[talkUser] = 0
return true
end
if not getItemAttribute(pb, "boost") or getItemAttribute(pb, "boost") < 20 then
selfSay("Sorry, your Abra is not boosted +20!", cid)
talkState[talkUser] = 0
return true
end
--100000 = 1k, 1000000 = 10k, 10000000 = 100k
if doPlayerRemoveMoney(cid, 20000000) == true then
selfSay("So there is it! Enjoy!", cid)
doItemSetAttribute(pb, "hp", 1)
doItemSetAttribute(pb, "poke", "Shiny Abra")
doItemSetAttribute(pb, "description", "Contains a Shiny Abra.")
doItemEraseAttribute(pb, "boost")
doTransformItem(getPlayerSlotItem(cid, 7).uid, fotos["Shiny Abra"])
if useKpdoDlls then
doCreatureExecuteTalkAction(cid, "/pokeread")
end
talkState[talkUser] = 0
return true
else
selfSay("You don't have enough money!", cid)
talkState[talkUser] = 0
return true
end
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
shiny abra.xml
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Psychic Trainer" script="shiny abra.lua" walkinterval="0" floorchange="0" access="5" level="1" maglevel="1">
<health now="150" max="150"/>
<look type="1426" head="114" body="119" legs="114" feet="114" corpse="2212"/>
<parameters>
<parameter key="message_greet" value="Welcome |PLAYERNAME|, you want to Transform you poke in {shiny}?"/>
</parameters>
</npc>
obs.: Note que o Nome do pokemon que o player vai ganhar é Shiny Abra... se Você mudou para Dark Abra, deverá alterar no script também.




info
Grupo: Campones
Registrado: 20/11/11
Posts: 50
Reputação: +1
Char no Tibia: Dj Lokys
alguém pode disponibilizar um npc que faz dark abra no server pda slicer 1.7 sem lvl ?