diff options
24 files changed, 105 insertions, 111 deletions
diff --git a/src/bindings/scripts/scripts/npc/npcs_special.cpp b/src/bindings/scripts/scripts/npc/npcs_special.cpp index 9c23c21ffbd..74905644fab 100644 --- a/src/bindings/scripts/scripts/npc/npcs_special.cpp +++ b/src/bindings/scripts/scripts/npc/npcs_special.cpp @@ -351,7 +351,7 @@ struct TRINITY_DLL_DECL npc_injured_patientAI : public ScriptedAI //no regen health m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); //to make them lay with face down - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_DEAD); + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD); uint32 mobId = m_creature->GetEntry(); @@ -392,7 +392,7 @@ struct TRINITY_DLL_DECL npc_injured_patientAI : public ScriptedAI //regen health m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); //stand up - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_NONE); + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_STAND); DoSay(SAY_DOC1,LANG_UNIVERSAL,NULL); uint32 mobId = m_creature->GetEntry(); diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp index a2c9912fbfa..f7f20bfde95 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp @@ -1957,7 +1957,7 @@ void boss_illidan_stormrageAI::HandleTalkSequence() { Maiev->CastSpell(Maiev, SPELL_TELEPORT_VISUAL, true); Maiev->setDeathState(JUST_DIED); - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,PLAYER_STATE_DEAD); + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,UNIT_STAND_STATE_DEAD); } break; case 21: // Kill ourself. diff --git a/src/bindings/scripts/scripts/zone/eastern_plaguelands/eastern_plaguelands.cpp b/src/bindings/scripts/scripts/zone/eastern_plaguelands/eastern_plaguelands.cpp index 44abf0da806..f0b073f5aa0 100644 --- a/src/bindings/scripts/scripts/zone/eastern_plaguelands/eastern_plaguelands.cpp +++ b/src/bindings/scripts/scripts/zone/eastern_plaguelands/eastern_plaguelands.cpp @@ -118,7 +118,7 @@ bool GossipHello_npc_tirion_fordring(Player *player, Creature *_Creature) if (_Creature->isQuestGiver()) player->PrepareQuestMenu( _Creature->GetGUID() ); - if (player->GetQuestStatus(5742) == QUEST_STATUS_INCOMPLETE && player->getStandState() == PLAYER_STATE_SIT ) + if (player->GetQuestStatus(5742) == QUEST_STATUS_INCOMPLETE && player->getStandState() == UNIT_STAND_STATE_SIT ) player->ADD_GOSSIP_ITEM( 0, "I am ready to hear your tale, Tirion.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID()); diff --git a/src/bindings/scripts/scripts/zone/eversong_woods/eversong_woods.cpp b/src/bindings/scripts/scripts/zone/eversong_woods/eversong_woods.cpp index 885913ffbed..ca069c2ff8b 100644 --- a/src/bindings/scripts/scripts/zone/eversong_woods/eversong_woods.cpp +++ b/src/bindings/scripts/scripts/zone/eversong_woods/eversong_woods.cpp @@ -229,7 +229,7 @@ struct TRINITY_DLL_DECL npc_secondTrialAI : public ScriptedAI questPhase = 0; summonerGuid = 0; - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_KNEEL); + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_KNEEL); m_creature->setFaction(FACTION_FRIENDLY); spellFlashLight = false; @@ -268,7 +268,7 @@ struct TRINITY_DLL_DECL npc_secondTrialAI : public ScriptedAI if ( questPhase == 1 ) { if ( timer < diff ) { - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_NONE); + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_STAND); m_creature->setFaction(FACTION_HOSTILE); questPhase = 0; diff --git a/src/bindings/scripts/scripts/zone/karazhan/bosses_opera.cpp b/src/bindings/scripts/scripts/zone/karazhan/bosses_opera.cpp index 73f19b03e61..0a0ae7e200e 100644 --- a/src/bindings/scripts/scripts/zone/karazhan/bosses_opera.cpp +++ b/src/bindings/scripts/scripts/zone/karazhan/bosses_opera.cpp @@ -905,7 +905,7 @@ void PretendToDie(Creature* _Creature) _Creature->SetUInt64Value(UNIT_FIELD_TARGET,0); _Creature->GetMotionMaster()->Clear(); _Creature->GetMotionMaster()->MoveIdle(); - _Creature->SetUInt32Value(UNIT_FIELD_BYTES_1,PLAYER_STATE_DEAD); + _Creature->SetUInt32Value(UNIT_FIELD_BYTES_1,UNIT_STAND_STATE_DEAD); }; void Resurrect(Creature* target) diff --git a/src/bindings/scripts/scripts/zone/nagrand/nagrand.cpp b/src/bindings/scripts/scripts/zone/nagrand/nagrand.cpp index 3ee4f06d629..92b179eefec 100644 --- a/src/bindings/scripts/scripts/zone/nagrand/nagrand.cpp +++ b/src/bindings/scripts/scripts/zone/nagrand/nagrand.cpp @@ -125,7 +125,7 @@ struct TRINITY_DLL_DECL mob_lumpAI : public ScriptedAI m_creature->DeleteThreatList(); m_creature->CombatStop(); m_creature->setFaction(1080); //friendly - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_SIT); + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_SIT); DoScriptText(LUMP_DEFEAT, m_creature); bReset = true; @@ -139,7 +139,7 @@ struct TRINITY_DLL_DECL mob_lumpAI : public ScriptedAI m_creature->RemoveAura(SPELL_VISUAL_SLEEP,0); if (!m_creature->IsStandState()) - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_NONE); + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_STAND); switch(rand()%2) { diff --git a/src/bindings/scripts/scripts/zone/netherstorm/netherstorm.cpp b/src/bindings/scripts/scripts/zone/netherstorm/netherstorm.cpp index fe4c3ba6501..c1b0b01f85a 100644 --- a/src/bindings/scripts/scripts/zone/netherstorm/netherstorm.cpp +++ b/src/bindings/scripts/scripts/zone/netherstorm/netherstorm.cpp @@ -441,8 +441,8 @@ struct TRINITY_DLL_DECL npc_commander_dawnforgeAI : public ScriptedAI ardonis->SendUpdateToPlayer(player); //Set them to kneel - m_creature->SetStandState(PLAYER_STATE_KNEEL); - ardonis->SetStandState(PLAYER_STATE_KNEEL); + m_creature->SetStandState(UNIT_STAND_STATE_KNEEL); + ardonis->SetStandState(UNIT_STAND_STATE_KNEEL); } //Set them back to each other @@ -466,8 +466,8 @@ struct TRINITY_DLL_DECL npc_commander_dawnforgeAI : public ScriptedAI ardonis->SendUpdateToPlayer(player); //Set state - m_creature->SetStandState(PLAYER_STATE_NONE); - ardonis->SetStandState(PLAYER_STATE_NONE); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + ardonis->SetStandState(UNIT_STAND_STATE_STAND); } } diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kalecgos.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kalecgos.cpp index 86cdf2ef39b..abae43e05b6 100644 --- a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kalecgos.cpp +++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kalecgos.cpp @@ -133,7 +133,7 @@ struct TRINITY_DLL_DECL boss_kalecgosAI : public ScriptedAI m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING); m_creature->SetVisibility(VISIBILITY_ON); - m_creature->SetStandState(PLAYER_STATE_SLEEP); + m_creature->SetStandState(UNIT_STAND_STATE_SLEEP); ArcaneBuffetTimer = 8000; FrostBreathTimer = 15000; @@ -158,7 +158,7 @@ struct TRINITY_DLL_DECL boss_kalecgosAI : public ScriptedAI void Aggro(Unit* who) { - m_creature->SetStandState(PLAYER_STATE_NONE); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); DoScriptText(SAY_EVIL_AGGRO, m_creature); GameObject *Door = GameObject::GetGameObject(*m_creature, DoorGUID); if(Door) Door->SetLootState(GO_ACTIVATED); diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_alar.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_alar.cpp index 85381e58fb3..63942e6ef11 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_alar.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_alar.cpp @@ -228,12 +228,12 @@ struct TRINITY_DLL_DECL boss_alarAI : public ScriptedAI WaitEvent = WE_DUMMY; return; case WE_DIE: - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_DEAD); + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD); WaitTimer = 5000; WaitEvent = WE_REVIVE; return; case WE_REVIVE: - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_NONE); + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_STAND); m_creature->SetHealth(m_creature->GetMaxHealth()); m_creature->SetSpeed(MOVE_RUN, DefaultMoveSpeedRate); m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp index 70ef1262507..9c55f846935 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp @@ -238,7 +238,7 @@ struct TRINITY_DLL_DECL advisorbase_ai : public ScriptedAI m_creature->SetUInt64Value(UNIT_FIELD_TARGET,0); m_creature->GetMotionMaster()->Clear(); m_creature->GetMotionMaster()->MoveIdle(); - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,PLAYER_STATE_DEAD); + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,UNIT_STAND_STATE_DEAD); if (pInstance->GetData(DATA_KAELTHASEVENT) == 3) JustDied(pKiller); @@ -575,7 +575,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI //Subphase 2 - Start case 2: Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[0])); - if(Advisor && (Advisor->GetUInt32Value(UNIT_FIELD_BYTES_1) == PLAYER_STATE_DEAD)) + if(Advisor && (Advisor->GetUInt32Value(UNIT_FIELD_BYTES_1) == UNIT_STAND_STATE_DEAD)) { DoScriptText(SAY_INTRO_SANGUINAR, m_creature); @@ -609,7 +609,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI //Subphase 3 - Start case 4: Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[1])); - if(Advisor && (Advisor->GetUInt32Value(UNIT_FIELD_BYTES_1) == PLAYER_STATE_DEAD)) + if(Advisor && (Advisor->GetUInt32Value(UNIT_FIELD_BYTES_1) == UNIT_STAND_STATE_DEAD)) { DoScriptText(SAY_INTRO_CAPERNIAN, m_creature); @@ -643,7 +643,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI //Subphase 4 - Start case 6: Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[2])); - if(Advisor && (Advisor->GetUInt32Value(UNIT_FIELD_BYTES_1) == PLAYER_STATE_DEAD)) + if(Advisor && (Advisor->GetUInt32Value(UNIT_FIELD_BYTES_1) == UNIT_STAND_STATE_DEAD)) { DoScriptText(SAY_INTRO_TELONICUS, m_creature); @@ -679,7 +679,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI //End of phase 1 case 8: Advisor = (Creature*)(Unit::GetUnit((*m_creature), AdvisorGuid[3])); - if(Advisor && (Advisor->GetUInt32Value(UNIT_FIELD_BYTES_1) == PLAYER_STATE_DEAD)) + if(Advisor && (Advisor->GetUInt32Value(UNIT_FIELD_BYTES_1) == UNIT_STAND_STATE_DEAD)) { Phase = 2; pInstance->SetData(DATA_KAELTHASEVENT, 2); @@ -1467,7 +1467,7 @@ struct TRINITY_DLL_DECL mob_phoenix_tkAI : public ScriptedAI if(SummonEgg == 1){ //hack die animation m_creature->RemoveAllAuras(); DoStartNoMovement(m_creature->getVictim()); - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_DEAD); + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD); SummonEgg = 2; Cycle_Timer = 1000; } diff --git a/src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp b/src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp index 811a3decce6..4f59befd664 100644 --- a/src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp +++ b/src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp @@ -60,7 +60,7 @@ struct TRINITY_DLL_DECL mob_unkor_the_ruthlessAI : public ScriptedAI CanDoQuest = false; UnkorUnfriendly_Timer = 0; Pulverize_Timer = 3000; - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_NONE); + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_STAND); m_creature->setFaction(FACTION_HOSTILE); } @@ -70,7 +70,7 @@ struct TRINITY_DLL_DECL mob_unkor_the_ruthlessAI : public ScriptedAI { DoScriptText(SAY_SUBMIT, m_creature); m_creature->setFaction(FACTION_FRIENDLY); - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, PLAYER_STATE_SIT); + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_SIT); m_creature->RemoveAllAuras(); m_creature->DeleteThreatList(); m_creature->CombatStop(); diff --git a/src/bindings/scripts/scripts/zone/zulaman/boss_zuljin.cpp b/src/bindings/scripts/scripts/zone/zulaman/boss_zuljin.cpp index 0897f584a90..42aaf0fdf56 100644 --- a/src/bindings/scripts/scripts/zone/zulaman/boss_zuljin.cpp +++ b/src/bindings/scripts/scripts/zone/zulaman/boss_zuljin.cpp @@ -253,7 +253,7 @@ struct TRINITY_DLL_DECL boss_zuljinAI : public ScriptedAI Summons.DespawnEntry(CREATURE_COLUMN_OF_FIRE); if(Unit *Temp = Unit::GetUnit(*m_creature, SpiritGUID[3])) - Temp->SetUInt32Value(UNIT_FIELD_BYTES_1,PLAYER_STATE_DEAD); + Temp->SetUInt32Value(UNIT_FIELD_BYTES_1,UNIT_STAND_STATE_DEAD); } void AttackStart(Unit *who) @@ -349,7 +349,7 @@ struct TRINITY_DLL_DECL boss_zuljinAI : public ScriptedAI if(Phase > 0) { if(Unit *Temp = Unit::GetUnit(*m_creature, SpiritGUID[Phase - 1])) - Temp->SetUInt32Value(UNIT_FIELD_BYTES_1,PLAYER_STATE_DEAD); + Temp->SetUInt32Value(UNIT_FIELD_BYTES_1,UNIT_STAND_STATE_DEAD); } if(Unit *Temp = Unit::GetUnit(*m_creature, SpiritGUID[NextPhase - 1])) Temp->CastSpell(m_creature, SPELL_SIPHON_SOUL, false); // should m cast on temp diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp index 99fe5f725bc..58ffb787a15 100644 --- a/src/game/GameObject.cpp +++ b/src/game/GameObject.cpp @@ -969,7 +969,7 @@ void GameObject::Use(Unit* user) // fallback, will always work player->TeleportTo(GetMapId(), GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation(),TELE_TO_NOT_LEAVE_TRANSPORT | TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET); } - player->SetStandState(PLAYER_STATE_SIT_LOW_CHAIR+info->chair.height); + player->SetStandState(UNIT_STAND_STATE_SIT_LOW_CHAIR+info->chair.height); return; } //big gun, its a spell/aura @@ -1280,7 +1280,7 @@ void GameObject::Use(Unit* user) WorldPacket data(SMSG_ENABLE_BARBER_SHOP, 0); player->GetSession()->SendPacket(&data); - player->SetStandState(PLAYER_STATE_SIT_LOW_CHAIR+info->barberChair.chairheight); + player->SetStandState(UNIT_STAND_STATE_SIT_LOW_CHAIR+info->barberChair.chairheight); return; } default: diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp index 255d8e5fd4d..eda08ebcd25 100644 --- a/src/game/MiscHandler.cpp +++ b/src/game/MiscHandler.cpp @@ -306,7 +306,7 @@ void WorldSession::HandleLogoutRequestOpcode( WorldPacket & /*recv_data*/ ) // not set flags if player can't free move to prevent lost state at logout cancel if(GetPlayer()->CanFreeMove()) { - GetPlayer()->SetStandState(PLAYER_STATE_SIT); + GetPlayer()->SetStandState(UNIT_STAND_STATE_SIT); WorldPacket data( SMSG_FORCE_MOVE_ROOT, (8+4) ); // guess size data.append(GetPlayer()->GetPackGUID()); @@ -346,7 +346,7 @@ void WorldSession::HandleLogoutCancelOpcode( WorldPacket & /*recv_data*/ ) SendPacket( &data ); //! Stand Up - GetPlayer()->SetStandState(PLAYER_STATE_NONE); + GetPlayer()->SetStandState(UNIT_STAND_STATE_STAND); //! DISABLE_ROTATE GetPlayer()->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 898299dc076..39220b87f75 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -5859,10 +5859,10 @@ void ObjectMgr::LoadGameobjectInfo() break; } case GAMEOBJECT_TYPE_CHAIR: //7 - if(goInfo->chair.height > 2) + if(goInfo->chair.height > (UNIT_STAND_STATE_SIT_HIGH_CHAIR-UNIT_STAND_STATE_SIT_LOW_CHAIR) ) { - sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data1=%u but correct chair height in range 0..2.", - id,goInfo->type,goInfo->chair.height); + sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data1=%u but correct chair height in range 0..%i.", + id,goInfo->type,goInfo->chair.height,UNIT_STAND_STATE_SIT_HIGH_CHAIR-UNIT_STAND_STATE_SIT_LOW_CHAIR); // prevent client and server unexpected work const_cast<GameObjectInfo*>(goInfo)->chair.height = 0; @@ -5957,6 +5957,16 @@ void ObjectMgr::LoadGameobjectInfo() } break; } + case GAMEOBJECT_TYPE_BARBER_CHAIR: //32 + if(goInfo->barberChair.chairheight > (UNIT_STAND_STATE_SIT_HIGH_CHAIR-UNIT_STAND_STATE_SIT_LOW_CHAIR) ) + { + sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data1=%u but correct chair height in range 0..%i.", + id,goInfo->type,goInfo->barberChair.chairheight,UNIT_STAND_STATE_SIT_HIGH_CHAIR-UNIT_STAND_STATE_SIT_LOW_CHAIR); + + // prevent client and server unexpected work + const_cast<GameObjectInfo*>(goInfo)->barberChair.chairheight = 0; + } + break; } } diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 7bf2deff3e8..63a06d79036 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -2487,7 +2487,7 @@ void Player::InitStatsForLevel(bool reapplyMods) // cleanup player flags (will be re-applied if need at aura load), to avoid have ghost flag without ghost aura, for example. RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_AFK | PLAYER_FLAGS_DND | PLAYER_FLAGS_GM | PLAYER_FLAGS_GHOST); - SetByteValue(UNIT_FIELD_BYTES_1, 2, 0x00); // one form stealth modified bytes + RemoveStandFlags(UNIT_STAND_FLAGS_ALL); // one form stealth modified bytes RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP | UNIT_BYTE2_FLAG_SANCTUARY); // restore if need some important flags @@ -3938,7 +3938,8 @@ void Player::BuildPlayerRepop() SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, (float)1.0); //see radius of death player? - SetByteValue(UNIT_FIELD_BYTES_1, 3, PLAYER_STATE_FLAG_ALWAYS_STAND); + // set and clear other + SetByteValue(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND); } void Player::SendDelayResponse(const uint32 ml_seconds) @@ -15888,9 +15889,9 @@ void Player::SaveToDB() uint32 tmp_displayid = GetDisplayId(); // Set player sit state to standing on save, also stealth and shifted form - SetByteValue(UNIT_FIELD_BYTES_1, 0, 0); // stand state + SetStandState(UNIT_STAND_STATE_STAND); // stand state + RemoveStandFlags(UNIT_STAND_FLAGS_ALL); // stand flags? SetByteValue(UNIT_FIELD_BYTES_2, 3, 0); // shapeshift - SetByteValue(UNIT_FIELD_BYTES_1, 3, 0); // stand flags? RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); SetDisplayId(GetNativeDisplayId()); diff --git a/src/game/Player.h b/src/game/Player.h index c6b99cefe70..8d6a486e3b8 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -376,52 +376,6 @@ enum DrunkenState DRUNKEN_SMASHED = 3 }; -enum PlayerStateType -{ - /* - PLAYER_STATE_DANCE - PLAYER_STATE_SLEEP - PLAYER_STATE_SIT - PLAYER_STATE_STAND - PLAYER_STATE_READYUNARMED - PLAYER_STATE_WORK - PLAYER_STATE_POINT(DNR) - PLAYER_STATE_NONE // not used or just no state, just standing there? - PLAYER_STATE_STUN - PLAYER_STATE_DEAD - PLAYER_STATE_KNEEL - PLAYER_STATE_USESTANDING - PLAYER_STATE_STUN_NOSHEATHE - PLAYER_STATE_USESTANDING_NOSHEATHE - PLAYER_STATE_WORK_NOSHEATHE - PLAYER_STATE_SPELLPRECAST - PLAYER_STATE_READYRIFLE - PLAYER_STATE_WORK_NOSHEATHE_MINING - PLAYER_STATE_WORK_NOSHEATHE_CHOPWOOD - PLAYER_STATE_AT_EASE - PLAYER_STATE_READY1H - PLAYER_STATE_SPELLKNEELSTART - PLAYER_STATE_SUBMERGED - */ - - PLAYER_STATE_NONE = 0, - PLAYER_STATE_SIT = 1, - PLAYER_STATE_SIT_CHAIR = 2, - PLAYER_STATE_SLEEP = 3, - PLAYER_STATE_SIT_LOW_CHAIR = 4, - PLAYER_STATE_SIT_MEDIUM_CHAIR = 5, - PLAYER_STATE_SIT_HIGH_CHAIR = 6, - PLAYER_STATE_DEAD = 7, - PLAYER_STATE_KNEEL = 8, - - PLAYER_STATE_FORM_ALL = 0x00FF0000, - - PLAYER_STATE_FLAG_ALWAYS_STAND = 0x01, // byte 4 - PLAYER_STATE_FLAG_CREEP = 0x02000000, - PLAYER_STATE_FLAG_UNTRACKABLE = 0x04000000, - PLAYER_STATE_FLAG_ALL = 0xFF000000, -}; - enum PlayerFlags { PLAYER_FLAGS_GROUP_LEADER = 0x00000001, diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index 51f6f1488fe..abd601e3851 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -1986,13 +1986,14 @@ enum CorpseDynFlags }; // Passive Spell codes explicit used in code -#define SPELL_ID_GENERIC_LEARN 483 -#define SPELL_ID_GENERIC_LEARN_PET 55884 // used for learning mounts and companions -#define SPELL_ID_PASSIVE_BATTLE_STANCE 2457 -#define SPELL_ID_PASSIVE_RESURRECTION_SICKNESS 15007 -#define SPELL_ID_WEAPON_SWITCH_COOLDOWN_1_5s 6119 -#define SPELL_ID_WEAPON_SWITCH_COOLDOWN_1_0s 6123 -#define SPELL_ID_AUTOSHOT 75 // used for checks in other spells interruption +#define SPELL_ID_GENERIC_LEARN 483 +#define SPELL_ID_GENERIC_LEARN_PET 55884 // used for learning mounts and companions +#define SPELL_ID_PASSIVE_BATTLE_STANCE 2457 +#define SPELL_ID_PASSIVE_RESURRECTION_SICKNESS 15007 +#define SPELL_ID_WEAPON_SWITCH_COOLDOWN_1_5s 6119 +#define SPELL_ID_WEAPON_SWITCH_COOLDOWN_1_0s 6123 +#define SPELL_ID_AUTOSHOT 75 // used for checks in other spells interruption +#define SPELL_ID_SHADOWMELD 58984 // used for check ignore stealth stance state enum WeatherType { diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 4f658bb1c08..ce5a70fb851 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -1033,7 +1033,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target) else if(m_customAttr & SPELL_ATTR_CU_AURA_CC) { if(!unit->IsStandState()) - unit->SetStandState(PLAYER_STATE_NONE); + unit->SetStandState(UNIT_STAND_STATE_STAND); } } } diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index fdb8fe316f5..bdff9779297 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -831,7 +831,7 @@ void Aura::_AddAura() { // Sitdown on apply aura req seated if (m_spellProto->AuraInterruptFlags & AURA_INTERRUPT_FLAG_NOT_SEATED && !m_target->IsSitState()) - m_target->SetStandState(PLAYER_STATE_SIT); + m_target->SetStandState(UNIT_STAND_STATE_SIT); // register aura diminishing on apply if (getDiminishGroup() != DIMINISHING_NONE ) @@ -3317,7 +3317,8 @@ void Aura::HandleModStealth(bool apply, bool Real) // only at real aura add if(Real) { - m_target->SetByteValue(UNIT_FIELD_BYTES_1, 2, 0x02); + if(GetId()!=SPELL_ID_SHADOWMELD) + m_target->SetStandFlags(UNIT_STAND_FLAGS_CREEP); if(m_target->GetTypeId()==TYPEID_PLAYER) m_target->SetFlag(PLAYER_FIELD_BYTES2, 0x2000); @@ -3338,7 +3339,8 @@ void Aura::HandleModStealth(bool apply, bool Real) // if last SPELL_AURA_MOD_STEALTH and no GM invisibility if(!m_target->HasAuraType(SPELL_AURA_MOD_STEALTH) && m_target->GetVisibility()!=VISIBILITY_OFF) { - m_target->SetByteValue(UNIT_FIELD_BYTES_1, 2, 0x00); + if(GetId()!=SPELL_ID_SHADOWMELD) + m_target->RemoveStandFlags(UNIT_STAND_FLAGS_CREEP); if(m_target->GetTypeId()==TYPEID_PLAYER) m_target->RemoveFlag(PLAYER_FIELD_BYTES2, 0x2000); @@ -5148,9 +5150,9 @@ void Aura::HandleAuraEmpathy(bool apply, bool Real) void Aura::HandleAuraUntrackable(bool apply, bool Real) { if(apply) - m_target->SetFlag(UNIT_FIELD_BYTES_1, PLAYER_STATE_FLAG_UNTRACKABLE); + m_target->SetByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_UNTRACKABLE); else - m_target->RemoveFlag(UNIT_FIELD_BYTES_1, PLAYER_STATE_FLAG_UNTRACKABLE); + m_target->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_UNTRACKABLE); } void Aura::HandleAuraModPacify(bool apply, bool Real) @@ -5320,7 +5322,7 @@ void Aura::HandleSpiritOfRedemption( bool apply, bool Real ) // set stand state (expected in this form) if(!m_target->IsStandState()) - m_target->SetStandState(PLAYER_STATE_NONE); + m_target->SetStandState(UNIT_STAND_STATE_STAND); } m_target->SetHealth(1); diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 5fd2fa69bc5..8573018ab47 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -9064,7 +9064,7 @@ void Unit::SetInCombatWith(Unit* enemy) void Unit::CombatStart(Unit* target) { if(!target->IsStandState()/* && !target->hasUnitState(UNIT_STAT_STUNNED)*/) - target->SetStandState(PLAYER_STATE_NONE); + target->SetStandState(UNIT_STAND_STATE_STAND); if(!target->isInCombat() && target->GetTypeId() != TYPEID_PLAYER && !((Creature*)target)->HasReactState(REACT_PASSIVE) && ((Creature*)target)->AI()) @@ -11214,15 +11214,16 @@ void Unit::SetConfused(bool apply, uint64 casterGUID, uint32 spellID) bool Unit::IsSitState() const { uint8 s = getStandState(); - return s == PLAYER_STATE_SIT_CHAIR || s == PLAYER_STATE_SIT_LOW_CHAIR || - s == PLAYER_STATE_SIT_MEDIUM_CHAIR || s == PLAYER_STATE_SIT_HIGH_CHAIR || - s == PLAYER_STATE_SIT; + return + s == UNIT_STAND_STATE_SIT_CHAIR || s == UNIT_STAND_STATE_SIT_LOW_CHAIR || + s == UNIT_STAND_STATE_SIT_MEDIUM_CHAIR || s == UNIT_STAND_STATE_SIT_HIGH_CHAIR || + s == UNIT_STAND_STATE_SIT; } bool Unit::IsStandState() const { uint8 s = getStandState(); - return !IsSitState() && s != PLAYER_STATE_SLEEP && s != PLAYER_STATE_KNEEL; + return !IsSitState() && s != UNIT_STAND_STATE_SLEEP && s != UNIT_STAND_STATE_KNEEL; } void Unit::SetStandState(uint8 state) diff --git a/src/game/Unit.h b/src/game/Unit.h index 08b1b8c2bf6..315f2c074a1 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -130,6 +130,35 @@ enum SpellFacingFlags #define BASE_MAXDAMAGE 2.0f #define BASE_ATTACK_TIME 2000 +// byte value (UNIT_FIELD_BYTES_1,0) +enum UnitStandStateType +{ + UNIT_STAND_STATE_STAND = 0, + UNIT_STAND_STATE_SIT = 1, + UNIT_STAND_STATE_SIT_CHAIR = 2, + UNIT_STAND_STATE_SLEEP = 3, + UNIT_STAND_STATE_SIT_LOW_CHAIR = 4, + UNIT_STAND_STATE_SIT_MEDIUM_CHAIR = 5, + UNIT_STAND_STATE_SIT_HIGH_CHAIR = 6, + UNIT_STAND_STATE_DEAD = 7, + UNIT_STAND_STATE_KNEEL = 8 +}; + +// byte flag value (UNIT_FIELD_BYTES_1,2) +enum UnitStandFlags +{ + UNIT_STAND_FLAGS_CREEP = 0x02, + UNIT_STAND_FLAGS_ALL = 0xFF +}; + +// byte flags value (UNIT_FIELD_BYTES_1,3) +enum UnitBytes1_Flags +{ + UNIT_BYTE1_FLAG_ALWAYS_STAND = 0x01, + UNIT_BYTE1_FLAG_UNTRACKABLE = 0x04, + UNIT_BYTE1_FLAG_ALL = 0xFF +}; + // high byte (3 from 0..3) of UNIT_FIELD_BYTES_2 enum ShapeshiftForm { @@ -937,6 +966,9 @@ class TRINITY_DLL_SPEC Unit : public WorldObject bool IsStandState() const; void SetStandState(uint8 state); + void SetStandFlags(uint8 flags) { SetByteFlag(UNIT_FIELD_BYTES_1, 2,flags); } + void RemoveStandFlags(uint8 flags) { RemoveByteFlag(UNIT_FIELD_BYTES_1, 2,flags); } + bool IsMounted() const { return HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_MOUNT ); } uint32 GetMountID() const { return GetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID); } void Mount(uint32 mount); diff --git a/src/shared/revision.h b/src/shared/revision.h deleted file mode 100644 index 207a60c8542..00000000000 --- a/src/shared/revision.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef __REVISION_H__ -#define __REVISION_H__ - #define _REVISION "1132" - #define _HASH "6db5380ccaad" - #define _REVISION_DATE "*" - #define _REVISION_TIME "*" -#endif // __REVISION_H__ diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 760e6b5108b..7735b97f656 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "7205" + #define REVISION_NR "7206" #endif // __REVISION_NR_H__ |