mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
[10938] Some adjustments to script calls OnQuestChooseReward replaced with OnQuestRewarded. Also fix compile in VC 8.0 and VC 9.0.
This commit is contained in:
parent
14c8db9c9a
commit
0b7e78d2a7
7 changed files with 58 additions and 87 deletions
|
|
@ -13790,6 +13790,21 @@ void Player::RewardQuest(Quest const *pQuest, uint32 reward, Object* questGiver,
|
|||
if (announce)
|
||||
SendQuestReward(pQuest, XP, questGiver);
|
||||
|
||||
bool handled = false;
|
||||
|
||||
switch(questGiver->GetTypeId())
|
||||
{
|
||||
case TYPEID_UNIT:
|
||||
handled = sScriptMgr.OnQuestRewarded(this, (Creature*)questGiver, pQuest);
|
||||
break;
|
||||
case TYPEID_GAMEOBJECT:
|
||||
handled = sScriptMgr.OnQuestRewarded(this, (GameObject*)questGiver, pQuest);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!handled && pQuest->GetQuestCompleteScript() != 0)
|
||||
GetMap()->ScriptsStart(sQuestEndScripts, pQuest->GetQuestCompleteScript(), questGiver, this);
|
||||
|
||||
// cast spells after mark quest complete (some spells have quest completed state reqyurements in spell_area data)
|
||||
if (pQuest->GetRewSpellCast() > 0)
|
||||
CastSpell(this, pQuest->GetRewSpellCast(), true);
|
||||
|
|
@ -14860,9 +14875,6 @@ void Player::SendQuestReward( Quest const *pQuest, uint32 XP, Object * questGive
|
|||
data << uint32(pQuest->GetBonusTalents()); // bonus talents
|
||||
data << uint32(0); // arena points
|
||||
GetSession()->SendPacket( &data );
|
||||
|
||||
if (pQuest->GetQuestCompleteScript() != 0)
|
||||
GetMap()->ScriptsStart(sQuestEndScripts, pQuest->GetQuestCompleteScript(), questGiver, this);
|
||||
}
|
||||
|
||||
void Player::SendQuestFailed( uint32 quest_id, InventoryChangeFailure reason)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue