Core/Creatures: implement CREATURE_FLAG_EXTRA_NO_SELL_VENDOR
Port From (https://github.com/TrinityCore/TrinityCore/commit/f8dda8a4fc696d07bb6007e49140cec1b7f60dd5)
This commit is contained in:
@@ -212,7 +212,7 @@ namespace Framework.Constants
|
||||
NoMoveFlagsUpdate = 0x200, // Creature won't update movement flags
|
||||
GhostVisibility = 0x400, // creature will be only visible for dead players
|
||||
UseOffhandAttack = 0x800, // creature will use offhand attacks
|
||||
Unused12 = 0x1000,
|
||||
NoSellVendor = 0x1000, // players can't sell items to this vendor
|
||||
Unused13 = 0x2000,
|
||||
Worldevent = 0x4000, // Custom Flag For World Event Creatures (Left Room For Merging)
|
||||
Guard = 0x8000, // Creature Is Guard
|
||||
@@ -234,7 +234,7 @@ namespace Framework.Constants
|
||||
Unused31 = 0x80000000,
|
||||
|
||||
// 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))
|
||||
}
|
||||
|
||||
@@ -1144,12 +1144,13 @@ namespace Framework.Constants
|
||||
|
||||
public enum SellResult
|
||||
{
|
||||
CantFindItem = 1,
|
||||
CantSellItem = 2, // Merchant Doesn'T Like That Item
|
||||
CantFindVendor = 3, // Merchant Doesn'T Like You
|
||||
YouDontOwnThatItem = 4, // You Don'T Own That Item
|
||||
CantFindItem = 1, // The item was not found.
|
||||
CantSellItem = 2, // The merchant doesn't want that item.
|
||||
CantFindVendor = 3, // The merchant doesn't like you.
|
||||
YouDontOwnThatItem = 4, // You don't own that item.
|
||||
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
|
||||
|
||||
@@ -390,6 +390,12 @@ namespace Game
|
||||
return;
|
||||
}
|
||||
|
||||
if (creature.GetCreatureTemplate().FlagsExtra.HasFlag(CreatureFlagsExtra.NoSellVendor))
|
||||
{
|
||||
_player.SendSellError(SellResult.CantSellToThisMerchant, creature, packet.ItemGUID);
|
||||
return;
|
||||
}
|
||||
|
||||
// remove fake death
|
||||
if (pl.HasUnitState(UnitState.Died))
|
||||
pl.RemoveAurasByType(AuraType.FeignDeath);
|
||||
|
||||
Reference in New Issue
Block a user