Quest system

Status
Zamknięty.

WielkiNaab

Active User
Zarejestrowany
Dołączył
Styczeń 25, 2009
Posty
70
Liczba reakcji
5
Witam.
Prosi? bym o udost?pnienie mi quest systemu kt?ry polega na ustawieniu questa tylko w map edytorze, ewentualnie z jak najmniejsz? ingerencj? w lua.
Tfs 0.4.0 trunk najnowszy.
 
Odp: Quest system

chodzi Ci o skrzynke z nagrodami??

function onUse(cid, item, fromPosition, itemEx, toPosition)
local item1 = 1234
local item2 = 4321


if item.uid == 2000 then
queststatus = getPlayerStorageValue(cid,6034)
if queststatus ~= 1 then
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have found ".. getItemNameById(item1) ..".")
doPlayerAddItem(cid, item1)
setPlayerStorageValue(cid,6034,1)
else
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "It is empty.")
end
elseif item.uid == 2001 then
queststatus = getPlayerStorageValue(cid,6033)
if queststatus ~= 1 then
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have found ".. getItemNameById(item2) .."."")
doPlayerAddItem(cid, item2)
setPlayerStorageValue(cid,6033,1)
else
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "It is empty.")
end
end
return 1
end

oczywiscie rejestrujesz w actions.xml i nadajjesz skrzynkom na mapie unique id 2000 i 2001
 
Odp: Quest system

Chodzi mi o jeden skrypt do wszystkich quest?w kt?rych nie musia? bym wpisywa? w skrypcie tylko na samej mapie.
 
Odp: Quest system

W actions tworzysz plik questy a w nim
function onUse(cid, item, frompos, item2, topos)
prize = item.uid
count = item.actionid

if prize > 0 and prize < 14000 then
queststatus = getPlayerStorageValue(cid,prize)

if queststatus == -1 then
if count > 1 then
doPlayerSendTextMessage(cid,22,'You have found '.. count ..' of ' .. getItemName(prize) .. '.')
doPlayerAddItem(cid,prize,count)
setPlayerStorageValue(cid,prize,1)
else
doPlayerSendTextMessage(cid,22,'You have found a ' .. getItemName(prize) .. '.')
doPlayerAddItem(cid,prize,1)
setPlayerStorageValue(cid,prize,1)
end
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end

return 1
else
return 0
end
end

nast?pnie w acions.xml
<action itemid="1740" script="quest.lua" />
<action itemid="1747" script="questy.lua" />
<action itemid="1748" script="questy.lua" />
<action itemid="1749" script="questy.lua" />
<action itemid="1770" script="questy.lua" />

Dzia?a to tak
w map edytorze stawiasz skrzynk? z id podanymi w actions.xml nast?pnie nadajesz uid takie jak ma item z kt?rych chcesz zrobi? quest
Je?li chcesz zrobi? grupowane itemy typu assassiny to wstawiasz uid assassinek 7368 i actionid np 50 to quest b?dzie na 50 assassinek
 
Status
Zamknięty.
Back
Do góry