diff --git a/data/sql/updates/pending_db_world/rev_1669454417149643100.sql b/data/sql/updates/pending_db_world/rev_1669454417149643100.sql new file mode 100644 index 000000000..324acb44c --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1669454417149643100.sql @@ -0,0 +1,8 @@ +-- +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=30 AND `SourceEntry` IN (24753,22943); +INSERT INTO `conditions` VALUES +(30,0,24753,0,0,33,0,1,2,0,0,0,0,'','Pint-Sized Pink Pachyderm visible only if target is in party with its owner'), +(30,0,24753,0,1,10,0,2,0,0,0,0,0,'','Pint-Sized Pink Pachyderm visible only if target is drunk'), + +(30,0,22943,0,0,33,0,1,2,0,0,0,0,'','Pint-Sized Pink Pachyderm visible only if target is in party with its owner'), +(30,0,22943,0,1,10,0,2,0,0,0,0,0,'','Pint-Sized Pink Pachyderm visible only if target is drunk'); diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index c6e79b5bc..e246d2a30 100644 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -768,21 +768,24 @@ uint32 Condition::GetMaxAvailableConditionTargets() // returns number of targets which are available for given source type switch (SourceType) { - case CONDITION_SOURCE_TYPE_SMART_EVENT: - return 3; - case CONDITION_SOURCE_TYPE_SPELL: - case CONDITION_SOURCE_TYPE_SPELL_IMPLICIT_TARGET: - case CONDITION_SOURCE_TYPE_CREATURE_TEMPLATE_VEHICLE: - case CONDITION_SOURCE_TYPE_VEHICLE_SPELL: - case CONDITION_SOURCE_TYPE_SPELL_CLICK_EVENT: - case CONDITION_SOURCE_TYPE_GOSSIP_MENU: - case CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION: - case CONDITION_SOURCE_TYPE_NPC_VENDOR: - case CONDITION_SOURCE_TYPE_SPELL_PROC: - return 2; - default: - return 1; + case CONDITION_SOURCE_TYPE_SMART_EVENT: + return 3; + case CONDITION_SOURCE_TYPE_SPELL: + case CONDITION_SOURCE_TYPE_SPELL_IMPLICIT_TARGET: + case CONDITION_SOURCE_TYPE_CREATURE_TEMPLATE_VEHICLE: + case CONDITION_SOURCE_TYPE_VEHICLE_SPELL: + case CONDITION_SOURCE_TYPE_SPELL_CLICK_EVENT: + case CONDITION_SOURCE_TYPE_GOSSIP_MENU: + case CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION: + case CONDITION_SOURCE_TYPE_NPC_VENDOR: + case CONDITION_SOURCE_TYPE_SPELL_PROC: + case CONDITION_SOURCE_TYPE_CREATURE_VISIBILITY: + return 2; + default: + break; } + + return 1; } ConditionMgr::ConditionMgr() {} diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 45f001630..d44f10f2d 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -1737,7 +1737,7 @@ bool WorldObject::CanSeeOrDetect(WorldObject const* obj, bool ignoreStealth, boo // Creature scripts if (Creature const* cObj = obj->ToCreature()) { - if (Player const* player = this->ToPlayer()) + if (Player const* player = ToPlayer()) { if (cObj->IsAIEnabled && !cObj->AI()->CanBeSeen(player)) { @@ -1745,8 +1745,7 @@ bool WorldObject::CanSeeOrDetect(WorldObject const* obj, bool ignoreStealth, boo } ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_CREATURE_VISIBILITY, cObj->GetEntry()); - - if (!sConditionMgr->IsObjectMeetToConditions((WorldObject*)this, conditions)) + if (!sConditionMgr->IsObjectMeetToConditions((WorldObject*)this, (WorldObject*)obj, conditions)) { return false; } @@ -1755,8 +1754,12 @@ bool WorldObject::CanSeeOrDetect(WorldObject const* obj, bool ignoreStealth, boo // Gameobject scripts if (GameObject const* goObj = obj->ToGameObject()) - if (this->ToPlayer() && !goObj->AI()->CanBeSeen(this->ToPlayer())) + { + if (ToPlayer() && !goObj->AI()->CanBeSeen(ToPlayer())) + { return false; + } + } // pussywizard: arena spectator if (obj->GetTypeId() == TYPEID_PLAYER)