• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Quest at Addon!

Maniucza

~Lua~ Noob
Joined
Aug 2, 2009
Messages
86
Reaction score
6
Location
Poland / Rzeszów
Hi all I decided to do quests that by click on the box to add our addon in this case it will be Second Demon Hunter Addon.

Getting started :

Data/actions/scripts/addon.lua

PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
        if item.itemid == 1740 then
			local pPos = getPlayerPosition(cid)
			doSendMagicEffect(pPos, 28)
                doPlayerAddOutfit(cid,288,2)
				doPlayerAddOutfit(cid,289,2)
					doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations, you got addon!")
        end
		return TRUE
end

Data/actions/actions.xml
PHP:
	<action uniqueid="2610" event="script" value="addon.lua"/>


Image : Imageshack - beztytuuedited

Rep++ I think someone helped. :)
 
Last edited:
omg..

for noobz :

doPlayerAddOutfit(cid,looktype,addon)

outfit numbers from outfits.xml

Lua:
<?xml version="1.0"?>
<outfits>
	<outfit id="1">
		<list gender="0" lookType="136" name="Citizen"/>
		<list gender="1" lookType="128" name="Citizen"/>
	</outfit>

	<outfit id="2">
		<list gender="0" lookType="137" name="Hunter"/>
		<list gender="1" lookType="129" name="Hunter"/>
	</outfit>

	<outfit id="3">
		<list gender="0" lookType="138" name="Mage"/>
		<list gender="1" lookType="130" name="Mage"/>
	</outfit>

	<outfit id="4">
		<list gender="0" lookType="139" name="Knight"/>
		<list gender="1" lookType="131" name="Knight"/>
	</outfit>

	<outfit id="5" premium="yes">
		<list gender="0" lookType="140" name="Noblewoman"/>
		<list gender="1" lookType="132" name="Nobleman"/>
	</outfit>

	<outfit id="6" premium="yes">
		<list gender="0" lookType="141" name="Summoner"/>
		<list gender="1" lookType="133" name="Summoner"/>
	</outfit>

	<outfit id="7" premium="yes">
		<list gender="0" lookType="142" name="Warrior"/>
		<list gender="1" lookType="134" name="Warrior"/>
	</outfit>

	<outfit id="8" premium="yes">
		<list gender="0" lookType="147" name="Barbarian"/>
		<list gender="1" lookType="143" name="Barbarian"/>
	</outfit>

	<outfit id="9" premium="yes">
		<list gender="0" lookType="148" name="Druid"/>
		<list gender="1" lookType="144" name="Druid"/>
	</outfit>

	<outfit id="10" premium="yes">
		<list gender="0" lookType="149" name="Wizard"/>
		<list gender="1" lookType="145" name="Wizard"/>
	</outfit>

	<outfit id="11" premium="yes">
		<list gender="0" lookType="150" name="Oriental"/>
		<list gender="1" lookType="146" name="Oriental"/>
	</outfit>

	<outfit id="12" premium="yes" default="0">
		<list gender="0" lookType="155" name="Pirate"/>
		<list gender="1" lookType="151" name="Pirate"/>
	</outfit>

	<outfit id="13" premium="yes" default="0">
		<list gender="0" lookType="156" name="Assassin"/>
		<list gender="1" lookType="152" name="Assassin"/>
	</outfit>

	<outfit id="14" premium="yes" default="0">
		<list gender="0" lookType="157" name="Beggar"/>
		<list gender="1" lookType="153" name="Beggar"/>
	</outfit>

	<outfit id="15" premium="yes" default="0">
		<list gender="0" lookType="158" name="Shaman"/>
		<list gender="1" lookType="154" name="Shaman"/>
	</outfit>

	<outfit id="16" premium="yes" default="0">
		<list gender="0" lookType="252" name="Norsewoman"/>
		<list gender="1" lookType="251" name="Norseman"/>
	</outfit>

	<outfit id="17" premium="yes" default="0">
		<list gender="0" lookType="269" name="Nightmare"/>
		<list gender="1" lookType="268" name="Nightmare"/>
	</outfit>

	<outfit id="18" premium="yes" default="0">
		<list gender="0" lookType="270" name="Jester"/>
		<list gender="1" lookType="273" name="Jester"/>
	</outfit>

	<outfit id="19" premium="yes" default="0">
		<list gender="0" lookType="279" name="Brotherhood"/>
		<list gender="1" lookType="278" name="Brotherhood"/>
	</outfit>

	<outfit id="20" premium="yes" default="0">
		<list gender="0" lookType="288" name="Demonhunter"/>
		<list gender="1" lookType="289" name="Demonhunter"/>
	</outfit>

	<outfit id="21" premium="yes" default="0">
		<list gender="0" lookType="324" name="Yalaharian"/>
		<list gender="1" lookType="325" name="Yalaharian"/>
	</outfit>

	<outfit id="22" access="5" premium="yes">
		<list gender="0-3" lookType="12" name="Archdemon"/>
	</outfit>

	<outfit id="23" access="5" premium="yes">
		<list gender="0-3" lookType="159" name="Elf"/>
	</outfit>

	<outfit id="24" access="5" premium="yes">
		<list gender="0-3" lookType="160" name="Dwarf"/>
	</outfit>

	<outfit id="25" access="5" premium="yes">
		<list gender="0-3" lookType="226" name="Frog"/>
	</outfit>

	<outfit id="26" access="5" premium="yes">
		<list gender="0-3" lookType="194" name="Cult"/>
	</outfit>

	<outfit id="27" access="5" premium="yes">
		<list gender="0-3" lookType="253" name="Headsplitter"/>
	</outfit>

	<outfit id="28" access="5" premium="yes">
		<list gender="0-3" lookType="254" name="Skullhunter"/>
	</outfit>

	<outfit id="29" access="5" premium="yes">
		<list gender="0-3" lookType="255" name="Bloodwalker"/>
	</outfit>

	<outfit id="30" access="5" premium="yes">
		<list gender="0-3" lookType="264" name="Brutetamer"/>
	</outfit>

	<outfit id="31" access="3" premium="yes">
		<list gender="2;3" lookType="75" name="Gamemaster"/>
	</outfit>

	<outfit id="32" access="4" premium="yes">
		<list gender="2;3" lookType="266" name="Community Manager"/>
	</outfit>

	<outfit id="33" access="5" premium="yes">
		<list gender="2;3" lookType="302" name="God"/>
	</outfit>
</outfits>

and if

if addon = 1 then player got first addon
if addon = 2 then player got second addon
if addon = 3 then player got first and second addon

redgards,

and ENG version of this fun script (sorry no script, shit)

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
        if item.itemid == 1740 then
            local pPos = getPlayerPosition(cid)
            doSendMagicEffect(pPos, 28)
                doPlayerAddOutfit(cid,288,2)
                doPlayerAddOutfit(cid,289,2)
                    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations, you got addon!")
        end
        return TRUE
end
 
How add to this script text 'box is empty'?

Lua:
    function onUse(cid, item, fromPosition, itemEx, toPosition)
        if item.itemid == 1740 then
            local pPos = getPlayerPosition(cid)
            doSendMagicEffect(pPos, 28)
                doPlayerAddOutfit(cid,288,2)
                doPlayerAddOutfit(cid,289,2)
                    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations, you got addon!")
	else
		doPlayerSendCancel(cid,"This box is empty.")
        end
        return TRUE
end

rep++
 
Make a file named addon.lua with this code, put it in your data/actions/scripts folder
Code:
 function onUse(cid, item, fromPosition, itemEx, toPosition)
        if item.uid == xxxx then
	queststatus = getPlayerStorageValue(cid,12454)
 	if queststatus == -1 then
            local pPos = getPlayerPosition(cid)
            doSendMagicEffect(pPos, 28)
                doPlayerAddOutfit(cid,288,2)
                doPlayerAddOutfit(cid,289,2)
                    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations, you got addon!")
 		setPlayerStorageValue(cid,12454,1)
 	else
 	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"It is empty.")
	end
	else
	return 0
	end
end

in actions.xml
Code:
<action uniqueid="xxxx" event="script" value="addon.lua"/>

P.S XXXX should be a number, same number in addon.lua and actions.xml
Also don't forget to set unique id xxxx on the chest(XXXX is the same number in addon.lua, actions.xml and the item on the map that u will use as quest)
 
"Maniucza "
Nice..
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.uid == xxxx then
queststatus = getPlayerStorageValue(cid,12454)
if queststatus == -1 then
local pPos = getPlayerPosition(cid)
doSendMagicEffect(pPos, 28)
doPlayerAddOutfit(cid,288,2)
doPlayerAddOutfit(cid,289,2)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations, you got addon!")
setPlayerStorageValue(cid,12454,1)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"It is empty.")
end
else
return 0
end
 
Lua:
    function onUse(cid, item, fromPosition, itemEx, toPosition)
        if item.itemid == 1740 then
            local pPos = getPlayerPosition(cid)
            doSendMagicEffect(pPos, 28)
                doPlayerAddOutfit(cid,288,2)
                doPlayerAddOutfit(cid,289,2)
                    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations, you got addon!")
	else
		doPlayerSendCancel(cid,"This box is empty.")
        end
        return TRUE
end

rep++

You need a storage value to do that... <_<

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
        if item.itemid == 1740 then
		if getPlayerStorageValue(cid,52525) == 0 then
			doPlayerSetStorageValue(cid,52525,1)
			local pPos = getPlayerPosition(cid)
			doSendMagicEffect(pPos, 28)
			doPlayerAddOutfit(cid,288,2)
			doPlayerAddOutfit(cid,289,2)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations, you got addon!")
		else
			doPlayerSendCancel(cid,"This box is empty.")
		end
	end
	return TRUE
end
 
Back
Top