Jpstafe
Well-Known Member
- Joined
- Aug 8, 2011
- Messages
- 581
- Reaction score
- 78
Hello otland community, my question is how can I make sure that the djns are not free, that they are by scrolls... I already have the scrolls made, but when I go to the djns I can still pass the doors, without activating the scrolls
Scroll Blue djns:
Scroll Green djns:
Nah'bob:
scripth-nah'bob.lua:
Alesar.xml npc:
scripth Alesar:
Scroll Blue djns:
LUA:
function onUse(cid, item, itemEx, toPosition)
local pos = getCreaturePosition(cid)
if (getTilePzInfo(getPlayerPosition(cid)) == TRUE) then
if(getPlayerStorageValue(cid, 1015) == 1) then
doPlayerSendTextMessage(cid, 22, "You already have Blue Djin Quest!")
else
doRemoveItem(item.uid, 1)
setPlayerStorageValue(cid, 1015, 1)
doPlayerSendTextMessage(cid, 22, "You just completed Blue Djin Quest!")
end
else
doPlayerSendTextMessage(cid, 22, "You can only use this item inside protection zone!")
end
return true
end
LUA:
function onUse(cid, item, itemEx, toPosition)
local pos = getCreaturePosition(cid)
if (getTilePzInfo(getPlayerPosition(cid)) == TRUE) then
if(getPlayerStorageValue(cid, 1038) == 1) then
doPlayerSendTextMessage(cid, 22, "You already have Green Djin Quest!")
else
doRemoveItem(item.uid, 1)
setPlayerStorageValue(cid, 1038, 1)
doPlayerSendTextMessage(cid, 22, "You just completed Green Djin Quest!")
end
else
doPlayerSendTextMessage(cid, 22, "You can only use this item inside protection zone!")
end
return true
end
Nah'bob:
LUA:
<npc name="Nah'bob" script="Nahbob.lua" floorchange="0" walkinterval="1500" speed="100">
<health now="100" max="100"/>
<look type="80" head="0" body="0" legs="0" feet="0"/>
<parameters>
<parameter key="idletime" value="60"/>
<parameter key="message_greet" value="Sighs.. Another customer! I've only just sat down! What is it, |PLAYERNAME|?"/>
<parameter key="message_placedinqueue" value="Whoa, |PLAYERNAME|! Easy! Old Bob is busy right now!"/>
<parameter key="message_walkaway" value="Bye then."/>
<parameter key="message_farewell" value="Bye now. Visit old Bob again one day!"/>
<parameter key="message_idletimeout" value="Bye now. Visit old Bob again one day!"/>
<parameter key="message_decline" value="Well, obviously not."/>
<parameter key="message_nothaveitem" value="You do not have that many!"/>
<parameter key="message_needmoremoney" value="Well, come back if you have enough copper."/>
</parameters>
</npc>
LUA:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
-- OTServ event handling functions start
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
-- OTServ event handling functions end
local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)
shopModule:addSellableItem({'dragon lance'}, 2414, 9000, 'dragon lance')
shopModule:addSellableItem({'fire axe'}, 2432, 8000, 'fire axe')
shopModule:addSellableItem({'fire sword'}, 2392, 4000, 'fire sword')
shopModule:addSellableItem({'war hammer'}, 2391, 1200, 'war hammer')
shopModule:addSellableItem({'spike sword'}, 2383, 1000, 'spike sword')
shopModule:addSellableItem({'ice rapier'}, 2396, 1000, 'ice rapier')
shopModule:addSellableItem({'broad sword'}, 2413, 500, 'broad sword')
shopModule:addSellableItem({'obsidian lance'}, 2425, 500, 'obsidian lance')
shopModule:addSellableItem({'crown armor'}, 2487, 12000, 'crown armor')
shopModule:addSellableItem({'blue robe'}, 2656, 10000, 'blue robe')
shopModule:addSellableItem({'noble armor'}, 2486, 900, 'noble armor')
shopModule:addSellableItem({'royal helmet'}, 2498, 30000, 'royal helmet')
shopModule:addSellableItem({'crusader helmet'}, 2497, 6000, 'crusader helmet')
shopModule:addSellableItem({'crown helmet'}, 2491, 2500, 'crown helmet')
shopModule:addSellableItem({'crown legs'}, 2488, 12000, 'crown legs')
shopModule:addSellableItem({'boots of haste'}, 2195, 30000, 'boots of haste')
shopModule:addSellableItem({'phoenix shield'}, 2539, 16000, 'phoenix shield')
shopModule:addSellableItem({'crown shield'}, 2519, 8000, 'crown shield')
shopModule:addSellableItem({'dragon shield'}, 2516, 4000, 'dragon shield')
shopModule:addSellableItem({'guardian shield'}, 2515, 2000, 'guardian shield')
shopModule:addSellableItem({'beholder shield'}, 2518, 1200, 'beholder shield')
shopModule:addBuyableItem({'war hammer'}, 2391, 10000, 'war hammer')
shopModule:addBuyableItem({'spike sword'}, 2383, 8000, 'spikesword')
shopModule:addBuyableItem({'noble armor'}, 2486, 8000, 'noble armor')
shopModule:addBuyableItem({'beholder shield'}, 2518, 7000, 'war hammer')
npcHandler:addModule(FocusModule:new())
Alesar.xml npc:
XML:
<?xml version="1.0"?>
<npc name="Alesar" script="alesar.lua" access="3" lookdir="2" walkinterval="2000">
<mana now="800" max="800" />
<health now="200" max="200" />
<look type="80" head="0" body="0" legs="0" feet="0" />
<parameters>
<parameter key="message_greet" value="What do you want from me, %N?" />
<parameter key="message_farewell" value="Finally." />
<parameter key="message_placedinqueue" value="I am already talking to one of you creeps. So shut up until it is your turn, |PLAYERNAME|." />
</parameters>
</npc>
scripth Alesar:
LUA:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
-- OTServ event handling functions start
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
-- OTServ event handling functions end
local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)
shopModule:addSellableItem({'scimitar'}, 2419, 150, 'scimitar')
shopModule:addSellableItem({'giant sword'}, 2393, 17000, 'giant sword')
shopModule:addSellableItem({'serpent sword'}, 2409, 900, 'serpent sword')
shopModule:addSellableItem({'poison dagger'}, 2411, 50, 'poison dagger')
shopModule:addSellableItem({'knight axe'}, 2430, 2000, 'knight axe')
shopModule:addSellableItem({'dragon hammer'}, 2434, 2000, 'dragon hammer')
shopModule:addSellableItem({'skull staff'}, 2436, 6000, 'skull staff')
shopModule:addSellableItem({'dark armor'}, 2489, 400, 'dark armor')
shopModule:addSellableItem({'knight armor'}, 2476, 5000, 'knight armor')
shopModule:addSellableItem({'dark helmet'}, 2490, 250, 'dark helmet')
shopModule:addSellableItem({'warrior helmet'}, 2475, 5000, 'warrior helmet')
shopModule:addSellableItem({'strange helmet'}, 2479, 500, 'strange helmet')
shopModule:addSellableItem({'mystic turban'}, 2663, 150, 'mystic turban')
shopModule:addSellableItem({'knight legs'}, 2477, 5000, 'knight legs')
shopModule:addSellableItem({'tower shield'}, 2528, 8000, 'tower shield')
shopModule:addSellableItem({'black shield'}, 2529, 800, 'black shield')
shopModule:addSellableItem({'ancient shield'}, 2532, 900, 'ancient shield')
shopModule:addSellableItem({'vampire shield'}, 2534, 15000, 'vampire shield')
shopModule:addBuyableItem({'ice rapier'}, 2396, 5000, 'ice rapier')
shopModule:addBuyableItem({'serpent sword'}, 2409, 6000, 'serpent sword')
shopModule:addBuyableItem({'dark armor'}, 2489, 1500, 'dark armor')
shopModule:addBuyableItem({'dark helmet'}, 2490, 1000, 'dark helmet')
shopModule:addBuyableItem({'ancient shield'}, 2532, 5000, 'ancient shield')
npcHandler:addModule(FocusModule:new())