예제 #1
0
        // Creates the trap(spell)
        private ISpellHandler MakeTrap()
        {
            DBSpell dbs = new DBSpell
            {
                Name         = "irritatin wisp",
                Icon         = 4107,
                ClientEffect = 5435,
                DamageType   = 15,
                Target       = "Enemy",
                Radius       = 0,
                Type         = "DirectDamage",
                Damage       = 80,
                Value        = 0,
                Duration     = 0,
                Frequency    = 0,
                Pulse        = 0,
                PulsePower   = 0,
                Power        = 0,
                CastTime     = 0,
                Range        = 1500
            };

            Spell     s  = new Spell(dbs, 50);
            SpellLine sl = SkillBase.GetSpellLine(GlobalSpellsLines.Reserved_Spells);

            return(ScriptMgr.CreateSpellHandler(m_pet, s, sl));
        }
예제 #2
0
        // Creates the trap(spell)
        private ISpellHandler MakeTrap()
        {
            DBSpell dbs = new DBSpell();

            dbs.Name         = "irritatin wisp";
            dbs.Icon         = 4107;
            dbs.ClientEffect = 5435;
            dbs.DamageType   = 15;
            dbs.Target       = "Enemy";
            dbs.Radius       = 0;
            dbs.Type         = "DirectDamage";
            dbs.Damage       = 80;
            dbs.Value        = 0;
            dbs.Duration     = 0;
            dbs.Frequency    = 0;
            dbs.Pulse        = 0;
            dbs.PulsePower   = 0;
            dbs.Power        = 0;
            dbs.CastTime     = 0;
            dbs.Range        = 1500;
            Spell     s  = new Spell(dbs, 50);
            SpellLine sl = SkillBase.GetSpellLine(GlobalSpellsLines.Reserved_Spells);

            return(ScriptMgr.CreateSpellHandler(m_pet, s, sl));
        }
예제 #3
0
        public void GetClientDelve_MajorSmite_CompareContent()
        {
            var dbSpell = new DBSpell();

            dbSpell.Name        = "Major Smite";
            dbSpell.Description = "Enhance the targets resistance to the listed damage type.";
            dbSpell.Target      = "Enemy";
            dbSpell.Range       = 1500;
            dbSpell.Power       = 9;
            dbSpell.CastTime    = 2.6;
            dbSpell.Type        = "DirectDamage";
            dbSpell.Damage      = 49;
            dbSpell.DamageType  = 15;
            dbSpell.TooltipId   = 1422;

            var actual = new SpellDelve(new Spell(dbSpell, 0)).GetClientDelves().ElementAt(0).ClientMessage;

            Assert.That(actual, Does.StartWith("(Spell "));
            Assert.That(actual, Does.Contain("(Index \"1422\")"));
            Assert.That(actual, Does.Contain("(Name \"Major Smite\")"));
            Assert.That(actual, Does.Contain("(cast_timer \"600\")"));
            Assert.That(actual, Does.Contain("(power_cost \"9\")"));
            Assert.That(actual, Does.Contain("(damage_type \"11\")"));
            Assert.That(actual, Does.Contain("(delve_string \"Does 49 Spirit damage to the target.\")"));
        }
예제 #4
0
        private GamePlayer _effectOwner;             // Owner of the effect

        public MinionRescueEffect()
            : base(Duration)
        {
            // Init NPC & Timer array
            _spirits     = new GameNPC[SpiritCount];
            _spiritTimer = new RegionTimer[SpiritCount];

            // Build spell
            DBSpell tSpell = new DBSpell
            {
                AllowAdd        = false,
                Description     = "Target is stunned and can't move or do any action during spell duration.",
                Name            = "Rescue stun",
                Target          = "Enemy",
                Radius          = 0,
                Range           = WorldMgr.VISIBILITY_DISTANCE,
                CastTime        = 0,
                Duration        = SpellDuration,
                Uninterruptible = true,
                Type            = "Stun",
                ResurrectMana   = 1,
                ResurrectHealth = 1,
                Damage          = 0,
                DamageType      = 0,
                Value           = 0,
                Icon            = 7049,
                ClientEffect    = 7049
            };

            _spiritSpell     = new Spell(tSpell, 1);
            _spiritSpellLine = new SpellLine("RAs", "RealmAbilitys", "RealmAbilitys", true);
        }
