[8190] Update killing quest objectives base at creature_template KillCredit fields. Author: GriffonHeart
Note: for avoid double counting must be removed C++ scripts and EventAI scripts that do same thing in old way.
Signed-off-by: VladimirMangos <[email protected]>
Also implement KillCreditN field check at loading.
--HG--
branch : trunk
This commit is contained in:
+3
-3
@@ -23,7 +23,7 @@ DROP TABLE IF EXISTS `db_version`;
|
|||||||
CREATE TABLE `db_version` (
|
CREATE TABLE `db_version` (
|
||||||
`version` varchar(120) default NULL,
|
`version` varchar(120) default NULL,
|
||||||
`creature_ai_version` varchar(120) default NULL,
|
`creature_ai_version` varchar(120) default NULL,
|
||||||
`required_8158_01_mangos_playercreateinfo_action` bit(1) default NULL
|
`required_8190_01_mangos_creature_template` bit(1) default NULL
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
|
||||||
|
|
||||||
--
|
--
|
||||||
@@ -788,8 +788,8 @@ DROP TABLE IF EXISTS `creature_template`;
|
|||||||
CREATE TABLE `creature_template` (
|
CREATE TABLE `creature_template` (
|
||||||
`entry` mediumint(8) unsigned NOT NULL default '0',
|
`entry` mediumint(8) unsigned NOT NULL default '0',
|
||||||
`heroic_entry` mediumint(8) unsigned NOT NULL default '0',
|
`heroic_entry` mediumint(8) unsigned NOT NULL default '0',
|
||||||
`unk1` int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
`KillCredit1` int(11) unsigned NOT NULL default '0',
|
||||||
`unk2` int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
`KillCredit2` int(11) unsigned NOT NULL default '0',
|
||||||
`modelid_A` mediumint(8) unsigned NOT NULL default '0',
|
`modelid_A` mediumint(8) unsigned NOT NULL default '0',
|
||||||
`modelid_A2` mediumint(8) unsigned NOT NULL default '0',
|
`modelid_A2` mediumint(8) unsigned NOT NULL default '0',
|
||||||
`modelid_H` mediumint(8) unsigned NOT NULL default '0',
|
`modelid_H` mediumint(8) unsigned NOT NULL default '0',
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
-- ALTER TABLE db_version CHANGE COLUMN required_8158_01_mangos_playercreateinfo_action required_8190_01_mangos_creature_template bit;
|
||||||
|
|
||||||
|
ALTER TABLE `creature_template`
|
||||||
|
CHANGE COLUMN `unk1` `KillCredit1` int(11) unsigned NOT NULL default '0',
|
||||||
|
CHANGE COLUMN `unk2` `KillCredit2` int(11) unsigned NOT NULL default '0';
|
||||||
@@ -41,7 +41,7 @@ struct TRINITY_DLL_DECL npc_ravenholdtAI : public ScriptedAI
|
|||||||
{
|
{
|
||||||
if( who->GetTypeId() == TYPEID_PLAYER )
|
if( who->GetTypeId() == TYPEID_PLAYER )
|
||||||
if( CAST_PLR(who)->GetQuestStatus(6681) == QUEST_STATUS_INCOMPLETE )
|
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) { }
|
void EnterCombat(Unit* who) { }
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ bool GossipSelect_npc_beaten_corpse(Player *player, Creature *_Creature, uint32
|
|||||||
if(action == GOSSIP_ACTION_INFO_DEF +1)
|
if(action == GOSSIP_ACTION_INFO_DEF +1)
|
||||||
{
|
{
|
||||||
player->SEND_GOSSIP_MENU(3558, _Creature->GetGUID());
|
player->SEND_GOSSIP_MENU(3558, _Creature->GetGUID());
|
||||||
player->KilledMonster( 10668,_Creature->GetGUID() );
|
player->KilledMonsterCredit( 10668,_Creature->GetGUID() );
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ struct TRINITY_DLL_DECL mobs_bladespire_ogreAI : public ScriptedAI
|
|||||||
void JustDied(Unit* Killer)
|
void JustDied(Unit* Killer)
|
||||||
{
|
{
|
||||||
if (Killer->GetTypeId() == TYPEID_PLAYER)
|
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)
|
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);
|
DoScriptText(SAY_SPELL_INFLUENCE, m_creature, who);
|
||||||
//TODO: Move the below to updateAI and run if this statement == true
|
//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);
|
CAST_PLR(who)->RemoveAurasDueToSpell(36904);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ struct TRINITY_DLL_DECL mob_webbed_creatureAI : public ScriptedAI
|
|||||||
case 0:
|
case 0:
|
||||||
spawnCreatureID = 17681;
|
spawnCreatureID = 17681;
|
||||||
if (Killer->GetTypeId() == TYPEID_PLAYER)
|
if (Killer->GetTypeId() == TYPEID_PLAYER)
|
||||||
CAST_PLR(Killer)->KilledMonster(spawnCreatureID, m_creature->GetGUID());
|
CAST_PLR(Killer)->KilledMonsterCredit(spawnCreatureID, m_creature->GetGUID());
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
case 2:
|
case 2:
|
||||||
|
|||||||
+1
-1
@@ -89,7 +89,7 @@ struct TRINITY_DLL_DECL instance_old_hillsbrad : public ScriptedInstance
|
|||||||
player->SendUpdateWorldState(WORLD_STATE_OH,mBarrelCount);
|
player->SendUpdateWorldState(WORLD_STATE_OH,mBarrelCount);
|
||||||
|
|
||||||
if (mBarrelCount == 5)
|
if (mBarrelCount == 5)
|
||||||
player->KilledMonster(LODGE_QUEST_TRIGGER,0);
|
player->KilledMonsterCredit(LODGE_QUEST_TRIGGER,0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else
|
}else
|
||||||
|
|||||||
@@ -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)
|
for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||||
{
|
{
|
||||||
if (Player* pPlayer = itr->getSource())
|
if (Player* pPlayer = itr->getSource())
|
||||||
pPlayer->KilledMonster(20156,m_creature->GetGUID());
|
pPlayer->KilledMonsterCredit(20156,m_creature->GetGUID());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -634,7 +634,7 @@ struct TRINITY_DLL_DECL npc_unworthy_initiateAI : public ScriptedAI
|
|||||||
{
|
{
|
||||||
if(m_creature->GetEntry() != 29519)
|
if(m_creature->GetEntry() != 29519)
|
||||||
if(killer->GetTypeId() == TYPEID_PLAYER)
|
if(killer->GetTypeId() == TYPEID_PLAYER)
|
||||||
CAST_PLR(killer)->KilledMonster(29519,m_creature->GetGUID());
|
CAST_PLR(killer)->KilledMonsterCredit(29519,m_creature->GetGUID());
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddEquipp()
|
void AddEquipp()
|
||||||
@@ -1166,7 +1166,7 @@ struct TRINITY_DLL_DECL npc_dkc1_gothikAI : public ScriptedAI
|
|||||||
{
|
{
|
||||||
if(CAST_PLR(owner)->GetQuestStatus(12698) == QUEST_STATUS_INCOMPLETE)
|
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);
|
who->setDeathState(DEAD);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ struct TRINITY_DLL_DECL npc_greengill_slaveAI : public ScriptedAI
|
|||||||
{
|
{
|
||||||
Unit* plr = Unit::GetUnit((*m_creature), PlayerGUID);
|
Unit* plr = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||||
if(plr && CAST_PLR(plr)->GetQuestStatus(QUESTG) == QUEST_STATUS_INCOMPLETE)
|
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);
|
DoCast(m_creature, ENRAGE);
|
||||||
Unit* Myrmidon = me->FindNearestCreature(DM, 70);
|
Unit* Myrmidon = me->FindNearestCreature(DM, 70);
|
||||||
|
|||||||
@@ -547,7 +547,7 @@ struct TRINITY_DLL_DECL npc_creditmarker_visit_with_ancestorsAI : public Scripte
|
|||||||
{
|
{
|
||||||
// 18840: Sunspring, 18841: Laughing, 18842: Garadar, 18843: Bleeding
|
// 18840: Sunspring, 18841: Laughing, 18842: Garadar, 18843: Bleeding
|
||||||
if(!CAST_PLR(who)->GetReqKillOrCastCurrentCount(10085, creditMarkerId))
|
if(!CAST_PLR(who)->GetReqKillOrCastCurrentCount(10085, creditMarkerId))
|
||||||
CAST_PLR(who)->KilledMonster(creditMarkerId, m_creature->GetGUID());
|
CAST_PLR(who)->KilledMonsterCredit(creditMarkerId, m_creature->GetGUID());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -255,7 +255,7 @@ struct TRINITY_DLL_DECL npc_manaforge_control_consoleAI : public ScriptedAI
|
|||||||
{
|
{
|
||||||
Unit* u = Unit::GetUnit((*m_creature),someplayer);
|
Unit* u = Unit::GetUnit((*m_creature),someplayer);
|
||||||
if( u && u->GetTypeId() == TYPEID_PLAYER )
|
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);
|
DoCast(m_creature,SPELL_DISABLE_VISUAL);
|
||||||
}
|
}
|
||||||
if( goConsole )
|
if( goConsole )
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ struct TRINITY_DLL_DECL mob_mature_netherwing_drakeAI : public ScriptedAI
|
|||||||
DoScriptText(SAY_JUST_EATEN, m_creature);
|
DoScriptText(SAY_JUST_EATEN, m_creature);
|
||||||
|
|
||||||
if (Player* pPlr = Unit::GetPlayer(uiPlayerGUID))
|
if (Player* pPlr = Unit::GetPlayer(uiPlayerGUID))
|
||||||
pPlr->KilledMonster(NPC_EVENT_PINGER, m_creature->GetGUID());
|
pPlr->KilledMonsterCredit(NPC_EVENT_PINGER, m_creature->GetGUID());
|
||||||
|
|
||||||
Reset();
|
Reset();
|
||||||
m_creature->GetMotionMaster()->Clear();
|
m_creature->GetMotionMaster()->Clear();
|
||||||
@@ -269,7 +269,7 @@ struct TRINITY_DLL_DECL mob_enslaved_netherwing_drakeAI : public ScriptedAI
|
|||||||
Player* plr = Unit::GetPlayer(PlayerGUID);
|
Player* plr = Unit::GetPlayer(PlayerGUID);
|
||||||
if(plr && plr->GetQuestStatus(10854) == QUEST_STATUS_INCOMPLETE)
|
if(plr && plr->GetQuestStatus(10854) == QUEST_STATUS_INCOMPLETE)
|
||||||
{
|
{
|
||||||
plr->KilledMonster(22316, m_creature->GetGUID());
|
plr->KilledMonsterCredit(22316, m_creature->GetGUID());
|
||||||
/*
|
/*
|
||||||
float x,y,z;
|
float x,y,z;
|
||||||
m_creature->GetPosition(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);
|
Player* plr = Unit::GetPlayer(PlayerGUID);
|
||||||
if(plr && plr->GetQuestStatus(11020) == QUEST_STATUS_INCOMPLETE)
|
if(plr && plr->GetQuestStatus(11020) == QUEST_STATUS_INCOMPLETE)
|
||||||
plr->KilledMonster(23209, m_creature->GetGUID());
|
plr->KilledMonsterCredit(23209, m_creature->GetGUID());
|
||||||
}
|
}
|
||||||
PoisonTimer = 0;
|
PoisonTimer = 0;
|
||||||
m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
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_AIRY_SOUL 21116
|
||||||
#define ENTRY_ENRAGED_WATERY_SOUL 21109 // wrong model
|
#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_EARTHEN_SOUL_CAPTURED_CREDIT 36108
|
||||||
#define SPELL_FIERY_SOUL_CAPTURED_CREDIT 36117
|
#define SPELL_FIERY_SOUL_CAPTURED_CREDIT 36117
|
||||||
#define SPELL_AIRY_SOUL_CAPTURED_CREDIT 36182
|
#define SPELL_AIRY_SOUL_CAPTURED_CREDIT 36182
|
||||||
#define SPELL_WATERY_SOUL_CAPTURED_CREDIT 36171
|
#define SPELL_WATERY_SOUL_CAPTURED_CREDIT 36171
|
||||||
|
|
||||||
/* KilledMonster Workaround */
|
/* KilledMonsterCredit Workaround */
|
||||||
#define CREDIT_FIRE 21094
|
#define CREDIT_FIRE 21094
|
||||||
#define CREDIT_WATER 21095
|
#define CREDIT_WATER 21095
|
||||||
#define CREDIT_AIR 21096
|
#define CREDIT_AIR 21096
|
||||||
@@ -1758,7 +1758,7 @@ struct TRINITY_DLL_DECL npc_enraged_spiritAI : public ScriptedAI
|
|||||||
Unit* Owner = totemOspirits->GetOwner();
|
Unit* Owner = totemOspirits->GetOwner();
|
||||||
if (Owner && Owner->GetTypeId() == TYPEID_PLAYER)
|
if (Owner && Owner->GetTypeId() == TYPEID_PLAYER)
|
||||||
// DoCast(Owner, credit); -- not working!
|
// DoCast(Owner, credit); -- not working!
|
||||||
CAST_PLR(Owner)->KilledMonster(credit, Summoned->GetGUID());
|
CAST_PLR(Owner)->KilledMonsterCredit(credit, Summoned->GetGUID());
|
||||||
DoCast(totemOspirits,SPELL_SOUL_CAPTURED);
|
DoCast(totemOspirits,SPELL_SOUL_CAPTURED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ bool GossipSelect_npcs_rutgar_and_frankal(Player *player, Creature *_Creature, u
|
|||||||
case GOSSIP_ACTION_INFO_DEF + 6:
|
case GOSSIP_ACTION_INFO_DEF + 6:
|
||||||
player->SEND_GOSSIP_MENU(7761, _Creature->GetGUID());
|
player->SEND_GOSSIP_MENU(7761, _Creature->GetGUID());
|
||||||
//'kill' our trigger to update quest status
|
//'kill' our trigger to update quest status
|
||||||
player->KilledMonster( TRIGGER_RUTGAR, _Creature->GetGUID() );
|
player->KilledMonsterCredit( TRIGGER_RUTGAR, _Creature->GetGUID() );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GOSSIP_ACTION_INFO_DEF + 9:
|
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:
|
case GOSSIP_ACTION_INFO_DEF + 14:
|
||||||
player->SEND_GOSSIP_MENU(7767, _Creature->GetGUID());
|
player->SEND_GOSSIP_MENU(7767, _Creature->GetGUID());
|
||||||
//'kill' our trigger to update quest status
|
//'kill' our trigger to update quest status
|
||||||
player->KilledMonster( TRIGGER_FRANKAL, _Creature->GetGUID() );
|
player->KilledMonsterCredit( TRIGGER_FRANKAL, _Creature->GetGUID() );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ struct TRINITY_DLL_DECL boss_silver_hand_bossesAI : public ScriptedAI
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(pInstance->GetData(TYPE_SH_QUEST) && Killer->GetTypeId() == TYPEID_PLAYER)
|
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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ struct TRINITY_DLL_DECL mob_netherweb_victimAI : public ScriptedAI
|
|||||||
if( rand()%100 < 25 )
|
if( rand()%100 < 25 )
|
||||||
{
|
{
|
||||||
DoSpawnCreature(QUEST_TARGET,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,60000);
|
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
|
}else
|
||||||
DoSpawnCreature(netherwebVictims[rand()%6],0,0,0,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,60000);
|
DoSpawnCreature(netherwebVictims[rand()%6],0,0,0,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,60000);
|
||||||
|
|
||||||
|
|||||||
+3
-2
@@ -172,13 +172,14 @@ enum SummonMask
|
|||||||
#pragma pack(push,1)
|
#pragma pack(push,1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define MAX_KILL_CREDIT 2
|
||||||
|
|
||||||
// from `creature_template` table
|
// from `creature_template` table
|
||||||
struct CreatureInfo
|
struct CreatureInfo
|
||||||
{
|
{
|
||||||
uint32 Entry;
|
uint32 Entry;
|
||||||
uint32 HeroicEntry;
|
uint32 HeroicEntry;
|
||||||
uint32 unk1;
|
uint32 KillCredit[MAX_KILL_CREDIT];
|
||||||
uint32 unk2;
|
|
||||||
uint32 DisplayID_A[2];
|
uint32 DisplayID_A[2];
|
||||||
uint32 DisplayID_H[2];
|
uint32 DisplayID_H[2];
|
||||||
char* Name;
|
char* Name;
|
||||||
|
|||||||
+3
-2
@@ -5690,8 +5690,9 @@ bool ChatHandler::HandleQuestComplete(const char* args)
|
|||||||
}
|
}
|
||||||
else if(creature > 0)
|
else if(creature > 0)
|
||||||
{
|
{
|
||||||
for(uint16 z = 0; z < creaturecount; ++z)
|
if(CreatureInfo const* cInfo = objmgr.GetCreatureTemplate(creature))
|
||||||
player->KilledMonster(creature,0);
|
for(uint16 z = 0; z < creaturecount; ++z)
|
||||||
|
player->KilledMonster(cInfo,0);
|
||||||
}
|
}
|
||||||
else if(creature < 0)
|
else if(creature < 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -703,6 +703,18 @@ void ObjectMgr::LoadCreatureTemplates()
|
|||||||
if (!displayScaleEntry)
|
if (!displayScaleEntry)
|
||||||
sLog.outErrorDb("Creature (Entry: %u) not has any existed display id in DisplayID_A/DisplayID_A2/DisplayID_H/DisplayID_H2", cInfo->Entry);
|
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)
|
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);
|
sLog.outErrorDb("Creature (Entry: %u) has invalid unit_class(%u) for creature_template", cInfo->Entry, cInfo->unit_class);
|
||||||
|
|
||||||
|
|||||||
@@ -359,7 +359,7 @@ void OPvPCapturePoint::SendObjectiveComplete(uint32 id,uint64 guid)
|
|||||||
|
|
||||||
// send to all players present in the area
|
// send to all players present in the area
|
||||||
for(PlayerSet::iterator itr = m_activePlayers[team].begin(); itr != m_activePlayers[team].end(); ++itr)
|
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)
|
void OutdoorPvP::HandleKill(Player *killer, Unit * killed)
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ void OutdoorPvPNA::HandleKillImpl(Player *plr, Unit * killed)
|
|||||||
{
|
{
|
||||||
if(killed->GetTypeId() == TYPEID_PLAYER && plr->GetTeam() != ((Player*)killed)->GetTeam())
|
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)
|
if(plr->GetTeam() == ALLIANCE)
|
||||||
plr->CastSpell(plr,NA_KILL_TOKEN_ALLIANCE,true);
|
plr->CastSpell(plr,NA_KILL_TOKEN_ALLIANCE,true);
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ bool OutdoorPvPSI::HandleAreaTrigger(Player *plr, uint32 trigger)
|
|||||||
// add 20 cenarion circle repu
|
// add 20 cenarion circle repu
|
||||||
plr->GetReputationMgr().ModifyReputation(sFactionStore.LookupEntry(609),20);
|
plr->GetReputationMgr().ModifyReputation(sFactionStore.LookupEntry(609),20);
|
||||||
// complete quest
|
// complete quest
|
||||||
plr->KilledMonster(SI_TURNIN_QUEST_CM_A,0);
|
plr->KilledMonsterCredit(SI_TURNIN_QUEST_CM_A,0);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
case SI_AREATRIGGER_H:
|
case SI_AREATRIGGER_H:
|
||||||
@@ -132,7 +132,7 @@ bool OutdoorPvPSI::HandleAreaTrigger(Player *plr, uint32 trigger)
|
|||||||
// add 20 cenarion circle repu
|
// add 20 cenarion circle repu
|
||||||
plr->GetReputationMgr().ModifyReputation(sFactionStore.LookupEntry(609),20);
|
plr->GetReputationMgr().ModifyReputation(sFactionStore.LookupEntry(609),20);
|
||||||
// complete quest
|
// complete quest
|
||||||
plr->KilledMonster(SI_TURNIN_QUEST_CM_H,0);
|
plr->KilledMonsterCredit(SI_TURNIN_QUEST_CM_H,0);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
+15
-5
@@ -13807,7 +13807,17 @@ void Player::ItemRemovedQuestCheck( uint32 entry, uint32 count )
|
|||||||
UpdateForQuestWorldObjects();
|
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;
|
uint32 addkillcount = 1;
|
||||||
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, entry, addkillcount);
|
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
|
// normal creature (not pet/etc) can be only in !PvP case
|
||||||
if(pVictim->GetTypeId()==TYPEID_UNIT)
|
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
|
// normal creature (not pet/etc) can be only in !PvP case
|
||||||
if(pVictim->GetTypeId()==TYPEID_UNIT)
|
if(pVictim->GetTypeId()==TYPEID_UNIT)
|
||||||
KilledMonster(pVictim->GetEntry(),pVictim->GetGUID());
|
KilledMonster(((Creature*)pVictim)->GetCreatureInfo(), pVictim->GetGUID());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return xp || honored_kill;
|
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
|
// quest objectives updated only for alive group member or dead but with not released body
|
||||||
if(pGroupGuy->isAlive()|| !pGroupGuy->GetCorpse())
|
if(pGroupGuy->isAlive()|| !pGroupGuy->GetCorpse())
|
||||||
pGroupGuy->KilledMonster(creature_id, creature_guid);
|
pGroupGuy->KilledMonsterCredit(creature_id, creature_guid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // if (!pGroup)
|
else // if (!pGroup)
|
||||||
KilledMonster(creature_id, creature_guid);
|
KilledMonsterCredit(creature_id, creature_guid);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Player::IsAtGroupRewardDistance(WorldObject const* pRewardSource) const
|
bool Player::IsAtGroupRewardDistance(WorldObject const* pRewardSource) const
|
||||||
|
|||||||
+2
-1
@@ -1229,7 +1229,8 @@ class TRINITY_DLL_SPEC Player : public Unit
|
|||||||
void GroupEventHappens( uint32 questId, WorldObject const* pEventObject );
|
void GroupEventHappens( uint32 questId, WorldObject const* pEventObject );
|
||||||
void ItemAddedQuestCheck( uint32 entry, uint32 count );
|
void ItemAddedQuestCheck( uint32 entry, uint32 count );
|
||||||
void ItemRemovedQuestCheck( 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 CastedCreatureOrGO( uint32 entry, uint64 guid, uint32 spell_id );
|
||||||
void TalkedToCreature( uint32 entry, uint64 guid );
|
void TalkedToCreature( uint32 entry, uint64 guid );
|
||||||
void MoneyChanged( uint32 value );
|
void MoneyChanged( uint32 value );
|
||||||
|
|||||||
@@ -191,8 +191,8 @@ void WorldSession::HandleCreatureQueryOpcode( WorldPacket & recv_data )
|
|||||||
data << uint32(ci->type); // CreatureType.dbc
|
data << uint32(ci->type); // CreatureType.dbc
|
||||||
data << uint32(ci->family); // CreatureFamily.dbc
|
data << uint32(ci->family); // CreatureFamily.dbc
|
||||||
data << uint32(ci->rank); // Creature Rank (elite, boss, etc)
|
data << uint32(ci->rank); // Creature Rank (elite, boss, etc)
|
||||||
data << uint32(ci->unk1); // new in 3.1, creature entry?
|
data << uint32(ci->KillCredit[0]); // new in 3.1, kill credit
|
||||||
data << uint32(ci->unk2); // new in 3.1, creature entry?
|
data << uint32(ci->KillCredit[1]); // new in 3.1, kill credit
|
||||||
data << uint32(ci->DisplayID_A[0]); // modelid_male1
|
data << uint32(ci->DisplayID_A[0]); // modelid_male1
|
||||||
data << uint32(ci->DisplayID_H[0]); // modelid_female1 ?
|
data << uint32(ci->DisplayID_H[0]); // modelid_female1 ?
|
||||||
data << uint32(ci->DisplayID_A[1]); // modelid_male2 ?
|
data << uint32(ci->DisplayID_A[1]); // modelid_male2 ?
|
||||||
|
|||||||
+1
-1
@@ -649,7 +649,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
|
|||||||
|
|
||||||
// some critters required for quests
|
// some critters required for quests
|
||||||
if(GetTypeId() == TYPEID_PLAYER)
|
if(GetTypeId() == TYPEID_PLAYER)
|
||||||
((Player*)this)->KilledMonster(pVictim->GetEntry(),pVictim->GetGUID());
|
((Player*)this)->KilledMonster(cInfo ,pVictim->GetGUID());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
pVictim->ModifyHealth(- (int32)damage);
|
pVictim->ModifyHealth(- (int32)damage);
|
||||||
|
|||||||
Reference in New Issue
Block a user