diff --git a/src/game/NPCHandler.cpp b/src/game/NPCHandler.cpp index e96dd7e8c..345e31397 100644 --- a/src/game/NPCHandler.cpp +++ b/src/game/NPCHandler.cpp @@ -128,16 +128,14 @@ static void SendTrainerSpellHelper(WorldPacket& data, TrainerSpell const* tSpell data << uint32(tSpell->spell); // learned spell (or cast-spell in profession case) data << uint8(state == TRAINER_SPELL_GREEN_DISABLED ? TRAINER_SPELL_GREEN : state); data << uint32(floor(tSpell->spellCost * fDiscountMod)); - - data << uint32(primary_prof_first_rank && can_learn_primary_prof ? 1 : 0); - // primary prof. learn confirmation dialog - data << uint32(primary_prof_first_rank ? 1 : 0); // must be equal prev. field to have learn button in enabled state data << uint8(reqLevel); data << uint32(tSpell->reqSkill); data << uint32(tSpell->reqSkillValue); + data << uint32(primary_prof_first_rank && can_learn_primary_prof ? 1 : 0); + // primary prof. learn confirmation dialog + data << uint32(primary_prof_first_rank ? 1 : 0); // must be equal prev. field to have learn button in enabled state data << uint32(!tSpell->IsCastable() && chain_node ? (chain_node->prev ? chain_node->prev : chain_node->req) : 0); data << uint32(!tSpell->IsCastable() && chain_node && chain_node->prev ? chain_node->req : 0); - data << uint32(0); } void WorldSession::SendTrainerList(ObjectGuid guid, const std::string& strTitle) @@ -178,6 +176,7 @@ void WorldSession::SendTrainerList(ObjectGuid guid, const std::string& strTitle) WorldPacket data(SMSG_TRAINER_LIST, 8 + 4 + 4 + maxcount * 38 + strTitle.size() + 1); data << ObjectGuid(guid); data << uint32(trainer_type); + data << uint32(ci->trainerId); size_t count_pos = data.wpos(); data << uint32(maxcount); @@ -291,18 +290,18 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket& recv_data) uint32 nSpellCost = uint32(floor(trainer_spell->spellCost * _player->GetReputationPriceDiscount(unit))); // check money requirement - if ((_player->GetMoney() < nSpellCost) && trainState > 1) + if (_player->GetMoney() < nSpellCost && trainState > 1) trainState = 0; - if(trainState != 2) + if (trainState != 2) { sendData << ObjectGuid(guid); sendData << uint32(spellId); - sendData << trainState; - SendPacket(&sendData); + sendData << uint32(trainState); + SendPacket(&sendData); } else - { + { _player->ModifyMoney(-int32(nSpellCost)); // visual effect on trainer @@ -320,7 +319,6 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket& recv_data) else _player->learnSpell(spellId, false); - sendData << ObjectGuid(guid); sendData << uint32(spellId); // should be same as in packet from client sendData << uint32(trainState); diff --git a/src/game/Player.h b/src/game/Player.h index 060d363bf..ce0fb39d6 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -153,9 +153,9 @@ typedef std::map SpellCooldowns; enum TrainerSpellState { - TRAINER_SPELL_GREEN = 0, - TRAINER_SPELL_RED = 1, - TRAINER_SPELL_GRAY = 2, + TRAINER_SPELL_GRAY = 0, + TRAINER_SPELL_GREEN = 1, + TRAINER_SPELL_RED = 2, TRAINER_SPELL_GREEN_DISABLED = 10 // custom value, not send to client: formally green but learn not allowed }; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index a75c33720..1ce826e73 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ -#define REVISION_NR "0172" +#define REVISION_NR "0175" #endif // __REVISION_NR_H__