예제 #5
0
        public void GetClientDelve_DeflectPunctures_CompareContent()
        {
            var dbSpell = new DBSpell();

            dbSpell.Name        = "Deflect Punctures";
            dbSpell.Target      = "Self";
            dbSpell.Type        = "SavageThrustResistanceBuff";
            dbSpell.Range       = 0;
            dbSpell.Power       = -3;
            dbSpell.CastTime    = 0;
            dbSpell.Duration    = 30;
            dbSpell.RecastDelay = 5;
            dbSpell.Value       = 5;
            dbSpell.TooltipId   = 3838;

            var actual = new SpellDelve(new Spell(dbSpell, 0)).GetClientDelves().ElementAt(0).ClientMessage;

            Assert.That(actual, Does.StartWith("(Spell "));
            Assert.That(actual, Does.Contain("(Index \"3838\")"));
            Assert.That(actual, Does.Contain("(Name \"Deflect Punctures\")"));
            Assert.That(actual, Does.Contain("(instant \"1\")"));
            Assert.That(actual, Does.Contain("(power_cost \"-3\")"));
            Assert.That(actual, Does.Contain("(duration \"30\")"));
            Assert.That(actual, Does.Contain("(dur_type \"2\")"));
            Assert.That(actual, Does.Contain("(timer_value \"5\")"));
            Assert.That(actual, Does.Contain("(cost_type \"2\")"));
            Assert.That(actual, Does.Contain("(delve_string \"Increases the target's resistance to thrust damage by 5%.\")"));
            Assert.That(actual, Does.Not.Contain("cast_timer"));
        }
        public virtual void CreateSpell(double damage)
        {
            _dbspell = new DBSpell
            {
                Name         = "Anger of the Gods",
                Icon         = 7023,
                ClientEffect = 7023,
                Damage       = damage,
                DamageType   = 0,
                Target       = "Group",
                Radius       = 0,
                Type         = "DamageAdd",
                Value        = 0,
                Duration     = 30,
                Pulse        = 0,
                PulsePower   = 0,
                Power        = 0,
                CastTime     = 0,
                EffectGroup  = 99999,
                Range        = 1000
            };

            _spell     = new Spell(_dbspell, 0); // make spell level 0 so it bypasses the spec level adjustment code
            _spellline = new SpellLine("RAs", "RealmAbilities", "RealmAbilities", true);
        }
예제 #7
0
        private int currentTick = 0;            // Count ticks

        public SearingPetEffect(GamePlayer owner)
            : base(RealmAbilities.SearingPetAbility.DURATION)
        {
            EffectOwner = owner;

            // Build spell
            DBSpell tSpell = new DBSpell();

            tSpell.AllowAdd        = false;
            tSpell.Description     = "Damage the target.";
            tSpell.Name            = "PBAoE damage";
            tSpell.Target          = "Enemy";
            tSpell.Radius          = 0;
            tSpell.Range           = WorldMgr.VISIBILITY_DISTANCE;
            tSpell.CastTime        = 0;
            tSpell.Duration        = 0;
            tSpell.Frequency       = 0;
            tSpell.Pulse           = 0;
            tSpell.Uninterruptible = true;
            tSpell.Type            = "DirectDamage";
            tSpell.Damage          = spellDamage;
            tSpell.DamageType      = (int)eDamageType.Heat;
            tSpell.Value           = 0;
            tSpell.Icon            = 476; // not official effect
            tSpell.ClientEffect    = 476; // not official effect
            petSpell     = new Spell(tSpell, 1);
            petSpellLine = new SpellLine("RAs", "RealmAbilitys", "RealmAbilitys", true);
        }
