@@ -5369,11 +5369,11 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp)
|
||||
m->checked = fields[7].GetUInt32();
|
||||
m->mailTemplateId = fields[8].GetInt16();
|
||||
|
||||
Player* pl = NULL;
|
||||
Player* player = NULL;
|
||||
if (serverUp)
|
||||
pl = ObjectAccessor::FindPlayer((uint64)m->receiver);
|
||||
player = ObjectAccessor::FindPlayer((uint64)m->receiver);
|
||||
|
||||
if (pl && pl->m_mailsLoaded)
|
||||
if (player && player->m_mailsLoaded)
|
||||
{ // this code will run very improbably (the time is between 4 and 5 am, in game is online a player, who has old mail
|
||||
// his in mailbox and he has already listed his mails)
|
||||
delete m;
|
||||
@@ -8490,13 +8490,13 @@ bool ObjectMgr::RemoveVendorItem(uint32 entry, uint32 item, bool savetodb)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 maxcount, uint32 incrtime, uint32 ExtendedCost, Player* pl, std::set<uint32>* skip_vendors, uint32 ORnpcflag) const
|
||||
bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 maxcount, uint32 incrtime, uint32 ExtendedCost, Player* player, std::set<uint32>* skip_vendors, uint32 ORnpcflag) const
|
||||
{
|
||||
CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(vendor_entry);
|
||||
if (!cInfo)
|
||||
{
|
||||
if (pl)
|
||||
ChatHandler(pl).SendSysMessage(LANG_COMMAND_VENDORSELECTION);
|
||||
if (player)
|
||||
ChatHandler(player).SendSysMessage(LANG_COMMAND_VENDORSELECTION);
|
||||
else
|
||||
sLog->outErrorDb("Table `(game_event_)npc_vendor` have data for not existed creature template (Entry: %u), ignore", vendor_entry);
|
||||
return false;
|
||||
@@ -8506,8 +8506,8 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max
|
||||
{
|
||||
if (!skip_vendors || skip_vendors->count(vendor_entry) == 0)
|
||||
{
|
||||
if (pl)
|
||||
ChatHandler(pl).SendSysMessage(LANG_COMMAND_VENDORSELECTION);
|
||||
if (player)
|
||||
ChatHandler(player).SendSysMessage(LANG_COMMAND_VENDORSELECTION);
|
||||
else
|
||||
sLog->outErrorDb("Table `(game_event_)npc_vendor` have data for not creature template (Entry: %u) without vendor flag, ignore", vendor_entry);
|
||||
|
||||
@@ -8519,8 +8519,8 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max
|
||||
|
||||
if (!sObjectMgr->GetItemTemplate(item_id))
|
||||
{
|
||||
if (pl)
|
||||
ChatHandler(pl).PSendSysMessage(LANG_ITEM_NOT_FOUND, item_id);
|
||||
if (player)
|
||||
ChatHandler(player).PSendSysMessage(LANG_ITEM_NOT_FOUND, item_id);
|
||||
else
|
||||
sLog->outErrorDb("Table `(game_event_)npc_vendor` for Vendor (Entry: %u) have in item list non-existed item (%u), ignore", vendor_entry, item_id);
|
||||
return false;
|
||||
@@ -8528,8 +8528,8 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max
|
||||
|
||||
if (ExtendedCost && !sItemExtendedCostStore.LookupEntry(ExtendedCost))
|
||||
{
|
||||
if (pl)
|
||||
ChatHandler(pl).PSendSysMessage(LANG_EXTENDED_COST_NOT_EXIST, ExtendedCost);
|
||||
if (player)
|
||||
ChatHandler(player).PSendSysMessage(LANG_EXTENDED_COST_NOT_EXIST, ExtendedCost);
|
||||
else
|
||||
sLog->outErrorDb("Table `(game_event_)npc_vendor` have Item (Entry: %u) with wrong ExtendedCost (%u) for vendor (%u), ignore", item_id, ExtendedCost, vendor_entry);
|
||||
return false;
|
||||
@@ -8537,16 +8537,16 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max
|
||||
|
||||
if (maxcount > 0 && incrtime == 0)
|
||||
{
|
||||
if (pl)
|
||||
ChatHandler(pl).PSendSysMessage("MaxCount != 0 (%u) but IncrTime == 0", maxcount);
|
||||
if (player)
|
||||
ChatHandler(player).PSendSysMessage("MaxCount != 0 (%u) but IncrTime == 0", maxcount);
|
||||
else
|
||||
sLog->outErrorDb("Table `(game_event_)npc_vendor` has `maxcount` (%u) for item %u of vendor (Entry: %u) but `incrtime`=0, ignore", maxcount, item_id, vendor_entry);
|
||||
return false;
|
||||
}
|
||||
else if (maxcount == 0 && incrtime > 0)
|
||||
{
|
||||
if (pl)
|
||||
ChatHandler(pl).PSendSysMessage("MaxCount == 0 but IncrTime<>= 0");
|
||||
if (player)
|
||||
ChatHandler(player).PSendSysMessage("MaxCount == 0 but IncrTime<>= 0");
|
||||
else
|
||||
sLog->outErrorDb("Table `(game_event_)npc_vendor` has `maxcount`=0 for item %u of vendor (Entry: %u) but `incrtime`<>0, ignore", item_id, vendor_entry);
|
||||
return false;
|
||||
@@ -8558,8 +8558,8 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max
|
||||
|
||||
if (vItems->FindItemCostPair(item_id, ExtendedCost))
|
||||
{
|
||||
if (pl)
|
||||
ChatHandler(pl).PSendSysMessage(LANG_ITEM_ALREADY_IN_LIST, item_id, ExtendedCost);
|
||||
if (player)
|
||||
ChatHandler(player).PSendSysMessage(LANG_ITEM_ALREADY_IN_LIST, item_id, ExtendedCost);
|
||||
else
|
||||
sLog->outErrorDb("Table `npc_vendor` has duplicate items %u (with extended cost %u) for vendor (Entry: %u), ignoring", item_id, ExtendedCost, vendor_entry);
|
||||
return false;
|
||||
@@ -8567,8 +8567,8 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max
|
||||
|
||||
if (vItems->GetItemCount() >= MAX_VENDOR_ITEMS)
|
||||
{
|
||||
if (pl)
|
||||
ChatHandler(pl).SendSysMessage(LANG_COMMAND_ADDVENDORITEMITEMS);
|
||||
if (player)
|
||||
ChatHandler(player).SendSysMessage(LANG_COMMAND_ADDVENDORITEMITEMS);
|
||||
else
|
||||
sLog->outErrorDb("Table `npc_vendor` has too many items (%u >= %i) for vendor (Entry: %u), ignore", vItems->GetItemCount(), MAX_VENDOR_ITEMS, vendor_entry);
|
||||
return false;
|
||||
|
||||
@@ -1140,7 +1140,7 @@ class ObjectMgr
|
||||
}
|
||||
void AddVendorItem(uint32 entry, uint32 item, int32 maxcount, uint32 incrtime, uint32 ExtendedCost, bool savetodb = true); // for event
|
||||
bool RemoveVendorItem(uint32 entry, uint32 item, bool savetodb = true); // for event
|
||||
bool IsVendorItemValid(uint32 vendor_entry, uint32 item, int32 maxcount, uint32 ptime, uint32 ExtendedCost, Player* pl = NULL, std::set<uint32>* skip_vendors = NULL, uint32 ORnpcflag = 0) const;
|
||||
bool IsVendorItemValid(uint32 vendor_entry, uint32 item, int32 maxcount, uint32 ptime, uint32 ExtendedCost, Player* player = NULL, std::set<uint32>* skip_vendors = NULL, uint32 ORnpcflag = 0) const;
|
||||
|
||||
void LoadScriptNames();
|
||||
ScriptNameMap &GetScriptNames() { return m_scriptNames; }
|
||||
|
||||
Reference in New Issue
Block a user