Arita
:))
Hi! Im looking for a script of a npc who trade a necromancer shield for 3000 demonic essences anyone knows how to do it? thank you so much otland!
I will rep+ if you help me
I will rep+ if you help me
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local Topic = {}
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
local necromancer_shield = 6433 ----- ID OF necromancer shield
local demonic_essences = 6500 ----- ID OF essences
function creatureSayCallback(cid, type, msg)
if (msgcontains(msg, 'shield') or msgcontains(msg, 'trade')) then
npcHandler:say('Really you change you 3000 demonic essence for me necromancer shield?', cid)
Topic[cid] = 1
elseif msgcontains(msg, 'yes') and getPlayerItemCount(cid,demonic_essences) >= 3000 and Topic[cid] == 1 then
npcHandler:say('Okay, here you go!', cid)
doPlayerRemoveItem(cid,demonic_essences,3000)
doPlayerAddItem(cid,necromancer_shield, 1)
Topic[cid] = 0
elseif msgcontains(msg, 'yes') and getPlayerItemCount(cid,demonic_essences) < 3000 and Topic[cid] == 1 then
npcHandler:say('You do not have the required demonic essences for this trade', cid)
Topic[cid] = 0
elseif msgcontains(msg, 'no') and Topic[cid] == 1 then
npcHandler:say('Then leave', cid)
Topic[cid] = 0
return true
end
end
npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
<?xml version="1.0" encoding="UTF-8"?>
<npc name="NPC NAME" script="YOURSCRIPT.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="134" head="114" body="113" legs="113" feet="113" addons="3" corpse="2212"/>
<parameters>
<parameter key="message_greet" value="Greetings |PLAYERNAME|. I can change 3000 demonic essences for necromancer {shield} ?." />
</parameters>
</npc>