public SummonEffectHandler(SpellCast cast, SpellEffect effect) : base(cast, effect) { // MiscValueB: // 41 -> NonCombat Companion // }
public NotImplementedEffect(SpellCast cast, SpellEffect effect) : base(cast, effect) { if (cast.Caster is Character) { (cast.Caster as Character).SendSystemMessage( "Spell {0} ({1}) has not implemented Effect {2}. Please report this to the developers", cast.Spell.Name, cast.Spell.Id, effect.EffectType); } }
//Use this to check whether an effect is already on someone, then just refresh the duration if it is public bool Equals(SpellEffect otherEffect) { if (instantDamage == otherEffect.instantDamage && instantKnockback == otherEffect.instantKnockback && maxHealthMod == otherEffect.maxHealthMod && healthRegenMod == otherEffect.healthRegenMod && damageReductionMod == otherEffect.damageReductionMod && maxManaMod == otherEffect.maxManaMod && manaRegenMod == otherEffect.manaRegenMod && damageMod == otherEffect.damageMod && attackTimeMod == otherEffect.attackTimeMod && knockbackMod == otherEffect.knockbackMod && speedMod == otherEffect.speedMod && jumpSpeedMod == otherEffect.jumpSpeedMod) { //All the effects are equal return true; } else { //One or more effects is not equal return false; } }
public override bool EquipEvent(int slotNo) { if ((slotNo ==9) || (slotNo ==10)) { if (objInt().isEnchanted==true) { //cast enchantment. SpellEffectApplied = GameWorldController.instance.playerUW.PlayerMagic.CastEnchantment(GameWorldController.instance.playerUW.gameObject,null,GetActualSpellIndex(),Magic.SpellRule_TargetSelf); if (SpellEffectApplied!=null) { SpellEffectApplied.SetPermanent(true); } } } return true; }
//For creating spells from templates -- necessary because when I tried //setting ProjectileSpell's effect field equal to the template effect, //it was a reference instead of a variable public SpellEffect(SpellEffect templateEffect) { instantDamage = templateEffect.instantDamage; instantKnockback = templateEffect.instantKnockback; maxHealthMod = templateEffect.maxHealthMod; healthRegenMod = templateEffect.healthRegenMod; damageReductionMod = templateEffect.damageReductionMod; maxManaMod = templateEffect.maxManaMod; damageMod = templateEffect.damageMod; attackTimeMod = templateEffect.attackTimeMod; knockbackMod = templateEffect.knockbackMod; speedMod = templateEffect.speedMod; jumpSpeedMod = templateEffect.jumpSpeedMod; duration = templateEffect.duration; }
public void SetSpellEffect(Spell newSpell) { effect = new SpellEffect (newSpell.effect); targetsEnemies = newSpell.targetsEnemies; AoE = newSpell.AoE; rb.useGravity = newSpell.affectedByGravity; radius = newSpell.radius; deathTimer = newSpell.lifetime; GetComponent<SphereCollider> ().radius = newSpell.size; if (transform.Find ("Trail") && transform.Find ("Explosion")) { transform.Find ("Trail").GetComponent<ParticleSystem> ().startSize *= newSpell.size; transform.Find ("Trail").GetComponent<ParticleSystem> ().startColor = newSpell.col; transform.Find ("Explosion").GetComponent<ParticleSystem> ().startColor = newSpell.col; } }
public override bool EquipEvent(int slotNo) { if (((slotNo ==7) && (GameWorldController.instance.playerUW.isLefty==true)) || ((slotNo ==8) && (GameWorldController.instance.playerUW.isLefty==false)))//Only on off hand { UpdateQuality(); if (objInt().isEnchanted==true) { int EffectId=GetActualSpellIndex (); switch (EffectId) { case SpellEffect.UW1_Spell_Effect_MinorProtection: case SpellEffect.UW1_Spell_Effect_Protection: case SpellEffect.UW1_Spell_Effect_AdditionalProtection: case SpellEffect.UW1_Spell_Effect_MajorProtection: case SpellEffect.UW1_Spell_Effect_GreatProtection: case SpellEffect.UW1_Spell_Effect_VeryGreatProtection: case SpellEffect.UW1_Spell_Effect_TremendousProtection: case SpellEffect.UW1_Spell_Effect_UnsurpassedProtection: ProtectionBonus=EffectId-463; break; case SpellEffect.UW1_Spell_Effect_MinorToughness: case SpellEffect.UW1_Spell_Effect_Toughness: case SpellEffect.UW1_Spell_Effect_AdditionalToughness: case SpellEffect.UW1_Spell_Effect_MajorToughness: case SpellEffect.UW1_Spell_Effect_GreatToughness: case SpellEffect.UW1_Spell_Effect_VeryGreatToughness: case SpellEffect.UW1_Spell_Effect_TremendousToughness: case SpellEffect.UW1_Spell_Effect_UnsurpassedToughness: ToughnessBonus=EffectId-471; break; default: //cast enchantment. SpellEffectApplied = GameWorldController.instance.playerUW.PlayerMagic.CastEnchantment(GameWorldController.instance.playerUW.gameObject,null,GetActualSpellIndex(),Magic.SpellRule_TargetSelf); if (SpellEffectApplied!=null) { SpellEffectApplied.SetPermanent(true); } break; } } } return true; }
public void AddEffect(SpellEffect newEffect) { //If you already have the effect, just refresh the timer bool hasEffect = false; for (int i = 0; i < effects.Count; i++) { if (effects [i].Equals (newEffect)) { hasEffect = true; effects [i].SetDuration (newEffect.duration); } } //If not, add the effect if (!hasEffect) { effects.Add (newEffect); } //Do damage regardless healthmana.ModHealth (-1 * newEffect.instantDamage); //Knockback is applied within the "projectile spell" code }
public void DrawCurrentEffects() { if (CurrentEffect == SpellEffect.MagicShieldUp && !MagicShield) { MagicShield = true; Effects.Add(ShieldEffect = new Effect(Libraries.Magic, 3890, 3, 600, this) { Repeat = true }); CurrentEffect = SpellEffect.None; } if (CurrentEffect == SpellEffect.ElementalBarrierUp && !ElementalBarrier) { ElementalBarrier = true; Effects.Add(ElementalBarrierEffect = new Effect(Libraries.Magic3, 1890, 16, 3200, this) { Repeat = true }); CurrentEffect = SpellEffect.None; } if (ElementEffect > 0 && !HasElements) { HasElements = true; if (ElementEffect == 4) Effects.Add(new ElementsEffect(Libraries.Magic3, 1660, 10, 10 * 100, this, true, 4, ElementOrbMax)); else { if (ElementEffect >= 1) Effects.Add(new ElementsEffect(Libraries.Magic3, 1630, 10, 10 * 100, this, true, 1, ElementOrbMax)); if (ElementEffect >= 2) Effects.Add(new ElementsEffect(Libraries.Magic3, 1640, 10, 10 * 100, this, true, 2, ElementOrbMax)); if (ElementEffect == 3) Effects.Add(new ElementsEffect(Libraries.Magic3, 1650, 10, 10 * 100, this, true, 3, ElementOrbMax)); } ElementEffect = 0; } }
public CorpseExplosionHandler(SpellCast cast, SpellEffect effect) : base(cast, effect) { }
public DistractEffectHandler(SpellCast cast, SpellEffect effect) : base(cast, effect) { }
public override IEnumerator UpdateView(FightStatus fightStatus) { if (fightStatus.TryGetEntity(concernedEntity, out PlayerStatus playerStatus)) { if (playerStatus.TryGetSpell(spellInstanceId, out SpellStatus spellStatus)) { SpellDefinition definition = spellStatus.definition; if (!(null != definition)) { yield break; } yield return(definition.LoadResources()); ICastTargetDefinition castTarget = definition.castTarget; CastTargetContext castTargetContext = castTarget.CreateCastTargetContext(fightStatus, concernedEntity, DynamicValueHolderType.Spell, spellDefId, spellLevel, 0); int count = targets.Count; for (int j = 0; j < count; j++) { castTargetContext.SelectTarget(targets[j].ToTarget(fightStatus)); } if (count > 0 && !playerStatus.isLocalPlayer) { CellObject targetedCell = GetTargetedCell(fightStatus, targets[0]); yield return(FightUIRework.ShowPlayingSpell(spellStatus, targetedCell)); } List <SpellEffectInstantiationData> spellEffectData = (List <SpellEffectInstantiationData>)definition.spellEffectData; int spellEffectCount = spellEffectData.Count; if (spellEffectCount > 0) { List <IEnumerator> routineList = ListPool <IEnumerator> .Get(); int num; for (int i = 0; i < spellEffectCount; i = num) { SpellEffect spellEffect = definition.GetSpellEffect(i); if (!(null == spellEffect)) { SpellEffectInstantiationData spellEffectInstantiationData = spellEffectData[i]; spellEffectInstantiationData.PreComputeDelayOverDistance(castTargetContext); foreach (Vector2Int item3 in spellEffectInstantiationData.EnumerateInstantiationPositions(castTargetContext)) { IEnumerator item = FightSpellEffectFactory.PlaySpellEffect(spellEffect, item3, spellEffectInstantiationData, castTargetContext); routineList.Add(item); } foreach (IsoObject item4 in spellEffectInstantiationData.EnumerateInstantiationObjectTargets(castTargetContext)) { IEnumerator item2 = FightSpellEffectFactory.PlaySpellEffect(spellEffect, item4, spellEffectInstantiationData, castTargetContext); routineList.Add(item2); } yield return(EnumeratorUtility.ParallelRecursiveImmediateSafeExecution(routineList.ToArray())); routineList.Clear(); } num = i + 1; } ListPool <IEnumerator> .Release(routineList); } FightSpellEffectFactory.SetupSpellEffectOverrides(definition, fightStatus.fightId, eventId); } else { Log.Error($"Could not find spell with instance id {spellInstanceId} for player with id {concernedEntity}.", 128, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\PlaySpellEvent.cs"); } } else { Log.Error(FightEventErrors.PlayerNotFound(concernedEntity), 133, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\PlaySpellEvent.cs"); } }
public void CastEffect() { SpellEffect.DynamicInvoke(); }
public MillingEffectHandler(SpellCast cast, SpellEffect effect) : base(cast, effect) { }
public HealEffectHandler(SpellCast cast, SpellEffect effect) : base(cast, effect) { }
public DispelMagicHandler(SpellCast cast, SpellEffect effect) : base(cast, effect) { }
public SummonWaterElementalHandler(SpellCast cast, SpellEffect effect) : base(cast, effect) { }
public PowerDrainEffectHandler(SpellCast cast, SpellEffect effect) : base(cast, effect) { }
public HealthLeechEffectHandler(SpellCast cast, SpellEffect effect) : base(cast, effect) { }
public WMODamage(SpellCast cast, SpellEffect effect) : base(cast, effect) { }
public RestoreHealthPercentEffectHandler(SpellCast cast, SpellEffect effect) : base(cast, effect) { }
public TriggerSpellEffectHandler(SpellCast cast, SpellEffect effect) : base(cast, effect) { }
public CannibalizeEffectHandler(SpellCast cast, SpellEffect effect) : base(cast, effect) { }
public ImprovedBlizzardHandler(SpellCast cast, SpellEffect effect) : base(cast, effect) { }
public ForgetSpecializationEffectHandler(SpellCast cast, SpellEffect effect) : base(cast, effect) { }
public DismissPetEffectHandler(SpellCast cast, SpellEffect effect) : base(cast, effect) { }
public DismissPetEffectHandler(SpellCast cast, SpellEffect effect) : base(cast, effect) { }
public DeathCoilHandler(SpellCast cast, SpellEffect effect) : base(cast, effect) { }
public InstantKillEffectHandler(SpellCast cast, SpellEffect effect) : base(cast, effect) { }
public FriendFoeTriggerSpellHandler(SpellCast cast, SpellEffect eff, SpellId beneficialSpell, SpellId harmfulSpell) : base(cast, eff) { this.beneficialSpell = beneficialSpell; this.harmfulSpell = harmfulSpell; }
public DeathStrikeHealHandler(SpellCast cast, SpellEffect effect) : base(cast, effect) { }
public ApplyJudgementEffectHandler(SpellCast cast, SpellEffect effect) : base(cast, effect) { }
public WeaponDamageNoSchoolEffectHandler(SpellCast cast, SpellEffect effect) : base(cast, effect) { }
public ApplyAuraEffectHandler(SpellCast cast, SpellEffect effect) : base(cast, effect) { }
public IceLanceHandler(SpellCast cast, SpellEffect effect) : base(cast, effect) { }
public WMORepair(SpellCast cast, SpellEffect effect) : base(cast, effect) { }
public override bool OnEquip(Mobile from) { if ( base.OnEquip(from) ) { if ( SpellEffectOnEquip && from.Alive && !from.Deleted && m_Effect != SpellEffect.None && SpellCharges > 0 ) { if ( SpellCastEffect.InvokeEffect( m_Effect, from, from ) ) { SpellCharges--; if ( SpellCharges <= 0 ) { if ( m_Timer != null ) { m_Timer.Stop(); m_Timer = null; } m_Effect = SpellEffect.None; from.SendAsciiMessage( "This magic item is out of charges." ); } } if ( SpellCharges > 0 && SpellCastEffect.IsRepeatingEffect( m_Effect ) ) { if ( m_Timer == null ) m_Timer = new CheckTimer( this ); if ( !m_Timer.Running ) m_Timer.Start(); } } return true; } else { return false; } }
public ColdSnapHandler(SpellCast cast, SpellEffect effect) : base(cast, effect) { }
public ClearQuestEffectHandler(SpellCast cast, SpellEffect effect) : base(cast, effect) { }
public override void UpdateObject() { SpellEffect item = obj as SpellEffect; gameObject.SetActive(item != null); }
public WMODamage(SpellCast cast, SpellEffect effect) : base(cast, effect) { }
public CreateManaGemEffectHandler(SpellCast cast, SpellEffect effect) : base(cast, effect) { }
public UnusedEffectHandler(SpellCast cast, SpellEffect effect) : base(cast, effect) { }
public ScriptEffectHandler(SpellCast cast, SpellEffect effect) : base(cast, effect) { }
public ProspectingEffectHandler(SpellCast cast, SpellEffect effect) : base(cast, effect) { }
public WeaponEffectHandler(SpellCast cast, SpellEffect effect) : base(cast, effect) { }
public void Load(S.ObjectPlayer info) { Name = info.Name; NameColour = info.NameColour; GuildName = info.GuildName; GuildRankName = info.GuildRankName; Class = info.Class; Gender = info.Gender; Level = info.Level; CurrentLocation = info.Location; MapLocation = info.Location; GameScene.Scene.MapControl.AddObject(this); Direction = info.Direction; Hair = info.Hair; Weapon = info.Weapon; Armour = info.Armour; Light = info.Light; Poison = info.Poison; Dead = info.Dead; Hidden = info.Hidden; WingEffect = info.WingEffect; CurrentEffect = info.Effect; MountType = info.MountType; RidingMount = info.RidingMount; Fishing = info.Fishing; TransformType = info.TransformType; SetLibraries(); if (Dead) ActionFeed.Add(new QueuedAction { Action = MirAction.Dead, Direction = Direction, Location = CurrentLocation }); if (info.Extra) Effects.Add(new Effect(Libraries.Magic2, 670, 10, 800, this)); ElementEffect = (int)info.ElementOrbEffect; ElementsLevel = (int)info.ElementOrbLvl; ElementOrbMax = (int)info.ElementOrbMax; Buffs = info.Buffs; LevelEffects = info.LevelEffects; ProcessBuffs(); SetAction(); SetEffects(); }
private void OnWordActivation(string word, SpellEffect SpellEffect) { }
public SummonObjectEffectHandler(SpellCast cast, SpellEffect effect) : base(cast, effect) { }
public BindEffectHandler(SpellCast cast, SpellEffect effect) : base(cast, effect) { }
public AddExtraAttacksEffectHandler(SpellCast cast, SpellEffect effect) : base(cast, effect) { }
public VideoEffectHandler(SpellCast cast, SpellEffect effect) : base(cast, effect) { }
public DisenchantEffectHandler(SpellCast cast, SpellEffect effect) : base(cast, effect) { }
public EnchantItemEffectHandler(SpellCast cast, SpellEffect effect) : base(cast, effect) { }
public StealBeneficialBuffEffectHandler(SpellCast cast, SpellEffect effect) : base(cast, effect) { }
public override void UpdateLifeRegen() {/* * if (Spellsmith.instance.abilityInterface.CurrentState == null) * { * if (player.HeldItem.modItem is SpellBlaster) * { * Spellsmith.instance.ShowAbilityUI(); * } * } * else if (!(player.HeldItem.modItem is SpellBlaster)) * { * Spellsmith.instance.HideAbilityUI(); * } */ if (activeBlaster != null) { for (int i = 0; i < activeEffects.Count; i++) { if (i < activeEffects.Count) { SpellEffect effect = activeEffects[i]; Main.NewText(effect); if (effect.OnCooldown) { bool success = effect.ReduceCooldown(); if (success) { activeEffects.Remove(effect); } } else if (effect.CanRunSpell(player, activeBlaster)) { Vector2 velocity = Vector2.Normalize(Main.MouseWorld - player.Center) * activeBlaster.shootSpeed; Vector2 castPosition = player.Center + (Vector2.Normalize(Main.MouseWorld - player.Center) * (activeBlaster.width + 12)); switch (effect.Style) { case SpellStyle.Default: { RunSpell(effect, velocity, castPosition); activeEffects.RemoveAt(i); break; } case SpellStyle.HoldRelease: { effect.Charge(player); effect.DoChargeVisuals(player, castPosition, activeBlaster); if (!player.channel) { RunSpell(effect, velocity, castPosition); } break; } case SpellStyle.Charge: { effect.DoChargeVisuals(player, castPosition, activeBlaster); bool success = effect.Charge(player); if (success || !player.channel) { RunSpell(effect, velocity, castPosition); } break; } case SpellStyle.ChargeRelease: { effect.DoChargeVisuals(player, castPosition, activeBlaster); effect.Charge(player); if (!player.channel) { RunSpell(effect, velocity, castPosition); } break; } } } } } } }
public SkillStepEffectHandler(SpellCast cast, SpellEffect effect) : base(cast, effect) { }
public DisenchantEffectHandler(SpellCast cast, SpellEffect effect) : base(cast, effect) { }
public EnchantItemTemporaryEffectHandler(SpellCast cast, SpellEffect effect) : base(cast, effect) { }
public MillingEffectHandler(SpellCast cast, SpellEffect effect) : base(cast, effect) { }