Ticket #3792: 3792.3.diff

File 3792.3.diff, 1.3 KB (added by fatherbushido, 8 years ago)
  • binaries/data/mods/public/simulation/components/Auras.js

    Auras.prototype.Schema =  
    5858                "<optional>" +
    5959                    "<element name='AffectedPlayers' a:help='Affected players'>" +
    6060                        "<text/>" +
    6161                    "</element>" +
    6262                "</optional>" +
     63                "<optional>" +
     64                "<element name='Stackable' a:help='Allow multiple applications of this aura'>" +
     65                        "<data type='boolean'/>" +
     66                    "</element>" +
     67                "</optional>" +
    6368            "</interleave>" +
    6469        "</element>" +
    6570    "</oneOrMore>";
    6671
    6772Auras.prototype.Init = function()
    Auras.prototype.Init = function()  
    8186    }
    8287};
    8388
    8489Auras.prototype.GetModifierIdentifier = function(name, mod)
    8590{
    86         return this.templateName + "/" + name + "/" + mod.value;
     91        let identifier = name + "/" + mod.value + "/";
     92        if (this.template[name].Stackable)
     93            return identifier + this.entity;
     94        // We add add/mul to prevent applying the same aura of different templates
     95        return identifier + (mod.Add || 0) + "/" + (mod.Multiply || 1);
    8796};
    8897
    8998Auras.prototype.GetDescriptions = function()
    9099{
    91100    var ret = {};