예제 #8
0
        private GamePlayer EffectOwner;                 // Owner of the effect

        public MinionRescueEffect()
            : base(RealmAbilities.MinionRescueAbility.DURATION)
        {
            // Init NPC & Timer array
            spirits     = new GameNPC[spiritCount];
            spiritTimer = new RegionTimer[spiritCount];

            // Build spell
            DBSpell tSpell = new DBSpell();

            tSpell.AllowAdd        = false;
            tSpell.Description     = "Target is stunned and can't move or do any action during spell duration.";
            tSpell.Name            = "Rescue stun";
            tSpell.Target          = "Enemy";
            tSpell.Radius          = 0;
            tSpell.Range           = WorldMgr.VISIBILITY_DISTANCE;
            tSpell.CastTime        = 0;
            tSpell.Duration        = spellDuration;
            tSpell.Uninterruptible = true;
            tSpell.Type            = "Stun";
            tSpell.ResurrectMana   = 1;
            tSpell.ResurrectHealth = 1;
            tSpell.Damage          = 0;
            tSpell.DamageType      = 0;
            tSpell.Value           = 0;
            tSpell.Icon            = 7049;
            tSpell.ClientEffect    = 7049;
            spiritSpell            = new Spell(tSpell, 1);
            spiritSpellLine        = new SpellLine("RAs", "RealmAbilitys", "RealmAbilitys", true);
        }
        private ISpellHandler MakeTrap()
        {
            DBSpell dbs = new DBSpell();

            dbs.Name            = "Increased Essence Consumption";
            dbs.Icon            = 11020;
            dbs.ClientEffect    = 11020;
            dbs.DamageType      = 10;
            dbs.Target          = "Enemy";
            dbs.Radius          = 0;
            dbs.Type            = "PetLifedrain";
            dbs.Damage          = 70;
            dbs.LifeDrainReturn = 100;
            dbs.Value           = -100;
            dbs.Duration        = 0;
            dbs.Frequency       = 0;
            dbs.Pulse           = 0;
            dbs.PulsePower      = 0;
            dbs.Power           = 0;
            dbs.CastTime        = 0;
            dbs.Range           = 350;
            Spell     s  = new Spell(dbs, 50);
            SpellLine sl = SkillBase.GetSpellLine(GlobalSpellsLines.Reserved_Spells);

            return(ScriptMgr.CreateSpellHandler(m_pet, s, sl));
        }
예제 #10
0
        private ISpellHandler MakeTrap()
        {
            DBSpell dbs = new DBSpell
            {
                Name            = "Increased Essence Consumption",
                Icon            = 11020,
                ClientEffect    = 11020,
                DamageType      = 10,
                Target          = "Enemy",
                Radius          = 0,
                Type            = "PetLifedrain",
                Damage          = 70,
                LifeDrainReturn = 100,
                Value           = -100,
                Duration        = 0,
                Frequency       = 0,
                Pulse           = 0,
                PulsePower      = 0,
                Power           = 0,
                CastTime        = 0,
                Range           = 350
            };

            Spell     s  = new Spell(dbs, 50);
            SpellLine sl = SkillBase.GetSpellLine(GlobalSpellsLines.Reserved_Spells);

            return(ScriptMgr.CreateSpellHandler(m_pet, s, sl));
        }
예제 #11
0
        private int _currentTick;                 // Count ticks

        public SearingPetEffect(GamePlayer owner)
            : base(Duration)
        {
            _effectOwner = owner;

            // Build spell
            DBSpell tSpell = new DBSpell
            {
                AllowAdd        = false,
                Description     = "Damage the target.",
                Name            = "PBAoE damage",
                Target          = "Enemy",
                Radius          = 0,
                Range           = WorldMgr.VISIBILITY_DISTANCE,
                CastTime        = 0,
                Duration        = 0,
                Frequency       = 0,
                Pulse           = 0,
                Uninterruptible = true,
                Type            = "DirectDamage",
                Damage          = SpellDamage,
                DamageType      = (int)eDamageType.Heat,
                Value           = 0,
                Icon            = 476,
                ClientEffect    = 476
            };

            _petSpell     = new Spell(tSpell, 1);
            _petSpellLine = new SpellLine("RAs", "RealmAbilitys", "RealmAbilitys", true);
        }
