Kjeld
Avid OTLand fan
2 Small scripts, which could fit good in any RPG server.
Furniture Seller (Also sell Wooden Stake(needed for blessed wooden stake)):
And a temple charcter, needed to bless the wooden stake.
You need 12.000 gold pieces, a wooden stake and 2 dead chickens, to bless this wooden stake.
I tried to make this temple npc, according to Tibia.erig.net, but unfortunatly, I couldn't figure out how to make a npc say several lines with a small delay.
It's based on Mokehammers' Blessed stake script.
Well, Enjoy!
Kjeld~
Furniture Seller (Also sell Wooden Stake(needed for blessed wooden stake)):
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
-- OTServ event handling functions start
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThingMove(creature, thing, oldpos, oldstackpos) npcHandler:onThingMove(creature, thing, oldpos, oldstackpos) end
function onCreatureAppear(creature) npcHandler:onCreatureAppear(creature) end
function onCreatureDisappear(id) npcHandler:onCreatureDisappear(id) end
function onCreatureTurn(creature) npcHandler:onCreatureTurn(creature) end
function onCreatureChangeOutfit(creature) npcHandler:onCreatureChangeOutfit(creature) end
function onThink() npcHandler:onThink() end
-- OTServ event handling functions end
local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)
function creatureSayCallback(cid, type, msg)
if(npcHandler.focus ~= cid) then
return false
end
not_enough_money = 'You do not have enough of money'
stake_give = 'Argh... my heart aches! Alright... a promise is a promise. Here - take this wooden stake, and now get lost.'
player_gold = getPlayerItemCount(cid,2148)
player_plat = getPlayerItemCount(cid,2152)*100
player_crys = getPlayerItemCount(cid,2160)*10000
player_money = player_gold + player_plat + player_crys
-- Wooden Stake --
if msgcontains(msg, 'wooden stake') then
total = 5000
selfSay('Making a stake from a chair? Are you insane??! I won\'t waste my chairs on you for free! You will have to pay for it, but since I consider your plan a blasphemy, it will cost '..total..' gold pieces. Okay?')
talk_state = 1
-- Confirm yes --
elseif msgcontains(msg, 'yes') and talk_state == 1 then
if doPlayerRemoveMoney(cid, total) == TRUE then
selfSay(stake_give)
doPlayerGiveItem(cid, 5941, 1)
focus = 0
else
selfSay(not_enough_money)
end
-- Decline --
elseif msgcontains(msg, 'no') and talk_state == 1 then
selfSay('Thank god, that I won\'t have to ruin my chair!')
talk_state = 0
end
return true
end
-- Statues --
shopModule:addBuyableItem({'knight statue'}, 1442, 50, 'Knight Statue')
shopModule:addBuyableItem({'minotaur statue'}, 1446, 50, 'Minotaur Statue')
shopModule:addBuyableItem({'goblin statue'}, 1447, 50, 'Goblin Statue')
-- Tables --
shopModule:addBuyableItem({'small table'}, 3912, 15, 'Small Table')
shopModule:addBuyableItem({'small round table'}, 3911, 15, 'Small Round Table')
shopModule:addBuyableItem({'stone table'}, 3913, 20, 'Stone Table')
shopModule:addBuyableItem({'square table'}, 3910, 20, 'Square Table')
shopModule:addBuyableItem({'big table'}, 3909, 25, 'Big Table')
shopModule:addBuyableItem({'tusk table'}, 3914, 25, 'Tusk Table')
shopModule:addBuyableItem({'bamboo table'}, 3919, 25, 'Bamboo Table')
-- Chairs --
shopModule:addBuyableItem({'wooden chair'}, 3901, 25, 'Wooden Chair')
shopModule:addBuyableItem({'sofa chair'}, 3902, 50, 'Sofa Chair')
shopModule:addBuyableItem({'red cushioned chair'}, 3903, 40, 'Red Cushioned Chair')
shopModule:addBuyableItem({'green cushioned chair'}, 3904, 40, 'Green Cushioned Chair')
shopModule:addBuyableItem({'tusk chair'}, 3905, 30, 'Tusk Chair')
shopModule:addBuyableItem({'ivory chair'}, 3906, 30, 'Ivory Chair')
shopModule:addBuyableItem({'tree stump'}, 3907, 15, 'Tree Stump')
-- other --
shopModule:addBuyableItem({'coal basin'}, 3908, 40, 'Coal Basin')
shopModule:addBuyableItem({'harp'}, 3917, 45, 'Harp')
shopModule:addBuyableItem({'bird cage'}, 3918, 45, 'Bird Cage')
shopModule:addBuyableItem({'thick trunk'}, 3920, 15, 'Thick Trunk')
shopModule:addBuyableItem({'drawers'}, 3921, 40, 'Drawers')
shopModule:addBuyableItem({'barrel'}, 3923, 15, 'Barrel')
shopModule:addBuyableItem({'piano'}, 3926, 50, 'Piano')
shopModule:addBuyableItem({'globe'}, 3927, 25, 'Globe')
shopModule:addBuyableItem({'potted flower'}, 3928, 25, 'Potted Flower')
shopModule:addBuyableItem({'indoor plant'}, 3929, 25, 'Indoor Plant')
shopModule:addBuyableItem({'christmas tree'}, 3931, 35, 'Christmas Tree')
shopModule:addBuyableItem({'dresser'}, 3932, 20, 'Dresser')
shopModule:addBuyableItem({'pendulum clock'}, 3933, 45, 'Pendulum Clock')
shopModule:addBuyableItem({'locker'}, 3934, 35, 'Locker')
shopModule:addBuyableItem({'trough'}, 3935, 15, 'Trough')
shopModule:addBuyableItem({'bookcase'}, 3936, 40, 'Bookcase')
shopModule:addBuyableItem({'table lamp'}, 3937, 25, 'Table Lamp')
shopModule:addBuyableItem({'large trunk'}, 3938, 35, 'Large Trunk')
-- Tapestries --
shopModule:addBuyableItem({'purple tapestry'}, 1857, 25, 'Purple Tapestry')
shopModule:addBuyableItem({'green tapestry'}, 1860, 25, 'Green Tapestry')
shopModule:addBuyableItem({'yellow tapestry'}, 1863, 25, 'Yellow Tapestry')
shopModule:addBuyableItem({'orange tapestry'}, 1866, 25, 'Orange Tapestry')
shopModule:addBuyableItem({'red tapestry'}, 1869, 25, 'Red Tapestry')
shopModule:addBuyableItem({'blue tapestry'}, 1872, 25, 'Blue Tapestry')
shopModule:addBuyableItem({'white tapestry'}, 1880, 25, 'White Tapestry')
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
-- Makes sure the npc reacts when you say hi, bye etc.
npcHandler:addModule(FocusModule:new())
And a temple charcter, needed to bless the wooden stake.
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
-- OTServ event handling functions start
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThingMove(creature, thing, oldpos, oldstackpos) npcHandler:onThingMove(creature, thing, oldpos, oldstackpos) end
function onCreatureAppear(creature) npcHandler:onCreatureAppear(creature) end
function onCreatureDisappear(id) npcHandler:onCreatureDisappear(id) end
function onCreatureTurn(creature) npcHandler:onCreatureTurn(creature) end
function onCreatureChangeOutfit(creature) npcHandler:onCreatureChangeOutfit(creature) end
function onThink() npcHandler:onThink() end
-- OTServ event handling functions end
local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)
function creatureSayCallback(cid, type, msg)
if(npcHandler.focus ~= cid) then
return false
end
player_gold = getPlayerItemCount(cid,2148)
player_plat = getPlayerItemCount(cid,2152)*100
player_crys = getPlayerItemCount(cid,2160)*10000
player_money = player_gold + player_plat + player_crys
bless1 = 'Do you want me to bless your stake? It will cost you 12000 gold pieces, and 2 dead chickens!'
blessed1 = '<mumblemmuble> Sha Kesh Mar!'
blessed_no = 'Maybe you will in the nearby future!'
-- Wooden Stake --
if msgcontains(msg, 'wooden stake') then
selfSay(bless1)
talk_state = 1
-- Confirm --
elseif msgcontains(msg,'yes') and talk_state == 1 then
if doPlayerRemoveMoney(cid, 12000) == TRUE then
if doPlayerTakeItem(cid,4265,2) then
if doPlayerTakeItem(cid,5941,1) then
selfSay(blessed1)
if doPlayerAddItem(cid,5942,1) then
else
selfSay(blessed_no)
end
return true
end
end
end
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
-- Makes sure the npc reacts when you say hi, bye etc.
npcHandler:addModule(FocusModule:new())
You need 12.000 gold pieces, a wooden stake and 2 dead chickens, to bless this wooden stake.
I tried to make this temple npc, according to Tibia.erig.net, but unfortunatly, I couldn't figure out how to make a npc say several lines with a small delay.
It's based on Mokehammers' Blessed stake script.
Well, Enjoy!
Kjeld~