Ejemplo n.º 1
0
 public DebuffInternal(spell_data_t spell, SpellBasedProxy owner, String sn)
     : base(spell, owner, sn)
 {
     Properties["up"] = () => GetAuraUp(Owner.GetUnit(), Spell, true);
     Properties["remains"] = () => GetAuraTimeLeft(Owner.GetUnit(), Spell, true).TotalSeconds;
 }
Ejemplo n.º 2
0
 public CooldownInternal(spell_data_t spell, SpellBasedProxy owner, String safename)
     : base(spell, owner, "cooldown::"+safename)
 {
     Properties.Add("remains", () => GetSpellCooldown(Spell).TotalSeconds);
     Properties.Add("duration", () => spell.cooldown);
 }
Ejemplo n.º 3
0
            public AuraInternal(spell_data_t spell, SpellBasedProxy owner, String safeName)
                : base(spell, owner, owner.GetType().ToString().Replace("Simcraft.SimcraftImpl+","")+"::"+safeName)
            {
                safename = safeName;
                if (spell == null) Write("Aura "+safename+" initialized with null");

                GetTickingEffect();

                Properties["Spell"] = () => 1;

                Properties["duration"] = () => this["up"]
                    ? (Decimal)GetAura(Owner.GetUnit(), Spell, true).Duration / 1000
                    : (Decimal)Spell.duration / 1000;
                Properties["up"] = () => GetAuraUp(Owner.GetUnit(), Spell);
                Properties["remains"] = () => GetAuraTimeLeft(Owner.GetUnit(), Spell).TotalSeconds;
                Properties["stack"] = () =>
                {
                    //Write("AI: " + safeName);
                    return GetAuraStacks(Owner.GetUnit(), Spell, true);
                };
                Properties["down"] = () => !this["up"];
                Properties["react"] = () => this["stack"] > 0 ? this["stack"] : this["up"];
                Properties["ticking"] = () => this["up"];
                Properties["tick_time"] = () => 1;
                Properties["ticks_remain"] = () => 1;
            }
Ejemplo n.º 4
0
                public SpellInternal(spell_data_t spell, SpellBasedProxy owner, String safename)
                    : base(spell, owner,"spell::"+safename)
                {
                    _hasMe = SpellManager.HasSpell((int) spell.id);

                    AddProperty("gcd", () =>
                    {
                        var sgcd = ((Decimal)Spell.gcd)/1000;
                        sgcd = sgcd / ((100 + simc.spell_haste) / 100);
                        return Math.Max(sgcd,1);
                    });

                    AddProperty("execute_time", () =>
                    {
                        if (this["cast_time"] > this["gcd"]) return this["cast_time"];
                        return this["gcd"];

                    });

                    AddProperty("range", () =>
                    {
                        if (!_hasMe) return Spell.max_range;
                        var _spell = GetSpell(Spell);
                        return new MagicValueType(_spell.HasRange ? _spell.MaxRange : Me.CombatReach + 5);
                    });

                    AddProperty("charges", () => !_hasMe
                        ? 0
                        : LuaGet<int>(
                            "currentCharges,_,_,_,_ = GetSpellCharges(" + Spell.id + "); return currentCharges", 0));

                    AddProperty("cast_time", () =>
                    {
                        if (Spell.IsChanneled()) return this["channel_time"];
                        if (!_hasMe)
                            return Math.Max(((Decimal)Spell.cast_max / 1000), this["gcd"]);
                        return
                            Math.Max(((Decimal)GetSpell(Spell).CastTime / 1000), this["gcd"]);
                    });

                    AddProperty("channel_time", () =>
                    {
                        if (!Spell.IsChanneled()) return MagicValueType.Zero;
                        if (!_hasMe)
                            return Math.Max((Decimal)Spell.duration / 1000, this["gcd"]);
                        return Math.Max((Decimal)GetSpell(Spell).MaxDuration / 1000, this["gcd"]);
                    });

                    AddProperty("duration", () => !_hasMe ? Spell.duration/1000 : GetSpell(Spell).BaseDuration/1000);

                    AddProperty("in_flight", () => false);

                    AddProperty("recharge_time", () => !_hasMe
                        ? 0
                        : LuaGet<double>(
                            "currentCharges, maxCharges, cooldownStart, cooldownDuration = GetSpellCharges(\"" +
                            Spell.id +
                            "\"); cd = (cooldownDuration-(GetTime()-cooldownStart)); if (cd > cooldownDuration or cd < 0) then cd = 0; end return cd",
                            0));
                    AddProperty("charges_fractional", () => !_hasMe
                        ? 0
                        : LuaGet<double>(
                            "currentCharges, maxCharges, cooldownStart, cooldownDuration = GetSpellCharges(\"" +
                            Spell.id +
                            "\"); cd = (cooldownDuration-(GetTime()-cooldownStart)); if (cd > cooldownDuration or cd < 0) then cd = 0; end return (cd*100/cooldownDuration)",
                            0) + this["charges"]);

                    Write("Created Spell: " + safename + " ex:" + this["execute_time"] + " r:" + this["range"] + " c:" + this["charges"] + " clt:" + this["channel_time"] + " dur:" + this["duration"] + " ct:" + this["cast_time"]+" id: "+Spell.id);
                }
Ejemplo n.º 5
0
 public SpellInternal(spell_data_t spell, SpellBasedProxy owner)
 {
     Spell = spell;
     Owner = owner;
 }
Ejemplo n.º 6
0
 public SpellCacheInternal(spell_data_t spell, SpellBasedProxy owner, String bossname)
     : base(owner.GetUnit, bossname)
 {
     Spell = spell;
     //Write(""+Spell);
     Owner = owner;
 }