NPC Working amulet/ring seller for 0.4

ralke

Felipe
Joined
Dec 17, 2011
Messages
269
Reaction score
31
Location
Chile
Hello, I think this is my first contribution to the forum. It is an NPC of amulets and rings that sells the amulets with their respective charges. This is for TFS 0.4 version 8.60, the charges of amulets are based in Amulets and Necklaces (https://tibia.fandom.com/wiki/Amulets_and_Necklaces) with the base of the following script NPC - Ultimate Amulets and Rings Dealer (https://otland.net/threads/ultimate-amulets-and-rings-dealer.166837/).

Create XML file on data/npc with:
XML:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Ralke" script="data/npc/scripts/amulet.lua" walkinterval="0" floorchange="0">
    <health now="150" max="150"/>
     <look type="130" head="24" body="77" legs="10" feet="20"/>
    <parameters>
        <parameter key="message_greet" value="Hello |PLAYERNAME|. I sell all kinds of amulets and rings!"/>
    </parameters>
</npc>
Then create LUA file named amulet.lua on data/npc/scripts with:
Lua:
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

local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)

shopModule:addBuyableItem({'scarf'}, 2661, 250, 'scarf')
shopModule:addBuyableItem({'bronze amulet'}, 2172, 250, 200, 'bronze amulet')
shopModule:addBuyableItem({'silver amulet'}, 2170, 250, 200, 'silver amulet')
shopModule:addBuyableItem({'garlic necklace'}, 2199, 250, 150, 'garlic necklace')
shopModule:addBuyableItem({'protection amulet'}, 2200, 250, 250, 'protection amulet')
shopModule:addBuyableItem({'dragon necklace'}, 2201, 250,200, 'dragon necklace')
shopModule:addBuyableItem({'strange talisman'}, 2161, 250,200, 'strange talisman')
shopModule:addBuyableItem({'crystal necklace'}, 2125, 250, 'crystal necklace')
shopModule:addBuyableItem({'amulet of loss'}, 2173, 10000, 'amulet of loss')
shopModule:addBuyableItem({'wedding ring'}, 2121, 990,'wedding ring')
shopModule:addBuyableItem({'time ring'}, 2169, 2000,'time ring')
shopModule:addBuyableItem({'sword ring'}, 2207, 500,'sword ring')
shopModule:addBuyableItem({'stealth ring'}, 2165, 5000,'stealth ring')
shopModule:addBuyableItem({'signet ring'}, 7697, 15000,'signet ring')
shopModule:addBuyableItem({'ring of the sky'}, 2123, 48000,'ring of the sky')
shopModule:addBuyableItem({'ring of healing'}, 2214, 2000,'ring of healing')
shopModule:addBuyableItem({'power ring'}, 2166, 100,'power ring')
shopModule:addBuyableItem({'might ring'}, 2164, 5000,'might ring')
shopModule:addBuyableItem({'life ring'}, 2168, 900,'life ring')
shopModule:addBuyableItem({'gold ring'}, 2179, 32000,'gold ring')
shopModule:addBuyableItem({'energy ring'}, 2167, 2000,'energy ring')
shopModule:addBuyableItem({'dwarven ring'}, 2213, 2000,'dwarven ring')
shopModule:addBuyableItem({'death ring'}, 6300, 4000,'death ring')
shopModule:addBuyableItem({'crystal ring'}, 2124, 1000,'crystal ring')
shopModule:addBuyableItem({'club ring'}, 2209, 500,'club ring')
shopModule:addBuyableItem({'axe ring'}, 2208, 500,'axe ring')
shopModule:addBuyableItem({'wolf tooth chain'}, 2129, 400,'wolf tooth chain')
shopModule:addBuyableItem({'beetle necklace'}, 11374, 6000,'beetle necklace')
shopModule:addBuyableItem({'ancient amulet'}, 2142, 800,'ancient amulet')
shopModule:addBuyableItem({'demonbone amulet'}, 2136, 128000,'demonbone amulet')
shopModule:addBuyableItem({'golden amulet'}, 2130, 6600,'golden amulet')
shopModule:addBuyableItem({'scarab amulet'}, 2135, 800,'scarab amulet')
shopModule:addBuyableItem({'star amulet'}, 2131, 2000,'star amulet')
shopModule:addBuyableItem({'platinum amulet'}, 2171, 10000,'platinum amulet')
shopModule:addBuyableItem({'elven amulet'}, 2198, 500, 50,'elven amulet')
shopModule:addBuyableItem({'glacier amulet'}, 7888, 6000,'glacier amulet')
shopModule:addBuyableItem({'leviathan/s amulet'}, 10220, 12000, 5,'leviathan/s amulet')
shopModule:addBuyableItem({'lightning pendant'}, 7889, 6000,'lightning pendant')
shopModule:addBuyableItem({'magma amulet'}, 7890, 6000, 200,'magma amulet')
shopModule:addBuyableItem({'sacred tree amulet'}, 10219, 12000, 5,'sacred tree amulet')
shopModule:addBuyableItem({'bonfire amulet'}, 10218, 12000, 5,'bonfire amulet')
shopModule:addBuyableItem({'shockwave amulet'}, 10221, 12000, 5,'shockwave amulet')
shopModule:addBuyableItem({'stone skin amulet'}, 2197, 5000, 5,'stone skin amulet')
shopModule:addBuyableItem({'terra amulet'}, 7887, 6000, 200, 'terra amulet')

npcHandler:addModule(FocusModule:new())
Hope it helps!
Regards
 
Top