--/*- ------------------------------- ---
--- Inspired by stix360's npc trade ---
--- item for item example. Not sure ---
--- if he made it, but I found it - ---
--- through his posts. ------------ ---
--- ------------------------------- ---
--- The shit job was done by me --- ---
--- ----- The hoster of Znote ----- ---
--- ------------------------------- -*/--
local talk_state = 0
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 msgcontains(msg, 'spike sword') then
if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
if getPlayerItemCount(cid,2795,5) >= 1 then --- 5 fire mushrooms
if getPlayerItemCount(cid,2383,1) >= 1 then --- spike sword
if doPlayerRemoveItem(cid,2152,60) then --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,2383,1) --- spike sword
selfSay('Enchantmenth completed, heres your weapon.')
doPlayerAddItem(cid,7744) --- Spike sword with fire enchant
end
end
end
end
elseif msgcontains(msg, 'barbarian axe') then
if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
if getPlayerItemCount(cid,2795,5) >= 1 then --- 5 fire mushrooms
if getPlayerItemCount(cid,2429,1) >= 1 then --- barbarian axe
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,2429,1) --- barbarian axe
selfSay('Enchantmenth completed, heres your weapon.')
doPlayerAddItem(cid,7749) --- barbarian axe with fire enchant
end
end
end
elseif msgcontains(msg, 'relic sword') then
if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
if getPlayerItemCount(cid,2795,5) >= 1 then --- 5 fire mushrooms
if getPlayerItemCount(cid,7383,1) >= 1 then --- weapon
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,7383,1) --- weapon
selfSay('Enchantmenth completed, heres your weapon.')
doPlayerAddItem(cid,7745) --- fire enchanted weapon
end
end
end
elseif msgcontains(msg, 'blacksteel sword') then
if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
if getPlayerItemCount(cid,2795,5) >= 1 then --- 5 fire mushrooms
if getPlayerItemCount(cid,7406,1) >= 1 then --- weapon
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,7406,1) --- weapon
selfSay('Enchantmenth completed, heres your weapon.')
doPlayerAddItem(cid,7747) --- fire enchanted weapon
end
end
end
elseif msgcontains(msg, 'dragon slayer') then
if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
if getPlayerItemCount(cid,2795,5) >= 1 then --- 5 fire mushrooms
if getPlayerItemCount(cid,7402,1) >= 1 then --- weapon
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,7402,1) --- weapon
selfSay('Enchantmenth completed, heres your weapon.')
doPlayerAddItem(cid,7748) --- fire enchanted weapon
end
end
end
elseif msgcontains(msg, 'mystic blade') then
if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
if getPlayerItemCount(cid,2795,5) >= 1 then --- 5 fire mushrooms
if getPlayerItemCount(cid,7384,1) >= 1 then --- weapon
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,7384,1) --- weapon
selfSay('Enchantmenth completed, heres your weapon.')
doPlayerAddItem(cid,7746) --- fire enchanted weapon
end
end
end
elseif msgcontains(msg, 'knight axe') then
if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
if getPlayerItemCount(cid,2795,5) >= 1 then --- 5 fire mushrooms
if getPlayerItemCount(cid,2430,1) >= 1 then --- weapon
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,2430,1) --- weapon
selfSay('Enchantmenth completed, heres your weapon.')
doPlayerAddItem(cid,7750) --- fire enchanted weapon
end
end
end
elseif msgcontains(msg, 'heroic axe') then
if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
if getPlayerItemCount(cid,2795,5) >= 1 then --- 5 fire mushrooms
if getPlayerItemCount(cid,7389,1) >= 1 then --- weapon
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,7389,1) --- weapon
selfSay('Enchantmenth completed, heres your weapon.')
doPlayerAddItem(cid,7751) --- fire enchanted weapon
end
end
end
elseif msgcontains(msg, 'headchopper') then
if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
if getPlayerItemCount(cid,2795,5) >= 1 then --- 5 fire mushrooms
if getPlayerItemCount(cid,7380,1) >= 1 then --- weapon
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,7380,1) --- weapon
selfSay('Enchantmenth completed, heres your weapon.')
doPlayerAddItem(cid,7752) --- fire enchanted weapon
end
end
end
elseif msgcontains(msg, 'war axe') then
if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
if getPlayerItemCount(cid,2795,5) >= 1 then --- 5 fire mushrooms
if getPlayerItemCount(cid,2454,1) >= 1 then --- weapon
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,2454,1) --- weapon
selfSay('Enchantmenth completed, heres your weapon.')
doPlayerAddItem(cid,7753) --- fire enchanted weapon
end
end
end
elseif msgcontains(msg, 'clerical mace') then
if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
if getPlayerItemCount(cid,2795,5) >= 1 then --- 5 fire mushrooms
if getPlayerItemCount(cid,2423,1) >= 1 then --- weapon
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,2423,1) --- weapon
selfSay('Enchantmenth completed, heres your weapon.')
doPlayerAddItem(cid,7754) --- fire enchanted weapon
end
end
end
elseif msgcontains(msg, 'crystal mace') then
if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
if getPlayerItemCount(cid,2795,5) >= 1 then --- 5 fire mushrooms
if getPlayerItemCount(cid,2445,1) >= 1 then --- weapon
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,2445,1) --- weapon
selfSay('Enchantmenth completed, heres your weapon.')
doPlayerAddItem(cid,7755) --- fire enchanted weapon
end
end
end
elseif msgcontains(msg, 'cranial basher') then
if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
if getPlayerItemCount(cid,2795,5) >= 1 then --- 5 fire mushrooms
if getPlayerItemCount(cid,7415,1) >= 1 then --- weapon
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,7415,1) --- weapon
selfSay('Enchantmenth completed, heres your weapon.')
doPlayerAddItem(cid,7756) --- fire enchanted weapon
end
end
end
elseif msgcontains(msg, 'orcish maul') then
if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
if getPlayerItemCount(cid,2795,5) >= 1 then --- 5 fire mushrooms
if getPlayerItemCount(cid,7392,1) >= 1 then --- weapon
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,7392,1) --- weapon
selfSay('Enchantmenth completed, heres your weapon.')
doPlayerAddItem(cid,7757) --- fire enchanted weapon
end
end
end
elseif msgcontains(msg, 'war hammer') then
if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
if getPlayerItemCount(cid,2795,5) >= 1 then --- 5 fire mushrooms
if getPlayerItemCount(cid,2391,1) >= 1 then --- weapon
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,2391,1) --- weapon
selfSay('Enchantmenth completed, heres your weapon.')
doPlayerAddItem(cid,7758) --- fire enchanted weapon
end
end
end
elseif msgcontains(msg, 'arrow') then
if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
if getPlayerItemCount(cid,2795,5) >= 1 then --- 5 fire mushrooms
if getPlayerItemCount(cid,2544,100) >= 1 then --- weapon
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,2544,100) --- weapon
selfSay('Enchantmenth completed, heres your weapon.')
doPlayerAddItem(cid,7840,100) --- fire enchanted weapon
end
end
end
elseif msgcontains(msg, 'no') then
selfSay('Maybe another time then.')
talk_state = 0
else
selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
talk_state = 0
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
[27/03/2008 19:13:49] Lua Script Error: [Npc interface]
[27/03/2008 19:13:49] data/npc/scripts/enchant.luanCreatureSay
[27/03/2008 19:13:49] luaGetPlayerItemCount(). Player not found
--- ------------------------------- ---
--- Inspired by stix360's npc trade ---
--- item for item example. Not sure ---
--- if he made it, but I found it - ---
--- through his posts. ------------ ---
--- ------------------------------- ---
--- The shit job was done by me --- ---
--- ----- The hoster of Znote ----- ---
--- ------------------------------- ---
------------Fixed by Empty--------------
local talk_state = 0
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 msgcontains(msg, 'spike sword') then
if player_money >= 600 then --- 60 platinum coins
if getPlayerItemCount(cid,2795) >= 5 then --- 5 fire mushrooms
if getPlayerItemCount(cid,2383) >= 1 then --- spike sword
if doPlayerRemoveMoney(cid,6000) == TRUE then --- 60 platinum coins
if doPlayerRemoveItem(cid,2795,5) == TRUE then --- 5 fire mushrooms
if doPlayerRemoveItem(cid,2383,1) == TRUE then --- spike sword
selfSay('Enchantment completed, here\'s your weapon.')
doPlayerAddItem(cid,7744) --- Spike sword with fire enchant
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
end
if msgcontains(msg, 'barbarian axe') then
if player_money >= 600 then --- 60 platinum coins
if getPlayerItemCount(cid,2795) >= 5 then --- 5 fire mushrooms
if getPlayerItemCount(cid,2429) >= 1 then --- barbarian axe
if doPlayerRemoveMoney(cid,6000) == TRUE then --- 60 platinum coins
if doPlayerRemoveItem(cid,2795,5) == 1 then --- 5 fire mushrooms
if doPlayerRemoveItem(cid,2429,1) == 1 then --- barbarian axe
selfSay('Enchantment completed, here\'s your weapon.')
doPlayerAddItem(cid,7749) --- barbarian axe with fire enchant
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
end
if msgcontains(msg, 'relic sword') then
if player_money >= 600 then --- 60 platinum coins
if getPlayerItemCount(cid,2795) >= 5 then --- 5 fire mushrooms
if getPlayerItemCount(cid,7383) >= 1 then --- weapon
if doPlayerRemoveMoney(cid,6000) == TRUE then --- 60 platinum coins
if doPlayerRemoveItem(cid,2795,5) == 1 then --- 5 fire mushrooms
if doPlayerRemoveItem(cid,7383,1) == 1 then --- weapon
selfSay('Enchantment completed, here\'s your weapon.')
doPlayerAddItem(cid,7745) --- fire enchanted weapon
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
end
if msgcontains(msg, 'blacksteel sword') then
if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
if getPlayerItemCount(cid,2795) >= 5 then --- 5 fire mushrooms
if getPlayerItemCount(cid,7406) >= 1 then --- weapon
if doPlayerRemoveMoney(cid,6000) == TRUE then --- 60 platinum coins
if doPlayerRemoveItem(cid,2795,5) == 1 then --- 5 fire mushrooms
if doPlayerRemoveItem(cid,7406,1) == 1 then --- weapon
selfSay('Enchantment completed, here\'s your weapon.')
doPlayerAddItem(cid,7747) --- fire enchanted weapon
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
end
if msgcontains(msg, 'dragon slayer') then
if player_money >= 600 then --- 60 platinum coins
if getPlayerItemCount(cid,2795) >= 5 then --- 5 fire mushrooms
if getPlayerItemCount(cid,7402) >= 1 then --- weapon
if doPlayerRemoveMoney(cid,6000) == TRUE then --- 60 platinum coins
if doPlayerRemoveItem(cid,2795,5) == 1 then --- 5 fire mushrooms
if doPlayerRemoveItem(cid,7402,1) == 1 then --- weapon
selfSay('Enchantment completed, here\'s your weapon.')
doPlayerAddItem(cid,7748) --- fire enchanted weapon
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
end
if msgcontains(msg, 'mystic blade') then
if player_money >= 600 then --- 60 platinum coins
if getPlayerItemCount(cid,2795) >= 5 then --- 5 fire mushrooms
if getPlayerItemCount(cid,7384) >= 1 then --- weapon
if doPlayerRemoveMoney(cid,6000) == TRUE then --- 60 platinum coins
if doPlayerRemoveItem(cid,2795,5) == 1 then --- 5 fire mushrooms
if doPlayerRemoveItem(cid,7384,1) == 1 then --- weapon
selfSay('Enchantment completed, here\'s your weapon.')
doPlayerAddItem(cid,7746) --- fire enchanted weapon
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
end
if msgcontains(msg, 'knight axe') then
if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
if getPlayerItemCount(cid,2795) >= 5 then --- 5 fire mushrooms
if getPlayerItemCount(cid,2430) >= 1 then --- weapon
if doPlayerRemoveMoney(cid,6000) == TRUE then --- 60 platinum coins
if doPlayerRemoveItem(cid,2795,5) == 1 then --- 5 fire mushrooms
if doPlayerRemoveItem(cid,2430,1) == 1 then --- weapon
selfSay('Enchantment completed, here\'s your weapon.')
doPlayerAddItem(cid,7750) --- fire enchanted weapon
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
end
if msgcontains(msg, 'heroic axe') then
if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
if getPlayerItemCount(cid,2795) >= 5 then --- 5 fire mushrooms
if getPlayerItemCount(cid,7389) >= 1 then --- weapon
if doPlayerRemoveMoney(cid,6000) == TRUE then --- 60 platinum coins
if doPlayerRemoveItem(cid,2795,5) == 1 then --- 5 fire mushrooms
if doPlayerRemoveItem(cid,7389,1) == 1 then --- weapon
selfSay('Enchantment completed, here\'s your weapon.')
doPlayerAddItem(cid,7751) --- fire enchanted weapon
else
selfSay('I need a weapon, and it\'s ingredients, I also want 6k as payment for this job.')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
end
if msgcontains(msg, 'headchopper') then
if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
if getPlayerItemCount(cid,2795) >= 5 then --- 5 fire mushrooms
if getPlayerItemCount(cid,7380) >= 1 then --- weapon
if doPlayerRemoveMoney(cid,6000) == TRUE then --- 60 platinum coins
if doPlayerRemoveItem(cid,2795,5) == 1 then --- 5 fire mushrooms
if doPlayerRemoveItem(cid,7380,1) == 1 then --- weapon
selfSay('Enchantment completed, here\'s your weapon.')
doPlayerAddItem(cid,7752) --- fire enchanted weapon
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
end
if msgcontains(msg, 'war axe') then
if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
if getPlayerItemCount(cid,2795) >= 5 then --- 5 fire mushrooms
if getPlayerItemCount(cid,2454) >= 1 then --- weapon
if doPlayerRemoveMoney(cid,6000) == TRUE then --- 60 platinum coins
if doPlayerRemoveItem(cid,2795,5) == 1 then --- 5 fire mushrooms
if doPlayerRemoveItem(cid,2454,1) == 1 then --- weapon
selfSay('Enchantment completed, here\'s your weapon.')
doPlayerAddItem(cid,7753) --- fire enchanted weapon
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
end
if msgcontains(msg, 'clerical mace') then
if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
if getPlayerItemCount(cid,2795,5) >= 1 then --- 5 fire mushrooms
if getPlayerItemCount(cid,2423) >= 1 then --- weapon
if doPlayerRemoveMoney(cid,6000) == TRUE then --- 60 platinum coins
if doPlayerRemoveItem(cid,2795,5) == 1 then --- 5 fire mushrooms
if doPlayerRemoveItem(cid,2423,1) == 1 then --- weapon
selfSay('Enchantment completed, here\'s your weapon.')
doPlayerAddItem(cid,7754) --- fire enchanted weapon
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
end
if msgcontains(msg, 'crystal mace') then
if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
if getPlayerItemCount(cid,2795) >= 5 then --- 5 fire mushrooms
if getPlayerItemCount(cid,2445) >= 1 then --- weapon
if doPlayerRemoveMoney(cid,6000) == TRUE then --- 60 platinum coins
if doPlayerRemoveItem(cid,2795,5) == TRUE then --- 5 fire mushrooms
if doPlayerRemoveItem(cid,2445,1) == TRUE then --- weapon
selfSay('Enchantment completed, here\'s your weapon.')
doPlayerAddItem(cid,7755) --- fire enchanted weapon
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
end
if msgcontains(msg, 'cranial basher') then
if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
if getPlayerItemCount(cid,2795) >= 5 then --- 5 fire mushrooms
if getPlayerItemCount(cid,7415) >= 1 then --- weapon
if doPlayerRemoveMoney(cid,6000) == TRUE then --- 60 platinum coins
if doPlayerRemoveItem(cid,2795,5) == 1 then --- 5 fire mushrooms
if doPlayerRemoveItem(cid,7415,1) == 1 then --- weapon
selfSay('Enchantment completed, here\'s your weapon.')
doPlayerAddItem(cid,7756) --- fire enchanted weapon
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
end
if msgcontains(msg, 'orcish maul') then
if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
if getPlayerItemCount(cid,2795) >= 5 then --- 5 fire mushrooms
if getPlayerItemCount(cid,7392) >= 1 then --- weapon
if doPlayerRemoveMoney(cid,6000) == TRUE then --- 60 platinum coins
if doPlayerRemoveItem(cid,2795,5) == 1 then --- 5 fire mushrooms
if doPlayerRemoveItem(cid,7392,1) == 1 then --- weapon
selfSay('Enchantment completed, here\'s your weapon.')
doPlayerAddItem(cid,7757) --- fire enchanted weapon
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
end
if msgcontains(msg, 'war hammer') then
if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
if getPlayerItemCount(cid,2795) >= 5 then --- 5 fire mushrooms
if getPlayerItemCount(cid,2391) >= 1 then --- weapon
if doPlayerRemoveMoney(cid,6000) == TRUE then --- 60 platinum coins
if doPlayerRemoveItem(cid,2795,5) == 1 then --- 5 fire mushrooms
if doPlayerRemoveItem(cid,2391,1) == 1 then --- weapon
selfSay('Enchantment completed, here\'s your weapon.')
doPlayerAddItem(cid,7758) --- fire enchanted weapon
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')
talk_state = 0
end
end
if msgcontains(msg, 'arrow') then
if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
if getPlayerItemCount(cid,2795) >= 5 then --- 5 fire mushrooms
if getPlayerItemCount(cid,2544) >= 100 then --- weapon
if doPlayerRemoveMoney(cid,6000) == TRUE then --- 60 platinum coins
if doPlayerRemoveItem(cid,2795,5) == TRUE then --- 5 fire mushrooms
if doPlayerRemoveItem(cid,2544,100) == TRUE then --- weapon
selfSay('Enchantment completed, here\'s your weapon.')
doPlayerAddItem(cid,7840,100) --- fire enchanted weapon
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')
talk_state = 0
end
else
selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')
talk_state = 0
end
end
if msgcontains(msg, 'no') then
selfSay('Maybe another time then.')
talk_state = 0
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Ah, I will post my script instead. He forgot to fix the functions...
Code:--- ------------------------------- --- --- Inspired by stix360's npc trade --- --- item for item example. Not sure --- --- if he made it, but I found it - --- --- through his posts. ------------ --- --- ------------------------------- --- --- The shit job was done by me --- --- --- ----- The hoster of Znote ----- --- --- ------------------------------- --- ------------Fixed by Empty-------------- local talk_state = 0 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 msgcontains(msg, 'spike sword') then if player_money >= 600 then --- 60 platinum coins if getPlayerItemCount(cid,2795) >= 5 then --- 5 fire mushrooms if getPlayerItemCount(cid,2383) >= 1 then --- spike sword if doPlayerRemoveMoney(cid,6000) == TRUE then --- 60 platinum coins if doPlayerRemoveItem(cid,2795,5) == TRUE then --- 5 fire mushrooms if doPlayerRemoveItem(cid,2383,1) == TRUE then --- spike sword selfSay('Enchantment completed, here\'s your weapon.') doPlayerAddItem(cid,7744) --- Spike sword with fire enchant else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end end if msgcontains(msg, 'barbarian axe') then if player_money >= 600 then --- 60 platinum coins if getPlayerItemCount(cid,2795) >= 5 then --- 5 fire mushrooms if getPlayerItemCount(cid,2429) >= 1 then --- barbarian axe if doPlayerRemoveMoney(cid,6000) == TRUE then --- 60 platinum coins if doPlayerRemoveItem(cid,2795,5) == 1 then --- 5 fire mushrooms if doPlayerRemoveItem(cid,2429,1) == 1 then --- barbarian axe selfSay('Enchantment completed, here\'s your weapon.') doPlayerAddItem(cid,7749) --- barbarian axe with fire enchant else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end end if msgcontains(msg, 'relic sword') then if player_money >= 600 then --- 60 platinum coins if getPlayerItemCount(cid,2795) >= 5 then --- 5 fire mushrooms if getPlayerItemCount(cid,7383) >= 1 then --- weapon if doPlayerRemoveMoney(cid,6000) == TRUE then --- 60 platinum coins if doPlayerRemoveItem(cid,2795,5) == 1 then --- 5 fire mushrooms if doPlayerRemoveItem(cid,7383,1) == 1 then --- weapon selfSay('Enchantment completed, here\'s your weapon.') doPlayerAddItem(cid,7745) --- fire enchanted weapon else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end end if msgcontains(msg, 'blacksteel sword') then if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins if getPlayerItemCount(cid,2795) >= 5 then --- 5 fire mushrooms if getPlayerItemCount(cid,7406) >= 1 then --- weapon if doPlayerRemoveMoney(cid,6000) == TRUE then --- 60 platinum coins if doPlayerRemoveItem(cid,2795,5) == 1 then --- 5 fire mushrooms if doPlayerRemoveItem(cid,7406,1) == 1 then --- weapon selfSay('Enchantment completed, here\'s your weapon.') doPlayerAddItem(cid,7747) --- fire enchanted weapon else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end end if msgcontains(msg, 'dragon slayer') then if player_money >= 600 then --- 60 platinum coins if getPlayerItemCount(cid,2795) >= 5 then --- 5 fire mushrooms if getPlayerItemCount(cid,7402) >= 1 then --- weapon if doPlayerRemoveMoney(cid,6000) == TRUE then --- 60 platinum coins if doPlayerRemoveItem(cid,2795,5) == 1 then --- 5 fire mushrooms if doPlayerRemoveItem(cid,7402,1) == 1 then --- weapon selfSay('Enchantment completed, here\'s your weapon.') doPlayerAddItem(cid,7748) --- fire enchanted weapon else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end end if msgcontains(msg, 'mystic blade') then if player_money >= 600 then --- 60 platinum coins if getPlayerItemCount(cid,2795) >= 5 then --- 5 fire mushrooms if getPlayerItemCount(cid,7384) >= 1 then --- weapon if doPlayerRemoveMoney(cid,6000) == TRUE then --- 60 platinum coins if doPlayerRemoveItem(cid,2795,5) == 1 then --- 5 fire mushrooms if doPlayerRemoveItem(cid,7384,1) == 1 then --- weapon selfSay('Enchantment completed, here\'s your weapon.') doPlayerAddItem(cid,7746) --- fire enchanted weapon else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end end if msgcontains(msg, 'knight axe') then if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins if getPlayerItemCount(cid,2795) >= 5 then --- 5 fire mushrooms if getPlayerItemCount(cid,2430) >= 1 then --- weapon if doPlayerRemoveMoney(cid,6000) == TRUE then --- 60 platinum coins if doPlayerRemoveItem(cid,2795,5) == 1 then --- 5 fire mushrooms if doPlayerRemoveItem(cid,2430,1) == 1 then --- weapon selfSay('Enchantment completed, here\'s your weapon.') doPlayerAddItem(cid,7750) --- fire enchanted weapon else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end end if msgcontains(msg, 'heroic axe') then if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins if getPlayerItemCount(cid,2795) >= 5 then --- 5 fire mushrooms if getPlayerItemCount(cid,7389) >= 1 then --- weapon if doPlayerRemoveMoney(cid,6000) == TRUE then --- 60 platinum coins if doPlayerRemoveItem(cid,2795,5) == 1 then --- 5 fire mushrooms if doPlayerRemoveItem(cid,7389,1) == 1 then --- weapon selfSay('Enchantment completed, here\'s your weapon.') doPlayerAddItem(cid,7751) --- fire enchanted weapon else selfSay('I need a weapon, and it\'s ingredients, I also want 6k as payment for this job.') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end end if msgcontains(msg, 'headchopper') then if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins if getPlayerItemCount(cid,2795) >= 5 then --- 5 fire mushrooms if getPlayerItemCount(cid,7380) >= 1 then --- weapon if doPlayerRemoveMoney(cid,6000) == TRUE then --- 60 platinum coins if doPlayerRemoveItem(cid,2795,5) == 1 then --- 5 fire mushrooms if doPlayerRemoveItem(cid,7380,1) == 1 then --- weapon selfSay('Enchantment completed, here\'s your weapon.') doPlayerAddItem(cid,7752) --- fire enchanted weapon else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end end if msgcontains(msg, 'war axe') then if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins if getPlayerItemCount(cid,2795) >= 5 then --- 5 fire mushrooms if getPlayerItemCount(cid,2454) >= 1 then --- weapon if doPlayerRemoveMoney(cid,6000) == TRUE then --- 60 platinum coins if doPlayerRemoveItem(cid,2795,5) == 1 then --- 5 fire mushrooms if doPlayerRemoveItem(cid,2454,1) == 1 then --- weapon selfSay('Enchantment completed, here\'s your weapon.') doPlayerAddItem(cid,7753) --- fire enchanted weapon else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end end if msgcontains(msg, 'clerical mace') then if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins if getPlayerItemCount(cid,2795,5) >= 1 then --- 5 fire mushrooms if getPlayerItemCount(cid,2423) >= 1 then --- weapon if doPlayerRemoveMoney(cid,6000) == TRUE then --- 60 platinum coins if doPlayerRemoveItem(cid,2795,5) == 1 then --- 5 fire mushrooms if doPlayerRemoveItem(cid,2423,1) == 1 then --- weapon selfSay('Enchantment completed, here\'s your weapon.') doPlayerAddItem(cid,7754) --- fire enchanted weapon else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end end if msgcontains(msg, 'crystal mace') then if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins if getPlayerItemCount(cid,2795) >= 5 then --- 5 fire mushrooms if getPlayerItemCount(cid,2445) >= 1 then --- weapon if doPlayerRemoveMoney(cid,6000) == TRUE then --- 60 platinum coins if doPlayerRemoveItem(cid,2795,5) == TRUE then --- 5 fire mushrooms if doPlayerRemoveItem(cid,2445,1) == TRUE then --- weapon selfSay('Enchantment completed, here\'s your weapon.') doPlayerAddItem(cid,7755) --- fire enchanted weapon else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end end if msgcontains(msg, 'cranial basher') then if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins if getPlayerItemCount(cid,2795) >= 5 then --- 5 fire mushrooms if getPlayerItemCount(cid,7415) >= 1 then --- weapon if doPlayerRemoveMoney(cid,6000) == TRUE then --- 60 platinum coins if doPlayerRemoveItem(cid,2795,5) == 1 then --- 5 fire mushrooms if doPlayerRemoveItem(cid,7415,1) == 1 then --- weapon selfSay('Enchantment completed, here\'s your weapon.') doPlayerAddItem(cid,7756) --- fire enchanted weapon else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end end if msgcontains(msg, 'orcish maul') then if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins if getPlayerItemCount(cid,2795) >= 5 then --- 5 fire mushrooms if getPlayerItemCount(cid,7392) >= 1 then --- weapon if doPlayerRemoveMoney(cid,6000) == TRUE then --- 60 platinum coins if doPlayerRemoveItem(cid,2795,5) == 1 then --- 5 fire mushrooms if doPlayerRemoveItem(cid,7392,1) == 1 then --- weapon selfSay('Enchantment completed, here\'s your weapon.') doPlayerAddItem(cid,7757) --- fire enchanted weapon else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end end if msgcontains(msg, 'war hammer') then if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins if getPlayerItemCount(cid,2795) >= 5 then --- 5 fire mushrooms if getPlayerItemCount(cid,2391) >= 1 then --- weapon if doPlayerRemoveMoney(cid,6000) == TRUE then --- 60 platinum coins if doPlayerRemoveItem(cid,2795,5) == 1 then --- 5 fire mushrooms if doPlayerRemoveItem(cid,2391,1) == 1 then --- weapon selfSay('Enchantment completed, here\'s your weapon.') doPlayerAddItem(cid,7758) --- fire enchanted weapon else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.')') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.') talk_state = 0 end end if msgcontains(msg, 'arrow') then if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins if getPlayerItemCount(cid,2795) >= 5 then --- 5 fire mushrooms if getPlayerItemCount(cid,2544) >= 100 then --- weapon if doPlayerRemoveMoney(cid,6000) == TRUE then --- 60 platinum coins if doPlayerRemoveItem(cid,2795,5) == TRUE then --- 5 fire mushrooms if doPlayerRemoveItem(cid,2544,100) == TRUE then --- weapon selfSay('Enchantment completed, here\'s your weapon.') doPlayerAddItem(cid,7840,100) --- fire enchanted weapon else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.') talk_state = 0 end else selfSay('I need a weapon, and its ingredients, I also want 6k as payment for this job.') talk_state = 0 end end if msgcontains(msg, 'no') then selfSay('Maybe another time then.') talk_state = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
--/*- ------------------------------- ---
--- Inspired by stix360's npc trade ---
--- item for item example. Not sure ---
--- if he made it, but I found it - ---
--- through his posts. ------------ ---
--- ------------------------------- ---
--- The shit job was done by me --- ---
--- ----- The hoster of Znote ----- ---
--- ------------------------------- -*/--
local talk_state = 0
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 getPlayerMoney(cid)
if isPlayer(cid) == 1 then
local gold = getPlayerItemCount(cid, 2148)
local platinum = getPlayerItemCount(cid, 2152)
local crystal = getPlayerItemCount(cid, 2160)
return gold + (platinum * 100) + (crystal * 10000)
end
end
function creatureSayCallback(cid, type, msg)
if msgcontains(msg, 'spike sword') then
if getPlayerMoney(cid) >= 6000 then --- 60 platinum coins
if getPlayerItemCount(cid, 2795) >= 5 then --- 5 fire mushrooms
if getPlayerItemCount(cid, 2383) >= 1 then --- spike sword
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,2383,1) --- spike sword
selfSay('Enchantmenth completed, heres your weapon.')
doPlayerAddItem(cid,7744) --- Spike sword with fire enchant
end
end
end
elseif msgcontains(msg, 'barbarian axe') then
if getPlayerMoney(cid) >= 6000 then --- 60 platinum coins
if getPlayerItemCount(cid, 2795) >= 5 then --- 5 fire mushrooms
if getPlayerItemCount(cid, 2429) >= 1 then --- barbarian axe
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,2429,1) --- barbarian axe
selfSay('Enchantmenth completed, heres your weapon.')
doPlayerAddItem(cid,7749) --- barbarian axe with fire enchant
end
end
end
elseif msgcontains(msg, 'relic sword') then
if getPlayerMoney(cid) >= 6000 then --- 60 platinum coins
if getPlayerItemCount(cid, 2795) >= 5 then --- 5 fire mushrooms
if getPlayerItemCount(cid, 7383) >= 1 then --- weapon
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,7383,1) --- weapon
selfSay('Enchantmenth completed, heres your weapon.')
doPlayerAddItem(cid,7745) --- fire enchanted weapon
end
end
end
elseif msgcontains(msg, 'blacksteel sword') then
if getPlayerMoney(cid) >= 6000 then --- 60 platinum coins
if getPlayerItemCount(cid, 2795) >= 5 then --- 5 fire mushrooms
if getPlayerItemCount(cid, 7406) >= 1 then --- weapon
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,7406,1) --- weapon
selfSay('Enchantmenth completed, heres your weapon.')
doPlayerAddItem(cid,7747) --- fire enchanted weapon
end
end
end
elseif msgcontains(msg, 'dragon slayer') then
if getPlayerMoney(cid) >= 6000 then --- 60 platinum coins
if getPlayerItemCount(cid, 2795) >= 5 then --- 5 fire mushrooms
if getPlayerItemCount(cid, 7402) >= 1 then --- weapon
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,7402,1) --- weapon
selfSay('Enchantmenth completed, heres your weapon.')
doPlayerAddItem(cid,7748) --- fire enchanted weapon
end
end
end
elseif msgcontains(msg, 'mystic blade') then
if getPlayerMoney(cid) >= 6000 then --- 60 platinum coins
if getPlayerItemCount(cid, 2795) >= 5 then --- 5 fire mushrooms
if getPlayerItemCount(cid, 7384) >= 1 then --- weapon
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,7384,1) --- weapon
selfSay('Enchantmenth completed, heres your weapon.')
doPlayerAddItem(cid,7746) --- fire enchanted weapon
end
end
end
elseif msgcontains(msg, 'knight axe') then
if getPlayerMoney(cid) >= 6000 then --- 60 platinum coins
if getPlayerItemCount(cid, 2795) >= 5 then --- 5 fire mushrooms
if getPlayerItemCount(cid, 2430) >= 1 then --- weapon
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,2430,1) --- weapon
selfSay('Enchantmenth completed, heres your weapon.')
doPlayerAddItem(cid,7750) --- fire enchanted weapon
end
end
end
elseif msgcontains(msg, 'heroic axe') then
if getPlayerMoney(cid) >= 6000 then --- 60 platinum coins
if getPlayerItemCount(cid, 2795) >= 5 then --- 5 fire mushrooms
if getPlayerItemCount(cid, 7389) >= 1 then --- weapon
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,7389,1) --- weapon
selfSay('Enchantmenth completed, heres your weapon.')
doPlayerAddItem(cid,7751) --- fire enchanted weapon
end
end
end
elseif msgcontains(msg, 'headchopper') then
if getPlayerMoney(cid) >= 6000 then --- 60 platinum coins
if getPlayerItemCount(cid, 2795) >= 5 then --- 5 fire mushrooms
if getPlayerItemCount(cid, 7380) >= 1 then --- weapon
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,7380,1) --- weapon
selfSay('Enchantmenth completed, heres your weapon.')
doPlayerAddItem(cid,7752) --- fire enchanted weapon
end
end
end
elseif msgcontains(msg, 'war axe') then
if getPlayerMoney(cid) >= 6000 then --- 60 platinum coins
if getPlayerItemCount(cid, 2795) >= 5 then --- 5 fire mushrooms
if getPlayerItemCount(cid, 2454) >= 1 then --- weapon
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,2454,1) --- weapon
selfSay('Enchantmenth completed, heres your weapon.')
doPlayerAddItem(cid,7753) --- fire enchanted weapon
end
end
end
elseif msgcontains(msg, 'clerical mace') then
if getPlayerMoney(cid) >= 6000 then --- 60 platinum coins
if getPlayerItemCount(cid, 2795) >= 5 then --- 5 fire mushrooms
if getPlayerItemCount(cid, 2423) >= 1 then --- weapon
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,2423,1) --- weapon
selfSay('Enchantmenth completed, heres your weapon.')
doPlayerAddItem(cid,7754) --- fire enchanted weapon
end
end
end
elseif msgcontains(msg, 'crystal mace') then
if getPlayerMoney(cid) >= 6000 then --- 60 platinum coins
if getPlayerItemCount(cid, 2795) >= 5 then --- 5 fire mushrooms
if getPlayerItemCount(cid, 2445) >= 1 then --- weapon
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,2445,1) --- weapon
selfSay('Enchantmenth completed, heres your weapon.')
doPlayerAddItem(cid,7755) --- fire enchanted weapon
end
end
end
elseif msgcontains(msg, 'cranial basher') then
if getPlayerMoney(cid) >= 6000 then --- 60 platinum coins
if getPlayerItemCount(cid, 2795) >= 5 then --- 5 fire mushrooms
if getPlayerItemCount(cid, 7415) >= 1 then --- weapon
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,7415,1) --- weapon
selfSay('Enchantmenth completed, heres your weapon.')
doPlayerAddItem(cid,7756) --- fire enchanted weapon
end
end
end
elseif msgcontains(msg, 'orcish maul') then
if getPlayerMoney(cid) >= 6000 then --- 60 platinum coins
if getPlayerItemCount(cid, 2795) >= 5 then --- 5 fire mushrooms
if getPlayerItemCount(cid, 7392) >= 1 then --- weapon
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,7392,1) --- weapon
selfSay('Enchantmenth completed, heres your weapon.')
doPlayerAddItem(cid,7757) --- fire enchanted weapon
end
end
end
elseif msgcontains(msg, 'war hammer') then
if getPlayerMoney(cid) >= 6000 then --- 60 platinum coins
if getPlayerItemCount(cid, 2795) >= 5 then --- 5 fire mushrooms
if getPlayerItemCount(cid, 2391) >= 1 then --- weapon
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,2391,1) --- weapon
selfSay('Enchantmenth completed, heres your weapon.')
doPlayerAddItem(cid,7758) --- fire enchanted weapon
end
end
end
elseif msgcontains(msg, 'arrow') then
if getPlayerMoney(cid) >= 6000 then --- 60 platinum coins
if getPlayerItemCount(cid, 2795) >= 5 then --- 5 fire mushrooms
if getPlayerItemCount(cid, 2544) >= 100 then --- weapon
doPlayerRemoveItem(cid,2152,60) --- 60 platinum coins
doPlayerRemoveItem(cid,2795,5) --- 5 fire mushrooms
doPlayerRemoveItem(cid,2544,100) --- weapon
selfSay('Enchantmenth completed, heres your weapon.')
doPlayerAddItem(cid,7840,100) --- fire enchanted weapon
end
end
end
elseif msgcontains(msg, 'no') then
selfSay('Maybe another time then.')
talk_state = 0
else
selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
talk_state = 0
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
It will work, but only if you have 60 platinum coins! ;P