Exemple #1
0
        public CharmInfo(Unit unit)
        {
            _unit          = unit;
            _CommandState  = CommandStates.Follow;
            _petnumber     = 0;
            _oldReactState = ReactStates.Passive;
            for (byte i = 0; i < SharedConst.MaxSpellCharm; ++i)
            {
                _charmspells[i] = new UnitActionBarEntry();
                _charmspells[i].SetActionAndType(0, ActiveStates.Disabled);
            }

            for (var i = 0; i < SharedConst.ActionBarIndexMax; ++i)
            {
                PetActionBar[i] = new UnitActionBarEntry();
            }

            Creature creature = _unit.ToCreature();

            if (creature != null)
            {
                _oldReactState = creature.GetReactState();
                creature.SetReactState(ReactStates.Passive);
            }
        }