diff options
author | megamage <none@none> | 2009-04-10 18:01:15 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-04-10 18:01:15 -0500 |
commit | d1c2d980153744977c5c44d520d3e1ff9204dbcf (patch) | |
tree | 1c9fde093cb7851411c6c59da76821d3c3f81bc3 | |
parent | c106914e945dbf5ce9a249a80f1e30ca10bf06e2 (diff) | |
parent | 2a75430028074d8e957a09b6ed236c9d020cabbb (diff) |
*Merge.
--HG--
branch : trunk
19 files changed, 66 insertions, 36 deletions
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp index 6b030f53d9a..8e2d4cea736 100644 --- a/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp +++ b/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp @@ -255,7 +255,7 @@ struct TRINITY_DLL_DECL mob_ethereal_beaconAI : public ScriptedAI m_creature->InterruptNonMeleeSpells(true); m_creature->CastSpell(m_creature,SPELL_ETHEREAL_APPRENTICE,true); - if( m_creature->GetOwner() ) + if( m_creature->isPet() ) ((Pet*)m_creature)->SetDuration(0); CanEvade = true; }else Apprentice_Timer -= diff; diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_anetheron.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_anetheron.cpp index 5fb5577960b..25e22f8f391 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_anetheron.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_anetheron.cpp @@ -110,6 +110,7 @@ struct TRINITY_DLL_DECL boss_anetheronAI : public hyjal_trashAI void JustDied(Unit *victim) { + hyjal_trashAI::JustDied(victim); if(pInstance && IsEvent) pInstance->SetData(DATA_ANETHERONEVENT, DONE); DoPlaySoundToSet(m_creature, SOUND_ONDEATH); diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_archimonde.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_archimonde.cpp index 86823aae7d4..b89a614389e 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_archimonde.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_archimonde.cpp @@ -24,6 +24,7 @@ EndScriptData */ #include "precompiled.h" #include "def_hyjal.h" #include "SpellAuras.h" +#include "hyjal_trash.h" //text id -1534018 are the text used when previous events complete. Not part of this script. #define SAY_AGGRO -1534019 @@ -201,9 +202,9 @@ struct TargetDistanceOrder : public std::binary_function<const Unit, const Unit, } }; -struct TRINITY_DLL_DECL boss_archimondeAI : public ScriptedAI +struct TRINITY_DLL_DECL boss_archimondeAI : public hyjal_trashAI { - boss_archimondeAI(Creature *c) : ScriptedAI(c) + boss_archimondeAI(Creature *c) : hyjal_trashAI(c) { pInstance = ((ScriptedInstance*)c->GetInstanceData()); } @@ -310,6 +311,7 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public ScriptedAI void JustDied(Unit *victim) { + hyjal_trashAI::JustDied(victim); DoScriptText(SAY_DEATH, m_creature); if (pInstance) @@ -608,6 +610,7 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public ScriptedAI DoMeleeAttackIfReady(); } + void WaypointReached(uint32 i){} }; CreatureAI* GetAI_boss_archimonde(Creature *_Creature) diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_azgalor.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_azgalor.cpp index 3228566c6e8..85948706145 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_azgalor.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_azgalor.cpp @@ -103,6 +103,7 @@ struct TRINITY_DLL_DECL boss_azgalorAI : public hyjal_trashAI void JustDied(Unit *victim) { + hyjal_trashAI::JustDied(victim); if(pInstance && IsEvent) pInstance->SetData(DATA_AZGALOREVENT, DONE); DoPlaySoundToSet(m_creature, SOUND_ONDEATH); diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_kazrogal.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_kazrogal.cpp index 29674dac0ff..6bd24fca7a4 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_kazrogal.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_kazrogal.cpp @@ -98,6 +98,7 @@ struct TRINITY_DLL_DECL boss_kazrogalAI : public hyjal_trashAI void JustDied(Unit *victim) { + hyjal_trashAI::JustDied(victim); if(pInstance && IsEvent) pInstance->SetData(DATA_KAZROGALEVENT, DONE); DoPlaySoundToSet(m_creature, SOUND_ONDEATH); diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_rage_winterchill.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_rage_winterchill.cpp index 1bc8823d3e6..b125668947c 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_rage_winterchill.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_rage_winterchill.cpp @@ -94,6 +94,7 @@ struct TRINITY_DLL_DECL boss_rage_winterchillAI : public hyjal_trashAI void JustDied(Unit *victim) { + hyjal_trashAI::JustDied(victim); if(pInstance && IsEvent) pInstance->SetData(DATA_RAGEWINTERCHILLEVENT, DONE); DoPlaySoundToSet(m_creature, SOUND_ONDEATH); diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/def_hyjal.h b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/def_hyjal.h index 948dbcaa53a..7d81dbe4993 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/def_hyjal.h +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/def_hyjal.h @@ -26,6 +26,8 @@ #define DATA_RESET_TRASH_COUNT 15 #define DATA_ALLIANCE_RETREAT 16 #define DATA_HORDE_RETREAT 17 +#define DATA_RAIDDAMAGE 18 +#define DATA_RESET_RAIDDAMAGE 19 #define ERROR_INST_DATA "TSCR: Instance data not set properly for Mount Hyjal. Encounters will be buggy" #endif diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp index a63856ea6f2..faa7f9eaad7 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp @@ -83,17 +83,11 @@ bool GossipHello_npc_jaina_proudmoore(Player *player, Creature *_Creature) player->ADD_GOSSIP_ITEM(2, "[GM] Toggle Debug Timers", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); player->SEND_GOSSIP_MENU(907, _Creature->GetGUID()); - return true; } bool GossipSelect_npc_jaina_proudmoore(Player *player, Creature *_Creature, uint32 sender, uint32 action) { - if(_Creature->GetMap()->GetPlayersCountExceptGMs() < MINPLAYERS && !player->isGameMaster()) - { - _Creature->MonsterSay("Did you come to die with me?",0,0); - return true; - } hyjalAI* ai = ((hyjalAI*)_Creature->AI()); switch(action) { @@ -113,7 +107,6 @@ bool GossipSelect_npc_jaina_proudmoore(Player *player, Creature *_Creature, uint debug_log("SD2: HyjalAI - Debug mode has been toggled"); break; } - return true; } @@ -138,12 +131,10 @@ CreatureAI* GetAI_npc_thrall(Creature *_Creature) bool GossipHello_npc_thrall(Player *player, Creature *_Creature) { hyjalAI* ai = ((hyjalAI*)_Creature->AI()); - if (ai->EventBegun) return false; uint32 AnetheronEvent = ai->GetInstanceData(DATA_ANETHERONEVENT); - // Only let them start the Horde phases if Anetheron is dead. if (AnetheronEvent == DONE && ai->GetInstanceData(DATA_ALLIANCE_RETREAT)) { @@ -161,17 +152,11 @@ bool GossipHello_npc_thrall(Player *player, Creature *_Creature) player->ADD_GOSSIP_ITEM(2, "[GM] Toggle Debug Timers", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); player->SEND_GOSSIP_MENU(907, _Creature->GetGUID()); - return true; } bool GossipSelect_npc_thrall(Player *player, Creature *_Creature, uint32 sender, uint32 action) { - if(_Creature->GetMap()->GetPlayersCountExceptGMs() < MINPLAYERS && !player->isGameMaster())//to stop idiot farmers - { - _Creature->MonsterSay("Did you come to die with me?",0,0); - return true; - } hyjalAI* ai = ((hyjalAI*)_Creature->AI()); ai->DeSpawnVeins();//despawn the alliance veins switch(action) @@ -192,7 +177,6 @@ bool GossipSelect_npc_thrall(Player *player, Creature *_Creature, uint32 sender, debug_log("SD2: HyjalAI - Debug mode has been toggled"); break; } - return true; } @@ -201,14 +185,12 @@ CreatureAI* GetAI_npc_tyrande_whisperwind(Creature *_Creature) hyjalAI* ai = new hyjalAI(_Creature); ai->Reset(); ai->EnterEvadeMode(); - return ai; } bool GossipHello_npc_tyrande_whisperwind(Player* player, Creature* _Creature) { hyjalAI* ai = ((hyjalAI*)_Creature->AI()); - //ai->DeSpawnVeins();//dont despawn the horde veins if someone takes the item from Tyrande uint32 AzgalorEvent = ai->GetInstanceData(DATA_AZGALOREVENT); // Only let them get item if Azgalor is dead. @@ -233,7 +215,6 @@ bool GossipSelect_npc_tyrande_whisperwind(Player *player, Creature *_Creature, u player->SEND_GOSSIP_MENU(907, _Creature->GetGUID()); hyjalAI* ai = ((hyjalAI*)_Creature->AI()); } - return true; } diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp index f27d2434550..c11abaa9b14 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp @@ -499,7 +499,11 @@ void hyjalAI::SummonCreature(uint32 entry, float Base[4][3]) ((hyjal_trashAI*)pCreature->AI())->IsEvent = true; break; } - + if(pInstance) + { + if(pInstance->GetData(DATA_RAIDDAMAGE) < MINRAIDDAMAGE) + pCreature->SetDisableReputationGain(true);//no repu for solo farming + } // Check if creature is a boss. if (pCreature->isWorldBoss()) { @@ -972,6 +976,7 @@ void hyjalAI::JustDied(Unit* killer) pInstance->SetData(DATA_KAZROGALEVENT, NOT_STARTED); if(pInstance->GetData(DATA_AZGALOREVENT) == IN_PROGRESS) pInstance->SetData(DATA_AZGALOREVENT, NOT_STARTED); + pInstance->SetData(DATA_RESET_RAIDDAMAGE, NULL);//reset damage on die } } void hyjalAI::HideNearPos(float x, float y) diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.h b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.h index f7aa2122db9..ba75eaa36f2 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.h +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.h @@ -8,10 +8,6 @@ #include "def_hyjal.h" #include "../../../npc/npc_escortAI.h" - -#define MINPLAYERS 1//min players on the map (except gms) to start the events, to prevent one player farming - - // Trash Mobs summoned in waves #define NECROMANCER 17899//done #define ABOMINATION 17898//done diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.cpp index f9f4f68fb42..3f6fd1044ff 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.cpp @@ -145,13 +145,18 @@ hyjal_trashAI::hyjal_trashAI(Creature *c) : npc_escortAI(c) SetupOverrun = false; faction = 0; useFlyPath = false; + damageTaken = 0; Reset(); } void hyjal_trashAI::DamageTaken(Unit *done_by, uint32 &damage) { - if(IsOverrun && done_by->GetTypeId() == TYPEID_UNIT && ((Creature*)done_by)->GetEntry() == 17931)//don't take dmg from the dummy target - damage = 0; + if(done_by->GetTypeId() == TYPEID_PLAYER) + { + damageTaken += damage; + if(pInstance) + pInstance->SetData(DATA_RAIDDAMAGE,damage);//store raid's damage + } } void hyjal_trashAI::Aggro(Unit *who){} @@ -328,9 +333,13 @@ void hyjal_trashAI::UpdateAI(const uint32 diff) void hyjal_trashAI::JustDied(Unit *victim) { - if(pInstance && IsEvent) + if(!pInstance)return; + if(IsEvent && !m_creature->isWorldBoss()) pInstance->SetData(DATA_TRASH, 0);//signal trash is dead + if((pInstance->GetData(DATA_RAIDDAMAGE) < MINRAIDDAMAGE && !m_creature->isWorldBoss()) || (damageTaken < m_creature->GetMaxHealth()/2 && m_creature->isWorldBoss())) + m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);//no loot + if(IsOverrun) { float x,y,z,o; diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.h b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.h index 2473184dc87..3ea12038436 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.h +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.h @@ -5,6 +5,8 @@ #include "def_hyjal.h" #include "../../../npc/npc_escortAI.h" +#define MINRAIDDAMAGE 1000000//minimal damage before trash can drop loot and reputation + struct TRINITY_DLL_DECL hyjal_trashAI : public npc_escortAI { hyjal_trashAI(Creature *c); @@ -31,6 +33,7 @@ struct TRINITY_DLL_DECL hyjal_trashAI : public npc_escortAI uint32 OverrunType; uint8 faction; bool useFlyPath; + uint32 damageTaken; //private: }; diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/instance_hyjal.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/instance_hyjal.cpp index 89a895713f7..13844079b84 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/instance_hyjal.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/instance_hyjal.cpp @@ -23,6 +23,7 @@ EndScriptData */ #include "precompiled.h" #include "def_hyjal.h" +#include "hyjal_trash.h" #define ENCOUNTERS 5 @@ -59,6 +60,8 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance uint32 allianceRetreat; bool ArchiYell; + uint32 RaidDamage; + void Initialize() { RageWinterchill = 0; @@ -72,6 +75,7 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance HordeGate = 0; ElfGate = 0; ArchiYell = false; + RaidDamage = 0; Trash = 0; for(uint8 i = 0; i < ENCOUNTERS; ++i) @@ -214,6 +218,14 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance OpenDoor(ElfGate,true); SaveToDB(); break; + case DATA_RAIDDAMAGE: + RaidDamage += data; + if(RaidDamage >= MINRAIDDAMAGE) + RaidDamage = MINRAIDDAMAGE; + break; + case DATA_RESET_RAIDDAMAGE: + RaidDamage = 0; + break; } debug_log("SD2: Instance Hyjal: Instance data updated for event %u (Data=%u)",type,data); @@ -225,7 +237,8 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance std::ostringstream saveStream; saveStream << Encounters[0] << " " << Encounters[1] << " " << Encounters[2] << " " << Encounters[3] << " " << Encounters[4] - << " " << allianceRetreat << " " << hordeRetreat; + << " " << allianceRetreat << " " << hordeRetreat + << " " << RaidDamage; str_data = saveStream.str(); @@ -247,6 +260,7 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance case DATA_TRASH: return Trash; case DATA_ALLIANCE_RETREAT: return allianceRetreat; case DATA_HORDE_RETREAT: return hordeRetreat; + case DATA_RAIDDAMAGE: return RaidDamage; } return 0; } @@ -280,7 +294,7 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance OUT_LOAD_INST_DATA(in); std::istringstream loadStream(in); - loadStream >> Encounters[0] >> Encounters[1] >> Encounters[2] >> Encounters[3] >> Encounters[4] >> allianceRetreat >> hordeRetreat; + loadStream >> Encounters[0] >> Encounters[1] >> Encounters[2] >> Encounters[3] >> Encounters[4] >> allianceRetreat >> hordeRetreat >> RaidDamage; for(uint8 i = 0; i < ENCOUNTERS; ++i) if(Encounters[i] == IN_PROGRESS) // Do not load an encounter as IN_PROGRESS - reset it instead. Encounters[i] = NOT_STARTED; 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 75d78fde331..70a77302823 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 @@ -101,7 +101,8 @@ struct TRINITY_DLL_DECL npc_converted_sentryAI : public ScriptedAI else DoScriptText(SAY_CONVERTED_2, m_creature); DoCast(m_creature, SPELL_CONVERT_CREDIT); - ((Pet*)m_creature)->SetDuration(7500); + if(m_creature->isPet()) + ((Pet*)m_creature)->SetDuration(7500); Credit = true; }else Timer -= diff; } diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index 74ebe4406c8..e41d18ac0a0 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -151,6 +151,7 @@ m_creatureInfo(NULL), m_reactState(REACT_AGGRESSIVE), m_formation(NULL), m_summo m_CreatureCategoryCooldowns.clear(); m_GlobalCooldown = 0; m_unit_movement_flags = MOVEMENTFLAG_WALK_MODE; + DisableReputationGain = false; } Creature::~Creature() diff --git a/src/game/Creature.h b/src/game/Creature.h index 0b09a00b84f..ce890c34902 100644 --- a/src/game/Creature.h +++ b/src/game/Creature.h @@ -134,6 +134,7 @@ enum CreatureFlagsExtra CREATURE_FLAG_EXTRA_WORLDEVENT = 0x00004000, // custom flag for world event creatures (left room for merging) //CREATURE_FLAG_EXTRA_CHARM_AI = 0x00008000, // use ai when charmed CREATURE_FLAG_EXTRA_NO_TAUNT = 0x00010000, // cannot be taunted + CREATURE_FLAG_EXTRA_NO_CRIT = 0x00020000, // creature can't do critical strikes }; enum SummonMask @@ -681,6 +682,8 @@ class TRINITY_DLL_SPEC Creature : public Unit Unit *SelectVictim(); void SetDeadByDefault (bool death_state) {m_isDeadByDefault = death_state;} + void SetDisableReputationGain(bool disable) { DisableReputationGain = disable; } + bool IsReputationGainDisabled() { return DisableReputationGain; } protected: bool CreateFromProto(uint32 guidlow,uint32 Entry,uint32 team, const CreatureData *data = NULL); bool InitEntry(uint32 entry, uint32 team=ALLIANCE, const CreatureData* data=NULL); @@ -729,6 +732,8 @@ class TRINITY_DLL_SPEC Creature : public Unit float mHome_Z; float mHome_O; + bool DisableReputationGain; + private: //WaypointMovementGenerator vars uint32 m_waypointID; diff --git a/src/game/Object.cpp b/src/game/Object.cpp index 924188bc3e2..cf59105742e 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -673,7 +673,8 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask if(sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP) && index == UNIT_FIELD_BYTES_2) { DEBUG_LOG("-- VALUES_UPDATE: Sending '%s' the blue-group-fix from '%s' (flag)", target->GetName(), ((Player*)this)->GetName()); - *data << ( m_uint32Values[ index ] & (UNIT_BYTE2_FLAG_SANCTUARY << 8) ); // this flag is at uint8 offset 1 !! + *data << ( m_uint32Values[ index ] & ((UNIT_BYTE2_FLAG_SANCTUARY | UNIT_BYTE2_FLAG_AURAS | UNIT_BYTE2_FLAG_UNK5) << 8) ); // this flag is at uint8 offset 1 !! + ch = true; } else diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 2064a6b6f3c..992630ad1d5 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -5722,6 +5722,9 @@ void Player::RewardReputation(Unit *pVictim, float rate) if(!pVictim || pVictim->GetTypeId() == TYPEID_PLAYER) return; + if(((Creature*)pVictim)->IsReputationGainDisabled()) + return; + ReputationOnKillEntry const* Rep = objmgr.GetReputationOnKilEntry(((Creature*)pVictim)->GetCreatureInfo()->Entry); if(!Rep) diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index a54ca74dfc6..c287cb1a033 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -1621,7 +1621,8 @@ void Unit::DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss) // If this is a creature and it attacks from behind it has a probability to daze it's victim if( (damageInfo->hitOutCome==MELEE_HIT_CRIT || damageInfo->hitOutCome==MELEE_HIT_CRUSHING || damageInfo->hitOutCome==MELEE_HIT_NORMAL || damageInfo->hitOutCome==MELEE_HIT_GLANCING) && - GetTypeId() != TYPEID_PLAYER && !((Creature*)this)->GetCharmerOrOwnerGUID() && !pVictim->HasInArc(M_PI, this) ) + GetTypeId() != TYPEID_PLAYER && !((Creature*)this)->GetCharmerOrOwnerGUID() && !pVictim->HasInArc(M_PI, this) + && (pVictim->GetTypeId() == TYPEID_PLAYER || !((Creature*)pVictim)->isWorldBoss())) { // -probability is between 0% and 40% // 20% base chance @@ -2424,7 +2425,8 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack if (tmp > 0 && roll < (sum += tmp)) { DEBUG_LOG ("RollMeleeOutcomeAgainst: CRIT <%d, %d)", sum-tmp, sum); - return MELEE_HIT_CRIT; + if(GetTypeId()!=TYPEID_PLAYER && !(((Creature*)this)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRIT)) + return MELEE_HIT_CRIT; } // Max 40% chance to score a glancing blow against mobs that are higher level (can do only players and pets and not with ranged weapon) |