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; }
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; } }
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; }
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; }
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; }
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; }
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; }
public Damage(EffectDice effect) { BaseMaxDamages = Math.Max(effect.DiceFace, effect.DiceNum); BaseMinDamages = Math.Min(effect.DiceFace, effect.DiceNum); if (BaseMinDamages == 0) { BaseMinDamages = BaseMaxDamages; } }
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; }
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); }
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; }
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)); }
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); }
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); }
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); } }
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(); } } } }
public VitalityPercent(EffectDice effect, FightActor caster, SpellCastHandler castHandler, Cell targetedCell, bool critical) : base(effect, caster, castHandler, targetedCell, critical) { }
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) { }
public HPSteal(EffectDice effect, FightActor caster, SpellCastHandler castHandler, Cell targetedCell, bool critical) : base(effect, caster, castHandler, targetedCell, critical) { }
public Damage(EffectDice effect, EffectSchoolEnum school, FightActor source, Spell spell) : this(effect) { this.School = school; this.Source = source; this.Spell = spell; }
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; }
public Attract(EffectDice effect, FightActor caster, SpellCastHandler castHandler, Cell targetedCell, bool critical) : base(effect, caster, castHandler, targetedCell, critical) { Pull = true; DamagesDisabled = true; }
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) { }