Fixed appearance validation
Implemented proper facial hair validation Implemented transmog Set fix interaction of spells like Shadowmeld with Threat reducing effects
This commit is contained in:
@@ -216,7 +216,7 @@ namespace Game
|
||||
uint auctionTime = (uint)(packet.RunTime * WorldConfig.GetFloatValue(WorldCfg.RateAuctionTime));
|
||||
AuctionHouseObject auctionHouse = Global.AuctionMgr.GetAuctionsMap(creature.getFaction());
|
||||
|
||||
uint deposit = Global.AuctionMgr.GetAuctionDeposit(auctionHouseEntry, packet.RunTime, item, finalCount);
|
||||
ulong deposit = Global.AuctionMgr.GetAuctionDeposit(auctionHouseEntry, packet.RunTime, item, finalCount);
|
||||
if (!GetPlayer().HasEnoughMoney(deposit))
|
||||
{
|
||||
SendAuctionCommandResult(null, AuctionAction.SellItem, AuctionError.NotEnoughtMoney);
|
||||
@@ -345,7 +345,7 @@ namespace Game
|
||||
GetPlayer().UpdateCriteria(CriteriaTypes.CreateAuction, 1);
|
||||
}
|
||||
|
||||
GetPlayer().ModifyMoney(-deposit);
|
||||
GetPlayer().ModifyMoney(-(long)deposit);
|
||||
}
|
||||
|
||||
[WorldPacketHandler(ClientOpcodes.AuctionPlaceBid)]
|
||||
@@ -445,10 +445,10 @@ namespace Game
|
||||
{
|
||||
//buyout:
|
||||
if (player.GetGUID().GetCounter() == auction.bidder)
|
||||
player.ModifyMoney(-auction.buyout - auction.bid);
|
||||
player.ModifyMoney(-(long)(auction.buyout - auction.bid));
|
||||
else
|
||||
{
|
||||
player.ModifyMoney(-auction.buyout);
|
||||
player.ModifyMoney(-(long)auction.buyout);
|
||||
if (auction.bidder != 0) //buyout for bidded auction ..
|
||||
Global.AuctionMgr.SendAuctionOutbiddedMail(auction, auction.buyout, GetPlayer(), trans);
|
||||
}
|
||||
@@ -500,11 +500,11 @@ namespace Game
|
||||
{
|
||||
if (auction.bidder > 0) // If we have a bidder, we have to send him the money he paid
|
||||
{
|
||||
uint auctionCut = auction.GetAuctionCut();
|
||||
ulong auctionCut = auction.GetAuctionCut();
|
||||
if (!player.HasEnoughMoney(auctionCut)) //player doesn't have enough money, maybe message needed
|
||||
return;
|
||||
Global.AuctionMgr.SendAuctionCancelledToBidderMail(auction, trans);
|
||||
player.ModifyMoney(-auctionCut);
|
||||
player.ModifyMoney(-(long)auctionCut);
|
||||
}
|
||||
|
||||
// item will deleted or added to received mail list
|
||||
|
||||
@@ -2451,6 +2451,14 @@ namespace Game
|
||||
stmt.AddValue(0, lowGuid);
|
||||
SetQuery(PlayerLoginQueryLoad.QuestStatusObjectives, stmt);
|
||||
|
||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_QUESTSTATUS_OBJECTIVES_CRITERIA);
|
||||
stmt.AddValue(0, lowGuid);
|
||||
SetQuery(PlayerLoginQueryLoad.QuestStatusObjectivesCriteria, stmt);
|
||||
|
||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_QUESTSTATUS_OBJECTIVES_CRITERIA_PROGRESS);
|
||||
stmt.AddValue(0, lowGuid);
|
||||
SetQuery(PlayerLoginQueryLoad.QuestStatusObjectivesCriteriaProgress, stmt);
|
||||
|
||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_QUESTSTATUS_DAILY);
|
||||
stmt.AddValue(0, lowGuid);
|
||||
SetQuery(PlayerLoginQueryLoad.DailyQuestStatus, stmt);
|
||||
@@ -2631,6 +2639,8 @@ namespace Game
|
||||
Spells,
|
||||
QuestStatus,
|
||||
QuestStatusObjectives,
|
||||
QuestStatusObjectivesCriteria,
|
||||
QuestStatusObjectivesCriteriaProgress,
|
||||
DailyQuestStatus,
|
||||
Reputation,
|
||||
Inventory,
|
||||
|
||||
@@ -437,6 +437,16 @@ namespace Game
|
||||
{
|
||||
if (pProto.GetSellPrice() > 0)
|
||||
{
|
||||
ulong money = pProto.GetSellPrice() * packet.Amount;
|
||||
|
||||
if (!_player.ModifyMoney((long)money)) // ensure player doesn't exceed gold limit
|
||||
{
|
||||
_player.SendSellError(SellResult.CantSellItem, creature, packet.ItemGUID);
|
||||
return;
|
||||
}
|
||||
|
||||
_player.UpdateCriteria(CriteriaTypes.MoneyFromVendors, money);
|
||||
|
||||
if (packet.Amount < pItem.GetCount()) // need split items
|
||||
{
|
||||
Item pNewItem = pItem.CloneItem(packet.Amount, pl);
|
||||
@@ -464,10 +474,6 @@ namespace Game
|
||||
Item.RemoveItemFromUpdateQueueOf(pItem, pl);
|
||||
pl.AddItemToBuyBackSlot(pItem);
|
||||
}
|
||||
|
||||
uint money = pProto.GetSellPrice() * packet.Amount;
|
||||
pl.ModifyMoney(money);
|
||||
pl.UpdateCriteria(CriteriaTypes.MoneyFromVendors, money);
|
||||
}
|
||||
else
|
||||
pl.SendSellError(SellResult.CantSellItem, creature, packet.ItemGUID);
|
||||
|
||||
@@ -288,6 +288,7 @@ namespace Game
|
||||
|
||||
item.DeleteFromInventoryDB(trans); // deletes item from character's inventory
|
||||
item.SetOwnerGUID(receiverGuid);
|
||||
item.SetState(ItemUpdateState.Changed);
|
||||
item.SaveToDB(trans); // recursive and not have transaction guard into self, item not in inventory and can be save standalone
|
||||
|
||||
draft.AddItem(item);
|
||||
@@ -494,7 +495,7 @@ namespace Game
|
||||
.SendMailTo(trans, new MailReceiver(receiver, m.sender), new MailSender( MailMessageType.Normal, m.receiver), MailCheckMask.CodPayment);
|
||||
}
|
||||
|
||||
player.ModifyMoney(-(int)m.COD);
|
||||
player.ModifyMoney(-(long)m.COD);
|
||||
}
|
||||
m.COD = 0;
|
||||
m.state = MailState.Changed;
|
||||
|
||||
+15
-11
@@ -56,18 +56,22 @@ namespace Game
|
||||
[WorldPacketHandler(ClientOpcodes.TrainerList)]
|
||||
void HandleTrainerList(Hello packet)
|
||||
{
|
||||
Log.outInfo(LogFilter.Network, $"{GetPlayerInfo()} sent legacy gossipless trainer hello for unit {packet.Unit.ToString()}, no trainer list available");
|
||||
}
|
||||
|
||||
public void SendTrainerList(ObjectGuid guid, uint trainerId)
|
||||
{
|
||||
Creature unit = GetPlayer().GetNPCIfCanInteractWith(guid, NPCFlags.Trainer);
|
||||
if (unit == null)
|
||||
Creature npc = GetPlayer().GetNPCIfCanInteractWith(packet.Unit, NPCFlags.Trainer);
|
||||
if (!npc)
|
||||
{
|
||||
Log.outDebug(LogFilter.Network, $"WORLD: SendTrainerList - {guid.ToString()} not found or you can not interact with him.");
|
||||
Log.outDebug(LogFilter.Network, $"WorldSession.SendTrainerList - {packet.Unit.ToString()} not found or you can not interact with him.");
|
||||
return;
|
||||
}
|
||||
|
||||
uint trainerId = Global.ObjectMgr.GetCreatureDefaultTrainer(npc.GetEntry());
|
||||
if (trainerId != 0)
|
||||
SendTrainerList(npc, trainerId);
|
||||
else
|
||||
Log.outDebug(LogFilter.Network, $"WorldSession.SendTrainerList - Creature id {npc.GetEntry()} has no trainer data.");
|
||||
}
|
||||
|
||||
public void SendTrainerList(Creature npc, uint trainerId)
|
||||
{
|
||||
// remove fake death
|
||||
if (GetPlayer().HasUnitState(UnitState.Died))
|
||||
GetPlayer().RemoveAurasByType(AuraType.FeignDeath);
|
||||
@@ -75,14 +79,14 @@ namespace Game
|
||||
Trainer trainer = Global.ObjectMgr.GetTrainer(trainerId);
|
||||
if (trainer == null)
|
||||
{
|
||||
Log.outDebug(LogFilter.Network, $"WORLD: SendTrainerList - trainer spells not found for trainer {guid.ToString()} id {trainerId}");
|
||||
Log.outDebug(LogFilter.Network, $"WORLD: SendTrainerList - trainer spells not found for trainer {npc.GetGUID().ToString()} id {trainerId}");
|
||||
return;
|
||||
}
|
||||
|
||||
_player.PlayerTalkClass.GetInteractionData().Reset();
|
||||
_player.PlayerTalkClass.GetInteractionData().SourceGuid = guid;
|
||||
_player.PlayerTalkClass.GetInteractionData().SourceGuid = npc.GetGUID();
|
||||
_player.PlayerTalkClass.GetInteractionData().TrainerId = trainerId;
|
||||
trainer.SendSpells(unit, _player, GetSessionDbLocaleIndex());
|
||||
trainer.SendSpells(npc, _player, GetSessionDbLocaleIndex());
|
||||
}
|
||||
|
||||
[WorldPacketHandler(ClientOpcodes.TrainerBuySpell)]
|
||||
|
||||
Reference in New Issue
Block a user