Example #1
0
        /// <summary>
        /// Lets this Pet cast the given spell
        /// </summary>
        public void CastPetSpell(SpellId spellId, WorldObject target)
        {
            var spell = NPCSpells.GetReadySpell(spellId);
            SpellFailedReason err;

            if (spell != null)
            {
                if (spell.HasTargets)
                {
                    Target = m_master.Target;
                }

                err = spell.CheckCasterConstraints(this);
                if (err == SpellFailedReason.Ok)
                {
                    err = SpellCast.Start(spell, false, target != null ? new[] { target } : null);
                }
            }
            else
            {
                err = SpellFailedReason.NotReady;
            }

            if (err != SpellFailedReason.Ok && m_master is IPacketReceiver)
            {
                PetHandler.SendCastFailed((IPacketReceiver)m_master, spellId, err);
            }
        }
Example #2
0
        private void UpdateTalentSpellRecords()
        {
            var spellList = new List <PetTalentSpellRecord>();

            foreach (var spell in NPCSpells)
            {
                var cdMillis    = NPCSpells.GetRemainingCooldownMillis(spell);
                var spellRecord = new PetTalentSpellRecord
                {
                    SpellId       = spell.Id,
                    CooldownUntil = DateTime.Now.AddMilliseconds(cdMillis)
                };
                spellList.Add(spellRecord);
            }
            // TODO: Implement
            // PetRecord.Spells = spellList;
        }
Example #3
0
 // Use this for initialization
 void Start()
 {
     speech = GameObject.Find("SpeechRecognition").GetComponent <SpeechRecognition01>();
     child  = GameObject.Find("Child_Spirit").GetComponent <NPCSpells>();
 }