예제 #12
0
        public void Save(DBSpell spell)
        {
            if (string.IsNullOrWhiteSpace(spell.ObjectId))
            {
                DatabaseManager.Database.AddObject(spell);
                return;
            }

            DatabaseManager.Database.SaveObject(spell);
        }
        private Spell NewSpellWithValue(int value)
        {
            var dbSpell = new DBSpell();

            dbSpell.Value    = value;
            dbSpell.Target   = "Realm";
            dbSpell.Duration = 10;
            var spell = new Spell(dbSpell, 0);

            return(spell);
        }
예제 #14
0
 public SpellCasting(PlayerObject player, WorldClient client, ushort spellId, ulong target, uint CastTime, short flags, Vector destinationVector, DBSpell spell) : base(TimeSpan.FromMilliseconds(1 + (double)CastTime))
 {
     this.spell             = spell;
     this.player            = player;
     this.client            = client;
     this.spellId           = spellId;
     this.target            = target;
     this.casttime          = CastTime;
     this.flags             = flags;
     this.destinationVector = destinationVector;
     EventManager.AddEvent(this);
 }
예제 #15
0
        public string Save(DBSpell spell)
        {
            if (!spell.IsPersisted)
            {
                spell.ObjectId = IDGenerator.GenerateID();
                DatabaseManager.Database.AddObject(spell);
                return(spell.ObjectId);
            }

            DatabaseManager.Database.SaveObject(spell);
            return(spell.ObjectId);
        }
예제 #16
0
        static void InitSpells(WORLDMSG msgID, BinReader data)
        {
            int numSpells = data.ReadInt32();

            for (int j = 0; j < numSpells; j++)
            {
                DBSpell spell = new DBSpell();
                spell.Deserialize(data);
                spellsDB.Add(spell.ObjectId, spell);
            }
            Console.WriteLine("WorldServer successfully received " + spellsDB.Count + " spells!");
        }
예제 #17
0
        public void GetClientDelve_GenericSpellWith2SecondsCastTime_CastTimerIsZeroAndNotInstant()
        {
            var dbSpell = new DBSpell();

            dbSpell.Name     = "GenericSpell";
            dbSpell.Type     = "Heal";
            dbSpell.CastTime = 2.0;

            var actual = new SpellDelve(new Spell(dbSpell, 0)).GetClientDelves().ElementAt(0).ClientMessage;

            Assert.That(actual, Does.Not.Contain("instant"));
        }
예제 #18
0
        private Spell NewHereticFocusDamageSpell(double initialDamage, int growthPercent, int growthCapPercent)
        {
            var dbspell = new DBSpell();

            dbspell.LifeDrainReturn = growthPercent;
            dbspell.AmnesiaChance   = growthCapPercent;
            dbspell.Target          = "Enemy";
            var spell = new Spell(dbspell, 1);

            spell.Damage = initialDamage;
            spell.Level  = 50;
            return(spell);
        }
예제 #19
0
        // constructor
        public FOPSpellHandler(GameLiving caster, Spell spell, SpellLine line)
            : base(caster, spell, line)
        {
            ApplyOnNPC = false;

            // Construct a new font.
            font = new GameFont
            {
                Model           = 2583,
                Name            = spell.Name,
                Realm           = caster.Realm,
                X               = caster.X,
                Y               = caster.Y,
                Z               = caster.Z,
                CurrentRegionID = caster.CurrentRegionID,
                Heading         = caster.Heading,
                Owner           = (GamePlayer)caster
            };

            // Construct the font spell
            dbs = new DBSpell
            {
                Name            = spell.Name,
                Icon            = 7212,
                ClientEffect    = 7212,
                Damage          = spell.Damage,
                DamageType      = (int)spell.DamageType,
                Target          = "Realm",
                Radius          = 0,
                Type            = "PowerOverTime",
                Value           = spell.Value,
                Duration        = spell.ResurrectHealth,
                Frequency       = spell.ResurrectMana,
                Pulse           = 0,
                PulsePower      = 0,
                LifeDrainReturn = spell.LifeDrainReturn,
                Power           = 0,
                CastTime        = 0,
                Range           = WorldMgr.VISIBILITY_DISTANCE,
                Message1        = spell.Message1,
                Message2        = spell.Message2,
                Message3        = spell.Message3,
                Message4        = spell.Message4
            };

            sRadius = 350;
            s       = new Spell(dbs, 1);
            sl      = SkillBase.GetSpellLine(GlobalSpellsLines.Reserved_Spells);
            heal    = ScriptMgr.CreateSpellHandler(Caster, s, sl);
        }
