コード例 #1
0
        public static void CastTeleport(Player.LeafSpell spell, Player.Player caster, int x, int y)
        {
            var tpdist = (spell.Level / 2) * 2;

            // if (tpdist <= 3) tpdist = 4;
            if (tpdist > 12)
            {
                tpdist = 12;
            }

            if (Point2D.Distance(caster.Position.X, caster.Position.Y, x, y) > tpdist)
            {
                return;
            }

            var tile = caster.Position.CurMap.GetTile(x, y);

            if (tile == null || tile.WalkFlags == 0)
            {
                return;
            }

            caster.Position.X = x;
            caster.Position.Y = y;

            caster.Position.CurMap.Events.OnTele(caster);
        }
コード例 #2
0
        public void RemoveBuff(Player.LeafSpell spell)
        {
            LeafBuff outv;

            Buffs.TryRemove(spell.Name, out outv);
            Position.CurMap.Events.OnChgObjSprit(this);
        }
コード例 #3
0
        public static void CastAoe(Player.LeafSpell spell, Player.Player caster)
        {
            var Targets = caster.Position.CurMap.TargetsInAoE(new Point2D(caster.Position.X, caster.Position.Y),
                                                              spell.Spell.Range, caster.State.PKMode);

            foreach (var tar in Targets)
            {
                tar.TakeDamage(caster, spell);
            }
        }
コード例 #4
0
        public static void CastTransparency(Player.LeafSpell spell, Player.Player caster)
        {
            int amt = 1;

            if (spell.Level >= 12)
            {
                amt = 100;
            }
            caster.Transparency = amt;
        }
コード例 #5
0
 public CreateSlotMagic(Player.LeafSpell spell, int slot)
     : base(0x19)
 {
     Write((byte)slot);
     Write((byte)spell.Spell.magType);
     Write((byte)spell.Level);
     Write((short)spell.Spell.Icon);
     Fill(3);
     Write((byte)1);
     WriteAsciiNull(spell.Name + " :S" + spell.SubLevel);
 }
コード例 #6
0
        public int FullManaCost(Player.Player caster, Player.LeafSpell cspell)
        {
            int retv = 0;

            if (FManaCost != 0)
            {
                var fc = FManaCost - FManaCostPl * cspell.Level;
                retv = (int)(fc * caster.MP);
            }
            else
            {
                retv = ManaCost - ManaCostPl * cspell.Level;
            }
            return(retv);
        }
コード例 #7
0
        public static void CastSingleTarget(Player.LeafSpell spell, Player.Player caster, Object.Mobile target, E_Race race = 0)
        {
            if (!(target is Object.Living))
            {
                return;
            }

            if (race != 0)
            {
                if (((target as Object.Living).Race & race) == 0)
                {
                    return;
                }
            }
            (target as Object.Living).TakeDamage(caster, spell);
        }
コード例 #8
0
        public static void CastView(Player.LeafSpell spell, Player.Player caster, Object.Mobile target)
        {
            if (target == null)
            {
                return;
            }

            if (target is Craft)
            {
                var           cstd = target as Craft;
                StringBuilder sb   = new StringBuilder();
                sb.Append(string.Format("The contents: ", cstd.Name));
                foreach (var ob in cstd.Contents)
                {
                    sb.Append(string.Format("{0} ", ob.Value.Name));
                }
                caster.WriteWarn(sb.ToString());
            }
        }
コード例 #9
0
        public virtual void TakeDamage(Living caster, Player.LeafSpell spell)
        {
            var dam  = spell.Spell.Dam + spell.Spell.DamPl * spell.Level;
            var tdam = dam - AC;

            if (tdam <= 0)
            {
                tdam = 1;
            }

            LoseHP(tdam);

            if (Died)
            {
                if (this is Monster && caster is Player.Player)
                {
                    (caster as Player.Player).State.XP += (this as Monster).XPGranted;
                }
            }
        }
コード例 #10
0
        public static void CastHeal(Player.LeafSpell spell, Object.Living target)
        {
            double amt = 0.6f + (spell.Level * 0.02);

            target.HPCur += (int)(target.HP * amt);
        }
コード例 #11
0
        public static void CastHeal(Player.LeafSpell spell, Player.Player caster)
        {
            double amt = 0.6f + (spell.Level * 0.02);

            caster.HPCur += (int)(caster.HP * amt);
        }
コード例 #12
0
 public static void CastBuff(Player.LeafSpell spell, Player.Player caster)
 {
     caster.SetBuff(spell);
     caster.UpdateStats();
     caster.Position.CurMap.Events.OnChgObjSprit(caster);
 }
コード例 #13
0
 public LeafBuff(Player.LeafSpell buff, int duration)
 {
     Buff     = buff;
     Duration = duration;
 }
コード例 #14
0
 public void SetBuff(Player.LeafSpell spell)
 {
     Buffs[spell.Name] = new LeafBuff(spell, spell.Spell.Duration(spell));
     spell.CastedTime  = World.World.tickcount.ElapsedMilliseconds;
 }