Core/Instances: Implemented DungeonEncounter.dbc for creating completed encounters mask to use in packets

Core/Dungeon Finder: Implemented new way of giving random dungeon rewards, linked to DungeonEncounter.dbc
This commit is contained in:
Shauren
2011-02-03 22:20:40 +01:00
parent 7ea8bad07f
commit c2b0bcbd6c
33 changed files with 941 additions and 152 deletions
@@ -68,6 +68,7 @@
#include "WeatherMgr.h"
#include "LFGMgr.h"
#include "CharacterDatabaseCleaner.h"
#include "InstanceScript.h"
#include <cmath>
#define ZONE_UPDATE_INTERVAL (1*IN_MILLISECONDS)
@@ -17709,6 +17710,10 @@ InstancePlayerBind* Player::BindToInstance(InstanceSave *save, bool permanent, b
void Player::BindToInstance()
{
// Player left the instance
if (_pendingBind->GetInstanceId() != GetInstanceId())
return;
WorldPacket data(SMSG_INSTANCE_SAVE_CREATED, 4);
data << uint32(0);
GetSession()->SendPacket(&data);
@@ -22116,6 +22121,12 @@ bool Player::RewardPlayerAndGroupAtKill(Unit* pVictim)
KilledMonster(pVictim->ToCreature()->GetCreatureInfo(), pVictim->GetGUID());
}
}
// Credit encounter in instance
if (pVictim->GetTypeId() == TYPEID_UNIT && GetMap()->IsDungeon())
if (InstanceScript* instance = pVictim->GetInstanceScript())
instance->UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, pVictim->GetEntry(), pVictim);
return xp || honored_kill;
}