예제 #20
0
        static bool OnLearnSpell(LoginClient client, string input)
        {
            string[] split = input.Split(' ');
            if (split.Length < 2)
            {
                return(false);
            }
            uint    targetSpellId = (uint)uint.Parse(split[1]);
            DBSpell targetSpell   = (DBSpell)DataServer.Database.FindObjectByKey(typeof(DBSpell), targetSpellId);

            if (targetSpell == null)
            {
                Chat.System(client, "Spell " + targetSpellId + " not found"); return(true);
            }
            DBKnownSpell newSpell = new DBKnownSpell();

            newSpell.Spell_Id = targetSpellId;
            if (client.Character.Spells == null || client.Character.Spells.Length == 0)
            {
                newSpell.Slot = 1;
            }
            else
            {
                newSpell.Slot = (uint)client.Character.Spells.Length + 1;
            }

            newSpell.CharacterID = client.Character.ObjectId;
            try
            {
                if (split.Length > 2)
                {
                    newSpell.SpellLevel = uint.Parse(split[2]);
                }
            }
            catch (Exception) {}

            if (newSpell.SpellLevel == 0)
            {
                newSpell.SpellLevel = 1;
            }
            DataServer.Database.AddNewObject(newSpell);
            DataServer.Database.FillObjectRelations(client.Character);
            DataServer.Database.FillObjectRelations(client.Character.Spells[newSpell.Slot - 1]);
            try
            {
                Chat.System(client, "Spell " + client.Character.Spells[newSpell.Slot - 1].Spell.Name + " added.");
            }
            catch (Exception) {}
            return(true);
        }
예제 #21
0
        private void Insertspell_Click(object sender, EventArgs e)
        {
            _spell = new DBSpell
            {
                AllowAdd = true
            };

            SyncSpell();

            _spell.ObjectId = null;
            _spell.SpellID  = _spellService.GetNextSpellId();

            _spellService.Save(_spell);
            BindingService.ClearData(this);
        }
예제 #22
0
        private async void Insertspell_Click(object sender, EventArgs e)
        {
            _spell = new DBSpell
            {
                AllowAdd = true
            };

            SyncSpell();

            _spell.SpellID = _spellService.GetNextSpellId();

            var spellId = _spellService.Save(_spell);

            await LoadSpell(spellId);
        }
예제 #23
0
        // constructor
        public SpeedWrapWardSpellHandler(GameLiving caster, Spell spell, SpellLine line)
            : base(caster, spell, line)
        {
            ApplyOnCombat = true;
            Friendly      = false;

            // Construct a new mine.
            font = new GameFont
            {
                Model           = 2586,
                Name            = spell.Name,
                Realm           = caster.Realm,
                X               = caster.X,
                Y               = caster.Y,
                Z               = caster.Z,
                CurrentRegionID = caster.CurrentRegionID,
                Heading         = caster.Heading,
                Owner           = (GamePlayer)caster
            };

            // Construct the mine spell
            dbs = new DBSpell
            {
                Name            = spell.Name,
                Icon            = 7237,
                ClientEffect    = 7237,
                Damage          = spell.Damage,
                DamageType      = (int)spell.DamageType,
                Target          = "Enemy",
                Radius          = 0,
                Type            = "SpeedWrap",
                Value           = spell.Value,
                Duration        = spell.ResurrectHealth,
                Frequency       = spell.ResurrectMana,
                Pulse           = 0,
                PulsePower      = 0,
                LifeDrainReturn = spell.LifeDrainReturn,
                Power           = 0,
                CastTime        = 0,
                Range           = WorldMgr.VISIBILITY_DISTANCE
            };

            sRadius        = 1000;
            dbs.SpellGroup = 9;
            s    = new Spell(dbs, 50);
            sl   = SkillBase.GetSpellLine(GlobalSpellsLines.Reserved_Spells);
            heal = ScriptMgr.CreateSpellHandler(Caster, s, sl);
        }
