• 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!

OnEquip/DeEquip - (put item on eq a changing outfit)

Vivelo

New Member
Joined
Aug 30, 2018
Messages
34
Reaction score
3
Hi there!
According to title of the post, my problem is an issue with changing outfit after equip eq on it. Im attachnig a video here:
Animated GIF - Find & Share on GIPHY

However everyting is fine, but outfit getting white, and looks like hunter(as the same as settings looktype) - Im working on include wings system as a new item(new item slot). Trying figuring out that in one way outfit will still be the same(with addons), and in future player chooses which outfit looktype will be after puts wings "on"(I create separate Set Wings Outfit window - unfortunately after i add it to gameinterface this window is not invoke). How can I put this things right in code whith this item wings on - in this case dwarven shield - just for tests - can choose looktype?(In [Set Outfit] and [Set Wings Outfit]) Leaving code here:

Code:
[LIST=1]
[*]local condition = createConditionObject(CONDITION_OUTFIT)
[*]setConditionParam(condition, CONDITION_PARAM_TICKS, -1)
[*]setConditionParam(condition, CONDITION_PARAM_SUBID, 8)
[*]addOutfitCondition(condition, {lookType = 274, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 0})
[*]

[*]function onEquip(cid, item, slot)
[*]     if getPlayerSlotItem(cid, slot).itemid == item.itemid then -- this prevents that the script executes the functions more than once, so you won't get more than 1 textmessage
[*]         doAddCondition(cid, condition)
[*]         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Congratulation! You have a wings!
[*]     end
[*]     return true  -- return true is needed else you can't equip the item
[*]end
[*]

[*]function onDeEquip(cid, item, slot) -- this happens when you unequip the item, so it should undo what the onEquip function does
[*]     doRemoveCondition(cid, CONDITION_OUTFIT, 8)
[*]     return true
[*]end
[*]
[/LIST]

[ TFS 0.3.6/Tibia 8.54 ] - working (addons.lua) - changeing outfit wings like in the gif (99,9% created by @Limos)
 
Back
Top