From c88b194e0a33111c7d62128f071cbe733242dd08 Mon Sep 17 00:00:00 2001 From: megamage Date: Thu, 9 Apr 2009 18:48:57 -0500 Subject: *Do not allow boss to be dazed by other creatures. --HG-- branch : trunk --- src/game/Unit.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 1af0ebd3bb5..c412be0e30b 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -1547,7 +1547,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 -- cgit v1.2.3 From 1e61dffc8969e2901adff5e34782aaa8c3c07e14 Mon Sep 17 00:00:00 2001 From: Rat Date: Fri, 10 Apr 2009 18:11:09 +0200 Subject: *added creature extra flag No Crit (CREATURE_FLAG_EXTRA_NO_CRIT) *added function to disable reputation gained from monsters *tabs2spaces in affected files --HG-- branch : trunk --- src/game/Creature.cpp | 1 + src/game/Creature.h | 6 ++++++ src/game/Player.cpp | 9 ++++++--- src/game/Unit.cpp | 7 ++++--- 4 files changed, 17 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index 471934f4f80..4a4415a8e08 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -158,6 +158,7 @@ m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL),m_creatureInfo(NULL), m_DBTabl 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 b477ea00f1d..0930fe00701 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 }; // GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push,N), also any gcc version not support it at some platform @@ -628,6 +629,9 @@ class TRINITY_DLL_SPEC Creature : public Unit uint32 GetFormationID(){return m_formationID;} Unit *SelectVictim(); + + 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); @@ -678,6 +682,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/Player.cpp b/src/game/Player.cpp index 764cb20c88c..24d36a42558 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -5924,6 +5924,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) @@ -15245,7 +15248,7 @@ bool Player::Satisfy(AccessRequirement const *ar, uint32 target_map, bool report missingItem = ar->item2; uint32 missingKey = 0; - uint32 missingHeroicQuest = 0; + uint32 missingHeroicQuest = 0; if(GetDifficulty() == DIFFICULTY_HEROIC) { if(ar->heroicKey) @@ -15257,7 +15260,7 @@ bool Player::Satisfy(AccessRequirement const *ar, uint32 target_map, bool report else if(ar->heroicKey2 && !HasItemCount(ar->heroicKey2, 1)) missingKey = ar->heroicKey2; - if(ar->heroicQuest && !GetQuestRewardStatus(ar->heroicQuest)) + if(ar->heroicQuest && !GetQuestRewardStatus(ar->heroicQuest)) missingHeroicQuest = ar->heroicQuest; } @@ -15273,7 +15276,7 @@ bool Player::Satisfy(AccessRequirement const *ar, uint32 target_map, bool report GetSession()->SendAreaTriggerMessage(GetSession()->GetTrinityString(LANG_LEVEL_MINREQUIRED_AND_ITEM), ar->levelMin, objmgr.GetItemPrototype(missingItem)->Name1); else if(missingKey) SendTransferAborted(target_map, TRANSFER_ABORT_DIFFICULTY2); - else if(missingHeroicQuest) + else if(missingHeroicQuest) GetSession()->SendAreaTriggerMessage(ar->heroicQuestFailedText.c_str()); else if(missingQuest) GetSession()->SendAreaTriggerMessage(ar->questFailedText.c_str()); diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index c412be0e30b..e5c6200e7a5 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -2557,7 +2557,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) @@ -4364,7 +4365,7 @@ void Unit::RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode) { caster->m_currentSpells[CURRENT_CHANNELED_SPELL]->cancel(); caster->m_currentSpells[CURRENT_CHANNELED_SPELL]=NULL; - + } } @@ -6138,7 +6139,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu triggered_spell_id = 21400; } else continue; - basepoints0 = CalculateSpellDamage(procSpell,i,procSpell->EffectBasePoints[i],this) * 0.4f; + basepoints0 = CalculateSpellDamage(procSpell,i,procSpell->EffectBasePoints[i],this) * 0.4f; CastCustomSpell(this,triggered_spell_id,&basepoints0,NULL,NULL,true,castItem,triggeredByAura); } return true; -- cgit v1.2.3 From ce0d9fbe8e828ca33ad5416a8719efa1339f393e Mon Sep 17 00:00:00 2001 From: Rat Date: Fri, 10 Apr 2009 22:02:52 +0200 Subject: *hyjal update -small cleanup -disable loot and reputation gain from trash mobs if players didn't do enough dmg -added raid damage to instance save -disable loot for bosses if players do less then 50% damage based on boss' max health -removed min players workaroud to start the events --HG-- branch : trunk --- .../zone/caverns_of_time/hyjal/boss_anetheron.cpp | 1 + .../zone/caverns_of_time/hyjal/boss_archimonde.cpp | 7 +++++-- .../zone/caverns_of_time/hyjal/boss_azgalor.cpp | 1 + .../zone/caverns_of_time/hyjal/boss_kazrogal.cpp | 1 + .../caverns_of_time/hyjal/boss_rage_winterchill.cpp | 1 + .../scripts/zone/caverns_of_time/hyjal/def_hyjal.h | 2 ++ .../scripts/zone/caverns_of_time/hyjal/hyjal.cpp | 19 ------------------- .../scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp | 7 ++++++- .../scripts/zone/caverns_of_time/hyjal/hyjalAI.h | 4 ---- .../zone/caverns_of_time/hyjal/hyjal_trash.cpp | 15 ++++++++++++--- .../scripts/zone/caverns_of_time/hyjal/hyjal_trash.h | 3 +++ .../zone/caverns_of_time/hyjal/instance_hyjal.cpp | 17 +++++++++++++++-- 12 files changed, 47 insertions(+), 31 deletions(-) (limited to 'src') 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 4095ef9ca23..89585b039fd 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 @@ -323,9 +324,9 @@ struct TargetDistanceOrder : public std::binary_functionGetInstanceData()); } @@ -426,6 +427,7 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public ScriptedAI void JustDied(Unit *victim) { + hyjal_trashAI::JustDied(victim); DoScriptText(SAY_DEATH, m_creature); if(pInstance) @@ -693,6 +695,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 f6a77174e5d..ed02258cd9f 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 9664fe6bf5f..312aa90a686 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->Say("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->Say("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 582cab0e290..f0112fe22f5 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 @@ -498,7 +498,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()) { @@ -971,6 +975,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 ba74c248707..4a2fbd6494e 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 1a0aaafb35b..b4fc3a65222 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 @@ -56,6 +57,8 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance uint32 allianceRetreat; bool ArchiYell; + uint32 RaidDamage; + void Initialize() { RageWinterchill = 0; @@ -69,6 +72,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) @@ -212,6 +216,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); @@ -232,6 +244,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; } @@ -255,7 +268,7 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance OUT_SAVE_INST_DATA; std::ostringstream stream; stream << Encounters[0] << " " << Encounters[1] << " " << Encounters[2] << " " - << Encounters[3] << " " << Encounters[4] << " " << allianceRetreat << " " << hordeRetreat; + << Encounters[3] << " " << Encounters[4] << " " << allianceRetreat << " " << hordeRetreat << " " << RaidDamage; char* out = new char[stream.str().length() + 1]; strcpy(out, stream.str().c_str()); if(out) @@ -278,7 +291,7 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance OUT_LOAD_INST_DATA(in); std::istringstream loadStream; loadStream.str(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; -- cgit v1.2.3 From e830ca720610505d3ab818e2142e939a1aa27ece Mon Sep 17 00:00:00 2001 From: Rat Date: Fri, 10 Apr 2009 23:48:44 +0200 Subject: *fix auras (buff/debuff) original patch by Iskander --HG-- branch : trunk --- src/game/Object.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/game/Object.cpp b/src/game/Object.cpp index 4a485f9c489..956b327820a 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -633,7 +633,8 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask if(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 if(index == UNIT_FIELD_FACTIONTEMPLATE) -- cgit v1.2.3 From 2a75430028074d8e957a09b6ed236c9d020cabbb Mon Sep 17 00:00:00 2001 From: megamage Date: Fri, 10 Apr 2009 17:52:42 -0500 Subject: *Fix a script bug that causes memory corruption. --HG-- branch : trunk --- .../scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp | 2 +- .../scripts/scripts/zone/isle_of_queldanas/isle_of_queldanas.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src') 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 7cd8cbe367a..325b5aeb8dd 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/isle_of_queldanas/isle_of_queldanas.cpp b/src/bindings/scripts/scripts/zone/isle_of_queldanas/isle_of_queldanas.cpp index 4462eee116c..900a5ae3d5b 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; } -- cgit v1.2.3