public static EffectBase CreateInstance(EffectInstance effect) { if (effect is EffectInstanceLadder) return new EffectLadder(effect as EffectInstanceLadder); if (effect is EffectInstanceCreature) return new EffectCreature(effect as EffectInstanceCreature); if (effect is EffectInstanceDate) return new EffectDate(effect as EffectInstanceDate); if (effect is EffectInstanceDice) return new EffectDice(effect as EffectInstanceDice); if (effect is EffectInstanceDuration) return new EffectDuration(effect as EffectInstanceDuration); if (effect is EffectInstanceMinMax) return new EffectMinMax(effect as EffectInstanceMinMax); if (effect is EffectInstanceMount) return new EffectMount(effect as EffectInstanceMount); if (effect is EffectInstanceString) return new EffectString(effect as EffectInstanceString); if (effect is EffectInstanceInteger) return new EffectInteger(effect as EffectInstanceInteger); return new EffectBase(effect); }
public EffectBase(EffectInstance effect) { Id = (short)effect.effectId; m_template = ObjectDataManager.Instance.Get<Effect>(effect.effectId); Targets = (SpellTargetType)effect.targetId; Delay = effect.delay; Duration = effect.duration; Group = effect.group; Random = effect.random; Modificator = effect.modificator; Trigger = effect.trigger; Hidden = effect.hidden; m_zoneMinSize = effect.zoneMinSize; m_zoneSize = effect.zoneSize; ZoneShape = (SpellShapeEnum)effect.zoneShape; }