Example #1
0
 public void InitializeTalentSpells(WS_PlayerData.CharacterObject objCharacter)
 {
     WS_Spells.SpellTargets t             = new WS_Spells.SpellTargets();
     WS_Base.BaseUnit       objCharacter2 = objCharacter;
     t.SetTarget_SELF(ref objCharacter2);
     objCharacter = (WS_PlayerData.CharacterObject)objCharacter2;
     foreach (KeyValuePair <int, WS_Spells.CharacterSpell> Spell in objCharacter.Spells)
     {
         if (WorldServiceLocator._WS_Spells.SPELLs.ContainsKey(Spell.Key) && WorldServiceLocator._WS_Spells.SPELLs[Spell.Key].IsPassive)
         {
             if (!objCharacter.HavePassiveAura(Spell.Key) && WorldServiceLocator._WS_Spells.SPELLs[Spell.Key].CanCast(ref objCharacter, t, FirstCheck: false) == SpellFailedReason.SPELL_NO_ERROR)
             {
                 WS_Spells.SpellInfo spellInfo = WorldServiceLocator._WS_Spells.SPELLs[Spell.Key];
                 WS_Base.BaseObject  caster    = objCharacter;
                 spellInfo.Apply(ref caster, t);
                 objCharacter = (WS_PlayerData.CharacterObject)caster;
             }
             else if (objCharacter.HavePassiveAura(Spell.Key) && WorldServiceLocator._WS_Spells.SPELLs[Spell.Key].CanCast(ref objCharacter, t, FirstCheck: false) != SpellFailedReason.SPELL_NO_ERROR)
             {
                 objCharacter.RemoveAuraBySpell(Spell.Key);
             }
         }
     }
 }