예제 #24
0
        // constructor
        public SiegeWreckerSpellHandler(GameLiving caster, Spell spell, SpellLine line)
            : base(caster, spell, line)
        {
            Unstealth = false;

            // Construct a new mine.
            mine = new GameMine
            {
                Model           = 2591,
                Name            = spell.Name,
                Realm           = caster.Realm,
                X               = caster.X,
                Y               = caster.Y,
                Z               = caster.Z,
                MaxSpeedBase    = 0,
                CurrentRegionID = caster.CurrentRegionID,
                Heading         = caster.Heading,
                Owner           = (GamePlayer)caster
            };

            // Construct the mine spell
            dbs = new DBSpell
            {
                Name            = spell.Name,
                Icon            = 7301,
                ClientEffect    = 7301,
                Damage          = spell.Damage,
                DamageType      = (int)spell.DamageType,
                Target          = "Enemy",
                Radius          = 0,
                Type            = "DirectDamage",
                Value           = spell.Value,
                Duration        = spell.ResurrectHealth,
                Frequency       = spell.ResurrectMana,
                Pulse           = 0,
                PulsePower      = 0,
                LifeDrainReturn = spell.LifeDrainReturn,
                Power           = 0,
                CastTime        = 0,
                Range           = WorldMgr.VISIBILITY_DISTANCE
            };

            sRadius = 350;
            s       = new Spell(dbs, 1);
            sl      = SkillBase.GetSpellLine(GlobalSpellsLines.Reserved_Spells);
            trap    = ScriptMgr.CreateSpellHandler(Caster, s, sl);
        }
예제 #25
0
        public Spell(DBSpell dbspell, int requiredLevel, bool minotaur)
            : base(dbspell.Name, dbspell.SpellID, (ushort)dbspell.Icon, requiredLevel, dbspell.TooltipId)
        {
            Description           = dbspell.Description;
            Target                = dbspell.Target;
            SpellType             = dbspell.Type;
            m_range               = dbspell.Range;
            Radius                = dbspell.Radius;
            Value                 = dbspell.Value;
            Damage                = dbspell.Damage;
            DamageType            = (eDamageType)dbspell.DamageType;
            Concentration         = (byte)dbspell.Concentration;
            Duration              = dbspell.Duration * 1000;
            Frequency             = dbspell.Frequency * 100;
            Pulse                 = dbspell.Pulse;
            PulsePower            = dbspell.PulsePower;
            m_power               = dbspell.Power;
            m_casttime            = (int)(dbspell.CastTime * 1000);
            RecastDelay           = dbspell.RecastDelay * 1000;
            ResurrectHealth       = dbspell.ResurrectHealth;
            ResurrectMana         = dbspell.ResurrectMana;
            LifeDrainReturn       = dbspell.LifeDrainReturn;
            AmnesiaChance         = dbspell.AmnesiaChance;
            Message1              = dbspell.Message1;
            Message2              = dbspell.Message2;
            Message3              = dbspell.Message3;
            Message4              = dbspell.Message4;
            ClientEffect          = (ushort)dbspell.ClientEffect;
            InstrumentRequirement = dbspell.InstrumentRequirement;
            Group                 = dbspell.SpellGroup;
            EffectGroup           = dbspell.EffectGroup;
            SubSpellId            = dbspell.SubSpellID;
            MoveCast              = dbspell.MoveCast;
            Uninterruptible       = dbspell.Uninterruptible;
            IsFocus               = dbspell.IsFocus;

            // warlocks
            IsPrimary        = dbspell.IsPrimary;
            IsSecondary      = dbspell.IsSecondary;
            AllowBolt        = dbspell.AllowBolt;
            SharedTimerGroup = dbspell.SharedTimerGroup;
            m_minotaurspell  = minotaur;

            // Params
            this.InitFromCollection <DBSpellXCustomValues>(dbspell.CustomValues, param => param.KeyName, param => param.Value);
        }
예제 #26
0
        private async Task LoadSpell(string spellId)
        {
            if (string.IsNullOrWhiteSpace(spellId))
            {
                return;
            }

            _spell = await _spellService.Get(spellId);

            if (_spell == null)
            {
                MessageBox.Show($@"Object with ObjectId: {spellId} not found", @"Object not found");
                return;
            }

            BindingService.BindData(_spell, this);
        }
