internal SpellCastResult CastSpell(SpellInfo spellInfo, SpellCastingOptions castOptions) { Spell spell = new Spell(unit, spellInfo, castOptions); ApplySpellModifier(spell, SpellModifierType.SpellValue, 1.0f); SpellCastResult castResult = spell.Prepare(); if (castResult != SpellCastResult.Success) { unit.World.SpellManager.Remove(spell); return(castResult); } switch (spell.ExecutionState) { case SpellExecutionState.Casting: unit.SpellCast.HandleSpellCast(spell, SpellCast.HandleMode.Started); break; case SpellExecutionState.Processing: return(castResult); case SpellExecutionState.Completed: return(castResult); } unit.ModifyEmoteState(EmoteType.None); return(SpellCastResult.Success); }
protected override void OnActiveUpdate(int deltaTime) { base.OnActiveUpdate(deltaTime); emoteTimeTracker.Update(deltaTime); if (emoteTimeTracker.Passed && randomEmotes.Count > 0) { Unit.ModifyEmoteState(RandomUtils.GetRandomElement(randomEmotes)); emoteTimeTracker.Reset(RandomUtils.Next(emoteIntervalMin, emoteIntervalMax)); } }