Ejemplo n.º 1
0
        public void KillTeam()
        {
            bool sequence = Fight.SequencesManager.StartSequence(SequenceTypeEnum.SEQUENCE_SPELL);

            foreach (var fighter in GetFighters())
            {
                fighter.Stats.CurrentLifePoints = 0;
            }

            Fight.CheckDeads();
            if (sequence)
            {
                Fight.SequencesManager.EndSequence(SequenceTypeEnum.SEQUENCE_SPELL);
            }

            Fight.CheckFightEnd();
        }
Ejemplo n.º 2
0
        private bool CloseCombat(SpellLevelRecord level, MapPoint castPoint, string rawZone, ushort weaponGId = 0)
        {
            SpellCastResultEnum canCast = CanCastSpell(level, CellId, castPoint.CellId);

            if (canCast != SpellCastResultEnum.Ok)
            {
                OnSpellCastFailed(canCast, level);
                return(false);
            }

            if (OnWeaponUsedEvt != null)
            {
                OnWeaponUsedEvt(this);
            }

            Fight.SequencesManager.StartSequence(SequenceTypeEnum.SEQUENCE_WEAPON);

            FightSpellCastCriticalEnum fightSpellCastCriticalEnum = this.RollCriticalDice(level);
            bool criticalHit = fightSpellCastCriticalEnum == FightSpellCastCriticalEnum.CRITICAL_HIT;

            EffectInstance[] effects = (criticalHit ? level.CriticalEffects : level.Effects).ToArray();



            Fight.Send(new GameActionFightCloseCombatMessage((ushort)ActionsEnum.ACTION_FIGHT_CLOSE_COMBAT,
                                                             Id, false, false, 0, castPoint.CellId, (sbyte)fightSpellCastCriticalEnum, weaponGId));

            SpellEffectsManager.Instance.HandleEffects(this, effects, level, castPoint, rawZone,
                                                       WeaponManager.WeaponTargetMask, criticalHit);



            this.UseAp(level.ApCost);

            this.OnSpellCasted(level, CellId, fightSpellCastCriticalEnum);
            Fight.SequencesManager.EndSequence(SequenceTypeEnum.SEQUENCE_WEAPON);
            Fight.CheckDeads();
            Fight.CheckFightEnd();
            return(true);
        }