diff options
author | Vincent-Michael <Vincent_Michael@gmx.de> | 2013-08-15 16:49:58 +0200 |
---|---|---|
committer | Vincent-Michael <Vincent_Michael@gmx.de> | 2013-08-15 16:49:58 +0200 |
commit | 21fe779dfbd7bf6dba5cb7db2be268f1405f98bc (patch) | |
tree | 8bb9db21632f07f745833a4a703e3c0a674c7b3e | |
parent | 0598f90dc002779fe2ae30c133434d7a1c6b9176 (diff) | |
parent | 4d260a54aebbdabdb9982e297d1e5086f8a68fa9 (diff) |
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
-rw-r--r-- | sql/updates/world/2013_08_14_00_world_gameobject_loot_template_335.sql | 2 | ||||
-rw-r--r-- | sql/updates/world/2013_08_15_01_world_sai.sql | 44 | ||||
-rw-r--r-- | sql/updates/world/2013_08_15_02_world_spell_proc_event.sql | 3 | ||||
-rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 15 | ||||
-rw-r--r-- | src/server/game/Spells/Auras/SpellAuras.cpp | 6 | ||||
-rw-r--r-- | src/server/game/Spells/Auras/SpellAuras.h | 2 | ||||
-rw-r--r-- | src/server/game/Spells/Spell.cpp | 22 | ||||
-rw-r--r-- | src/server/game/Spells/SpellInfo.cpp | 6 | ||||
-rw-r--r-- | src/server/game/Spells/SpellInfo.h | 2 | ||||
-rw-r--r-- | src/server/game/Spells/SpellMgr.cpp | 11 | ||||
-rw-r--r-- | src/server/game/Spells/SpellScript.cpp | 2 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_warrior.cpp | 3 |
12 files changed, 91 insertions, 27 deletions
diff --git a/sql/updates/world/2013_08_14_00_world_gameobject_loot_template_335.sql b/sql/updates/world/2013_08_14_00_world_gameobject_loot_template_335.sql index db3d6659ba5..a2a4ad1e98d 100644 --- a/sql/updates/world/2013_08_14_00_world_gameobject_loot_template_335.sql +++ b/sql/updates/world/2013_08_14_00_world_gameobject_loot_template_335.sql @@ -243,4 +243,4 @@ INSERT INTO `gameobject_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lo -- Cleanups DELETE FROM `reference_loot_template` WHERE `entry` IN (12010,12011,12012,12013,12014,12015,12016,12017); DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`= 4 AND `SourceGroup` IN (6150,6313,13948) AND `SourceEntry`=11514; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=10 AND `SourceGroup` IN (12010,12012,12013,12014) AND `SourceEntry`=11514;
\ No newline at end of file +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=10 AND `SourceGroup` IN (12010,12012,12013,12014) AND `SourceEntry`=11514; diff --git a/sql/updates/world/2013_08_15_01_world_sai.sql b/sql/updates/world/2013_08_15_01_world_sai.sql new file mode 100644 index 00000000000..5110993f1de --- /dev/null +++ b/sql/updates/world/2013_08_15_01_world_sai.sql @@ -0,0 +1,44 @@ +-- Random comment +SET @SHREDDER := 27061; -- Xink's Shredder +SET @XINK := 26660; -- Xink +SET @SPELL := 52872; -- Forceitem Xink's Shredder + +UPDATE `creature_template` SET `npcflag`=16777216,`unit_flags`=32768,`spell1`=47938,`spell2`=47921,`spell3`=49857,`spell4`=47966, `spell6`=47939 ,`VehicleId`=42 WHERE `entry`=@SHREDDER; +-- Creature Gossip_menu_option ppdate from sniff +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (9422) AND `id` IN (0); +INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`) VALUES +(9422,0,0, 'I seem to have misplaced your Shredder Control Device... might you have another?',1,1,0,0,0,0, ''); +-- Gossip option conditions +DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId`=15 AND `SourceGroup`=9422); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,9422,0,1,9,12050,0,0,0,'','Show gossip only if Lumber Hack quest is taken'), +(15,9422,0,1,26,36734,0,0,0,'','Show gossip only if player does not have item Xink''s Shredder Control Device'), +(15,9422,0,2,26,36734,0,0,0,'','Show gossip option if player does not have item Xink''s Shredder Control Device'), +(15,9422,0,2,9,12052,0,0,0,'','Show gossip option if player has quest marked as taken'); + +DELETE FROM `conditions` WHERE `SourceEntry`=@SHREDDER; +INSERT INTO `conditions`(`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`)VALUES +(16,0,@SHREDDER,0,23,4230,0,0,0,'',"Dismount player when not in intended zone - Coldwind Heights"); + +-- NPC talk text insert from sniff +DELETE FROM `creature_text` WHERE `entry` IN (26660,27061) AND `groupid` IN (0,1); +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@XINK,0,0, 'About time! Get that lumber and get moving. The horde won''t be up there fighting forever, there''s money to be made!',12,0,100,25,1000,0, 'Xink'), +(@SHREDDER,0,0, 'Xink''s Shredder ready and available for woodland destruction.',16,0,100,0,0,0, 'Xink''s Shredder'), +(@SHREDDER,1,0, 'Xink''s Shredder security features activated. Returning to base.',16,0,100,0,0,0, 'Xink''s Shredder'); + +-- SAI for Xink +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@XINK; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@XINK AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@XINK,0,0,0,19,0,100,0,12050,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Xink - On Quest Accept - say 0'), +(@XINK,0,1,2,62,0,100,0,9422,0,0,0,11,@SPELL,0,0,0,0,0,7,0,0,0,0,0,0,0,'Xink - On Gossip option select - Cast Forceitem Xink''s Shredder'), +(@XINK,0,2,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Xink - On Gossip option select - Close Gossip'); + +DELETE FROM `conditions` WHERE `SourceEntry`=47939; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13, 1, 47939, 0, 0, 35, 0, 1, 5, 3, 0, 0, 0, '', 'Gather Lumber - limit GO targets to Coldwind Tree'); + +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`=27061; +INSERT INTO `npc_spellclick_spells` (`npc_entry`, `spell_id`, `cast_flags`, `user_type`) VALUES +(27061, 47920, 1, 0); diff --git a/sql/updates/world/2013_08_15_02_world_spell_proc_event.sql b/sql/updates/world/2013_08_15_02_world_spell_proc_event.sql new file mode 100644 index 00000000000..4e2b04faea4 --- /dev/null +++ b/sql/updates/world/2013_08_15_02_world_spell_proc_event.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_proc_event` WHERE `entry`=46916; +INSERT INTO `spell_proc_event` (`entry`,`SpellFamilyName`,`SpellFamilyMask0`,`SpellFamilyMask1`,`SpellFamilyMask2`) VALUES +(46916,4,0x200000,0x0,0x0); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 27e8453cfc3..4f98312f3d0 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -2734,11 +2734,11 @@ void Unit::SetCurrentCastedSpell(Spell* pSpell) if (m_currentSpells[CURRENT_AUTOREPEAT_SPELL]) { // break autorepeat if not Auto Shot - if (m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Id != 75) + if (m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->GetSpellInfo()->Id != 75) InterruptSpell(CURRENT_AUTOREPEAT_SPELL); m_AutoRepeatFirstCast = true; } - if (pSpell->m_spellInfo->CalcCastTime(this) > 0) + if (pSpell->GetCastTime() > 0) AddUnitState(UNIT_STATE_CASTING); break; @@ -2751,7 +2751,7 @@ void Unit::SetCurrentCastedSpell(Spell* pSpell) // it also does break autorepeat if not Auto Shot if (m_currentSpells[CURRENT_AUTOREPEAT_SPELL] && - m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Id != 75) + m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->GetSpellInfo()->Id != 75) InterruptSpell(CURRENT_AUTOREPEAT_SPELL); AddUnitState(UNIT_STATE_CASTING); @@ -2760,7 +2760,7 @@ void Unit::SetCurrentCastedSpell(Spell* pSpell) case CURRENT_AUTOREPEAT_SPELL: { // only Auto Shoot does not break anything - if (pSpell->m_spellInfo->Id != 75) + if (pSpell->GetSpellInfo()->Id != 75) { // generic autorepeats break generic non-delayed and channeled non-delayed spells InterruptSpell(CURRENT_GENERIC_SPELL, false); @@ -12332,11 +12332,10 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u if (spellInfo->AttributesEx3 & SPELL_ATTR3_DISABLE_PROC) SetCantProc(true); - i->aura->CallScriptProcHandlers(aurApp, eventInfo); + bool handled = i->aura->CallScriptProcHandlers(aurApp, eventInfo); - // This bool is needed till separate aura effect procs are still here - bool handled = false; - if (HandleAuraProc(target, damage, i->aura, procSpell, procFlag, procExtra, cooldown, &handled)) + // "handled" is needed as long as proc can be handled in multiple places + if (!handled && HandleAuraProc(target, damage, i->aura, procSpell, procFlag, procExtra, cooldown, &handled)) { TC_LOG_DEBUG(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell %u (triggered with value by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), Id); takeCharges = true; diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index f5d87a469de..1ca3e08a8b4 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -2094,8 +2094,9 @@ bool Aura::CallScriptPrepareProcHandlers(AuraApplication const* aurApp, ProcEven return prepare; } -void Aura::CallScriptProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo) +bool Aura::CallScriptProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo) { + bool handled = false; for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_PROC, aurApp); @@ -2103,8 +2104,11 @@ void Aura::CallScriptProcHandlers(AuraApplication const* aurApp, ProcEventInfo& for (; hookItr != hookItrEnd; ++hookItr) hookItr->Call(*scritr, eventInfo); + handled |= (*scritr)->_IsDefaultActionPrevented(); (*scritr)->_FinishScriptCall(); } + + return handled; } void Aura::CallScriptAfterProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo) diff --git a/src/server/game/Spells/Auras/SpellAuras.h b/src/server/game/Spells/Auras/SpellAuras.h index e865d415438..9e7d0cce82c 100644 --- a/src/server/game/Spells/Auras/SpellAuras.h +++ b/src/server/game/Spells/Auras/SpellAuras.h @@ -229,7 +229,7 @@ class Aura // Spell Proc Hooks bool CallScriptCheckProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo); bool CallScriptPrepareProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo); - void CallScriptProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo); + bool CallScriptProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo); void CallScriptAfterProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo); bool CallScriptEffectProcHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, ProcEventInfo& eventInfo); void CallScriptAfterEffectProcHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, ProcEventInfo& eventInfo); diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 7b30c3e6634..66d930ebc74 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3051,18 +3051,20 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered // Prepare data for triggers prepareDataForTriggerSystem(triggeredByAura); - if (m_caster->GetTypeId() == TYPEID_PLAYER) - m_caster->ToPlayer()->SetSpellModTakingSpell(this, true); - // calculate cast time (calculated after first CheckCast check to prevent charge counting for first CheckCast fail) - m_casttime = m_spellInfo->CalcCastTime(m_caster, this); - if (m_caster->GetTypeId() == TYPEID_PLAYER) + if (Player* player = m_caster->ToPlayer()) { - m_caster->ToPlayer()->SetSpellModTakingSpell(this, false); - - // Set casttime to 0 if .cheat casttime is enabled. - if (m_caster->ToPlayer()->GetCommandStatus(CHEAT_CASTTIME)) - m_casttime = 0; + if (!m_caster->ToPlayer()->GetCommandStatus(CHEAT_CASTTIME)) + { + m_caster->ToPlayer()->SetSpellModTakingSpell(this, true); + // calculate cast time (calculated after first CheckCast check to prevent charge counting for first CheckCast fail) + m_casttime = m_spellInfo->CalcCastTime(this); + m_caster->ToPlayer()->SetSpellModTakingSpell(this, false); + } + else + m_casttime = 0; // Set cast time to 0 if .cheat casttime is enabled. } + else + m_casttime = m_spellInfo->CalcCastTime(this); // don't allow channeled spells / spells with cast time to be casted while moving // (even if they are interrupted on moving, spells with almost immediate effect get to have their effect processed before movement interrupter kicks in) diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 52d4e5487ee..c48f6f8be20 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -2238,7 +2238,7 @@ int32 SpellInfo::GetMaxDuration() const return (DurationEntry->Duration[2] == -1) ? -1 : abs(DurationEntry->Duration[2]); } -uint32 SpellInfo::CalcCastTime(Unit* caster, Spell* spell) const +uint32 SpellInfo::CalcCastTime(Spell* spell /*= NULL*/) const { int32 castTime = 0; @@ -2255,8 +2255,8 @@ uint32 SpellInfo::CalcCastTime(Unit* caster, Spell* spell) const if (!castTime) return 0; - if (caster) - caster->ModSpellCastTime(this, castTime, spell); + if (spell) + spell->GetCaster()->ModSpellCastTime(this, castTime, spell); if (Attributes & SPELL_ATTR0_REQ_AMMO && (!IsAutoRepeatRangedSpell()) && !(AttributesEx9 & SPELL_ATTR9_AIMED_SHOT)) castTime += 500; diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index 0ee8571196f..bd2bd6cdb1f 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -495,7 +495,7 @@ public: uint32 GetMaxTicks() const; - uint32 CalcCastTime(Unit* caster = NULL, Spell* spell = NULL) const; + uint32 CalcCastTime(Spell* spell = NULL) const; uint32 GetRecoveryTime() const; int32 CalcPowerCost(Unit const* caster, SpellSchoolMask schoolMask) const; diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index cf694ff3348..1d0c0e81317 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3173,6 +3173,17 @@ void SpellMgr::LoadSpellInfoCorrections() // Entries were not updated after spell effect change, we have to do that manually :/ spellInfo->AttributesEx3 |= SPELL_ATTR3_CAN_PROC_WITH_TRIGGERED; break; + case 5308: // Execute (Rank 1) + case 20658: // Execute (Rank 2) + case 20660: // Execute (Rank 3) + case 20661: // Execute (Rank 4) + case 20662: // Execute (Rank 5) + case 25234: // Execute (Rank 6) + case 25236: // Execute (Rank 7) + case 47470: // Execute (Rank 8) + case 47471: // Execute (Rank 9) + spellInfo->AttributesEx3 |= SPELL_ATTR3_CANT_TRIGGER_PROC; + break; case 59725: // Improved Spell Reflection - aoe aura // Target entry seems to be wrong for this spell :/ spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER_AREA_PARTY); diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp index 5fb4d69cd02..bb9aab023af 100644 --- a/src/server/game/Spells/SpellScript.cpp +++ b/src/server/game/Spells/SpellScript.cpp @@ -909,6 +909,7 @@ bool AuraScript::_IsDefaultActionPrevented() case AURA_SCRIPT_HOOK_EFFECT_ABSORB: case AURA_SCRIPT_HOOK_EFFECT_SPLIT: case AURA_SCRIPT_HOOK_PREPARE_PROC: + case AURA_SCRIPT_HOOK_PROC: case AURA_SCRIPT_HOOK_EFFECT_PROC: return m_defaultActionPrevented; default: @@ -927,6 +928,7 @@ void AuraScript::PreventDefaultAction() case AURA_SCRIPT_HOOK_EFFECT_ABSORB: case AURA_SCRIPT_HOOK_EFFECT_SPLIT: case AURA_SCRIPT_HOOK_PREPARE_PROC: + case AURA_SCRIPT_HOOK_PROC: case AURA_SCRIPT_HOOK_EFFECT_PROC: m_defaultActionPrevented = true; break; diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index 310527d8fe9..c81d3aaae62 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -711,9 +711,8 @@ class spell_warr_slam : public SpellScriptLoader void HandleDummy(SpellEffIndex /*effIndex*/) { - int32 bp0 = GetEffectValue(); if (GetHitUnit()) - GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_WARRIOR_SLAM, &bp0, NULL, NULL, true, 0); + GetCaster()->CastCustomSpell(SPELL_WARRIOR_SLAM, SPELLVALUE_BASE_POINT0, GetEffectValue(), GetHitUnit(), TRIGGERED_FULL_MASK); } void Register() OVERRIDE |