fix(DB/Conditions): Pint-Sized Pink Pachyderm and Wolpertinger should… (#13946)

fix(DB/Conditions): Pint-Sized Pink Pachyderm and Wolpertinger should be visible only to party members or drunk players.

Fixes #13900
This commit is contained in:
UltraNix
2022-12-06 16:47:43 +01:00
committed by GitHub
parent d32daab969
commit 003bd93666
3 changed files with 32 additions and 18 deletions

View File

@@ -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');

View File

@@ -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() {}

View File

@@ -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)