CRÉDITOS:
Npc de Premium Account: KingCPI
NPC DE PREMIUM ACCOUNT
Crie um arquivo na pasta data/npc com o nome de KingCPI.xml. Coloque isso dento:
<?xml version="1.0"?>
<npc name="KingCPI" script="data/npc/scripts/premium.lua" access="3">
<mana now="800" max="800"/>
<health now="800" max="800"/>
<look type="128" head="94" body="0" legs="0" feet="94" addons="3"/>
<parameters>
<parameter key="message_greet" value="Hello |PLAYERNAME|. I sell Premium accounts."/>
</parameters>
</npc>
Crie um arquivo na pasta data/npc/scripts com o nome de premium.lua. Coloque isso dento:
---------------------------- Premium account NPC by KingCPI ------------------------------------------
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) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
function creatureSayCallback(cid, type, msg)
if(npcHandler.focus ~= cid) then
return false
end
if msgcontains(msg, 'prem') or msgcontains(msg, 'premium') or msgcontains(msg, 'account') or msgcontains(msg, 'premmy') then
selfSay('Do you want to buy 7 days of premium account for 7k?')
talk_state = 843
elseif talk_state == 843 then
if msgcontains(msg, 'yes') then
if doPlayerRemoveMoney(cid,7000) == 1 then
selfSay('Here you are.')
doPlayerAddPremiumDays(cid, 7)
else
selfSay('Sorry, you dont have enough money.')
end
elseif msgcontains(msg, 'no') then
selfSay('Ok. Maybe another time.')
end
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Um NPC simples e útil
Espero que tenham gostado!
Qualquer erro ou duvida postem!!!
:hi: