• 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 Use item - get outfit!

Sorbal

Member
Joined
Jul 23, 2010
Messages
406
Reaction score
11
Location
Poland
Hello Otlanders, i come here to share with You this script:
TFS/data/actions/scripts/outfiter.lua
PHP:
function onUse(cid, item, frompos, item2, topos)
    if getPlayerSex(cid) == 1 then
            doPlayerAddOutfit(cid, 335, 3)
			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FIREAREA)
            doRemoveItem(item.uid, 1)			
    elseif getPlayerSex(cid) == 0 then 
            doPlayerAddOutfit(cid, 336, 3)
			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FIREAREA)
			doRemoveItem(item.uid, 1)
    end
end
In actions.xml add:
PHP:
<action itemid="10503" event="script" value="outfiter.lua"/>
  • How does it work?
After use item with id 10503 we will see magic effect on Your character, and You will gain Warmaster outfit with both addons.
  • How to configure?
PHP:
doPlayerAddOutfit(cid, 335, 3)
  1. 335 - Outfit looktype (You can find it in data/XML/outfits.xml)
  2. 3 - how many addons player will gain (if You paste 1 - You will gain only first addon, if You paste 2 - You will gain only second addon, if You paste 3 - You will gain both addons)
Tested on 0.3.6
Hope You like it. :$
 
Last edited:
@OnTopic Great script but could be done better :)

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == 10503 and (getPlayerStorageValue(cid, 8000) == EMPTY_STORAGE) then
		doPlayerAddOutfit(cid, 335, 3)
		doPlayerAddOutfit(cid, 336, 3)
		setPlayerStorageValue(cid, 8000, 1)
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYDAMAGE)
  		doPlayerSendTextMessage(cid,22,"Congratulations, you have received warmaster addon!")
                doRemoveItem(item.uid, 1)
	else
		doPlayerSendCancel(cid,"You have already received this addon!.")
	end
end

More features :p
 
@nicktm
It should work, just test it and give feedback ^_^
@felipemko
Thanks :$
 
How Can I make this give custom outfits with newtypes?

- - - Updated - - -

bring up this post!
 
Back
Top