[Source Code] Dynamic Tier System [AS3]

Posts 12 of 2 · Page 1 of 1
[Source Code] Dynamic Tier System [AS3]
Its quite simple.

Inside the EquipmentToolTip class (default: _E_7.EquipmentToolTip) go to the tier rendering function (default: _07X_()). Add this somewhere at the top
Code:
var tier:XML;
Replace all the code inside the if statement that checks if the item has a Tier element with this
Code:
    tier = XML(this._I_z.Tier);
    this._V_0.text = !isNaN(Number(this._I_z.Tier)) ? "T" + this._I_z.Tier : this._I_z.Tier;
    this._V_0.setColor(tier.hasOwnProperty("@ color") && tier.@ color <= 0xffffff ? uint(tier.@ color) : 0xffffff);
    this._V_0.setBold(tier.hasOwnProperty("@ bold") && tier.@ bold == "true");

Remove the spaces after "@"

If you have some programming knowledge it should look like this:

Now for the item its really simple, add "bold" ("true" or "false") and "color" (uint, Hex below #FFFFFF or Dec below 16777215) attributes to your Tier tag, exclude them and it does nothing. Example:
Code:
<Tier bold="false" color="0xff1493">:></Tier>



For the server, if you havent already add a try-catch in db/Descriptors.cs so your server wont fook up when you make your Tier non-numbers. Example:
Code:
    if ((n = elem.Element("Tier")) != null)
        try
        {
            Tier = Utils.FromString(n.Value);
        }
        catch
        {
            Tier = -1;
        }

Credits: @Omniraptor for making this thread http://www.mpgh.net/forum/showthread.php?t=913431, which gave me the idea to make this.
Me for coding this shizzle
@Transferred for being lazy and watching me

 
Note
This is source code, not a tutorial, though I could help if you have questions


MPGH changed some code due to there being @'s, good thing I provided screenshots. If you need more help you can check this out.
more like @Transferred for coding this whole thing then copy and pasting it to you
kappa.
Posts 12 of 2 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?