From 087352a367f619f093e3fcae757fefadacfb9f12 Mon Sep 17 00:00:00 2001 From: win32 Date: Thu, 17 Dec 2009 13:30:40 +0200 Subject: speed-up code,Thanks QAtson. --HG-- branch : trunk --- src/game/SpellEffects.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 3d6d3ca8671..3f90a52c7df 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -2822,12 +2822,14 @@ void Spell::SpellDamageHeal(uint32 /*i*/) { addhealth = caster->SpellHealingBonus(unitTarget, m_spellInfo, addhealth, HEAL); - Unit::AuraEffectList const& Periodic = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_HEAL); - for (Unit::AuraEffectList::const_iterator i = Periodic.begin(); i != Periodic.end(); ++i) + if (AuraEffect const* aurEff = m_caster->GetAuraEffect(62971, 0)) { - if (m_caster->HasAura(62971)) + Unit::AuraEffectList const& Periodic = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_HEAL); + for (Unit::AuraEffectList::const_iterator i = Periodic.begin(); i != Periodic.end(); ++i) + { if (m_caster->GetGUID() == (*i)->GetCasterGUID()) - addhealth += addhealth * (*i)->GetParentAura()->GetStackAmount() * 0.06f; + addhealth += addhealth * (*i)->GetParentAura()->GetStackAmount() * aurEff->GetAmount() / 100; + } } } // Riptide - increase healing done by Chain Heal -- cgit v1.2.3 From ca3b2066ea4b7e12c23819b950f8faf5ef827d3e Mon Sep 17 00:00:00 2001 From: win32 Date: Thu, 17 Dec 2009 14:31:32 +0200 Subject: Correct spell proc for 16086 and rank Closes #56 --HG-- branch : trunk --- sql/FULL/world_spell_full.sql | 4 ++-- sql/updates/6549_world_spell_proc_event.sql | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 sql/updates/6549_world_spell_proc_event.sql diff --git a/sql/FULL/world_spell_full.sql b/sql/FULL/world_spell_full.sql index 5217f5cf19c..0202194ac69 100644 --- a/sql/FULL/world_spell_full.sql +++ b/sql/FULL/world_spell_full.sql @@ -687,8 +687,8 @@ INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `Spell ( 15362, 0x00, 6, 0x10001E00, 0x00010004, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Inspiration (Rank 2) ( 15363, 0x00, 6, 0x10001E00, 0x00010004, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Inspiration (Rank 3) ( 15600, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 1, 0, 0), -- Hand of Justice -( 16086, 0x04, 11, 0x00000020, 0x00000000, 0x00000000, 0x00011000, 0x00000000, 0, 0, 0), -- Improved Fire Nova Totem (Rank 1) -( 16544, 0x04, 11, 0x00000020, 0x00000000, 0x00000000, 0x00011000, 0x00000000, 0, 100, 0), -- Improved Fire Nova Totem (Rank 2) +( 16086, 0x04, 11, 0x00000000, 0x00040000, 0x00000000, 0x00030000, 0x00000000, 0, 0, 0), -- Improved Fire Nova Totem (Rank 1) +( 16544, 0x04, 11, 0x00000000, 0x00040000, 0x00000000, 0x00030000, 0x00000000, 0, 0, 0), -- Improved Fire Nova Totem (Rank 2) ( 16176, 0x00, 11, 0x000001C0, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Ancestral Healing (Rank 1) ( 16180, 0x00, 11, 0x000000C0, 0x00000000, 0x00000010, 0x00000000, 0x00000002, 0, 0, 0), -- Improved Water Shield (Rank 1) ( 16196, 0x00, 11, 0x000000C0, 0x00000000, 0x00000010, 0x00000000, 0x00000002, 0, 0, 0), -- Improved Water Shield (Rank 2) diff --git a/sql/updates/6549_world_spell_proc_event.sql b/sql/updates/6549_world_spell_proc_event.sql new file mode 100644 index 00000000000..a7cae2b1c09 --- /dev/null +++ b/sql/updates/6549_world_spell_proc_event.sql @@ -0,0 +1,4 @@ +DELETE FROM `spell_proc_event` WHERE `entry` IN (16086,16544); +INSERT INTO `spell_proc_event` VALUES +( 16086, 0x04, 11, 0x00000000, 0x00040000, 0x00000000, 0x00030000, 0x00000000, 0, 0, 0), -- Improved Fire Nova Totem (Rank 1) +( 16544, 0x04, 11, 0x00000000, 0x00040000, 0x00000000, 0x00030000, 0x00000000, 0, 0, 0); -- Improved Fire Nova Totem (Rank 2) -- cgit v1.2.3 From 6653394f8c37a86f2ccb79024ca93e11381cb027 Mon Sep 17 00:00:00 2001 From: maanuel Date: Thu, 17 Dec 2009 14:29:52 -0300 Subject: Prevent crash when GetSummoner() is used. --HG-- branch : trunk --- .../scripts/scripts/northrend/borean_tundra.cpp | 54 +++++++++++++--------- 1 file changed, 32 insertions(+), 22 deletions(-) diff --git a/src/bindings/scripts/scripts/northrend/borean_tundra.cpp b/src/bindings/scripts/scripts/northrend/borean_tundra.cpp index 1f23470c308..3a3f13d39e7 100644 --- a/src/bindings/scripts/scripts/northrend/borean_tundra.cpp +++ b/src/bindings/scripts/scripts/northrend/borean_tundra.cpp @@ -645,9 +645,10 @@ struct TRINITY_DLL_DECL npc_nesingwary_trapperAI : public ScriptedAI go_caribou->SetLootState(GO_JUST_DEACTIVATED); if (TempSummon *summon = (TempSummon*)m_creature) - if (Unit *pTemp = summon->GetSummoner()) - if (pTemp->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(pTemp)->KilledMonsterCredit(m_creature->GetEntry(),0); + if (summon->isSummon()) + if (Unit *pTemp = summon->GetSummoner()) + if (pTemp->GetTypeId() == TYPEID_PLAYER) + CAST_PLR(pTemp)->KilledMonsterCredit(m_creature->GetEntry(),0); if (go_caribou && go_caribou->GetTypeId() == TYPEID_GAMEOBJECT) go_caribou->SetGoState(GO_STATE_READY); @@ -1307,8 +1308,9 @@ struct TRINITY_DLL_DECL npc_image_lich_kingAI : public ScriptedAI if (uiType != POINT_MOTION_TYPE) return; - if (Unit* pSummoner = CAST_SUM(m_creature)->GetSummoner()) - CAST_AI(npc_thassarianAI,CAST_CRE(pSummoner)->AI())->bArthasInPosition = true; + if (m_creature->isSummon()) + if (Unit* pSummoner = CAST_SUM(m_creature)->GetSummoner()) + CAST_AI(npc_thassarianAI,CAST_CRE(pSummoner)->AI())->bArthasInPosition = true; } }; @@ -1332,8 +1334,9 @@ struct TRINITY_DLL_DECL npc_general_arlosAI : public ScriptedAI m_creature->addUnitState(UNIT_STAT_STUNNED); m_creature->CastSpell(m_creature, SPELL_STUN, true); - if (Unit* pSummoner = CAST_SUM(m_creature)->GetSummoner()) - CAST_AI(npc_thassarianAI,CAST_CRE(pSummoner)->AI())->bArlosInPosition = true; + if (m_creature->isSummon()) + if (Unit* pSummoner = CAST_SUM(m_creature)->GetSummoner()) + CAST_AI(npc_thassarianAI,CAST_CRE(pSummoner)->AI())->bArlosInPosition = true; } }; @@ -1382,8 +1385,9 @@ struct TRINITY_DLL_DECL npc_counselor_talbotAI : public ScriptedAI if(uiType != POINT_MOTION_TYPE) return; - if (Unit* pSummoner = CAST_SUM(m_creature)->GetSummoner()) - CAST_AI(npc_thassarianAI,CAST_CRE(pSummoner)->AI())->bTalbotInPosition = true; + if (m_creature->isSummon()) + if (Unit* pSummoner = CAST_SUM(m_creature)->GetSummoner()) + CAST_AI(npc_thassarianAI,CAST_CRE(pSummoner)->AI())->bTalbotInPosition = true; } void UpdateAI(const uint32 uiDiff) @@ -1481,14 +1485,16 @@ struct TRINITY_DLL_DECL npc_leryssaAI : public ScriptedAI m_creature->addUnitState(UNIT_STAT_STUNNED); m_creature->CastSpell(m_creature, SPELL_STUN, true); - if (Unit* pSummoner = CAST_SUM(m_creature)->GetSummoner()) - CAST_AI(npc_thassarianAI,CAST_CRE(pSummoner)->AI())->bLeryssaInPosition = true; + if (m_creature->isSummon()) + if (Unit* pSummoner = CAST_SUM(m_creature)->GetSummoner()) + CAST_AI(npc_thassarianAI,CAST_CRE(pSummoner)->AI())->bLeryssaInPosition = true; bDone = true; } else { m_creature->SetStandState(UNIT_STAND_STATE_SIT); - if (Unit* pSummoner = CAST_SUM(m_creature)->GetSummoner()) + if (m_creature->isSummon()) + if (Unit* pSummoner = CAST_SUM(m_creature)->GetSummoner()) pSummoner->SetStandState(UNIT_STAND_STATE_SIT); Phase_Timer = 1500; Phase = 1; @@ -1504,8 +1510,9 @@ struct TRINITY_DLL_DECL npc_leryssaAI : public ScriptedAI switch (Phase) { case 1: - if (Unit* pThassarian = CAST_SUM(m_creature)->GetSummoner()) - DoScriptText(SAY_THASSARIAN_4, pThassarian); + if (m_creature->isSummon()) + if (Unit* pThassarian = CAST_SUM(m_creature)->GetSummoner()) + DoScriptText(SAY_THASSARIAN_4, pThassarian); Phase_Timer = 5000; ++Phase; break; @@ -1515,8 +1522,9 @@ struct TRINITY_DLL_DECL npc_leryssaAI : public ScriptedAI ++Phase; break; case 3: - if (Unit* pThassarian = CAST_SUM(m_creature)->GetSummoner()) - DoScriptText(SAY_THASSARIAN_5, pThassarian); + if (m_creature->isSummon()) + if (Unit* pThassarian = CAST_SUM(m_creature)->GetSummoner()) + DoScriptText(SAY_THASSARIAN_5, pThassarian); Phase_Timer = 5000; ++Phase; break; @@ -1526,7 +1534,8 @@ struct TRINITY_DLL_DECL npc_leryssaAI : public ScriptedAI ++Phase; break; case 5: - if (Unit* pThassarian = CAST_SUM(m_creature)->GetSummoner()) + if (m_creature->isSummon()) + if (Unit* pThassarian = CAST_SUM(m_creature)->GetSummoner()) DoScriptText(SAY_THASSARIAN_6, pThassarian); Phase_Timer = 5000; ++Phase; @@ -1538,11 +1547,12 @@ struct TRINITY_DLL_DECL npc_leryssaAI : public ScriptedAI ++Phase; break; case 7: - if (Unit* pThassarian = CAST_SUM(m_creature)->GetSummoner()) - { - DoScriptText(SAY_THASSARIAN_7, pThassarian); - CAST_AI(npc_thassarianAI,CAST_CRE(pThassarian)->AI())->uiPhase = 16; - } + if (m_creature->isSummon()) + if (Unit* pThassarian = CAST_SUM(m_creature)->GetSummoner()) + { + DoScriptText(SAY_THASSARIAN_7, pThassarian); + CAST_AI(npc_thassarianAI,CAST_CRE(pThassarian)->AI())->uiPhase = 16; + } Phase_Timer = 5000; Phase = 0; break; -- cgit v1.2.3 From bf454b08e699b6bb460703345c3298c6466fb817 Mon Sep 17 00:00:00 2001 From: Anubisss Date: Thu, 17 Dec 2009 22:07:10 +0100 Subject: Fix a typo. This fix a crash in escortAI. --HG-- branch : trunk --- src/bindings/scripts/base/escort_ai.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bindings/scripts/base/escort_ai.cpp b/src/bindings/scripts/base/escort_ai.cpp index 9b31d032a71..07f0778389e 100644 --- a/src/bindings/scripts/base/escort_ai.cpp +++ b/src/bindings/scripts/base/escort_ai.cpp @@ -456,7 +456,7 @@ void npc_escortAI::Start(bool bIsActiveAttacker, bool bRun, uint64 uiPlayerGUID, { if (pQuest != NULL) { - error_db_log("TSCR: EscortAI Start with 0 waypoints (possible missing entry in script_waypoint. Quest: %u).", m_pQuestForEscort->GetQuestId()); + error_db_log("TSCR: EscortAI Start with 0 waypoints (possible missing entry in script_waypoint. Quest: %u).", pQuest->GetQuestId()); return; } else -- cgit v1.2.3 From 274a9ee77cc1221857fc2ba391286bcaa0fb0df5 Mon Sep 17 00:00:00 2001 From: Anubisss Date: Thu, 17 Dec 2009 22:08:57 +0100 Subject: Fix line endings. --HG-- branch : trunk --- .../scripts/scripts/world/npcs_special.cpp | 66 +++++++++++----------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/src/bindings/scripts/scripts/world/npcs_special.cpp b/src/bindings/scripts/scripts/world/npcs_special.cpp index 3fad7034238..de62242e175 100644 --- a/src/bindings/scripts/scripts/world/npcs_special.cpp +++ b/src/bindings/scripts/scripts/world/npcs_special.cpp @@ -1494,22 +1494,22 @@ CreatureAI* GetAI_npc_tonk_mine(Creature* pCreature) ## npc_brewfest_reveler ####*/ -struct TRINITY_DLL_DECL npc_brewfest_revelerAI : public ScriptedAI -{ - npc_brewfest_revelerAI(Creature* c) : ScriptedAI(c) {} - void ReceiveEmote(Player* pPlayer, uint32 emote) - { - if (!IsHolidayActive(HOLIDAY_BREWFEST)) - return; - - if (emote == TEXTEMOTE_DANCE) - m_creature->CastSpell(pPlayer, 41586, false); - } -}; - -CreatureAI* GetAI_npc_brewfest_reveler(Creature* pCreature) -{ - return new npc_brewfest_revelerAI(pCreature); +struct TRINITY_DLL_DECL npc_brewfest_revelerAI : public ScriptedAI +{ + npc_brewfest_revelerAI(Creature* c) : ScriptedAI(c) {} + void ReceiveEmote(Player* pPlayer, uint32 emote) + { + if (!IsHolidayActive(HOLIDAY_BREWFEST)) + return; + + if (emote == TEXTEMOTE_DANCE) + m_creature->CastSpell(pPlayer, 41586, false); + } +}; + +CreatureAI* GetAI_npc_brewfest_reveler(Creature* pCreature) +{ + return new npc_brewfest_revelerAI(pCreature); } /*#### @@ -1519,31 +1519,31 @@ CreatureAI* GetAI_npc_brewfest_reveler(Creature* pCreature) struct TRINITY_DLL_DECL npc_winter_revelerAI : public ScriptedAI { npc_winter_revelerAI(Creature* c) : ScriptedAI(c) {} - void ReceiveEmote(Player* pPlayer, uint32 emote) - { - if (!IsHolidayActive(HOLIDAY_FEAST_OF_WINTER_VEIL)) + void ReceiveEmote(Player* pPlayer, uint32 emote) + { + if (!IsHolidayActive(HOLIDAY_FEAST_OF_WINTER_VEIL)) + return; + //TODO: check auralist. + if (pPlayer->HasAura(26218)) return; - //TODO: check auralist. - if (pPlayer->HasAura(26218)) - return; - + if (emote == TEXTEMOTE_KISS) { - m_creature->CastSpell(m_creature, 26218, false); - pPlayer->CastSpell(pPlayer, 26218, false); - switch (urand(0,2)) - { - case 0: m_creature->CastSpell(pPlayer, 26207, false); break; - case 1: m_creature->CastSpell(pPlayer, 26206, false); break; - case 2: m_creature->CastSpell(pPlayer, 45036, false); break; + m_creature->CastSpell(m_creature, 26218, false); + pPlayer->CastSpell(pPlayer, 26218, false); + switch (urand(0,2)) + { + case 0: m_creature->CastSpell(pPlayer, 26207, false); break; + case 1: m_creature->CastSpell(pPlayer, 26206, false); break; + case 2: m_creature->CastSpell(pPlayer, 45036, false); break; } } } }; -CreatureAI* GetAI_npc_winter_reveler(Creature* pCreature) -{ - return new npc_winter_revelerAI(pCreature); +CreatureAI* GetAI_npc_winter_reveler(Creature* pCreature) +{ + return new npc_winter_revelerAI(pCreature); } -- cgit v1.2.3