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

Lua Outfits and Transformation

Rid0

New Member
Joined
May 1, 2011
Messages
2
Reaction score
0
Hello.
First of all will I say is that I am short time here and my number of posts come from opinion that if somebody haven't got something concrete to say then he should not speak at all. But what I want? I searched many forums OTS already, I asked for help several people, but this did not bring me effect - so I decided ask here. To my OTS project I need two scripts: Outfit for professio and advanced transformation. On my server i have got several player races, and how can you see outfits for profession are indispensable and without this I cannot work. Now precise description:

Outfits: Every profession should have after creation only one destionation outfit to choose with full configuation of colours.

Transformation: On 100 lvl script should change our profession and add new, second outfit with full configuration of colours for ever(on solid). And then player after transformation should have got 2 outfits (old and new) to choice + new profession..

I will add that I work on TFS 0.3.6 engine and I use Gęsior Acc.
 
Regarding the outfits, I found these functions to be useful:

doPlayerRemoveOutfitId(cid, outfitId[, addon = 0])
doPlayerAddOutfitId(cid, outfitId, addon)

These can be placed in any script, promotion NPC, talkaction, onadvance anything.

Perhaps you can disable all outfits and on first login you give them an outfit id depending on their vocation.
Just modify the firstitems script or login.lua creatureevent where they ask you to set your outfit on first visit.


Now, to disable regular outfits we need to go to /data/XML/outfits.xml

You see there are 3 general options:

The normal outfits that are always enabled:
Sample: <outfit id="1">

The normal outfits only enabled if you have Premium:
Sample: <outfit id="5" premium="yes">

Outfits which are disabled by default, and has to be acquired through the game somehow:
<outfit id="22" default="0">

And then a mix of premium + need to acquire yourself:
<outfit id="12" premium="yes" default="0">

To have full control of outfits yourself just add [default="0"] to all outfits and handle all outfits with scripts in-game.

To transform to a new outfit without the possibility to keep the old outfit:

First add his new outfit id:
doPlayerAddOutfitId(cid, outfitId, addon)
Then use the function:
doPlayerAddOutfit(cid,looktype, addon)
To quickly change the players outfit to the new looktype.
Then with function
doPlayerRemoveOutfitId(cid, outfitId[, addon = 0])
you remove the old outfit id
And do the function
doPlayerSendOutfitWindow(cid)

To quickly make him customize his new outfit.¨

When it comes to changing vocation I have a sample from my Quest OTs project:
http://otland.net/f251/help-me-suggestions-my-quest-ots-110025/#post1096376

Where I use the function
doPlayerSetVocation(cid, NewVocId)
In a rather smart way. Be careful when setting new vocation if you want to balance stuff out regarding his hp/mana income each level and stuff.

This should be enough help to get you started doing stuff on your own.
I hope you are not posting here to leech on our scripters requesting us to do the whole job for you.

Only you know precisely how you want this to work after all.
 
Last edited:
Thanks for information. This info should be very important for me. I have the same opinion that we must learn on our own mistakes. But thanks for pointing me in good way to final destination. If I have another question about it I ask here again.
 
Back
Top