From e79656b75a3a4272f25457b11856f8ca9df29ba4 Mon Sep 17 00:00:00 2001 From: megamage Date: Thu, 23 Jul 2009 09:17:35 +0800 Subject: *Use virtual function for GetFollowAngle --HG-- branch : trunk --- src/game/Unit.cpp | 9 --------- 1 file changed, 9 deletions(-) (limited to 'src/game/Unit.cpp') diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 5f651fcd015..308d510e5ae 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -14906,15 +14906,6 @@ void Unit::SetFlying(bool apply) } } -float Unit::GetFollowAngle() const -{ - if (GetTypeId()!=TYPEID_UNIT) - return PET_FOLLOW_ANGLE; - if (!((Creature*)this)->HasSummonMask(SUMMON_MASK_MINION)) - return PET_FOLLOW_ANGLE; - return ((Minion*)this)->GetFollowAngle(); -} - void Unit::NearTeleportTo( float x, float y, float z, float orientation, bool casting /*= false*/ ) { if(GetTypeId() == TYPEID_PLAYER) -- cgit v1.2.3 From 1eef9f86f63ce0c61635c059681845a3a953744a Mon Sep 17 00:00:00 2001 From: QAston Date: Thu, 23 Jul 2009 15:13:17 +0200 Subject: *Script for Plug the Sinkholes - by Drethek. --HG-- branch : trunk --- sql/FULL/world_scripts_full.sql | 4 +- sql/FULL/world_tmp_full.sql | 1 + sql/updates/4544_world.sql | 3 + src/bindings/scripts/scripts/item/item_scripts.cpp | 22 ++++ .../scripts/zone/borean_tundra/borean_tundra.cpp | 115 +++++++++++++++++++++ src/game/Unit.cpp | 2 +- 6 files changed, 145 insertions(+), 2 deletions(-) create mode 100644 sql/updates/4544_world.sql (limited to 'src/game/Unit.cpp') diff --git a/sql/FULL/world_scripts_full.sql b/sql/FULL/world_scripts_full.sql index c4cdeab90a7..fbbbf44c77f 100644 --- a/sql/FULL/world_scripts_full.sql +++ b/sql/FULL/world_scripts_full.sql @@ -81,6 +81,7 @@ UPDATE `item_template` SET `ScriptName`='item_yehkinyas_bramble' WHERE `entry`=1 UPDATE `item_template` SET `ScriptName`='item_zezzaks_shard' WHERE `entry`=31463; UPDATE `item_template` SET `ScriptName`='item_only_for_flight' WHERE `entry` IN (34475, 34489, 24538); UPDATE `item_template` SET `ScriptName`='item_inoculating_crystal' WHERE `entry`=22962; +UPDATE `item_template` SET `ScriptName`='item_incendiary_explosives' WHERE (`entry`=35704); /* NPC (usually creatures to be found in more than one specific zone) */ UPDATE `creature_template` SET `ScriptName`='npc_air_force_bots' WHERE `entry` IN (2614, 2615, 21974, 21993, 21996, 21997, 21999, 22001, 22002, 22003, 22063, 22065, 22066, 22068, 22069, 22070, 22071, 22078, 22079, 22080, 22086, 22087, 22088, 22090, 22124, 22125, 22126); @@ -115,6 +116,7 @@ UPDATE `creature_template` SET `ScriptName`='npc_dkc1_gothik' WHERE `entry`=2865 UPDATE `creature_template` SET `ScriptName`='npc_a_special_surprise' WHERE `entry` IN (29032, 29061, 29065, 29067, 29068, 29070, 29074, 29072, 29073, 29071); UPDATE `creature_template` SET `ScriptName`='npc_demolisher_engineerer' WHERE `entry` IN (30400, 30499); UPDATE `creature_template` SET `ScriptName`='npc_valkyr_battle_maiden' WHERE `entry`=28534; +UPDATE `creature_template` SET `ScriptName`='npc_mirror_image' WHERE `entry`=31216; /* */ /* ZONE */ @@ -309,6 +311,7 @@ UPDATE `creature_template` SET `ScriptName`='npc_captured_sunhawk_agent' WHERE ` /* BOREAN TUNDRA */ UPDATE `creature_template` SET `ScriptName`='npc_surristrasz' WHERE `entry`=24795; UPDATE `creature_template` SET `ScriptName`='npc_tiare' WHERE `entry`=30051; +UPDATE `creature_template` SET `ScriptName`='npc_sinkhole_kill_credit' WHERE `entry` IN (26248,26249); /* BURNING STEPPES */ UPDATE `creature_template` SET `ScriptName`='npc_ragged_john' WHERE `entry`=9563; @@ -1092,7 +1095,6 @@ UPDATE `creature_template` SET `ScriptName`='mob_spawn_of_marli' WHERE `entry`=1 UPDATE `creature_template` SET `ScriptName`='mob_batrider' WHERE `entry`=14965; UPDATE `creature_template` SET `ScriptName`='mob_shade_of_jindo' WHERE `entry`=14986; UPDATE `creature_template` SET `ScriptName`='mob_ohgan' WHERE `entry`=14988; -UPDATE `creature_template` SET `ScriptName`='npc_mirror_image' WHERE `entry`=31216; UPDATE `creature_template` SET `ScriptName`='EventAI', `modelid_A` = 16925,`modelid_H` = 16925, `minmana` = 1000000,`maxmana` = 1000000, `unit_flags` = 33554434 WHERE `entry` IN(29998, 33753, 33752, 33751, 33750); DELETE FROM `creature_ai_scripts` WHERE `creature_id` IN (29998, 33753, 33752, 33751, 33750); diff --git a/sql/FULL/world_tmp_full.sql b/sql/FULL/world_tmp_full.sql index 9931dc50ee3..8b9e65d3f65 100644 --- a/sql/FULL/world_tmp_full.sql +++ b/sql/FULL/world_tmp_full.sql @@ -179,6 +179,7 @@ spell6 = VALUES(spell6), spell7 = VALUES(spell7), spell8 = VALUES(spell8); +UPDATE `creature_template` SET `flags_extra`=2 WHERE (`entry`=26250); # Plug the Sinkholes - worm UPDATE `creature_template` SET `spell1`=59638, `spell2` = 59637 WHERE `entry`=31216; # Mirror Image # Spore diff --git a/sql/updates/4544_world.sql b/sql/updates/4544_world.sql new file mode 100644 index 00000000000..90f7e193f15 --- /dev/null +++ b/sql/updates/4544_world.sql @@ -0,0 +1,3 @@ +UPDATE `creature_template` SET `ScriptName`='npc_sinkhole_kill_credit' WHERE (`entry`='26248') or (`entry`='26249'); +UPDATE `item_template` SET `ScriptName`='item_incendiary_explosives' WHERE (`entry`='35704'); +UPDATE `creature_template` SET `flags_extra`='2' WHERE (`entry`='26250'); diff --git a/src/bindings/scripts/scripts/item/item_scripts.cpp b/src/bindings/scripts/scripts/item/item_scripts.cpp index f577d0fed9c..d30efdae89f 100644 --- a/src/bindings/scripts/scripts/item/item_scripts.cpp +++ b/src/bindings/scripts/scripts/item/item_scripts.cpp @@ -489,6 +489,23 @@ bool ItemUse_item_zezzak_shard(Player *player, Item* _Item, SpellCastTargets con return true; } +/*##### +# item_incendiary_explosives +#####*/ + +bool ItemUse_item_incendiary_explosives(Player *player, Item* _Item, SpellCastTargets const& targets) +{ + if ( player->FindNearestCreature(26248,15) || player->FindNearestCreature(26249,15) ) + { + return false; + } + else + { + player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE,_Item,NULL); + return true; + } +} + void AddSC_item_scripts() { Script *newscript; @@ -592,5 +609,10 @@ void AddSC_item_scripts() newscript->Name="item_zezzaks_shard"; newscript->pItemUse = &ItemUse_item_zezzak_shard; newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="item_incendiary_explosives"; + newscript->pItemUse = &ItemUse_item_incendiary_explosives; + newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/zone/borean_tundra/borean_tundra.cpp b/src/bindings/scripts/scripts/zone/borean_tundra/borean_tundra.cpp index 94c93c8e449..c45ef53a81a 100644 --- a/src/bindings/scripts/scripts/zone/borean_tundra/borean_tundra.cpp +++ b/src/bindings/scripts/scripts/zone/borean_tundra/borean_tundra.cpp @@ -87,6 +87,116 @@ bool GossipSelect_npc_surristrasz(Player *player, Creature *_Creature, uint32 se return true; } +/*###### +## npc_sinkhole_kill_credit +######*/ + +enum +{ + SPELL_SET_CART = 46797, + SPELL_EXPLODE_CART = 46799, + SPELL_SUMMON_CART = 46798, + SPELL_SUMMON_WORM = 46800, +}; + +struct TRINITY_DLL_DECL npc_sinkhole_kill_creditAI : public ScriptedAI +{ + npc_sinkhole_kill_creditAI(Creature* c) : ScriptedAI(c){} + + uint32 Phase_Timer; + uint8 Phase; + Unit* Caster; + + void Reset() + { + Phase_Timer = 500; + Phase = 0; + Caster = NULL; + } + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + if (Phase) + return; + + if (spell->Id == SPELL_SET_CART && CAST_PLR(caster)->GetQuestStatus(11897) == QUEST_STATUS_INCOMPLETE) + { + Phase = 1; + Caster = caster; + } + } + + void EnterCombat(Unit* who) { } + + void UpdateAI(const uint32 diff) + { + if (!Phase) + return; + + if (Phase_Timer < diff) + { + switch (Phase) + { + case 1: + DoCast(m_creature, SPELL_EXPLODE_CART, true); + DoCast(m_creature, SPELL_SUMMON_CART, true); + if (GameObject* cart = m_creature->FindNearestGameObject(188160,3)) + cart->SetUInt32Value(GAMEOBJECT_FACTION, 14); + Phase_Timer = 3000; + Phase = 2; + break; + case 2: + if (GameObject* cart = m_creature->FindNearestGameObject(188160,3)) + cart->UseDoorOrButton(); + DoCast(m_creature, SPELL_EXPLODE_CART, true); + Phase_Timer = 3000; + Phase = 3; + break; + case 3: + DoCast(m_creature, SPELL_EXPLODE_CART, true); + Phase_Timer = 2000; + Phase = 4; + case 5: + DoCast(m_creature, SPELL_SUMMON_WORM, true); + if (Unit* worm = m_creature->FindNearestCreature(26250, 3)) + { + worm->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + worm->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE); + } + Phase_Timer = 1000; + Phase = 6; + break; + case 6: + DoCast(m_creature, SPELL_EXPLODE_CART, true); + if (Unit* worm = m_creature->FindNearestCreature(26250, 3)) + { + m_creature->DealDamage(worm, worm->GetHealth()); + worm->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + } + Phase_Timer = 2000; + Phase = 7; + break; + case 7: + DoCast(m_creature, SPELL_EXPLODE_CART, true); + CAST_PLR(Caster)->KilledMonster(m_creature->GetCreatureInfo(),m_creature->GetGUID()); + Phase_Timer = 5000; + Phase = 8; + break; + case 8: + EnterEvadeMode(); + break; + } + } else Phase_Timer -= diff; + + } + +}; + +CreatureAI* GetAI_npc_sinkhole_kill_credit(Creature* pCreature) +{ + return new npc_sinkhole_kill_creditAI(pCreature); +} + void AddSC_borean_tundra() { Script *newscript; @@ -102,4 +212,9 @@ void AddSC_borean_tundra() newscript->pGossipHello = &GossipHello_npc_surristrasz; newscript->pGossipSelect = &GossipSelect_npc_surristrasz; newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_sinkhole_kill_credit"; + newscript->GetAI = &GetAI_npc_sinkhole_kill_credit; + newscript->RegisterSelf(); } diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 308d510e5ae..882a599466e 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -1412,7 +1412,7 @@ void Unit::CalculateMeleeDamage(Unit *pVictim, uint32 damage, CalcDamageInfo *da damageInfo->procEx = PROC_EX_NONE; damageInfo->hitOutCome = MELEE_HIT_EVADE; - if(!this || !pVictim) + if(!pVictim) return; if(!this->isAlive() || !pVictim->isAlive()) return; -- cgit v1.2.3 From dad71db6777423c1cbbe9a5f53a330dc23b917d0 Mon Sep 17 00:00:00 2001 From: megamage Date: Fri, 24 Jul 2009 09:37:52 +0800 Subject: [8207] Allow show combat log for healing done by totems. Author: Itch --HG-- branch : trunk --- src/game/Unit.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src/game/Unit.cpp') diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 882a599466e..0a7a65be2a9 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -8827,19 +8827,24 @@ int32 Unit::DealHeal(Unit *pVictim, uint32 addhealth, SpellEntry const *spellPro { int32 gain = pVictim->ModifyHealth(int32(addhealth)); - if (GetTypeId()==TYPEID_PLAYER) + Unit* unit = this; + + if( GetTypeId()==TYPEID_UNIT && ((Creature*)this)->isTotem() && ((Totem*)this)->GetTotemType()!=TOTEM_STATUE) + unit = GetOwner(); + + if (unit->GetTypeId()==TYPEID_PLAYER) { // overheal = addhealth - gain - SendHealSpellLog(pVictim, spellProto->Id, addhealth, addhealth > gain ? addhealth - gain : 0, critical); + unit->SendHealSpellLog(pVictim, spellProto->Id, addhealth, addhealth - gain, critical); - if (BattleGround *bg = ((Player*)this)->GetBattleGround()) - bg->UpdatePlayerScore((Player*)this, SCORE_HEALING_DONE, gain); + if (BattleGround *bg = ((Player*)unit)->GetBattleGround()) + bg->UpdatePlayerScore((Player*)unit, SCORE_HEALING_DONE, gain); // use the actual gain, as the overheal shall not be counted, skip gain 0 (it ignored anyway in to criteria) if (gain) - ((Player*)this)->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE, gain, 0, pVictim); + ((Player*)unit)->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE, gain, 0, pVictim); - ((Player*)this)->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEAL_CASTED, addhealth); + ((Player*)unit)->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEAL_CASTED, addhealth); } if (pVictim->GetTypeId()==TYPEID_PLAYER) -- cgit v1.2.3 From c3f0ab67180a72659de477d5522cfd0f44b10b3b Mon Sep 17 00:00:00 2001 From: megamage Date: Fri, 24 Jul 2009 09:41:33 +0800 Subject: [8208] Add part support for spell 33525. Author: NoFantasy Also let spell 33652 trigger when aura from 33572 reach full effect. --HG-- branch : trunk --- src/game/SpellAuras.cpp | 15 ++++++++++++++- src/game/Unit.cpp | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'src/game/Unit.cpp') diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index f9b7d406061..e027632328d 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -2541,6 +2541,9 @@ void AuraEffect::TriggerSpell() case 29213: case 54835: caster->CastSpell(m_target, trigger_spell_id, true, NULL, this); + // Ground Slam + case 33525: + target->CastSpell(target, trigger_spell_id, true); return; } } @@ -4388,12 +4391,22 @@ void AuraEffect::HandleAuraModIncreaseSwimSpeed(bool /*apply*/, bool Real, bool m_target->UpdateSpeed(MOVE_SWIM, true); } -void AuraEffect::HandleAuraModDecreaseSpeed(bool /*apply*/, bool Real, bool changeAmount) +void AuraEffect::HandleAuraModDecreaseSpeed(bool apply, bool Real, bool changeAmount) { // all applied/removed only at real aura add/remove if(!Real && !changeAmount) return; + if (apply) + { + // Gronn Lord's Grasp, becomes stoned + if (GetId() == 33572) + { + if (GetParentAura()->GetStackAmount() >= 5 && !m_target->HasAura(33652)) + m_target->CastSpell(m_target, 33652, true); + } + } + m_target->UpdateSpeed(MOVE_RUN, true); m_target->UpdateSpeed(MOVE_SWIM, true); m_target->UpdateSpeed(MOVE_FLIGHT, true); diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 0a7a65be2a9..07db984be72 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -8829,7 +8829,7 @@ int32 Unit::DealHeal(Unit *pVictim, uint32 addhealth, SpellEntry const *spellPro Unit* unit = this; - if( GetTypeId()==TYPEID_UNIT && ((Creature*)this)->isTotem() && ((Totem*)this)->GetTotemType()!=TOTEM_STATUE) + if( GetTypeId()==TYPEID_UNIT && ((Creature*)this)->isTotem()) unit = GetOwner(); if (unit->GetTypeId()==TYPEID_PLAYER) -- cgit v1.2.3 From 8c4e30eb07a6fef825a095e78908cf4af44b493c Mon Sep 17 00:00:00 2001 From: Anubisss Date: Sat, 25 Jul 2009 01:50:55 +0200 Subject: *Fix spell Savage Defense's reducing damage amount. --HG-- branch : trunk --- src/game/Unit.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/game/Unit.cpp') diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 07db984be72..daefe39254e 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -7866,6 +7866,12 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig ((Player*)this)->RemoveCategoryCooldown(82); return true; } + // Savage Defense + case 62606: + { + basepoints0 = int32(GetTotalAttackPowerValue(BASE_ATTACK) * triggerAmount / 100.f); + break; + } } if( cooldown && GetTypeId()==TYPEID_PLAYER && ((Player*)this)->HasSpellCooldown(trigger_spell_id)) -- cgit v1.2.3 From bf4fe35bdb699ecdab2869dcf12721eb98b885fe Mon Sep 17 00:00:00 2001 From: Anubisss Date: Sat, 25 Jul 2009 01:52:35 +0200 Subject: *Fix a typo. :) --HG-- branch : trunk --- src/game/Unit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/game/Unit.cpp') diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index daefe39254e..0ac5f788263 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -7869,7 +7869,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig // Savage Defense case 62606: { - basepoints0 = int32(GetTotalAttackPowerValue(BASE_ATTACK) * triggerAmount / 100.f); + basepoints0 = int32(GetTotalAttackPowerValue(BASE_ATTACK) * triggerAmount / 100.0f); break; } } -- cgit v1.2.3 From c2f5b67a40c59d42b4d30d27cd3632336a19acab Mon Sep 17 00:00:00 2001 From: Anubisss Date: Sat, 25 Jul 2009 20:48:12 +0200 Subject: *Correct damage for spell Piercing Shots' ticks. --HG-- branch : trunk --- src/game/Unit.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/game/Unit.cpp') diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 0ac5f788263..cd378c94586 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -7363,7 +7363,10 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig sLog.outError("Unit::HandleProcTriggerSpell: Spell %u miss posibly Piercing Shots",auraSpellInfo->Id); return false; } - basepoints0 = int32(damage * triggerAmount / 100); + SpellEntry const *TriggerPS = sSpellStore.LookupEntry(trigger_spell_id); + if(!TriggerPS) + return false; + basepoints0 = int32(damage * triggerAmount / 100 / (GetSpellMaxDuration(TriggerPS) / TriggerPS->EffectAmplitude[0])); target = pVictim; } break; -- cgit v1.2.3 From 190863e5a58364a9f42336e300c836d9ec6242ad Mon Sep 17 00:00:00 2001 From: QAston Date: Sun, 26 Jul 2009 19:58:01 +0200 Subject: *Update procflags for Imp.Shadowform. *Use item speed value instead of attack speed value for enchant PPM - by MaS0n. *Correctly apply cooldown to Improved leader of the pack mana regen. *Do not refresh duration when stack from aura is dropped - by Apoc --HG-- branch : trunk --- sql/FULL/world_spell_full.sql | 4 ++-- sql/updates/4601_world_spell_proc_event.sql | 4 ++++ src/bindings/scripts/scripts/npc/npcs_special.cpp | 3 ++- src/game/Player.cpp | 5 +---- src/game/SpellAuras.cpp | 7 ++++++- src/game/Unit.cpp | 10 ++++++---- 6 files changed, 21 insertions(+), 12 deletions(-) create mode 100644 sql/updates/4601_world_spell_proc_event.sql (limited to 'src/game/Unit.cpp') diff --git a/sql/FULL/world_spell_full.sql b/sql/FULL/world_spell_full.sql index 88b6d86de66..7d1e6fd12f4 100644 --- a/sql/FULL/world_spell_full.sql +++ b/sql/FULL/world_spell_full.sql @@ -1102,8 +1102,8 @@ INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `Spell ( 47535, 0x00, 6, 0x00000001, 0x00000000, 0x00000000, 0x00004000, 0x00002000, 0, 0, 12), -- Rapture (Rank 1) ( 47536, 0x00, 6, 0x00000001, 0x00000000, 0x00000000, 0x00004000, 0x00002000, 0, 0, 12), -- Rapture (Rank 2) ( 47537, 0x00, 6, 0x00000001, 0x00000000, 0x00000000, 0x00004000, 0x00002000, 0, 0, 12), -- Rapture (Rank 3) -( 47569, 0x00, 6, 0x00004000, 0x00000000, 0x00000000, 0x00000400, 0x00000000, 0, 50, 0), -- Improved Shadowform (Rank 1) -( 47570, 0x00, 6, 0x00004000, 0x00000000, 0x00000000, 0x00000400, 0x00000000, 0, 100, 0), -- Improved Shadowform (Rank 2) +( 47569, 0x00, 6, 0x00004000, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0, 50, 0), -- Improved Shadowform (Rank 1) +( 47570, 0x00, 6, 0x00004000, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0, 100, 0), -- Improved Shadowform (Rank 2) ( 47580, 0x00, 6, 0x00000000, 0x00000000, 0x00000040, 0x00000000, 0x00010000, 0, 0, 0), -- Pain and Suffering (Rank 1) ( 47581, 0x00, 6, 0x00000000, 0x00000000, 0x00000040, 0x00000000, 0x00010000, 0, 0, 0), -- Pain and Suffering (Rank 2) ( 47582, 0x00, 6, 0x00000000, 0x00000000, 0x00000040, 0x00000000, 0x00010000, 0, 0, 0), -- Pain and Suffering (Rank 3) diff --git a/sql/updates/4601_world_spell_proc_event.sql b/sql/updates/4601_world_spell_proc_event.sql new file mode 100644 index 00000000000..516cd070482 --- /dev/null +++ b/sql/updates/4601_world_spell_proc_event.sql @@ -0,0 +1,4 @@ +DELETE FROM `spell_proc_event` WHERE `entry` IN(47569, 47570); +INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) VALUES +( 47569, 0x00, 6, 0x00004000, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0, 50, 0), -- Improved Shadowform (Rank 1) +( 47570, 0x00, 6, 0x00004000, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0, 100, 0); -- Improved Shadowform (Rank 2) \ No newline at end of file diff --git a/src/bindings/scripts/scripts/npc/npcs_special.cpp b/src/bindings/scripts/scripts/npc/npcs_special.cpp index 6c44b5b9ae3..9bf3113a9c6 100644 --- a/src/bindings/scripts/scripts/npc/npcs_special.cpp +++ b/src/bindings/scripts/scripts/npc/npcs_special.cpp @@ -1639,9 +1639,10 @@ CreatureAI* GetAI_mob_mojo(Creature *_Creature) struct TRINITY_DLL_DECL npc_mirror_image : public SpellAI { npc_mirror_image(Creature *c) : SpellAI(c) {} - Unit * owner; + void Reset() { + Unit * owner = NULL; if (m_creature->isSummon()) owner = ((TempSummon*)me)->GetOwner(); if (!owner) diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 3f0add0373b..ec31194680c 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -7243,10 +7243,7 @@ void Player::CastItemCombatSpell(Unit *target, WeaponAttackType attType, uint32 float chance = pEnchant->amount[s] != 0 ? float(pEnchant->amount[s]) : GetWeaponProcChance(); if (entry && entry->PPMChance) - { - uint32 WeaponSpeed = GetAttackTime(attType); - chance = GetPPMProcChance(WeaponSpeed, entry->PPMChance, spellInfo); - } + chance = GetPPMProcChance(proto->Delay, entry->PPMChance, spellInfo); else if (entry && entry->customChance) chance = entry->customChance; diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 5f9a3d6eeae..cb6f2caf31f 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -1388,6 +1388,7 @@ void Aura::_RemoveAura() void Aura::SetStackAmount(uint8 stackAmount, bool applied) { + bool refresh = stackAmount >= m_stackAmount; if (stackAmount != m_stackAmount) { m_stackAmount = stackAmount; @@ -1399,7 +1400,11 @@ void Aura::SetStackAmount(uint8 stackAmount, bool applied) } } } - RefreshAura(); + + if (refresh) + RefreshAura(); + else + SendAuraUpdate(); } bool Aura::modStackAmount(int32 num) diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index cd378c94586..69f42896dbd 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -5843,10 +5843,13 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger basepoints0 = triggerAmount * GetMaxHealth() / 100; target = this; triggered_spell_id = 34299; - if (triggeredByAura->GetCaster() != this) + if (triggeredByAura->GetCasterGUID() != GetGUID()) break; int32 basepoints1 = triggerAmount * 2; - CastCustomSpell(this,60889,&basepoints1,0,0,true,0,triggeredByAura); + // Improved Leader of the Pack + // Check cooldown of heal spell cooldown + if (GetTypeId()==TYPEID_PLAYER && !((Player *)this)->HasSpellCooldown(34299)) + CastCustomSpell(this,60889,&basepoints1,0,0,true,0,triggeredByAura); break; } // Healing Touch (Dreamwalker Raiment set) @@ -10451,8 +10454,7 @@ float Unit::GetPPMProcChance(uint32 WeaponSpeed, float PPM, const SpellEntry * s if(Player* modOwner = GetSpellModOwner()) modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_PROC_PER_MINUTE,PPM); - uint32 result = uint32((WeaponSpeed * PPM) / 600.0f); // result is chance in percents (probability = Speed_in_sec * (PPM / 60)) - return result; + return uint32((WeaponSpeed * PPM) / 600.0f); // result is chance in percents (probability = Speed_in_sec * (PPM / 60)) } void Unit::Mount(uint32 mount) -- cgit v1.2.3