Added new quest template fields, updated some enums and opcodes

This commit is contained in:
tomrus88 2008-11-03 14:03:09 +03:00
parent 8d54103456
commit 81693c4c15
8 changed files with 109 additions and 107 deletions

View file

@ -13392,7 +13392,7 @@ void Player::SendQuestComplete( uint32 quest_id )
if( quest_id )
{
WorldPacket data( SMSG_QUESTUPDATE_COMPLETE, 4 );
data << quest_id;
data << uint32(quest_id);
GetSession()->SendPacket( &data );
sLog.outDebug( "WORLD: Sent SMSG_QUESTUPDATE_COMPLETE quest = %u", quest_id );
}
@ -13400,16 +13400,14 @@ void Player::SendQuestComplete( uint32 quest_id )
void Player::SendQuestReward( Quest const *pQuest, uint32 XP, Object * questGiver )
{
// TODO: something really wrong here (there is only 5 x uint32 in client)
uint32 questid = pQuest->GetQuestId();
sLog.outDebug( "WORLD: Sent SMSG_QUESTGIVER_QUEST_COMPLETE quest = %u", questid );
WorldPacket data( SMSG_QUESTGIVER_QUEST_COMPLETE, (4+4+4+4+4+4+pQuest->GetRewItemsCount()*8) );
data << questid;
data << uint32(0x03);
WorldPacket data( SMSG_QUESTGIVER_QUEST_COMPLETE, (4+4+4+4+4) );
data << uint32(questid);
if ( getLevel() < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL) )
{
data << XP;
data << uint32(XP);
data << uint32(pQuest->GetRewOrReqMoney());
}
else
@ -13417,17 +13415,9 @@ void Player::SendQuestReward( Quest const *pQuest, uint32 XP, Object * questGive
data << uint32(0);
data << uint32(pQuest->GetRewOrReqMoney() + int32(pQuest->GetRewMoneyMaxLevel() * sWorld.getRate(RATE_DROP_MONEY)));
}
data << uint32(0); // new 2.3.0, HonorPoints, HONORAWARD
data << uint32(0); // added in WotLK, LEVEL_UP_CHAR_POINTS
data << uint32( pQuest->GetRewItemsCount() ); // max is 5
for (uint32 i = 0; i < pQuest->GetRewItemsCount(); ++i)
{
if ( pQuest->RewItemId[i] > 0 )
data << pQuest->RewItemId[i] << pQuest->RewItemCount[i];
else
data << uint32(0) << uint32(0);
}
data << uint32(10*MaNGOS::Honor::hk_honor_at_level(pSession->GetPlayer()->getLevel(), pQuest->GetRewHonorableKills()));
data << uint32(pQuest->GetBonusTalents()); // bonus talents
GetSession()->SendPacket( &data );
if (pQuest->GetQuestCompleteScript() != 0)
@ -13440,7 +13430,7 @@ void Player::SendQuestFailed( uint32 quest_id )
{
WorldPacket data( SMSG_QUESTGIVER_QUEST_FAILED, 4+4 );
data << quest_id;
data << uint32(0); // added in WotLK?
data << uint32(0); // failed reason (4 for inventory is full)
GetSession()->SendPacket( &data );
sLog.outDebug("WORLD: Sent SMSG_QUESTGIVER_QUEST_FAILED");
}
@ -13479,10 +13469,10 @@ void Player::SendPushToPartyResponse( Player *pPlayer, uint32 msg )
void Player::SendQuestUpdateAddItem( Quest const* pQuest, uint32 item_idx, uint32 count )
{
WorldPacket data( SMSG_QUESTUPDATE_ADD_ITEM, (4+4) );
WorldPacket data( SMSG_QUESTUPDATE_ADD_ITEM, 0 );
sLog.outDebug( "WORLD: Sent SMSG_QUESTUPDATE_ADD_ITEM" );
data << pQuest->ReqItemId[item_idx];
data << count;
//data << pQuest->ReqItemId[item_idx];
//data << count;
GetSession()->SendPacket( &data );
}