mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[11563] Add support mailbox access for npc with CREATURE_TYPEFLAGS_SQUIRE
This commit is contained in:
parent
e0c92f50f4
commit
3c0ca51db3
3 changed files with 26 additions and 4 deletions
|
|
@ -51,11 +51,33 @@ bool WorldSession::CheckMailBox(ObjectGuid guid)
|
|||
}
|
||||
}
|
||||
// mailbox case
|
||||
else
|
||||
else if (guid.IsGameObject())
|
||||
{
|
||||
if (!GetPlayer()->GetGameObjectIfCanInteractWith(guid, GAMEOBJECT_TYPE_MAILBOX))
|
||||
{
|
||||
DEBUG_LOG("Mailbox %s not found or you can't interact with him.", guid.GetString().c_str());
|
||||
DEBUG_LOG("Mailbox %s not found or %s can't interact with him.", guid.GetString().c_str(), GetPlayer()->GetGuidStr().c_str());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// squire case
|
||||
else if (guid.IsAnyTypeCreature())
|
||||
{
|
||||
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_NONE);
|
||||
if (!creature)
|
||||
{
|
||||
DEBUG_LOG("%s not found or %s can't interact with him.", creature->GetGuidStr().c_str(), GetPlayer()->GetGuidStr().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(creature->GetCreatureInfo()->type_flags & CREATURE_TYPEFLAGS_SQUIRE))
|
||||
{
|
||||
DEBUG_LOG("%s not have access to mailbox.", creature->GetGuidStr().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
if (creature->GetOwnerGuid() != GetPlayer()->GetObjectGuid())
|
||||
{
|
||||
DEBUG_LOG("%s not owned by %s for access to mailbox.", creature->GetGuidStr().c_str(), GetPlayer()->GetGuidStr().c_str());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1994,7 +1994,7 @@ enum CreatureTypeFlags
|
|||
CREATURE_TYPEFLAGS_UNK21 = 0x00100000, // no idea, but it used by client, may be related to rendering
|
||||
CREATURE_TYPEFLAGS_UNK22 = 0x00200000, // may be has something to do with animation (disable animation?)
|
||||
CREATURE_TYPEFLAGS_UNK23 = 0x00400000, // this one probably controls some creature visual
|
||||
CREATURE_TYPEFLAGS_UNK24 = 0x00800000, // ? First seen in 3.2.2. Related to banner/backpack of creature/companion, used in CanInteract function by client
|
||||
CREATURE_TYPEFLAGS_SQUIRE = 0x00800000, // First seen in 3.2.2. Related to banner/backpack of creature/companion, used in CanInteract function by client
|
||||
CREATURE_TYPEFLAGS_UNK25 = 0x01000000, // pet sounds related?
|
||||
CREATURE_TYPEFLAGS_UNK26 = 0x02000000, // this one probably controls some creature visual
|
||||
CREATURE_TYPEFLAGS_UNK27 = 0x04000000, // creature has no type, or forces creature to be considered as in party, may be related to creature assistance
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "11562"
|
||||
#define REVISION_NR "11563"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue