예제 #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);
            }
        }
예제 #2
0
 public void RestoreState()
 {
     if (_unit.IsTypeId(TypeId.Unit))
     {
         Creature creature = _unit.ToCreature();
         if (creature)
         {
             creature.SetReactState(_oldReactState);
         }
     }
 }