aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bindings/scripts/scripts/zone/alterac_mountains/alterac_mountains.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/blades_edge_mountains/blades_edge_mountains.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/bloodmyst_isle/bloodmyst_isle.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/isle_of_queldanas/isle_of_queldanas.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/nagrand/nagrand.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/netherstorm/netherstorm.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp12
-rw-r--r--src/bindings/scripts/scripts/zone/silithus/silithus.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/stratholme/boss_order_of_silver_hand.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp2
-rw-r--r--src/game/Creature.h5
-rw-r--r--src/game/Level3.cpp5
-rw-r--r--src/game/ObjectMgr.cpp12
-rw-r--r--src/game/OutdoorPvP.cpp2
-rw-r--r--src/game/OutdoorPvPNA.cpp2
-rw-r--r--src/game/OutdoorPvPSI.cpp4
-rw-r--r--src/game/Player.cpp20
-rw-r--r--src/game/Player.h3
-rw-r--r--src/game/QueryHandler.cpp4
-rw-r--r--src/game/Unit.cpp2
24 files changed, 64 insertions, 39 deletions
diff --git a/src/bindings/scripts/scripts/zone/alterac_mountains/alterac_mountains.cpp b/src/bindings/scripts/scripts/zone/alterac_mountains/alterac_mountains.cpp
index 128583163ae..46be478f939 100644
--- a/src/bindings/scripts/scripts/zone/alterac_mountains/alterac_mountains.cpp
+++ b/src/bindings/scripts/scripts/zone/alterac_mountains/alterac_mountains.cpp
@@ -41,7 +41,7 @@ struct TRINITY_DLL_DECL npc_ravenholdtAI : public ScriptedAI
{
if( who->GetTypeId() == TYPEID_PLAYER )
if( CAST_PLR(who)->GetQuestStatus(6681) == QUEST_STATUS_INCOMPLETE )
- CAST_PLR(who)->KilledMonster(m_creature->GetEntry(),m_creature->GetGUID() );
+ CAST_PLR(who)->KilledMonsterCredit(m_creature->GetEntry(),m_creature->GetGUID() );
}
void EnterCombat(Unit* who) { }
diff --git a/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp b/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp
index b13881a02ee..986f4a78f21 100644
--- a/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp
+++ b/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp
@@ -52,7 +52,7 @@ bool GossipSelect_npc_beaten_corpse(Player *player, Creature *_Creature, uint32
if(action == GOSSIP_ACTION_INFO_DEF +1)
{
player->SEND_GOSSIP_MENU(3558, _Creature->GetGUID());
- player->KilledMonster( 10668,_Creature->GetGUID() );
+ player->KilledMonsterCredit( 10668,_Creature->GetGUID() );
}
return true;
}
diff --git a/src/bindings/scripts/scripts/zone/blades_edge_mountains/blades_edge_mountains.cpp b/src/bindings/scripts/scripts/zone/blades_edge_mountains/blades_edge_mountains.cpp
index dc38bb3268a..9cf6d18b26f 100644
--- a/src/bindings/scripts/scripts/zone/blades_edge_mountains/blades_edge_mountains.cpp
+++ b/src/bindings/scripts/scripts/zone/blades_edge_mountains/blades_edge_mountains.cpp
@@ -61,7 +61,7 @@ struct TRINITY_DLL_DECL mobs_bladespire_ogreAI : public ScriptedAI
void JustDied(Unit* Killer)
{
if (Killer->GetTypeId() == TYPEID_PLAYER)
- CAST_PLR(Killer)->KilledMonster(19995, m_creature->GetGUID());
+ CAST_PLR(Killer)->KilledMonsterCredit(19995, m_creature->GetGUID());
}
};
CreatureAI* GetAI_mobs_bladespire_ogre(Creature *_Creature)
@@ -261,7 +261,7 @@ struct TRINITY_DLL_DECL npc_daranelleAI : public ScriptedAI
{
DoScriptText(SAY_SPELL_INFLUENCE, m_creature, who);
//TODO: Move the below to updateAI and run if this statement == true
- CAST_PLR(who)->KilledMonster(21511, m_creature->GetGUID());
+ CAST_PLR(who)->KilledMonsterCredit(21511, m_creature->GetGUID());
CAST_PLR(who)->RemoveAurasDueToSpell(36904);
}
}
diff --git a/src/bindings/scripts/scripts/zone/bloodmyst_isle/bloodmyst_isle.cpp b/src/bindings/scripts/scripts/zone/bloodmyst_isle/bloodmyst_isle.cpp
index 34fc8e02057..42104776d6c 100644
--- a/src/bindings/scripts/scripts/zone/bloodmyst_isle/bloodmyst_isle.cpp
+++ b/src/bindings/scripts/scripts/zone/bloodmyst_isle/bloodmyst_isle.cpp
@@ -56,7 +56,7 @@ struct TRINITY_DLL_DECL mob_webbed_creatureAI : public ScriptedAI
case 0:
spawnCreatureID = 17681;
if (Killer->GetTypeId() == TYPEID_PLAYER)
- CAST_PLR(Killer)->KilledMonster(spawnCreatureID, m_creature->GetGUID());
+ CAST_PLR(Killer)->KilledMonsterCredit(spawnCreatureID, m_creature->GetGUID());
break;
case 1:
case 2:
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp
index dc9946e468a..04490cf13a8 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp
@@ -89,7 +89,7 @@ struct TRINITY_DLL_DECL instance_old_hillsbrad : public ScriptedInstance
player->SendUpdateWorldState(WORLD_STATE_OH,mBarrelCount);
if (mBarrelCount == 5)
- player->KilledMonster(LODGE_QUEST_TRIGGER,0);
+ player->KilledMonsterCredit(LODGE_QUEST_TRIGGER,0);
}
}
}else
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp
index 9f7ba1ca7f6..80542b9a1db 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp
@@ -347,7 +347,7 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI
for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
{
if (Player* pPlayer = itr->getSource())
- pPlayer->KilledMonster(20156,m_creature->GetGUID());
+ pPlayer->KilledMonsterCredit(20156,m_creature->GetGUID());
}
}
diff --git a/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp b/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp
index 9b6610deb43..213e92f762d 100644
--- a/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp
+++ b/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp
@@ -634,7 +634,7 @@ struct TRINITY_DLL_DECL npc_unworthy_initiateAI : public ScriptedAI
{
if(m_creature->GetEntry() != 29519)
if(killer->GetTypeId() == TYPEID_PLAYER)
- CAST_PLR(killer)->KilledMonster(29519,m_creature->GetGUID());
+ CAST_PLR(killer)->KilledMonsterCredit(29519,m_creature->GetGUID());
}
void AddEquipp()
@@ -1166,7 +1166,7 @@ struct TRINITY_DLL_DECL npc_dkc1_gothikAI : public ScriptedAI
{
if(CAST_PLR(owner)->GetQuestStatus(12698) == QUEST_STATUS_INCOMPLETE)
{
- CAST_PLR(owner)->KilledMonster(28845, me->GetGUID());
+ CAST_PLR(owner)->KilledMonsterCredit(28845, me->GetGUID());
who->setDeathState(DEAD);
}
}
diff --git a/src/bindings/scripts/scripts/zone/isle_of_queldanas/isle_of_queldanas.cpp b/src/bindings/scripts/scripts/zone/isle_of_queldanas/isle_of_queldanas.cpp
index 1a79bead96c..d1c90c709d0 100644
--- a/src/bindings/scripts/scripts/zone/isle_of_queldanas/isle_of_queldanas.cpp
+++ b/src/bindings/scripts/scripts/zone/isle_of_queldanas/isle_of_queldanas.cpp
@@ -114,7 +114,7 @@ struct TRINITY_DLL_DECL npc_greengill_slaveAI : public ScriptedAI
{
Unit* plr = Unit::GetUnit((*m_creature), PlayerGUID);
if(plr && CAST_PLR(plr)->GetQuestStatus(QUESTG) == QUEST_STATUS_INCOMPLETE)
- CAST_PLR(plr)->KilledMonster(25086, m_creature->GetGUID());
+ CAST_PLR(plr)->KilledMonsterCredit(25086, m_creature->GetGUID());
}
DoCast(m_creature, ENRAGE);
Unit* Myrmidon = me->FindNearestCreature(DM, 70);
diff --git a/src/bindings/scripts/scripts/zone/nagrand/nagrand.cpp b/src/bindings/scripts/scripts/zone/nagrand/nagrand.cpp
index d90c8b1d817..a89c0c3325a 100644
--- a/src/bindings/scripts/scripts/zone/nagrand/nagrand.cpp
+++ b/src/bindings/scripts/scripts/zone/nagrand/nagrand.cpp
@@ -547,7 +547,7 @@ struct TRINITY_DLL_DECL npc_creditmarker_visit_with_ancestorsAI : public Scripte
{
// 18840: Sunspring, 18841: Laughing, 18842: Garadar, 18843: Bleeding
if(!CAST_PLR(who)->GetReqKillOrCastCurrentCount(10085, creditMarkerId))
- CAST_PLR(who)->KilledMonster(creditMarkerId, m_creature->GetGUID());
+ CAST_PLR(who)->KilledMonsterCredit(creditMarkerId, m_creature->GetGUID());
}
}
}
diff --git a/src/bindings/scripts/scripts/zone/netherstorm/netherstorm.cpp b/src/bindings/scripts/scripts/zone/netherstorm/netherstorm.cpp
index 500e1251fce..1a8a41649e0 100644
--- a/src/bindings/scripts/scripts/zone/netherstorm/netherstorm.cpp
+++ b/src/bindings/scripts/scripts/zone/netherstorm/netherstorm.cpp
@@ -255,7 +255,7 @@ struct TRINITY_DLL_DECL npc_manaforge_control_consoleAI : public ScriptedAI
{
Unit* u = Unit::GetUnit((*m_creature),someplayer);
if( u && u->GetTypeId() == TYPEID_PLAYER )
- CAST_PLR(u)->KilledMonster(m_creature->GetEntry(),m_creature->GetGUID());
+ CAST_PLR(u)->KilledMonsterCredit(m_creature->GetEntry(),m_creature->GetGUID());
DoCast(m_creature,SPELL_DISABLE_VISUAL);
}
if( goConsole )
diff --git a/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp b/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp
index ca40ff16322..251d6f0441a 100644
--- a/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp
+++ b/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp
@@ -139,7 +139,7 @@ struct TRINITY_DLL_DECL mob_mature_netherwing_drakeAI : public ScriptedAI
DoScriptText(SAY_JUST_EATEN, m_creature);
if (Player* pPlr = Unit::GetPlayer(uiPlayerGUID))
- pPlr->KilledMonster(NPC_EVENT_PINGER, m_creature->GetGUID());
+ pPlr->KilledMonsterCredit(NPC_EVENT_PINGER, m_creature->GetGUID());
Reset();
m_creature->GetMotionMaster()->Clear();
@@ -269,7 +269,7 @@ struct TRINITY_DLL_DECL mob_enslaved_netherwing_drakeAI : public ScriptedAI
Player* plr = Unit::GetPlayer(PlayerGUID);
if(plr && plr->GetQuestStatus(10854) == QUEST_STATUS_INCOMPLETE)
{
- plr->KilledMonster(22316, m_creature->GetGUID());
+ plr->KilledMonsterCredit(22316, m_creature->GetGUID());
/*
float x,y,z;
m_creature->GetPosition(x,y,z);
@@ -366,7 +366,7 @@ struct TRINITY_DLL_DECL mob_dragonmaw_peonAI : public ScriptedAI
{
Player* plr = Unit::GetPlayer(PlayerGUID);
if(plr && plr->GetQuestStatus(11020) == QUEST_STATUS_INCOMPLETE)
- plr->KilledMonster(23209, m_creature->GetGUID());
+ plr->KilledMonsterCredit(23209, m_creature->GetGUID());
}
PoisonTimer = 0;
m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
@@ -1681,13 +1681,13 @@ CreatureAI* GetAI_mob_torloth_the_magnificent(Creature* c)
#define ENTRY_ENRAGED_AIRY_SOUL 21116
#define ENTRY_ENRAGED_WATERY_SOUL 21109 // wrong model
-/* SPELL KILLCREDIT - not working!?! - using KilledMonster */
+/* SPELL KILLCREDIT - not working!?! - using KilledMonsterCredit */
#define SPELL_EARTHEN_SOUL_CAPTURED_CREDIT 36108
#define SPELL_FIERY_SOUL_CAPTURED_CREDIT 36117
#define SPELL_AIRY_SOUL_CAPTURED_CREDIT 36182
#define SPELL_WATERY_SOUL_CAPTURED_CREDIT 36171
-/* KilledMonster Workaround */
+/* KilledMonsterCredit Workaround */
#define CREDIT_FIRE 21094
#define CREDIT_WATER 21095
#define CREDIT_AIR 21096
@@ -1758,7 +1758,7 @@ struct TRINITY_DLL_DECL npc_enraged_spiritAI : public ScriptedAI
Unit* Owner = totemOspirits->GetOwner();
if (Owner && Owner->GetTypeId() == TYPEID_PLAYER)
// DoCast(Owner, credit); -- not working!
- CAST_PLR(Owner)->KilledMonster(credit, Summoned->GetGUID());
+ CAST_PLR(Owner)->KilledMonsterCredit(credit, Summoned->GetGUID());
DoCast(totemOspirits,SPELL_SOUL_CAPTURED);
}
}
diff --git a/src/bindings/scripts/scripts/zone/silithus/silithus.cpp b/src/bindings/scripts/scripts/zone/silithus/silithus.cpp
index b05fa68bbf6..e748f39eab9 100644
--- a/src/bindings/scripts/scripts/zone/silithus/silithus.cpp
+++ b/src/bindings/scripts/scripts/zone/silithus/silithus.cpp
@@ -168,7 +168,7 @@ bool GossipSelect_npcs_rutgar_and_frankal(Player *player, Creature *_Creature, u
case GOSSIP_ACTION_INFO_DEF + 6:
player->SEND_GOSSIP_MENU(7761, _Creature->GetGUID());
//'kill' our trigger to update quest status
- player->KilledMonster( TRIGGER_RUTGAR, _Creature->GetGUID() );
+ player->KilledMonsterCredit( TRIGGER_RUTGAR, _Creature->GetGUID() );
break;
case GOSSIP_ACTION_INFO_DEF + 9:
@@ -194,7 +194,7 @@ bool GossipSelect_npcs_rutgar_and_frankal(Player *player, Creature *_Creature, u
case GOSSIP_ACTION_INFO_DEF + 14:
player->SEND_GOSSIP_MENU(7767, _Creature->GetGUID());
//'kill' our trigger to update quest status
- player->KilledMonster( TRIGGER_FRANKAL, _Creature->GetGUID() );
+ player->KilledMonsterCredit( TRIGGER_FRANKAL, _Creature->GetGUID() );
break;
}
return true;
diff --git a/src/bindings/scripts/scripts/zone/stratholme/boss_order_of_silver_hand.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_order_of_silver_hand.cpp
index 4405a50461b..4d6dc2a6b06 100644
--- a/src/bindings/scripts/scripts/zone/stratholme/boss_order_of_silver_hand.cpp
+++ b/src/bindings/scripts/scripts/zone/stratholme/boss_order_of_silver_hand.cpp
@@ -108,7 +108,7 @@ struct TRINITY_DLL_DECL boss_silver_hand_bossesAI : public ScriptedAI
break;
}
if(pInstance->GetData(TYPE_SH_QUEST) && Killer->GetTypeId() == TYPEID_PLAYER)
- CAST_PLR(Killer)->KilledMonster(SH_QUEST_CREDIT,m_creature->GetGUID());
+ CAST_PLR(Killer)->KilledMonsterCredit(SH_QUEST_CREDIT,m_creature->GetGUID());
}
}
diff --git a/src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp b/src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp
index e70c060b6ac..4fb92eac739 100644
--- a/src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp
+++ b/src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp
@@ -220,7 +220,7 @@ struct TRINITY_DLL_DECL mob_netherweb_victimAI : public ScriptedAI
if( rand()%100 < 25 )
{
DoSpawnCreature(QUEST_TARGET,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,60000);
- CAST_PLR(Killer)->KilledMonster(QUEST_TARGET, m_creature->GetGUID());
+ CAST_PLR(Killer)->KilledMonsterCredit(QUEST_TARGET, m_creature->GetGUID());
}else
DoSpawnCreature(netherwebVictims[rand()%6],0,0,0,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,60000);
diff --git a/src/game/Creature.h b/src/game/Creature.h
index 4dbc2fed77f..ef4e99da8c0 100644
--- a/src/game/Creature.h
+++ b/src/game/Creature.h
@@ -172,13 +172,14 @@ enum SummonMask
#pragma pack(push,1)
#endif
+#define MAX_KILL_CREDIT 2
+
// from `creature_template` table
struct CreatureInfo
{
uint32 Entry;
uint32 HeroicEntry;
- uint32 unk1;
- uint32 unk2;
+ uint32 KillCredit[MAX_KILL_CREDIT];
uint32 DisplayID_A[2];
uint32 DisplayID_H[2];
char* Name;
diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp
index f1ba79e7fac..b82a6a845da 100644
--- a/src/game/Level3.cpp
+++ b/src/game/Level3.cpp
@@ -5690,8 +5690,9 @@ bool ChatHandler::HandleQuestComplete(const char* args)
}
else if(creature > 0)
{
- for(uint16 z = 0; z < creaturecount; ++z)
- player->KilledMonster(creature,0);
+ if(CreatureInfo const* cInfo = objmgr.GetCreatureTemplate(creature))
+ for(uint16 z = 0; z < creaturecount; ++z)
+ player->KilledMonster(cInfo,0);
}
else if(creature < 0)
{
diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp
index b5e8245c676..c531366845f 100644
--- a/src/game/ObjectMgr.cpp
+++ b/src/game/ObjectMgr.cpp
@@ -703,6 +703,18 @@ void ObjectMgr::LoadCreatureTemplates()
if (!displayScaleEntry)
sLog.outErrorDb("Creature (Entry: %u) not has any existed display id in DisplayID_A/DisplayID_A2/DisplayID_H/DisplayID_H2", cInfo->Entry);
+ for(int k = 0; k < MAX_KILL_CREDIT; ++k)
+ {
+ if(cInfo->KillCredit[k])
+ {
+ if(!GetCreatureTemplate(cInfo->KillCredit[k]))
+ {
+ sLog.outErrorDb("Creature (Entry: %u) has not existed creature entry in `KillCredit%d` (%u)",cInfo->Entry,k+1,cInfo->KillCredit[k]);
+ const_cast<CreatureInfo*>(cInfo)->KillCredit[k] = 0;
+ }
+ }
+ }
+
if (cInfo->unit_class && ((1 << (cInfo->unit_class-1)) & CLASSMASK_ALL_CREATURES) == 0)
sLog.outErrorDb("Creature (Entry: %u) has invalid unit_class(%u) for creature_template", cInfo->Entry, cInfo->unit_class);
diff --git a/src/game/OutdoorPvP.cpp b/src/game/OutdoorPvP.cpp
index 3e0239935aa..d3c96f53fcb 100644
--- a/src/game/OutdoorPvP.cpp
+++ b/src/game/OutdoorPvP.cpp
@@ -359,7 +359,7 @@ void OPvPCapturePoint::SendObjectiveComplete(uint32 id,uint64 guid)
// send to all players present in the area
for(PlayerSet::iterator itr = m_activePlayers[team].begin(); itr != m_activePlayers[team].end(); ++itr)
- (*itr)->KilledMonster(id, guid);
+ (*itr)->KilledMonsterCredit(id, guid);
}
void OutdoorPvP::HandleKill(Player *killer, Unit * killed)
diff --git a/src/game/OutdoorPvPNA.cpp b/src/game/OutdoorPvPNA.cpp
index 53bf1a3c770..7a421b848ba 100644
--- a/src/game/OutdoorPvPNA.cpp
+++ b/src/game/OutdoorPvPNA.cpp
@@ -33,7 +33,7 @@ void OutdoorPvPNA::HandleKillImpl(Player *plr, Unit * killed)
{
if(killed->GetTypeId() == TYPEID_PLAYER && plr->GetTeam() != ((Player*)killed)->GetTeam())
{
- plr->KilledMonster(NA_CREDIT_MARKER,0); // 0 guid, btw it isn't even used in killedmonster function :S
+ plr->KilledMonsterCredit(NA_CREDIT_MARKER,0); // 0 guid, btw it isn't even used in killedmonster function :S
if(plr->GetTeam() == ALLIANCE)
plr->CastSpell(plr,NA_KILL_TOKEN_ALLIANCE,true);
else
diff --git a/src/game/OutdoorPvPSI.cpp b/src/game/OutdoorPvPSI.cpp
index 33a304f2f6b..e60888c7e08 100644
--- a/src/game/OutdoorPvPSI.cpp
+++ b/src/game/OutdoorPvPSI.cpp
@@ -107,7 +107,7 @@ bool OutdoorPvPSI::HandleAreaTrigger(Player *plr, uint32 trigger)
// add 20 cenarion circle repu
plr->GetReputationMgr().ModifyReputation(sFactionStore.LookupEntry(609),20);
// complete quest
- plr->KilledMonster(SI_TURNIN_QUEST_CM_A,0);
+ plr->KilledMonsterCredit(SI_TURNIN_QUEST_CM_A,0);
}
return true;
case SI_AREATRIGGER_H:
@@ -132,7 +132,7 @@ bool OutdoorPvPSI::HandleAreaTrigger(Player *plr, uint32 trigger)
// add 20 cenarion circle repu
plr->GetReputationMgr().ModifyReputation(sFactionStore.LookupEntry(609),20);
// complete quest
- plr->KilledMonster(SI_TURNIN_QUEST_CM_H,0);
+ plr->KilledMonsterCredit(SI_TURNIN_QUEST_CM_H,0);
}
return true;
}
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index fd27607a402..27014c97f76 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -13807,7 +13807,17 @@ void Player::ItemRemovedQuestCheck( uint32 entry, uint32 count )
UpdateForQuestWorldObjects();
}
-void Player::KilledMonster( uint32 entry, uint64 guid )
+void Player::KilledMonster( CreatureInfo const* cInfo, uint64 guid )
+{
+ if(cInfo->Entry)
+ KilledMonsterCredit(cInfo->Entry,guid);
+
+ for(int i = 0; i < MAX_KILL_CREDIT; ++i)
+ if(cInfo->KillCredit[i])
+ KilledMonsterCredit(cInfo->KillCredit[i],guid);
+}
+
+void Player::KilledMonsterCredit( uint32 entry, uint64 guid )
{
uint32 addkillcount = 1;
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, entry, addkillcount);
@@ -19795,7 +19805,7 @@ bool Player::RewardPlayerAndGroupAtKill(Unit* pVictim)
{
// normal creature (not pet/etc) can be only in !PvP case
if(pVictim->GetTypeId()==TYPEID_UNIT)
- pGroupGuy->KilledMonster(pVictim->GetEntry(), pVictim->GetGUID());
+ pGroupGuy->KilledMonster(((Creature*)pVictim)->GetCreatureInfo(), pVictim->GetGUID());
}
}
}
@@ -19820,7 +19830,7 @@ bool Player::RewardPlayerAndGroupAtKill(Unit* pVictim)
// normal creature (not pet/etc) can be only in !PvP case
if(pVictim->GetTypeId()==TYPEID_UNIT)
- KilledMonster(pVictim->GetEntry(),pVictim->GetGUID());
+ KilledMonster(((Creature*)pVictim)->GetCreatureInfo(), pVictim->GetGUID());
}
}
return xp || honored_kill;
@@ -19844,11 +19854,11 @@ void Player::RewardPlayerAndGroupAtEvent(uint32 creature_id, WorldObject* pRewar
// quest objectives updated only for alive group member or dead but with not released body
if(pGroupGuy->isAlive()|| !pGroupGuy->GetCorpse())
- pGroupGuy->KilledMonster(creature_id, creature_guid);
+ pGroupGuy->KilledMonsterCredit(creature_id, creature_guid);
}
}
else // if (!pGroup)
- KilledMonster(creature_id, creature_guid);
+ KilledMonsterCredit(creature_id, creature_guid);
}
bool Player::IsAtGroupRewardDistance(WorldObject const* pRewardSource) const
diff --git a/src/game/Player.h b/src/game/Player.h
index 14e3d730e3b..51f17027fa7 100644
--- a/src/game/Player.h
+++ b/src/game/Player.h
@@ -1229,7 +1229,8 @@ class TRINITY_DLL_SPEC Player : public Unit
void GroupEventHappens( uint32 questId, WorldObject const* pEventObject );
void ItemAddedQuestCheck( uint32 entry, uint32 count );
void ItemRemovedQuestCheck( uint32 entry, uint32 count );
- void KilledMonster( uint32 entry, uint64 guid );
+ void KilledMonster( CreatureInfo const* cInfo, uint64 guid );
+ void KilledMonsterCredit( uint32 entry, uint64 guid );
void CastedCreatureOrGO( uint32 entry, uint64 guid, uint32 spell_id );
void TalkedToCreature( uint32 entry, uint64 guid );
void MoneyChanged( uint32 value );
diff --git a/src/game/QueryHandler.cpp b/src/game/QueryHandler.cpp
index 7c2bd21e81d..b70a85c58e2 100644
--- a/src/game/QueryHandler.cpp
+++ b/src/game/QueryHandler.cpp
@@ -191,8 +191,8 @@ void WorldSession::HandleCreatureQueryOpcode( WorldPacket & recv_data )
data << uint32(ci->type); // CreatureType.dbc
data << uint32(ci->family); // CreatureFamily.dbc
data << uint32(ci->rank); // Creature Rank (elite, boss, etc)
- data << uint32(ci->unk1); // new in 3.1, creature entry?
- data << uint32(ci->unk2); // new in 3.1, creature entry?
+ data << uint32(ci->KillCredit[0]); // new in 3.1, kill credit
+ data << uint32(ci->KillCredit[1]); // new in 3.1, kill credit
data << uint32(ci->DisplayID_A[0]); // modelid_male1
data << uint32(ci->DisplayID_H[0]); // modelid_female1 ?
data << uint32(ci->DisplayID_A[1]); // modelid_male2 ?
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 69e22885691..66a06135ec5 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -649,7 +649,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
// some critters required for quests
if(GetTypeId() == TYPEID_PLAYER)
- ((Player*)this)->KilledMonster(pVictim->GetEntry(),pVictim->GetGUID());
+ ((Player*)this)->KilledMonster(cInfo ,pVictim->GetGUID());
}
else
pVictim->ModifyHealth(- (int32)damage);