Lbtg
Intermediate OT User
- Joined
- Nov 22, 2008
- Messages
- 2,332
- Reaction score
- 141
Hello so i got this npc with gives Storage for xxxx items.
i use 0.4
i want that npc can aswell Sell ticket with Same storage for lets say 30 min and after 30 min remove storage from player . and player again can buy Ticket for 30 min for xxxx items.
So player can bring items to npc to have 4eever storage or buy tickets to have storage for 30 min.
npc.lua
npc.xml
Thanks in advance
i use 0.4
i want that npc can aswell Sell ticket with Same storage for lets say 30 min and after 30 min remove storage from player . and player again can buy Ticket for 30 min for xxxx items.
So player can bring items to npc to have 4eever storage or buy tickets to have storage for 30 min.
npc.lua
PHP:
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 AssassinFirst(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
if getPlayerItemCount(cid,8309) >= 250 then
if doPlayerRemoveItem(cid,8309,250) then
npcHandler:say('You can now pass next floor!', cid)
setPlayerStorageValue(cid,6211,1)
end
else
npcHandler:say('You don\'t have 250 nails , you can get them at War Golems!', cid)
end
end
keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Bring me 250 nails from War golems, and bring them to me."})
local node = keywordHandler:addKeyword({'m'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you already collected 250 nails to pass next floor?'})
node:addChildKeyword({'yes'}, AssassinFirst, {npcHandler = npcHandler, onlyFocus = true, reset = true})
node:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got the neccessary items.', reset = true})
npcHandler:addModule(FocusModule:new())
npc.xml
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Alex" script="1floor.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="326" head="110" body="133" legs="54" feet="45" addons="2"/>
<parameters>
<parameter key="message_greet" value="Hello |PLAYERNAME|, wanna make {mission} to pass next floor? Or do you need {help} ?"/>
</parameters>
</npc>
Thanks in advance
Last edited: