Aew Galera Tipo EU Editei o Npc Que Apelida O Pokemon ,, Mais Como Eu Nao Sei Mexer Com Sources So Vo Postar o Npc !! Entao Vamos La ''Script Do Pokemon Squadium''
Vai Em Seuot/data/npc E Crie Um Arquivo Chamado name.xml E Adicione Isto !
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Namer" script="NameRater.lua" walkinterval="350000" floorchange="0" speed="0" lookdir="2">
<health now="150" max="150"/>
<look type="178" head="91" body="114" legs="86" feet="0"/>
<parameters>
</parameters>
</npc>
Depois Vai Em Seuot/data/npc/script E Crie Um Arquivo Chamado NameRater.lua E Adicione Isto Dentro !
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
if msgcontains(msg:lower(), "job") then
selfSay("Hello ".. getCreatureName(cid) .." . I'm the name rater. Do you wanna change the name of your pokemon?", cid)
talk_state = 1
elseif msgcontains(msg:lower(), "nick") or msgcontains(msg:lower(), "yes") and talk_state == 1 then
selfSay("Ok. But first i need you put the ball that contains the pokemon which you wanna change name in the pokeball slot. Is this in?", cid)
talk_state = 2
elseif msgcontains(msg:lower(), "yes") and talk_state == 2 then
selfSay("So, what will be the nickname?", cid)
talk_state = 3
elseif talk_state == 3 then
nick = tostring(msg)
if #getCreatureSummons(cid) == 0 then
if #nick <= 13 then
if getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid >= 1 then
doItemSetAttribute(getPlayerSlotItem(cid, CONST_SLOT_FEET).uid, "nickname", "".. nick .."")
selfSay("So be it. Come back anytime.", cid)
talk_state = 0
else
selfSay("There is no ball on the slot.", cid)
talk_state = 2
end
else
selfSay("Too long nickname. Try again.", cid)
talk_state = 2
end
else
selfSay("I want you put your pokemon back to the ball. Try again.", cid)
talk_state = 2
end
elseif msgcontains(msg:lower(), "summon") then
local x = doSummonCreature("Bulbasaur", getCreaturePos(getNpcId()))
doConvinceCreature(getNpcId(), x)
doChallengeCreature(x, cid)
doMonsterSetTarget(x, cid)
doChallengeCreature(getNpcId(), cid)
doMonsterSetTarget(getCreatureSummons(getNpcId())[1], cid)
selfSay("Take this!", cid)
elseif msgcontains(msg:lower(), "no") and talk_state ~= 3 then
selfSay("Hmmm, ok then. COme back anytime.")
talk_state = 0
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
E Depois Adicione no Map Editor ,, E Edita Pelo Source "QUE EU NAO SEI MEXER" ,, se eu aprender eu posto um tuto vlw galera