Ticket #3792: 3792.2.diff

File 3792.2.diff, 1.3 KB (added by fatherbushido, 8 years ago)

rebased on 17810

  • 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()  
    8287    }
    8388};
    8489
    8590Auras.prototype.GetModifierIdentifier = function(name, mod)
    8691{
    87         return this.templateName + "/" + name + "/" + mod.value;
     92        let identifier = name + "/" + mod.value + "/";
     93        if (this.template[name].Stackable)
     94            return identifier + this.entity;
     95        // We add add/mul to prevent applying the same aura of different templates
     96        return identifier + (mod.Add || 0) + "/" + (mod.Multiply || 1);
    8897};
    8998
    9099Auras.prototype.GetDescriptions = function()
    91100{
    92101    var ret = {};