Core/Creatures: implement CREATURE_FLAG_EXTRA_NO_SELL_VENDOR

Port From (https://github.com/TrinityCore/TrinityCore/commit/f8dda8a4fc696d07bb6007e49140cec1b7f60dd5)
This commit is contained in:
hondacrx
2021-09-21 20:04:54 -04:00
parent d771b5c9f6
commit 2b08c49bbf
3 changed files with 14 additions and 7 deletions
+2 -2
View File
@@ -212,7 +212,7 @@ namespace Framework.Constants
NoMoveFlagsUpdate = 0x200, // Creature won't update movement flags NoMoveFlagsUpdate = 0x200, // Creature won't update movement flags
GhostVisibility = 0x400, // creature will be only visible for dead players GhostVisibility = 0x400, // creature will be only visible for dead players
UseOffhandAttack = 0x800, // creature will use offhand attacks UseOffhandAttack = 0x800, // creature will use offhand attacks
Unused12 = 0x1000, NoSellVendor = 0x1000, // players can't sell items to this vendor
Unused13 = 0x2000, Unused13 = 0x2000,
Worldevent = 0x4000, // Custom Flag For World Event Creatures (Left Room For Merging) Worldevent = 0x4000, // Custom Flag For World Event Creatures (Left Room For Merging)
Guard = 0x8000, // Creature Is Guard Guard = 0x8000, // Creature Is Guard
@@ -234,7 +234,7 @@ namespace Framework.Constants
Unused31 = 0x80000000, Unused31 = 0x80000000,
// Masks // Masks
AllUnused = (Unused12 | Unused13 | Unused16 | Unused22 | Unused23 | Unused24 | Unused25 | Unused26 | Unused27 | Unused31), AllUnused = (Unused13 | Unused16 | Unused22 | Unused23 | Unused24 | Unused25 | Unused26 | Unused27 | Unused31),
DBAllowed = (0xFFFFFFFF & ~(AllUnused | DungeonBoss)) DBAllowed = (0xFFFFFFFF & ~(AllUnused | DungeonBoss))
} }
+6 -5
View File
@@ -1144,12 +1144,13 @@ namespace Framework.Constants
public enum SellResult public enum SellResult
{ {
CantFindItem = 1, CantFindItem = 1, // The item was not found.
CantSellItem = 2, // Merchant Doesn'T Like That Item CantSellItem = 2, // The merchant doesn't want that item.
CantFindVendor = 3, // Merchant Doesn'T Like You CantFindVendor = 3, // The merchant doesn't like you.
YouDontOwnThatItem = 4, // You Don'T Own That Item YouDontOwnThatItem = 4, // You don't own that item.
Unk = 5, // Nothing Appears... Unk = 5, // Nothing Appears...
OnlyEmptyBag = 6 // Can Only Do With Empty Bags OnlyEmptyBag = 6, // You can only do that with empty bags.
CantSellToThisMerchant = 7 // You cannot sell items to this merchant.
} }
public enum EnchantmentSlot public enum EnchantmentSlot
+6
View File
@@ -390,6 +390,12 @@ namespace Game
return; return;
} }
if (creature.GetCreatureTemplate().FlagsExtra.HasFlag(CreatureFlagsExtra.NoSellVendor))
{
_player.SendSellError(SellResult.CantSellToThisMerchant, creature, packet.ItemGUID);
return;
}
// remove fake death // remove fake death
if (pl.HasUnitState(UnitState.Died)) if (pl.HasUnitState(UnitState.Died))
pl.RemoveAurasByType(AuraType.FeignDeath); pl.RemoveAurasByType(AuraType.FeignDeath);