• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

How to use corpses as "quests" instead of regular boxes?!

Johanz

New Member
Joined
Dec 31, 2008
Messages
188
Reaction score
1
As the titels says, anyone know how to use a corpse as a "quest box" ? Tryed to set the unique id just as i do with chests but with bad results ingame :( when i open corpse, nothing there. any idea?
 
Set uniqueID X to the corpse

actions.xml

Lua:
<action uniqueid="STORAGE_HERE" event="script" value="quests/yourscript.lua"/> <!-- brief description of the quest, so you can easily identify it later -->

quests/yourscript.lua

Lua:
function onUse(cid, item, frompos, item2, topos)

	if item.uid == STORAGE_HERE then
		if getPlayerStorageValue(cid,STORAGE_HERE) == -1 then
			doPlayerSendTextMessage(cid,25,"You have found ITEM_HERE.")
			doPlayerAddItem(cid,ITEM_ID_HERE,1)
			setPlayerStorageValue(cid,STORAGE_HERE,1)
		else
			doPlayerSendTextMessage(cid,25,"This body has been looted already.")
		end
	
	end
	return TRUE
end
 
Set uniqueID X to the corpse

actions.xml

Lua:
<action uniqueid="STORAGE_HERE" event="script" value="quests/yourscript.lua"/> <!-- brief description of the quest, so you can easily identify it later -->



quests/yourscript.lua

Lua:
function onUse(cid, item, frompos, item2, topos)

	if item.uid == STORAGE_HERE then
		if getPlayerStorageValue(cid,STORAGE_HERE) == -1 then
			doPlayerSendTextMessage(cid,25,"You have found ITEM_HERE.")
			doPlayerAddItem(cid,ITEM_ID_HERE,1)
			setPlayerStorageValue(cid,STORAGE_HERE,1)
		else
			doPlayerSendTextMessage(cid,25,"This body has been looted already.")
		end
	
	end
	return TRUE
end

Tryed it buy doesn't work..


You also have to set the corpse ID in actions.xml.


where do i need to set the corpse id? at the moment i just put storage id in actions.xml not the corpse.. where do i need to put it?
 
with the map editor :) you should put the action ID in the corpes and then edit it from the scripts.

Action id? I use my Storage id, the one i use as Unique id in actions.xml Should i change uniqueid to actionid instead but still use the storage id? :)
 
Just add something like this:
Code:
	[[COLOR="red"][B]2001[/B][/COLOR]] = [COLOR="#4169e1"][B]30015[/B][/COLOR],[COLOR="lime"] --Demon Helmet (DHQ)[/COLOR]
	[[COLOR="red"][B]2002[/B][/COLOR]] = [COLOR="#4169e1"][B]30016[/B][/COLOR], [COLOR="lime"]--Demon Shield (DHQ)[/COLOR]
	[[COLOR="red"][B]2003[/B][/COLOR]] = [COLOR="#4169e1"][B]30017[/B][/COLOR], [COLOR="lime"]--Steel Boots (DHQ)[/COLOR]
	[[COLOR="red"][B]2004[/B][/COLOR]] = [COLOR="#4169e1"][B]30018[/B][/COLOR], [COLOR="lime"]--POI main[/COLOR]
where:
xxxx - action ids
xxxx - storage ids
--xxxx - (optional) quest name



Then just add something like that:
Code:
<action actionid="2001-2004" event="script" value="quests/system.lua"/>
to your actions.xml
 
Back
Top