QuaS
Cykotitan Pwned =/
Hello. Here i would like to show you my quest system.
First of all scripts:
actions/scripts/quest/quest.lua
in actions.xml:
How does it works:
(first part is made because of lot of chest on my map with this system. you can skip to part 2)
if you want to make chest give x item then:
I: make chest unique ID of Item Id. (only 1 chest with this item on map)
II: make chest action.id of item.id, make chest unique.id range 11000 - 20000
That is all.
This script is giving one item. count of items is noe editable it will be always 1.
Good for simple quests. You don't have to writting anything to actions.xml or anywhere else.
//QuaS~
First of all scripts:
actions/scripts/quest/quest.lua
LUA:
function onUse(cid, item, frompos, item2, topos)
prize = item.uid
count = item.actionid
queststatus = getPlayerStorageValue(cid,prize)
msgEmpty = "It is empty."
if prize > 0 and prize < 10500 then
msgGetItem = "You have found "..getItemArticleById(prize).." "..getItemNameById(prize).."."
msgNoCap = "You have found a "..getItemNameById(prize).." weighing "..getItemWeightById(prize,1).." oz. It is too heavy or you don't have enough space in backpack to take it."
if queststatus <= 0 then
reward = doCreateItemEx(prize,1)
additem = doPlayerAddItemEx(cid,reward,0)
if additem == RETURNVALUE_NOERROR then
doPlayerSendTextMessage(cid,22,msgGetItem)
setPlayerStorageValue(cid,prize,1)
else
doPlayerSendTextMessage(cid,22,msgNoCap)
end
else
doPlayerSendTextMessage(cid,22,msgEmpty)
end
return TRUE
elseif prize > 10500 then
msgGetItem = "You have found "..getItemArticleById(count).." "..getItemNameById(count).."."
msgNoCap = "You have found a "..getItemNameById(count).." weighing "..getItemWeightById(count,1).." oz. It is too heavy or you don't have enough space in backpack to take it."
if queststatus <= 0 then
reward = doCreateItemEx(count,1)
additem = doPlayerAddItemEx(cid,reward,0)
if additem == RETURNVALUE_NOERROR then
doPlayerSendTextMessage(cid,22,msgGetItem)
setPlayerStorageValue(cid,prize,1)
else
doPlayerSendTextMessage(cid,22,msgEmpty)
end
else
doPlayerSendTextMessage(cid,22,msgEmpty)
end
return TRUE
else
return FALSE
end
end
in actions.xml:
PHP:
<action itemid="1740" event="script" value="quests/quest.lua" />
<action itemid="1747" event="script" value="quests/quest.lua" />
<action itemid="1748" event="script" value="quests/quest.lua" />
<action itemid="1749" event="script" value="quests/quest.lua" />
<action itemid="1770" event="script" value="quests/quest.lua" />
How does it works:
(first part is made because of lot of chest on my map with this system. you can skip to part 2)
if you want to make chest give x item then:
I: make chest unique ID of Item Id. (only 1 chest with this item on map)
II: make chest action.id of item.id, make chest unique.id range 11000 - 20000
That is all.
This script is giving one item. count of items is noe editable it will be always 1.
Good for simple quests. You don't have to writting anything to actions.xml or anywhere else.
//QuaS~