Vai em data/NPC e cria um arquivo.XML pro npc
<?xml version="1.0" encoding="UTF-8"?>
<npc name="TSUUNADE" script="npcc.lua" walkinterval="3000" floorchange="0" access="5" level="1" maglevel="1">
<health now="150" max="150"/>
<look type="225" head="114" body="119" legs="114" feet="114" corpse="2212"/>
<parameters>
<parameter key="message_greet" value="Ola |PLAYERNAME|,Quer Se Tornar Da Aliance? {Aliance}"/>
</parameters>
</npc>
DATA/NPC/SCRIPT e cria um chamado npcc.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, 'Aliance') or msgcontains(msg, 'aliance') then
selfSay("Para Se Tornar Da Aliance Shinobi Primeiro Me Traga 3 Espinha De Kimimaro de Suna {Espinha}", cid)
talkState[talkUser] = 1
return true
elseif (msgcontains(msg, 'Espinha') or msgcontains(msg, 'espinha')) and talkState[talkUser] == 1 then
selfSay("Voce Ja Tem As Espinhas? {Yes}", cid)
talkState[talkUser] = 1
return true
elseif (msgcontains(msg, 'Yes') or msgcontains(msg, 'yes')) and talkState[talkUser] == 1 then
if doPlayerRemoveItem(cid, 2234, 3) == true then
setPlayerStorageValue(cid, 99999, 3)
selfSay("Agora voce vai ganhar 10% de XP a mais!!!", cid)
talkState[talkUser] = 1
return true
else
selfSay("Voce nao Tem As Espinhas", cid)
talkState[talkUser] = 1
return true
end
return true
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())