diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/DataStores/DBCStores.cpp | 2 | ||||
-rw-r--r-- | src/server/game/Handlers/AuctionHouseHandler.cpp | 225 | ||||
-rw-r--r-- | src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp | 170 | ||||
-rw-r--r-- | src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp | 2 | ||||
-rw-r--r-- | src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp | 3 | ||||
-rw-r--r-- | src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp | 11 | ||||
-rw-r--r-- | src/server/shared/Cryptography/SHA1.cpp | 1 | ||||
-rw-r--r-- | src/server/shared/Database/Field.cpp | 1 | ||||
-rw-r--r-- | src/server/shared/Database/MySQLConnection.cpp | 2 | ||||
-rw-r--r-- | src/server/shared/Database/PreparedStatement.cpp | 1 | ||||
-rw-r--r-- | src/server/shared/Threading/Callback.h | 2 | ||||
-rw-r--r-- | src/server/worldserver/TCSoap/TCSoap.h | 2 |
12 files changed, 221 insertions, 201 deletions
diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index ebe3792420b..a00698bc527 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -902,7 +902,7 @@ LFGDungeonEntry const* GetLFGDungeon(uint32 mapId, Difficulty difficulty) if (!dungeon) continue; - if (dungeon->map == (int)mapId && Difficulty(dungeon->difficulty) == difficulty) + if (dungeon->map == int32(mapId) && Difficulty(dungeon->difficulty) == difficulty) return dungeon; } diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp index cd914951ae8..6f44b867c4b 100644 --- a/src/server/game/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Handlers/AuctionHouseHandler.cpp @@ -230,140 +230,137 @@ void WorldSession::HandleAuctionSellItem(WorldPacket& recvData) } } - for (uint32 i = 0; i < itemsCount; ++i) + Item* item = items[0]; + + uint32 auctionTime = uint32(etime * sWorld->getRate(RATE_AUCTION_TIME)); + AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction()); + + uint32 deposit = sAuctionMgr->GetAuctionDeposit(auctionHouseEntry, etime, item, finalCount); + if (!_player->HasEnoughMoney(deposit)) { - Item* item = items[i]; + SendAuctionCommandResult(0, AUCTION_SELL_ITEM, ERR_AUCTION_NOT_ENOUGHT_MONEY); + return; + } - uint32 auctionTime = uint32(etime * sWorld->getRate(RATE_AUCTION_TIME)); - AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction()); + AuctionEntry* AH = new AuctionEntry(); + + if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION)) + AH->auctioneer = 23442; ///@TODO - HARDCODED DB GUID, BAD BAD BAD + else + AH->auctioneer = GUID_LOPART(auctioneer); - uint32 deposit = sAuctionMgr->GetAuctionDeposit(auctionHouseEntry, etime, item, finalCount); - if (!_player->HasEnoughMoney(deposit)) + // Required stack size of auction matches to current item stack size, just move item to auctionhouse + if (itemsCount == 1 && item->GetCount() == count[0]) + { + if (HasPermission(RBAC_PERM_LOG_GM_TRADE)) { - SendAuctionCommandResult(0, AUCTION_SELL_ITEM, ERR_AUCTION_NOT_ENOUGHT_MONEY); - return; + sLog->outCommand(GetAccountId(), "GM %s (Account: %u) create auction: %s (Entry: %u Count: %u)", + GetPlayerName().c_str(), GetAccountId(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetCount()); } - _player->ModifyMoney(-int32(deposit)); - - AuctionEntry* AH = new AuctionEntry; AH->Id = sObjectMgr->GenerateAuctionID(); - - if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION)) - AH->auctioneer = 23442; - else - AH->auctioneer = GUID_LOPART(auctioneer); - - // Required stack size of auction matches to current item stack size, just move item to auctionhouse - if (itemsCount == 1 && item->GetCount() == count[i]) + AH->itemGUIDLow = item->GetGUIDLow(); + AH->itemEntry = item->GetEntry(); + AH->itemCount = item->GetCount(); + AH->owner = _player->GetGUIDLow(); + AH->startbid = bid; + AH->bidder = 0; + AH->bid = 0; + AH->buyout = buyout; + AH->expire_time = time(NULL) + auctionTime; + AH->deposit = deposit; + AH->auctionHouseEntry = auctionHouseEntry; + + TC_LOG_INFO(LOG_FILTER_NETWORKIO, "CMSG_AUCTION_SELL_ITEM: Player %s (guid %d) is selling item %s entry %u (guid %d) to auctioneer %u with count %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u", _player->GetName().c_str(), _player->GetGUIDLow(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetGUIDLow(), AH->auctioneer, item->GetCount(), bid, buyout, auctionTime, AH->GetHouseId()); + sAuctionMgr->AddAItem(item); + auctionHouse->AddAuction(AH); + + _player->MoveItemFromInventory(item->GetBagSlot(), item->GetSlot(), true); + + SQLTransaction trans = CharacterDatabase.BeginTransaction(); + item->DeleteFromInventoryDB(trans); + item->SaveToDB(trans); + AH->SaveToDB(trans); + _player->SaveInventoryAndGoldToDB(trans); + CharacterDatabase.CommitTransaction(trans); + + SendAuctionCommandResult(AH->Id, AUCTION_SELL_ITEM, ERR_AUCTION_OK); + + GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION, 1); + } + else // Required stack size of auction does not match to current item stack size, clone item and set correct stack size + { + Item* newItem = item->CloneItem(finalCount, _player); + if (!newItem) { - if (HasPermission(RBAC_PERM_LOG_GM_TRADE)) - { - sLog->outCommand(GetAccountId(), "GM %s (Account: %u) create auction: %s (Entry: %u Count: %u)", - GetPlayerName().c_str(), GetAccountId(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetCount()); - } - - AH->itemGUIDLow = item->GetGUIDLow(); - AH->itemEntry = item->GetEntry(); - AH->itemCount = item->GetCount(); - AH->owner = _player->GetGUIDLow(); - AH->startbid = bid; - AH->bidder = 0; - AH->bid = 0; - AH->buyout = buyout; - AH->expire_time = time(NULL) + auctionTime; - AH->deposit = deposit; - AH->auctionHouseEntry = auctionHouseEntry; - - TC_LOG_INFO(LOG_FILTER_NETWORKIO, "CMSG_AUCTION_SELL_ITEM: Player %s (guid %d) is selling item %s entry %u (guid %d) to auctioneer %u with count %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u", _player->GetName().c_str(), _player->GetGUIDLow(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetGUIDLow(), AH->auctioneer, item->GetCount(), bid, buyout, auctionTime, AH->GetHouseId()); - sAuctionMgr->AddAItem(item); - auctionHouse->AddAuction(AH); - - _player->MoveItemFromInventory(item->GetBagSlot(), item->GetSlot(), true); - - SQLTransaction trans = CharacterDatabase.BeginTransaction(); - item->DeleteFromInventoryDB(trans); - item->SaveToDB(trans); - AH->SaveToDB(trans); - _player->SaveInventoryAndGoldToDB(trans); - CharacterDatabase.CommitTransaction(trans); - - SendAuctionCommandResult(AH->Id, AUCTION_SELL_ITEM, ERR_AUCTION_OK); - - GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION, 1); + TC_LOG_ERROR(LOG_FILTER_NETWORKIO, "CMSG_AUCTION_SELL_ITEM: Could not create clone of item %u", item->GetEntry()); + SendAuctionCommandResult(0, AUCTION_SELL_ITEM, ERR_AUCTION_DATABASE_ERROR); + delete AH; return; } - else // Required stack size of auction does not match to current item stack size, clone item and set correct stack size + + if (HasPermission(RBAC_PERM_LOG_GM_TRADE)) { - Item* newItem = item->CloneItem(finalCount, _player); - if (!newItem) - { - TC_LOG_ERROR(LOG_FILTER_NETWORKIO, "CMSG_AUCTION_SELL_ITEM: Could not create clone of item %u", item->GetEntry()); - SendAuctionCommandResult(0, AUCTION_SELL_ITEM, ERR_AUCTION_DATABASE_ERROR); - return; - } + sLog->outCommand(GetAccountId(), "GM %s (Account: %u) create auction: %s (Entry: %u Count: %u)", + GetPlayerName().c_str(), GetAccountId(), newItem->GetTemplate()->Name1.c_str(), newItem->GetEntry(), newItem->GetCount()); + } - if (HasPermission(RBAC_PERM_LOG_GM_TRADE)) + AH->Id = sObjectMgr->GenerateAuctionID(); + AH->itemGUIDLow = newItem->GetGUIDLow(); + AH->itemEntry = newItem->GetEntry(); + AH->itemCount = newItem->GetCount(); + AH->owner = _player->GetGUIDLow(); + AH->startbid = bid; + AH->bidder = 0; + AH->bid = 0; + AH->buyout = buyout; + AH->expire_time = time(NULL) + auctionTime; + AH->deposit = deposit; + AH->auctionHouseEntry = auctionHouseEntry; + + TC_LOG_INFO(LOG_FILTER_NETWORKIO, "CMSG_AUCTION_SELL_ITEM: Player %s (guid %d) is selling item %s entry %u (guid %d) to auctioneer %u with count %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u", _player->GetName().c_str(), _player->GetGUIDLow(), newItem->GetTemplate()->Name1.c_str(), newItem->GetEntry(), newItem->GetGUIDLow(), AH->auctioneer, newItem->GetCount(), bid, buyout, auctionTime, AH->GetHouseId()); + sAuctionMgr->AddAItem(newItem); + auctionHouse->AddAuction(AH); + + for (uint32 j = 0; j < itemsCount; ++j) + { + Item* item2 = items[j]; + + // Item stack count equals required count, ready to delete item - cloned item will be used for auction + if (item2->GetCount() == count[j]) { - sLog->outCommand(GetAccountId(), "GM %s (Account: %u) create auction: %s (Entry: %u Count: %u)", - GetPlayerName().c_str(), GetAccountId(), newItem->GetTemplate()->Name1.c_str(), newItem->GetEntry(), newItem->GetCount()); - } + _player->MoveItemFromInventory(item2->GetBagSlot(), item2->GetSlot(), true); - AH->itemGUIDLow = newItem->GetGUIDLow(); - AH->itemEntry = newItem->GetEntry(); - AH->itemCount = newItem->GetCount(); - AH->owner = _player->GetGUIDLow(); - AH->startbid = bid; - AH->bidder = 0; - AH->bid = 0; - AH->buyout = buyout; - AH->expire_time = time(NULL) + auctionTime; - AH->deposit = deposit; - AH->auctionHouseEntry = auctionHouseEntry; - - TC_LOG_INFO(LOG_FILTER_NETWORKIO, "CMSG_AUCTION_SELL_ITEM: Player %s (guid %d) is selling item %s entry %u (guid %d) to auctioneer %u with count %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u", _player->GetName().c_str(), _player->GetGUIDLow(), newItem->GetTemplate()->Name1.c_str(), newItem->GetEntry(), newItem->GetGUIDLow(), AH->auctioneer, newItem->GetCount(), bid, buyout, auctionTime, AH->GetHouseId()); - sAuctionMgr->AddAItem(newItem); - auctionHouse->AddAuction(AH); - - for (uint32 j = 0; j < itemsCount; ++j) + SQLTransaction trans = CharacterDatabase.BeginTransaction(); + item2->DeleteFromInventoryDB(trans); + item2->DeleteFromDB(trans); + CharacterDatabase.CommitTransaction(trans); + } + else // Item stack count is bigger than required count, update item stack count and save to database - cloned item will be used for auction { - Item* item2 = items[j]; - - // Item stack count equals required count, ready to delete item - cloned item will be used for auction - if (item2->GetCount() == count[j]) - { - _player->MoveItemFromInventory(item2->GetBagSlot(), item2->GetSlot(), true); - - SQLTransaction trans = CharacterDatabase.BeginTransaction(); - item2->DeleteFromInventoryDB(trans); - item2->DeleteFromDB(trans); - CharacterDatabase.CommitTransaction(trans); - } - else // Item stack count is bigger than required count, update item stack count and save to database - cloned item will be used for auction - { - item2->SetCount(item2->GetCount() - count[j]); - item2->SetState(ITEM_CHANGED, _player); - _player->ItemRemovedQuestCheck(item2->GetEntry(), count[j]); - item2->SendUpdateToPlayer(_player); - - SQLTransaction trans = CharacterDatabase.BeginTransaction(); - item2->SaveToDB(trans); - CharacterDatabase.CommitTransaction(trans); - } + item2->SetCount(item2->GetCount() - count[j]); + item2->SetState(ITEM_CHANGED, _player); + _player->ItemRemovedQuestCheck(item2->GetEntry(), count[j]); + item2->SendUpdateToPlayer(_player); + + SQLTransaction trans = CharacterDatabase.BeginTransaction(); + item2->SaveToDB(trans); + CharacterDatabase.CommitTransaction(trans); } + } - SQLTransaction trans = CharacterDatabase.BeginTransaction(); - newItem->SaveToDB(trans); - AH->SaveToDB(trans); - _player->SaveInventoryAndGoldToDB(trans); - CharacterDatabase.CommitTransaction(trans); + SQLTransaction trans = CharacterDatabase.BeginTransaction(); + newItem->SaveToDB(trans); + AH->SaveToDB(trans); + _player->SaveInventoryAndGoldToDB(trans); + CharacterDatabase.CommitTransaction(trans); - SendAuctionCommandResult(AH->Id, AUCTION_SELL_ITEM, ERR_AUCTION_OK); + SendAuctionCommandResult(AH->Id, AUCTION_SELL_ITEM, ERR_AUCTION_OK); - GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION, 1); - return; - } + GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION, 1); } + + _player->ModifyMoney(-int32(deposit)); } //this function is called when client bids or buys out auction diff --git a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp index 1f8ba3edade..71ef0cbe3ce 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp @@ -110,103 +110,107 @@ class npc_verdisa_beglaristrasz_eternos : public CreatureScript public: npc_verdisa_beglaristrasz_eternos() : CreatureScript("npc_verdisa_beglaristrasz_eternos") { } - InstanceScript* instance; - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); switch (creature->GetEntry()) { - case NPC_VERDISA: //Verdisa - switch (action) + case NPC_VERDISA: //Verdisa { - case GOSSIP_ACTION_INFO_DEF + 1: - if (!HAS_ESSENCE(player)) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_VERDISA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_VERDISA2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_VERDISA1, creature->GetGUID()); - } - else + switch (action) { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_VERDISA2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_VERDISA2, creature->GetGUID()); + case GOSSIP_ACTION_INFO_DEF + 1: + if (!HAS_ESSENCE(player)) + { + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_VERDISA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_VERDISA2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_VERDISA1, creature->GetGUID()); + } + else + { + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_VERDISA2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_VERDISA2, creature->GetGUID()); + } + break; + case GOSSIP_ACTION_INFO_DEF + 2: + { + ItemPosCountVec dest; + uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_EMERALD_ESSENCE, 1); + if (msg == EQUIP_ERR_OK) + player->StoreNewItem(dest, ITEM_EMERALD_ESSENCE, true); + player->CLOSE_GOSSIP_MENU(); + break; + } + case GOSSIP_ACTION_INFO_DEF + 3: + player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_VERDISA3, creature->GetGUID()); + break; } break; - case GOSSIP_ACTION_INFO_DEF + 2: - { - ItemPosCountVec dest; - uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_EMERALD_ESSENCE, 1); - if (msg == EQUIP_ERR_OK) - player->StoreNewItem(dest, ITEM_EMERALD_ESSENCE, true); - player->CLOSE_GOSSIP_MENU(); - break; } - case GOSSIP_ACTION_INFO_DEF + 3: - player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_VERDISA3, creature->GetGUID()); - break; - } - break; - case NPC_BELGARISTRASZ: //Belgaristrasz - switch (action) + case NPC_BELGARISTRASZ: //Belgaristrasz { - case GOSSIP_ACTION_INFO_DEF + 1: - if (!HAS_ESSENCE(player)) + switch (action) { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BELGARISTRASZ1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BELGARISTRASZ2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_BELGARISTRASZ1, creature->GetGUID()); - } - else - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BELGARISTRASZ2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_BELGARISTRASZ2, creature->GetGUID()); + case GOSSIP_ACTION_INFO_DEF + 1: + if (!HAS_ESSENCE(player)) + { + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BELGARISTRASZ1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BELGARISTRASZ2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_BELGARISTRASZ1, creature->GetGUID()); + } + else + { + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BELGARISTRASZ2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_BELGARISTRASZ2, creature->GetGUID()); + } + break; + case GOSSIP_ACTION_INFO_DEF + 2: + { + ItemPosCountVec dest; + uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_RUBY_ESSENCE, 1); + if (msg == EQUIP_ERR_OK) + player->StoreNewItem(dest, ITEM_RUBY_ESSENCE, true); + player->CLOSE_GOSSIP_MENU(); + break; + } + case GOSSIP_ACTION_INFO_DEF + 3: + player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_BELGARISTRASZ3, creature->GetGUID()); + break; } break; - case GOSSIP_ACTION_INFO_DEF + 2: - { - ItemPosCountVec dest; - uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_RUBY_ESSENCE, 1); - if (msg == EQUIP_ERR_OK) - player->StoreNewItem(dest, ITEM_RUBY_ESSENCE, true); - player->CLOSE_GOSSIP_MENU(); - break; - } - case GOSSIP_ACTION_INFO_DEF + 3: - player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_BELGARISTRASZ3, creature->GetGUID()); - break; } - break; - case NPC_ETERNOS: //Eternos - switch (action) + case NPC_ETERNOS: //Eternos { - case GOSSIP_ACTION_INFO_DEF + 1: - if (!HAS_ESSENCE(player)) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ETERNOS1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ETERNOS2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ETERNOS1, creature->GetGUID()); - } - else + switch (action) { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ETERNOS2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ETERNOS2, creature->GetGUID()); + case GOSSIP_ACTION_INFO_DEF + 1: + if (!HAS_ESSENCE(player)) + { + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ETERNOS1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ETERNOS2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ETERNOS1, creature->GetGUID()); + } + else + { + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ETERNOS2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ETERNOS2, creature->GetGUID()); + } + break; + case GOSSIP_ACTION_INFO_DEF + 2: + { + ItemPosCountVec dest; + uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_AMBER_ESSENCE, 1); + if (msg == EQUIP_ERR_OK) + player->StoreNewItem(dest, ITEM_AMBER_ESSENCE, true); + player->CLOSE_GOSSIP_MENU(); + break; + } + case GOSSIP_ACTION_INFO_DEF + 3: + player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ETERNOS3, creature->GetGUID()); + break; } break; - case GOSSIP_ACTION_INFO_DEF + 2: - { - ItemPosCountVec dest; - uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_AMBER_ESSENCE, 1); - if (msg == EQUIP_ERR_OK) - player->StoreNewItem(dest, ITEM_AMBER_ESSENCE, true); - player->CLOSE_GOSSIP_MENU(); - break; - } - case GOSSIP_ACTION_INFO_DEF + 3: - player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ETERNOS3, creature->GetGUID()); - break; } - break; } return true; @@ -235,15 +239,15 @@ public: void MovementInform(uint32 /*type*/, uint32 id) { + if (id) + return; + // When Belgaristraz finish his moving say grateful text if (me->GetEntry() == NPC_BELGARISTRASZ) - if (id == 0) - { - Talk(SAY_BELGARISTRASZ); - } + Talk(SAY_BELGARISTRASZ); + // The gossip flag should activate when Drakos die and not from DB - if (id == 0) - me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); } }; diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp index 55bb61b8c42..0ffab435a9c 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp @@ -62,6 +62,8 @@ OPvPCapturePointHP::OPvPCapturePointHP(OutdoorPvP* pvp, OutdoorPvPHPTowerType ty OutdoorPvPHP::OutdoorPvPHP() { m_TypeId = OUTDOOR_PVP_HP; + m_AllianceTowersControlled = 0; + m_HordeTowersControlled = 0; } bool OutdoorPvPHP::SetupOutdoorPvP() diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp index bd6fd96451f..fe3489b4a7e 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp @@ -27,6 +27,7 @@ OutdoorPvPNA::OutdoorPvPNA() { m_TypeId = OUTDOOR_PVP_NA; + m_obj = NULL; } void OutdoorPvPNA::HandleKillImpl(Player* player, Unit* killed) @@ -216,8 +217,8 @@ bool OutdoorPvPNA::SetupOutdoorPvP() m_obj = new OPvPCapturePointNA(this); if (!m_obj) return false; - AddCapturePoint(m_obj); + AddCapturePoint(m_obj); return true; } diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp index bd8b6cfd982..98b0ee5c5f4 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp @@ -28,6 +28,17 @@ OutdoorPvPTF::OutdoorPvPTF() { m_TypeId = OUTDOOR_PVP_TF; + + m_IsLocked = false; + m_LockTimer = TF_LOCK_TIME; + m_LockTimerUpdate = 0; + + m_AllianceTowersControlled = 0; + m_HordeTowersControlled = 0; + + hours_left = 6; + second_digit = 0; + first_digit = 0; } OPvPCapturePointTF::OPvPCapturePointTF(OutdoorPvP* pvp, OutdoorPvPTF_TowerType type) diff --git a/src/server/shared/Cryptography/SHA1.cpp b/src/server/shared/Cryptography/SHA1.cpp index d02e9711014..00d7e520d51 100644 --- a/src/server/shared/Cryptography/SHA1.cpp +++ b/src/server/shared/Cryptography/SHA1.cpp @@ -23,6 +23,7 @@ SHA1Hash::SHA1Hash() { SHA1_Init(&mC); + memset(mDigest, 0, SHA_DIGEST_LENGTH * sizeof(uint8)); } SHA1Hash::~SHA1Hash() diff --git a/src/server/shared/Database/Field.cpp b/src/server/shared/Database/Field.cpp index 9bd37641813..51d918e716e 100644 --- a/src/server/shared/Database/Field.cpp +++ b/src/server/shared/Database/Field.cpp @@ -22,6 +22,7 @@ Field::Field() data.value = NULL; data.type = MYSQL_TYPE_NULL; data.length = 0; + data.raw = false; } Field::~Field() diff --git a/src/server/shared/Database/MySQLConnection.cpp b/src/server/shared/Database/MySQLConnection.cpp index 846c8ce72fe..19d0a7af4c8 100644 --- a/src/server/shared/Database/MySQLConnection.cpp +++ b/src/server/shared/Database/MySQLConnection.cpp @@ -84,8 +84,10 @@ bool MySQLConnection::Open() int port; char const* unix_socket; + unsigned int timeout = 10; mysql_options(mysqlInit, MYSQL_SET_CHARSET_NAME, "utf8"); + mysql_options(mysqlInit, MYSQL_OPT_READ_TIMEOUT, (char const*)&timeout); #ifdef _WIN32 if (m_connectionInfo.host == ".") // named pipe use option (Windows) { diff --git a/src/server/shared/Database/PreparedStatement.cpp b/src/server/shared/Database/PreparedStatement.cpp index 06f9ff51132..24097ca41c5 100644 --- a/src/server/shared/Database/PreparedStatement.cpp +++ b/src/server/shared/Database/PreparedStatement.cpp @@ -203,6 +203,7 @@ void PreparedStatement::setNull(const uint8 index) } MySQLPreparedStatement::MySQLPreparedStatement(MYSQL_STMT* stmt) : +m_stmt(NULL), m_Mstmt(stmt), m_bind(NULL) { diff --git a/src/server/shared/Threading/Callback.h b/src/server/shared/Threading/Callback.h index f6bc1581857..e0215f5b3d3 100644 --- a/src/server/shared/Threading/Callback.h +++ b/src/server/shared/Threading/Callback.h @@ -35,7 +35,7 @@ template <typename Result, typename ParamType, bool chain = false> class QueryCallback { public: - QueryCallback() : _stage(chain ? 0 : CALLBACK_STAGE_INVALID) {} + QueryCallback() : _param(), _stage(chain ? 0 : CALLBACK_STAGE_INVALID) {} //! The parameter of this function should be a resultset returned from either .AsyncQuery or .AsyncPQuery void SetFutureResult(ACE_Future<Result> value) diff --git a/src/server/worldserver/TCSoap/TCSoap.h b/src/server/worldserver/TCSoap/TCSoap.h index b786ee94e81..63ccb6b304e 100644 --- a/src/server/worldserver/TCSoap/TCSoap.h +++ b/src/server/worldserver/TCSoap/TCSoap.h @@ -27,7 +27,7 @@ class TCSoapRunnable: public ACE_Based::Runnable { public: - TCSoapRunnable() { } + TCSoapRunnable() : m_host(""), m_port(0) { } void run(); void setListenArguments(std::string host, uint16 port) { |