예제 #27
0
 public ClimbingAbilityHandler()
 {
     // Graveen: crappy, but not hardcoded. if we except by the ability name ofc...
     // problems are:
     //      - matching vs ability name / spell name needed
     //      - spell name is not indexed
     // perhaps a basis to think about, but definitively not the design we want.
     if (_spellid == -1)
     {
         _spellid = 0;
         DBSpell climbSpell = GameServer.Database.SelectObjects <DBSpell>("`Name` = @Name", new QueryParameter("@Name", Abilities.ClimbSpikes)).FirstOrDefault();
         if (climbSpell != null)
         {
             _spellid = climbSpell.SpellID;
         }
     }
 }
예제 #28
0
 public ClimbingAbilityHandler()
 {
     // Graveen: crappy, but not hardcoded. if we except by the ability name ofc...
     // problems are:
     //      - matching vs ability name / spell name needed
     //		- spell name is not indexed
     // perhaps a basis to think about, but definitively not the design we want.
     if (spellid == -1)
     {
         spellid = 0;
         DBSpell climbSpell = GameServer.Database.SelectObject <DBSpell>("Name = '" + Abilities.ClimbSpikes.ToString() + "'");
         if (climbSpell != null)
         {
             spellid = climbSpell.SpellID;
         }
     }
 }
예제 #29
0
        // constructor
        public FOPSpellHandler(GameLiving caster, Spell spell, SpellLine line)
            : base(caster, spell, line)
        {
            ApplyOnNPC = false;

            //Construct a new font.
            font                 = new GameFont();
            font.Model           = 2583;
            font.Name            = spell.Name;
            font.Realm           = caster.Realm;
            font.X               = caster.X;
            font.Y               = caster.Y;
            font.Z               = caster.Z;
            font.CurrentRegionID = caster.CurrentRegionID;
            font.Heading         = caster.Heading;
            font.Owner           = (GamePlayer)caster;

            // Construct the font spell
            dbs                 = new DBSpell();
            dbs.Name            = spell.Name;
            dbs.Icon            = 7212;
            dbs.ClientEffect    = 7212;
            dbs.Damage          = spell.Damage;
            dbs.DamageType      = (int)spell.DamageType;
            dbs.Target          = "Realm";
            dbs.Radius          = 0;
            dbs.Type            = "PowerOverTime";
            dbs.Value           = spell.Value;
            dbs.Duration        = spell.ResurrectHealth;
            dbs.Frequency       = spell.ResurrectMana;
            dbs.Pulse           = 0;
            dbs.PulsePower      = 0;
            dbs.LifeDrainReturn = spell.LifeDrainReturn;
            dbs.Power           = 0;
            dbs.CastTime        = 0;
            dbs.Range           = WorldMgr.VISIBILITY_DISTANCE;
            dbs.Message1        = spell.Message1;
            dbs.Message2        = spell.Message2;
            dbs.Message3        = spell.Message3;
            dbs.Message4        = spell.Message4;
            sRadius             = 350;
            s    = new Spell(dbs, 1);
            sl   = SkillBase.GetSpellLine(GlobalSpellsLines.Reserved_Spells);
            heal = ScriptMgr.CreateSpellHandler(m_caster, s, sl);
        }
예제 #30
0
        private ISpellHandler CreateSnare()
        {
            DBSpell dbSpell = new DBSpell();

            dbSpell.ClientEffect = Spell.ClientEffect;
            dbSpell.Icon         = Spell.Icon;
            dbSpell.Type         = "SpeedDecrease";
            dbSpell.Duration     = (Spell.Radius == 0) ? 10 : 3;
            dbSpell.Target       = "Enemy";
            dbSpell.Range        = 1500;
            dbSpell.Value        = Spell.Value;
            dbSpell.Name         = Spell.Name + " Snare";
            dbSpell.DamageType   = (int)Spell.DamageType;
            Spell         subSpell        = new Spell(dbSpell, Spell.Level);
            ISpellHandler subSpellHandler = new SnareWithoutImmunity(Caster, subSpell, SpellLine);

            return(subSpellHandler);
        }