示例#1
0
 public TriggerBuff(int id, FightActor target, FightActor caster, EffectDice effect, Spell spell, bool critical, int dispelable, BuffTriggerType trigger, TriggerBuffApplyHandler applyTrigger, short customActionId)
     : base(id, target, caster, effect, spell, critical, dispelable, customActionId)
 {
     this.Trigger      = trigger;
     this.Dice         = effect;
     this.ApplyTrigger = applyTrigger;
 }
示例#2
0
文件: Push.cs 项目: Mixi59/Stump
 public Push(EffectDice effect, FightActor caster, SpellCastHandler castHandler, Cell targetedCell, bool critical)
     : base(effect, caster, castHandler, targetedCell, critical)
 {
     DamagesDisabled = effect.EffectId == EffectsEnum.Effect_PushBack_1103 ||
                       effect.EffectId == EffectsEnum.Effect_PullForward;
     Pull = effect.EffectId == EffectsEnum.Effect_PullForward;
 }
        public static bool SpawnMonster(Character character, EffectDice effect)
        {
            MonsterRecord template = MonsterRecord.GetMonster(effect.Const);

            if (template != null && template.GradeExist((sbyte)effect.Min))
            {
                if (character.Map.Instance.MonsterGroupCount < MonsterSpawnManager.MaxMonsterGroupPerMap && MapNoSpawnRecord.AbleToSpawn(character.Map.Id))
                {
                    MonsterSpawnManager.Instance.AddFixedMonsterGroup(character.Map.Instance,
                                                                      new MonsterRecord[] { template },
                                                                      new sbyte[] { (sbyte)effect.Min },
                                                                      false);

                    return(true);
                }
                else
                {
                    character.ReplyError("Impossible de spawn le monstre ici...");

                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }
 public SpellBoost(EffectDice effect, FightActor caster, Spell spell, Cell targetedCell, bool critical)
     : base(effect, caster, spell, targetedCell, critical)
 {
     if (effect.DiceNum == 171 && effect.Targets != SpellTargetType.ONLY_SELF)
     {
         effect.Targets = SpellTargetType.ONLY_SELF;
     }
 }
示例#5
0
 public TriggerBuff(int id, FightActor target, FightActor caster, EffectDice effect, Spell spell, bool critical, int dispelable, BuffTriggerType trigger, TriggerBuffApplyHandler applyTrigger, TriggerBuffRemoveHandler removeTrigger)
     : base(id, target, caster, effect, spell, critical, dispelable)
 {
     this.Trigger       = trigger;
     this.Dice          = effect;
     this.ApplyTrigger  = applyTrigger;
     this.RemoveTrigger = removeTrigger;
 }
示例#6
0
        public EffectBase DeserializeEffect(byte[] buffer, ref int index)
        {
            if (buffer.Length < index)
            {
                throw new System.Exception("buffer too small to contain an Effect");
            }
            byte       b = buffer[index];
            EffectBase effectBase;

            switch (b)
            {
            case 1:
                effectBase = new EffectBase();
                break;

            case 2:
                effectBase = new EffectCreature();
                break;

            case 3:
                effectBase = new EffectDate();
                break;

            case 4:
                effectBase = new EffectDice();
                break;

            case 5:
                effectBase = new EffectDuration();
                break;

            case 6:
                effectBase = new EffectInteger();
                break;

            case 7:
                effectBase = new EffectLadder();
                break;

            case 8:
                effectBase = new EffectMinMax();
                break;

            case 9:
                effectBase = new EffectMount();
                break;

            case 10:
                effectBase = new EffectString();
                break;

            default:
                throw new System.Exception(string.Format("Incorrect identifier : {0}", b));
            }
            index++;
            effectBase.DeSerialize(buffer, ref index);
            return(effectBase);
        }
        // CONSTRUCTORS
        public TriggerBuff(int id, FightActor target, FightActor caster, EffectDice effect, Spell spell, bool critical, bool dispelable, BuffTriggerType trigger, TriggerBuffApplyHandler applyTrigger)
            : base(id, target, caster, effect, spell, critical, dispelable)
        {
            this.Trigger      = trigger;
            this.Dice         = effect;
            this.ApplyTrigger = applyTrigger;

            this.m_roundCreation = target.Fight.TimeLine.RoundNumber;
        }
示例#8
0
文件: Damage.cs 项目: Mixi59/Stump
 public Damage(EffectDice effect, EffectSchoolEnum school, FightActor source, Spell spell, Cell targetCell, Zone zone = null)
     : this(effect)
 {
     School     = school;
     Source     = source;
     Spell      = spell;
     TargetCell = targetCell;
     Zone       = zone;
 }
示例#9
0
 public Trap(short id, FightActor caster, Spell spell, Cell centerCell, EffectDice originEffect, Spell trapSpell, GameActionMarkCellsTypeEnum shape, byte size)
     : base(id, caster, spell, centerCell, originEffect, new MarkShape[]
 {
     new MarkShape(caster.Fight, centerCell, shape, size, Color.Brown)
 })
 {
     this.TrapSpell    = trapSpell;
     this.VisibleState = GameActionFightInvisibilityStateEnum.INVISIBLE;
 }
示例#10
0
 protected MarkTrigger(short id, FightActor caster, Spell castedSpell, EffectDice originEffect, Cell centerCell, MarkShape shape)
 {
     Id           = id;
     Caster       = caster;
     CastedSpell  = castedSpell;
     OriginEffect = originEffect;
     CenterCell   = centerCell;
     Shape        = shape;
 }
示例#11
0
文件: Damage.cs 项目: Mixi59/Stump
        public Damage(EffectDice effect)
        {
            BaseMaxDamages = Math.Max(effect.DiceFace, effect.DiceNum);
            BaseMinDamages = Math.Min(effect.DiceFace, effect.DiceNum);

            if (BaseMinDamages == 0)
            {
                BaseMinDamages = BaseMaxDamages;
            }
        }
示例#12
0
 public Glyph(short id, FightActor caster, Spell castedSpell, EffectDice originEffect, Spell glyphSpell,
              Cell centerCell, SpellShapeEnum shape, byte minSize, byte size, Color color, bool canBeForced, TriggerType triggerType = TriggerType.OnTurnBegin)
     : base(id, caster, castedSpell, originEffect, centerCell,
            new MarkShape(caster.Fight, centerCell, shape, GetMarkShape(shape), minSize, size, color))
 {
     GlyphSpell  = glyphSpell;
     CanBeForced = canBeForced;
     Duration    = originEffect.Duration;
     TriggerType = triggerType;
 }
示例#13
0
        public void DissociateLiving(CharacterItemRecord item)
        {
            EffectDice effect = item.FirstEffect <EffectDice>(EffectsEnum.Effect_LivingObjectId);

            if (effect != null)
            {
                var levelEffect    = item.FirstEffect <Effect>(EffectsEnum.Effect_LivingObjectLevel);
                var categoryEffect = item.FirstEffect <Effect>(EffectsEnum.Effect_LivingObjectCategory);
                var moodEffect     = item.FirstEffect <Effect>(EffectsEnum.Effect_LivingObjectMood);
                var skinEffect     = item.FirstEffect <Effect>(EffectsEnum.Effect_LivingObjectSkin);

                var newItem = ItemRecord.GetItem(effect.Const).GetCharacterItem(Character.Id, item.Quantity, false);
                newItem.Effects.Clear(); //RemoveAllEffects
                newItem.AddEffect(levelEffect);
                newItem.AddEffect(categoryEffect);
                newItem.AddEffect(moodEffect);
                newItem.AddEffect(skinEffect);
                newItem.AppearanceId = item.AppearanceId;
                item.RemoveAllEffects(EffectsEnum.Effect_LivingObjectId);
                item.RemoveAllEffects(EffectsEnum.Effect_LivingObjectLevel);
                item.RemoveAllEffects(EffectsEnum.Effect_LivingObjectCategory);
                item.RemoveAllEffects(EffectsEnum.Effect_LivingObjectMood);
                item.RemoveAllEffects(EffectsEnum.Effect_LivingObjectSkin);

                AddItem(newItem);

                if (item.PositionEnum != CharacterInventoryPositionEnum.INVENTORY_POSITION_NOT_EQUIPED)
                {
                    UpdateItemAppearence(item, item.Template.AppearanceId);
                    OnItemModified(item);
                }
                else
                {
                    item.AppearanceId = item.Template.AppearanceId;

                    if (item.PositionEnum == CharacterInventoryPositionEnum.INVENTORY_POSITION_NOT_EQUIPED)
                    {
                        if (!CheckPassiveStacking(item))
                        {
                            OnItemModified(item);
                        }
                    }
                    else
                    {
                        OnItemModified(item);
                    }
                }

                Character.RefreshActorOnMap();
                item.UpdateElement();
                RefreshWeight();
            }
        }
        protected SpellEffectHandler(EffectDice effect, FightActor caster, Spell spell, Cell targetedCell, bool critical) : base(effect)
        {
            this.Dice          = effect;
            this.Caster        = caster;
            this.Spell         = spell;
            this.TargetedCell  = targetedCell;
            this.TargetedPoint = new MapPoint(this.TargetedCell);
            this.Critical      = critical;
            this.Targets       = effect.Targets;

            SpellEffectHandler.logger.Debug <EffectsEnum, SpellTemplate>("Handle '{0}' effect for the spell '{1}'.", effect.EffectId, spell.Template);
        }
示例#15
0
 protected SpellEffectHandler(EffectDice effect, FightActor caster, SpellCastHandler castHandler, Cell targetedCell, bool critical)
     : base(effect)
 {
     Dice                     = effect;
     Caster                   = caster;
     CastHandler              = castHandler;
     TargetedCell             = targetedCell;
     TargetedPoint            = new MapPoint(TargetedCell);
     Critical                 = critical;
     Targets                  = effect.Targets;
     Category                 = SpellIdentifier.GetEffectCategories(effect.EffectId);
     DefaultDispellableStatus = FightDispellableEnum.DISPELLABLE;
 }
示例#16
0
        public double GetEffectMaxPower(EffectDice effect)
        {
            int max;

            if (effect.DiceFace == 0 || effect.DiceNum == 0)
            {
                max = effect.DiceFace == 0 ? effect.DiceNum : effect.DiceFace;
            }
            else
            {
                max = effect.DiceFace < effect.DiceNum ? effect.DiceNum : effect.DiceFace;
            }

            return((effect.Template.BonusType < 0 ? -1 : 1) * max * GetEffectPower(effect.Template));
        }
示例#17
0
文件: PetItem.cs 项目: Mixi59/Stump
        private int IncreaseCreatureKilledCount(MonsterTemplate monster)
        {
            if (!m_monsterKilledEffects.TryGetValue(monster.Id, out var effect))
            {
                effect = new EffectDice(EffectsEnum.Effect_MonsterKilledCount, 1, (short)monster.Id, 0);
                m_monsterKilledEffects.Add(monster.Id, effect);
                Effects.Add(effect);
            }
            else
            {
                effect.Value++;
            }

            return(effect.Value);
        }
示例#18
0
        public SpellEffectHandler GetSpellEffectHandler(EffectDice effect, FightActor caster, Stump.Server.WorldServer.Game.Spells.Spell spell, Cell targetedCell, bool critical)
        {
            EffectManager.SpellEffectConstructor spellEffectConstructor;
            SpellEffectHandler result;

            if (this.m_spellsEffectHandler.TryGetValue(effect.EffectId, out spellEffectConstructor))
            {
                result = spellEffectConstructor(effect, caster, spell, targetedCell, critical);
            }
            else
            {
                result = new DefaultSpellEffect(effect, caster, spell, targetedCell, critical);
            }
            return(result);
        }
示例#19
0
文件: SoulStone.cs 项目: Mixi59/Stump
        public SoulStone(Character owner, PlayerItemRecord record)
            : base(owner, record)
        {
            m_soulStoneEffect = Effects.OfType <EffectDice>().FirstOrDefault(x => x.EffectId == EffectsEnum.Effect_SoulStone);

            if (m_soulStoneEffect == null)
            {
                return;
            }

            if (IsEquiped())
            {
                SubscribeEvents();
            }
        }
        public override void Execute()
        {
            base.Execute();
            var target = this.Caster.Team.GetOneTree(this.TargetedCell);

            if (target != null)
            {
                var id     = target.PopNextBuffId();
                var effect = new EffectDice()
                {
                    Duration = DURATION
                };                                                     //TODO : Add EffectId
                var actionId = (short)ActionsEnum.ACTION_793;
                var buff     = new TriggerBuff(id, target, target, effect, base.Spell, false, true, BuffTriggerType.TURN_END, new TriggerBuffApplyHandler(TreeTrigger), actionId);

                target.AddAndApplyBuff(buff);
                ContextHandler.SendGameActionFightDispellableEffectMessage(base.Caster.Fight.Clients, buff);
            }
        }
示例#21
0
        public void DecrementEtherals()
        {
            foreach (var item in GetEquipedItems())
            {
                EffectDice effect = item.FirstEffect <EffectDice>(EffectsEnum.Effect_RemainingEtheral);

                if (effect != null)
                {
                    effect.Min--;

                    if ((effect.Max -= 1) == 0)
                    {
                        SetItemPosition(item.UId, CharacterInventoryPositionEnum.INVENTORY_POSITION_NOT_EQUIPED, item.Quantity);
                        RemoveItem(item, item.Quantity);
                    }
                    else
                    {
                        this.OnItemModified(item);
                        item.UpdateElement();
                    }
                }
            }
        }
示例#22
0
 public VitalityPercent(EffectDice effect, FightActor caster, SpellCastHandler castHandler, Cell targetedCell, bool critical)
     : base(effect, caster, castHandler, targetedCell, critical)
 {
 }
示例#23
0
 public ChangeSkin(EffectDice effect, FightActor caster, Spell spell, Cell targetedCell, bool critical)
     : base(effect, caster, spell, targetedCell, critical)
 {
 }
 public KillAndReplace(EffectDice effect, FightActor caster, Spell spell, Cell targetedCell, bool critical) : base(effect, caster, spell, targetedCell, critical)
 {
 }
示例#25
0
文件: HPSteal.cs 项目: Mixi59/Stump
 public HPSteal(EffectDice effect, FightActor caster, SpellCastHandler castHandler, Cell targetedCell, bool critical)
     : base(effect, caster, castHandler, targetedCell, critical)
 {
 }
示例#26
0
 public Damage(EffectDice effect, EffectSchoolEnum school, FightActor source, Spell spell) : this(effect)
 {
     this.School = school;
     this.Source = source;
     this.Spell  = spell;
 }
示例#27
0
 public Rune(short id, FightActor caster, Spell spell, EffectDice originEffect, Spell runeSpell, Cell centerCell, SpellShapeEnum shape, byte minSize, byte size)
     : base(id, caster, spell, originEffect, centerCell, new MarkShape(caster.Fight, centerCell, shape, GetMarkShape(shape), minSize, size, GetRuneColorBySpell(spell)))
 {
     RuneSpell = runeSpell;
     Duration  = originEffect.Duration;
 }
示例#28
0
 public Attract(EffectDice effect, FightActor caster, SpellCastHandler castHandler, Cell targetedCell, bool critical)
     : base(effect, caster, castHandler, targetedCell, critical)
 {
     Pull            = true;
     DamagesDisabled = true;
 }
示例#29
0
 public DamageIntercept(EffectDice effect, FightActor caster, SpellCastHandler castHandler, Cell targetedCell, bool critical)
     : base(effect, caster, castHandler, targetedCell, critical)
 {
     DefaultDispellableStatus = FightDispellableEnum.DISPELLABLE_BY_DEATH;
 }
 public TPPreviousPosition(EffectDice effect, FightActor caster, Spell spell, Cell targetedCell, bool critical) : base(effect, caster, spell, targetedCell, critical)
 {
 }