Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4

Conflicts:
	src/server/game/Entities/Player/Player.cpp
	src/server/game/Entities/Unit/Unit.cpp
	src/server/game/Spells/Spell.cpp
	src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp
	src/server/scripts/Spells/spell_paladin.cpp
	src/server/scripts/Spells/spell_priest.cpp
	src/server/scripts/Spells/spell_shaman.cpp
	src/server/scripts/Spells/spell_warrior.cpp
This commit is contained in:
Vincent_Michael committed 2014-01-26 18:22:06 +01:00
commit 7cc4828554
38 files changed
+651 -272

No files matched your search

@@ -0,0 +1,13 @@
DELETE FROM `spell_script_names` WHERE `ScriptName` IN (
'spell_gen_slow_roasted_turkey',
'spell_gen_cranberry_chutney',
'spell_gen_spice_bread_stuffing',
'spell_gen_pumpkin_pie',
'spell_gen_candied_sweet_potato'
);
INSERT INTO `spell_script_names` (`spell_id` ,`ScriptName`) VALUES
(65422, 'spell_gen_slow_roasted_turkey'), -- Slow-Roasted Turkey
(65420, 'spell_gen_cranberry_chutney'), -- Cranberry Chutney
(65419, 'spell_gen_spice_bread_stuffing'), -- Spice Bread Stuffing
(65421, 'spell_gen_pumpkin_pie'), -- Pumpkin Pie
(65418, 'spell_gen_candied_sweet_potato'); -- Candied Sweet Potato
@@ -0,0 +1,11 @@
-- Scalewing Serpent SAI
SET @ENTRY := 20749;
UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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
(@ENTRY,0,0,0,0,0,100,0,2000,6000,12000,13000,11,37841,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Scalewing Serpent - Combat - Casts Lightning Strike'),
(@ENTRY,0,1,0,31,0,100,0,37841,0,0,0,33,21910,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Scalewing Serpent - On Spellhit - Killcredit');
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry`=20749;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(22,2,20749,0,0,1,0,37830,0,0,0,0,0, '', 'SAI - Scalewing Serpent gives kill credit if quest item aura is applied');
@@ -0,0 +1,2 @@
--
UPDATE `creature_template` SET `gossip_menu_id` = 0 WHERE `entry` = 5634;
@@ -0,0 +1,16 @@
--
UPDATE `creature_template` SET `ainame`='SmartAI' WHERE `entry`=16847;
DELETE FROM `smart_scripts` WHERE `entryorguid`=16847 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
(16847,0,0,1,8,0,100,0,29314,0,60000,60000,33,16847,0,0,0,0,0,7,0,0,0,0,0,0,0,'Debilitated Maghar Grunt - On Spellhit (Quest - Healing Salve) - Give Kill Credit'),
(16847,0,1,2,61,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Debilitated Maghar Grunt - Linked with Previous Event - Say'),
(16847,0,2,3,61,0,100,0,0,0,0,0,3,16846,0,0,0,0,0,1,0,0,0,0,0,0,0,'Debilitated Maghar Grunt - Linked with Previous Event - Change Entry'),
(16847,0,3,0,61,0,100,0,0,0,0,0,41,15000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Debilitated Maghar Grunt - Linked with Previous Event - Despawn'),
(16847,0,4,0,25,0,100,0,0,0,0,0,3,16847,0,0,0,0,0,1,0,0,0,0,0,0,0,'Debilitated Maghar Grunt - On Spawn - Change Entry');
DELETE FROM `creature_text` WHERE `entry` =16847;
INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
(16847,0,0,'My strength.... is... returning!',12,0,100,0,0,0,'Debilitated Maghar Grunt'),
(16847,0,1,'You''ve found a cure! We will crush our enemies!',12,0,100,0,0,0,'Debilitated Maghar Grunt'),
(16847,0,2,'You''ve restored my health! I''m in your debt, $N.',12,0,100,0,0,0,'Debilitated Maghar Grunt');
@@ -0,0 +1,4 @@
--
UPDATE `creature_template` SET `AIName`= '' WHERE `entry`=23450;
DELETE FROM `smart_scripts` WHERE `entryorguid`=23450 AND `source_type`=0;
UPDATE `creature_template` SET `AIName`= '' WHERE `entry`=28674;
@@ -0,0 +1,4 @@
-- Fixes the Dragonmaw Race: Wing Commander Ichman creature_queststarter mistake
UPDATE creature_template SET npcflag=3 WHERE entry=23345;
DELETE FROM creature_queststarter WHERE quest=11069;
INSERT INTO creature_queststarter VALUES (23345,11069);
@@ -0,0 +1,3 @@
--
INSERT INTO `gameobject_loot_template` (`entry`, `item`, `ChanceOrQuestChance`) VALUES
(18111, 22795, 10);
@@ -0,0 +1,3 @@
-- Fixes to Highlord Demitrian smart_scripts
UPDATE smart_scripts SET `comment`='Highlord Demitrian - On Gossip Complete - Add Item Vessel of Rebirth' WHERE entryorguid=14347 AND event_type=62;
UPDATE smart_scripts SET action_param2=6, action_param3=60000, target_type=8, target_x='-6241.771973',target_y='1717.143311',target_z='4.250421',target_o='0.680879',`comment`='Highlord Demitrian - On Quest Thunderaan the Windseeker Finished - Summon Creature Prince Thunderaan at XYZO' WHERE entryorguid=14347 AND event_type=20;
@@ -0,0 +1,13 @@
--
DELETE FROM `smart_scripts` WHERE `entryorguid`=24601 AND `id`=2;
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
(24601, 0, 2, 0, 6, 0, 100, 0, 0, 0, 0, 0, 33, 25987, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Steam Rager - On Death - Kill Credit');
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry` =24601;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(22,3,24601,0,0,1,1,46374,0,0,0,0,'','Windsoul Totem Credit only if aura present at death');
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=46374;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(13,1,46374,0,0,31,0,3,24601,0,0,0,0,'','Windsoul Totem Aura targets only Steam Rager'),
(13,1,46374,0,0,36,0,0,0,0,0,0,0,'','Windsoul Totem Aura targets only alive units');
@@ -0,0 +1,10 @@
--
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=37056;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(13, 1, 37056, 0, 0, 31, 0, 3, 21316, 0, 0, 0, '','Kill Legion Hold Infernals Targets Deathforged Infernal');
UPDATE `creature_template` SET `ainame`='SmartAI' WHERE `entry`=21512;
DELETE FROM `smart_scripts` WHERE `entryorguid`=21512 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
(21512,0,0,1,8,0,100,0,37055,0,300000,300000,33,21512,0,0,0,0,0,7,0,0,0,0,0,0,0,'Invis Legion Hold Glyph - On Spellhit (Destroy Legion Hold Infernals) - Give Kill Credit'),
(21512,0,1,0,61,0,100,0,37055,0,0,0,11,37056,0,0,0,0,0,1,0,0,0,0,0,0,0,'Invis Legion Hold Glyph - Linked with Previous Event - Cast Kill Legion Hold Infernals');
@@ -0,0 +1,12 @@
--
UPDATE `smart_scripts` SET `event_type`=11 WHERE `entryorguid`=9546 AND `source_type`=0 AND `id`=0;
UPDATE `smart_scripts` SET `target_type`=12, `target_param1`=1 WHERE `entryorguid`=954600 AND `source_type`=9 AND `id`=2;
DELETE FROM `smart_scripts` WHERE `entryorguid`=164954 AND `source_type`=1;
DELETE FROM `smart_scripts` WHERE `entryorguid`=16495400 AND `source_type`=9;
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
(164954,1,0,1,19,0,100,0,4265,0,0,0,64,1,0,0,0,0,0,7,0,0,0,0,0,0,0,"Zukk'ash Pod - On Quest Accept - Store Target List"),
(164954,1,1,2,61,0,100,0,0,0,0,0,12,9546,1,25000,0,0,0,8,0,0,0,-5314.81,430.89,11.79,3.46,"Zukk'ash Pod - On Quest Accept - Summon Raschal the Courier"),
(164954,1,2,0,61,0,100,0,0,0,0,0,80,16495400,2,0,0,0,0,1,0,0,0,0,0,0,0,"Zukk'ash Pod - On Quest Accept - Run Script"),
(16495400,9,0,0,0,0,100,0,100,100,0,0,100,1,0,0,0,0,0,19,9546,0,0,0,0,0,0,"Zukk'ash Pod - Script - Send Target List to Raschal the Courier");
@@ -0,0 +1,18 @@
-- [11796] Emergency Protocol: Section 8.2, Paragraph D
UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry` IN(25845,25846,25847);
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (25845,25846,25847);
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
(25845, 0, 0, 0, 8, 0, 100, 0, 46171, 0, 0, 0, 33, 25845 , 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Northwest Crash - On Spellhit - Kill Credit'),
(25846, 0, 0, 0, 8, 0, 100, 0, 46171, 0, 0, 0, 33, 25846 , 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'South Crash - On Spellhit - Kill Credit'),
(25847, 0, 0, 0, 8, 0, 100, 0, 46171, 0, 0, 0, 33, 25847 , 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'East Crash - On Spellhit - Kill Credit');
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=46171;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(13,1,46171,0,0,31,0,3,25845,0,0,0,0,'','Scuttle Wrecked Flying Machine targets Northwest Crash'),
(13,1,46171,0,1,31,0,3,25846,0,0,0,0,'','Scuttle Wrecked Flying Machine targets South Crash'),
(13,1,46171,0,2,31,0,3,25847,0,0,0,0,'','Scuttle Wrecked Flying Machine Flare targets East Crash');
DELETE FROM `disables` WHERE `sourceType`=0 AND `entry`=46171;
INSERT INTO `disables` (`sourceType`, `entry`, `flags`, `params_0`, `params_1`, `comment`) VALUES
(0, 46171, 64, '', '', 'Ignore LOS on Scuttle Wrecked Flying Machine');
@@ -0,0 +1,15 @@
--
UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 29978;
DELETE FROM `smart_scripts` WHERE `entryorguid`=29978;
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
(29978, 0, 0, 0, 6, 0, 100, 0, 0, 0, 0, 0, 33, 30297, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Iron Dwarf Assailant - On Death - Give Kill credit');
UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`= 29984;
DELETE FROM `smart_scripts` WHERE `entryorguid`=29984;
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
(29984, 0, 0, 0, 6, 0, 100, 0, 0, 0, 0, 0, 33, 30296, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Iron Sentinel <Servant of Loken> - On Death - Give Kill credit'),
(29984, 0, 1, 0, 9, 0, 100, 0, 0,10, 12000, 24000, 11, 56490, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Iron Sentinel <Servant of Loken> - On Range - Cast Stomp'),
(29984, 0, 2, 0, 0, 0, 100, 0, 0, 3000, 5000, 8000, 11, 55811, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Iron Sentinel <Servant of Loken> - IC - Cast Throw Bolder'),
(29984, 0, 3, 0, 9, 0, 100, 0, 0, 5, 5000, 7000, 11, 5568, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Iron Sentinel <Servant of Loken> - IC - Cast Trample');
@@ -0,0 +1,7 @@
DELETE FROM `spell_script_names` WHERE `spell_id` IN (58387,20230,-48438);
INSERT INTO `spell_script_names` (`spell_id` ,`ScriptName`) VALUES
(58387, 'spell_warr_glyph_of_sunder_armor'),
(20230, 'spell_warr_retaliation'),
(-48438,'spell_dru_wild_growth');
DELETE FROM `spell_proc_event` WHERE `entry`=58387;
@@ -0,0 +1,8 @@
DELETE FROM `spell_script_names` WHERE `spell_id` IN (-34861,64844,64904,54968,71610,71641);
INSERT INTO `spell_script_names` (`spell_id` ,`ScriptName`) VALUES
(-34861,'spell_pri_circle_of_healing'),
(64844, 'spell_pri_divine_hymn'),
(64904, 'spell_pri_hymn_of_hope'),
(54968, 'spell_pal_glyph_of_holy_light'),
(71610, 'spell_item_echoes_of_light'),
(71641, 'spell_item_echoes_of_light');
+2 -1
View File
@@ -340,7 +340,8 @@ CalendarEventStore CalendarMgr::GetPlayerEvents(uint64 guid)
for (CalendarEventInviteStore::const_iterator itr = _invites.begin(); itr != _invites.end(); ++itr)
for (CalendarInviteStore::const_iterator itr2 = itr->second.begin(); itr2 != itr->second.end(); ++itr2)
if ((*itr2)->GetInviteeGUID() == guid)
events.insert(GetEvent(itr->first));
if (CalendarEvent* event = GetEvent(itr->first)) // NULL check added as attempt to fix #11512
events.insert(event);
if (Player* player = ObjectAccessor::FindPlayer(guid))
for (CalendarEventStore::const_iterator itr = _events.begin(); itr != _events.end(); ++itr)
@@ -2210,3 +2210,19 @@ void GameObject::GetRespawnPosition(float &x, float &y, float &z, float* ori /*
if (ori)
*ori = GetOrientation();
}
float GameObject::GetInteractionDistance()
{
switch (GetGoType())
{
/// @todo find out how the client calculates the maximal usage distance to spellless working
// gameobjects like guildbanks and mailboxes - 10.0 is a just an abitrary choosen number
case GAMEOBJECT_TYPE_GUILD_BANK:
case GAMEOBJECT_TYPE_MAILBOX:
return 10.0f;
case GAMEOBJECT_TYPE_FISHINGHOLE:
return 20.0f + CONTACT_DISTANCE; // max spell range
default:
return INTERACTION_DISTANCE;
}
}
@@ -831,6 +831,8 @@ class GameObject : public WorldObject, public GridObject<GameObject>, public Map
float GetStationaryZ() const { if (GetGOInfo()->type != GAMEOBJECT_TYPE_MO_TRANSPORT) return m_stationaryPosition.GetPositionZ(); return GetPositionZ(); }
float GetStationaryO() const { if (GetGOInfo()->type != GAMEOBJECT_TYPE_MO_TRANSPORT) return m_stationaryPosition.GetOrientation(); return GetOrientation(); }
float GetInteractionDistance();
protected:
bool AIM_Initialize();
void UpdateModel(); // updates model in case displayId were changed
+19 -34
View File
@@ -2705,43 +2705,44 @@ void Player::RegenerateHealth()
return;
float HealthIncreaseRate = sWorld->getRate(RATE_HEALTH);
float addvalue = 0.0f;
float addValue = 0.0f;
// polymorphed case
if (IsPolymorphed())
addvalue = (float)GetMaxHealth()/3;
addValue = float(GetMaxHealth()) / 3.0f;
// normal regen case (maybe partly in combat case)
else if (!IsInCombat() || HasAuraType(SPELL_AURA_MOD_REGEN_DURING_COMBAT))
{
addvalue = HealthIncreaseRate;
addValue = HealthIncreaseRate;
if (!IsInCombat())
{
if (getLevel() < 15)
addvalue = (0.20f*((float)GetMaxHealth())/getLevel()*HealthIncreaseRate);
addValue = (0.20f * ((float)GetMaxHealth()) / getLevel() * HealthIncreaseRate);
else
addvalue = 0.015f*((float)GetMaxHealth())*HealthIncreaseRate;
addValue = 0.015f * ((float)GetMaxHealth()) * HealthIncreaseRate;
AuraEffectList const& mModHealthRegenPct = GetAuraEffectsByType(SPELL_AURA_MOD_HEALTH_REGEN_PERCENT);
for (AuraEffectList::const_iterator i = mModHealthRegenPct.begin(); i != mModHealthRegenPct.end(); ++i)
AddPct(addvalue, (*i)->GetAmount());
AddPct(addValue, (*i)->GetAmount());
addvalue += GetTotalAuraModifier(SPELL_AURA_MOD_REGEN) * 2 * IN_MILLISECONDS / (5 * IN_MILLISECONDS);
addValue += GetTotalAuraModifier(SPELL_AURA_MOD_REGEN) * 0.4f;
}
else if (HasAuraType(SPELL_AURA_MOD_REGEN_DURING_COMBAT))
ApplyPct(addvalue, GetTotalAuraModifier(SPELL_AURA_MOD_REGEN_DURING_COMBAT));
ApplyPct(addValue, GetTotalAuraModifier(SPELL_AURA_MOD_REGEN_DURING_COMBAT));
if (!IsStandState())
addvalue *= 1.5f;
addValue *= 1.5f;
}
// always regeneration bonus (including combat)
addvalue += GetTotalAuraModifier(SPELL_AURA_MOD_HEALTH_REGEN_IN_COMBAT);
addvalue += m_baseHealthRegen / 2.5f;
addValue += GetTotalAuraModifier(SPELL_AURA_MOD_HEALTH_REGEN_IN_COMBAT);
addValue += m_baseHealthRegen / 2.5f;
if (addvalue < 0)
addvalue = 0;
if (addValue < 0.0f)
addValue = 0.0f;
ModifyHealth(int32(addvalue));
ModifyHealth(int32(addValue));
}
void Player::ResetAllPowers()
@@ -2844,30 +2845,14 @@ GameObject* Player::GetGameObjectIfCanInteractWith(uint64 guid, GameobjectTypes
{
if (go->GetGoType() == type)
{
float maxdist;
switch (type)
{
/// @todo find out how the client calculates the maximal usage distance to spellless working
// gameobjects like guildbanks and mailboxes - 10.0 is a just an abitrary choosen number
case GAMEOBJECT_TYPE_GUILD_BANK:
case GAMEOBJECT_TYPE_MAILBOX:
maxdist = 10.0f;
break;
case GAMEOBJECT_TYPE_FISHINGHOLE:
maxdist = 20.0f+CONTACT_DISTANCE; // max spell range
break;
default:
maxdist = INTERACTION_DISTANCE;
break;
}
if (go->IsWithinDistInMap(this, maxdist))
if (go->IsWithinDistInMap(this, go->GetInteractionDistance()))
return go;
TC_LOG_DEBUG("maps", "IsGameObjectOfTypeInRange: GameObject '%s' [GUID: %u] is too far away from player %s [GUID: %u] to be used by him (distance=%f, maximal 10 is allowed)", go->GetGOInfo()->name.c_str(),
TC_LOG_DEBUG("maps", "GetGameObjectIfCanInteractWith: GameObject '%s' [GUID: %u] is too far away from player %s [GUID: %u] to be used by him (distance=%f, maximal 10 is allowed)", go->GetGOInfo()->name.c_str(),
go->GetGUIDLow(), GetName().c_str(), GetGUIDLow(), go->GetDistance(this));
}
}
return NULL;
}
@@ -17233,7 +17218,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
// init saved position, and fix it later if problematic
uint32 transLowGUID = uint32(fields[31].GetUInt32());
Relocate(fields[12].GetFloat(), fields[13].GetFloat(), fields[14].GetFloat(), fields[16].GetFloat());
uint32 mapId = fields[15].GetUInt16();
+13 -11
View File
@@ -7901,9 +7901,7 @@ void Unit::SetMinion(Minion *minion, bool apply)
}
if (minion->m_Properties && minion->m_Properties->Type == SUMMON_TYPE_MINIPET)
{
SetCritterGUID(minion->GetGUID());
}
// PvP, FFAPvP
minion->SetByteValue(UNIT_FIELD_BYTES_2, 1, GetByteValue(UNIT_FIELD_BYTES_2, 1));
@@ -11506,12 +11504,14 @@ void Unit::SetLevel(uint8 lvl)
{
SetUInt32Value(UNIT_FIELD_LEVEL, lvl);
// group update
if (GetTypeId() == TYPEID_PLAYER && ToPlayer()->GetGroup())
ToPlayer()->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_LEVEL);
if (Player* player = ToPlayer())
{
// group update
if (player->GetGroup())
player->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_LEVEL);
if (GetTypeId() == TYPEID_PLAYER)
sWorld->UpdateCharacterNameDataLevel(ToPlayer()->GetGUIDLow(), lvl);
sWorld->UpdateCharacterNameDataLevel(GetGUIDLow(), lvl);
}
}
void Unit::SetHealth(uint32 val)
@@ -16152,19 +16152,21 @@ bool Unit::SetHover(bool enable, bool packetOnly /*= false*/)
if (enable == HasUnitMovementFlag(MOVEMENTFLAG_HOVER))
return false;
float hoverHeight = GetFloatValue(UNIT_FIELD_HOVERHEIGHT);
if (enable)
{
//! No need to check height on ascent
AddUnitMovementFlag(MOVEMENTFLAG_HOVER);
if (float hh = GetFloatValue(UNIT_FIELD_HOVERHEIGHT))
UpdateHeight(GetPositionZ() + hh);
if (hoverHeight)
UpdateHeight(GetPositionZ() + hoverHeight);
}
else
{
RemoveUnitMovementFlag(MOVEMENTFLAG_HOVER);
if (float hh = GetFloatValue(UNIT_FIELD_HOVERHEIGHT))
if (hoverHeight)
{
float newZ = GetPositionZ() - hh;
float newZ = GetPositionZ() - hoverHeight;
UpdateAllowedPositionZ(GetPositionX(), GetPositionY(), newZ);
UpdateHeight(newZ);
}
+23 -1
View File
@@ -2273,12 +2273,23 @@ namespace Trinity
{
public:
PowerPctOrderPred(Powers power, bool ascending = true) : _power(power), _ascending(ascending) { }
bool operator() (Unit const* a, Unit const* b) const
bool operator()(WorldObject const* objA, WorldObject const* objB) const
{
Unit const* a = objA->ToUnit();
Unit const* b = objB->ToUnit();
float rA = (a && a->GetMaxPower(_power)) ? float(a->GetPower(_power)) / float(a->GetMaxPower(_power)) : 0.0f;
float rB = (b && b->GetMaxPower(_power)) ? float(b->GetPower(_power)) / float(b->GetMaxPower(_power)) : 0.0f;
return _ascending ? rA < rB : rA > rB;
}
bool operator()(Unit const* a, Unit const* b) const
{
float rA = a->GetMaxPower(_power) ? float(a->GetPower(_power)) / float(a->GetMaxPower(_power)) : 0.0f;
float rB = b->GetMaxPower(_power) ? float(b->GetPower(_power)) / float(b->GetMaxPower(_power)) : 0.0f;
return _ascending ? rA < rB : rA > rB;
}
private:
Powers const _power;
bool const _ascending;
@@ -2289,12 +2300,23 @@ namespace Trinity
{
public:
HealthPctOrderPred(bool ascending = true) : _ascending(ascending) { }
bool operator()(WorldObject const* objA, WorldObject const* objB) const
{
Unit const* a = objA->ToUnit();
Unit const* b = objB->ToUnit();
float rA = (a && a->GetMaxHealth()) ? float(a->GetHealth()) / float(a->GetMaxHealth()) : 0.0f;
float rB = (b && b->GetMaxHealth()) ? float(b->GetHealth()) / float(b->GetMaxHealth()) : 0.0f;
return _ascending ? rA < rB : rA > rB;
}
bool operator() (Unit const* a, Unit const* b) const
{
float rA = a->GetMaxHealth() ? float(a->GetHealth()) / float(a->GetMaxHealth()) : 0.0f;
float rB = b->GetMaxHealth() ? float(b->GetHealth()) / float(b->GetMaxHealth()) : 0.0f;
return _ascending ? rA < rB : rA > rB;
}
private:
bool const _ascending;
};
@@ -88,6 +88,9 @@ void WorldSession::HandleTalentWipeConfirmOpcode(WorldPacket& recvData)
return;
}
if (!unit->isCanTrainingAndResetTalentsOf(_player))
return;
// remove fake death
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
+6 -4
View File
@@ -285,19 +285,21 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket)
void WorldSession::HandleGameObjectUseOpcode(WorldPacket& recvData)
{
uint64 guid;
recvData >> guid;
TC_LOG_DEBUG("network", "WORLD: Recvd CMSG_GAMEOBJ_USE Message [guid=%u]", GUID_LOPART(guid));
if (GameObject* obj = GetPlayer()->GetMap()->GetGameObject(guid))
{
if (!obj->IsWithinDistInMap(GetPlayer(), obj->GetInteractionDistance()))
return;
// ignore for remote control state
if (_player->m_mover != _player)
if (!(_player->IsOnVehicle(_player->m_mover) || _player->IsMounted()) && !obj->GetGOInfo()->IsUsableMounted())
if (GetPlayer()->m_mover != GetPlayer())
if (!(GetPlayer()->IsOnVehicle(GetPlayer()->m_mover) || GetPlayer()->IsMounted()) && !obj->GetGOInfo()->IsUsableMounted())
return;
obj->Use(_player);
obj->Use(GetPlayer());
}
}
+35 -156
View File
@@ -1144,6 +1144,7 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge
ASSERT(false && "Spell::SelectImplicitAreaTargets: received not implemented target reference type");
return;
}
if (!referer)
return;
@@ -1165,6 +1166,7 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge
ASSERT(false && "Spell::SelectImplicitAreaTargets: received not implemented target reference type");
return;
}
std::list<WorldObject*> targets;
float radius = m_spellInfo->Effects[effIndex].CalcRadius(m_caster) * m_spellValue->RadiusMod;
SearchAreaTargets(targets, radius, center, referer, targetType.GetObjectType(), targetType.GetCheckType(), m_spellInfo->Effects[effIndex].ImplicitTargetConditions);
@@ -1242,142 +1244,19 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge
CallScriptObjectAreaTargetSelectHandlers(targets, effIndex);
std::list<Unit*> unitTargets;
std::list<GameObject*> gObjTargets;
// for compability with older code - add only unit and go targets
/// @todo remove this
for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end(); ++itr)
if (!targets.empty())
{
if (Unit* unitTarget = (*itr)->ToUnit())
unitTargets.push_back(unitTarget);
else if (GameObject* gObjTarget = (*itr)->ToGameObject())
gObjTargets.push_back(gObjTarget);
}
if (!unitTargets.empty())
{
// Special target selection for smart heals and energizes
uint32 maxSize = 0;
int32 power = -1;
switch (m_spellInfo->SpellFamilyName)
{
case SPELLFAMILY_GENERIC:
switch (m_spellInfo->Id)
{
case 52759: // Ancestral Awakening
case 71610: // Echoes of Light (Althor's Abacus normal version)
case 71641: // Echoes of Light (Althor's Abacus heroic version)
maxSize = 1;
power = POWER_HEALTH;
break;
case 54968: // Glyph of Holy Light
maxSize = m_spellInfo->MaxAffectedTargets;
power = POWER_HEALTH;
break;
case 57669: // Replenishment
// In arenas Replenishment may only affect the caster
if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->ToPlayer()->InArena())
{
unitTargets.clear();
unitTargets.push_back(m_caster);
break;
}
maxSize = 10;
power = POWER_MANA;
break;
default:
break;
}
break;
case SPELLFAMILY_PRIEST:
if (m_spellInfo->SpellFamilyFlags[0] == 0x10000000) // Circle of Healing
{
maxSize = m_caster->HasAura(55675) ? 6 : 5; // Glyph of Circle of Healing
power = POWER_HEALTH;
}
else if (m_spellInfo->Id == 64844) // Divine Hymn
{
maxSize = 3;
power = POWER_HEALTH;
}
else if (m_spellInfo->Id == 64904) // Hymn of Hope
{
maxSize = 3;
power = POWER_MANA;
}
else
break;
// Remove targets outside caster's raid
for (std::list<Unit*>::iterator itr = unitTargets.begin(); itr != unitTargets.end();)
{
if (!(*itr)->IsInRaidWith(m_caster))
itr = unitTargets.erase(itr);
else
++itr;
}
break;
case SPELLFAMILY_DRUID:
if (m_spellInfo->SpellFamilyFlags[1] == 0x04000000) // Wild Growth
{
maxSize = m_caster->HasAura(62970) ? 6 : 5; // Glyph of Wild Growth
power = POWER_HEALTH;
}
else
break;
// Remove targets outside caster's raid
for (std::list<Unit*>::iterator itr = unitTargets.begin(); itr != unitTargets.end();)
if (!(*itr)->IsInRaidWith(m_caster))
itr = unitTargets.erase(itr);
else
++itr;
break;
default:
break;
}
if (maxSize && power != -1)
{
if (Powers(power) == POWER_HEALTH)
{
if (unitTargets.size() > maxSize)
{
unitTargets.sort(Trinity::HealthPctOrderPred());
unitTargets.resize(maxSize);
}
}
else
{
for (std::list<Unit*>::iterator itr = unitTargets.begin(); itr != unitTargets.end();)
if ((*itr)->getPowerType() != (Powers)power)
itr = unitTargets.erase(itr);
else
++itr;
if (unitTargets.size() > maxSize)
{
unitTargets.sort(Trinity::PowerPctOrderPred((Powers)power));
unitTargets.resize(maxSize);
}
}
}
// Other special target selection goes here
if (uint32 maxTargets = m_spellValue->MaxAffectedTargets)
Trinity::Containers::RandomResizeList(unitTargets, maxTargets);
Trinity::Containers::RandomResizeList(targets, maxTargets);
for (std::list<Unit*>::iterator itr = unitTargets.begin(); itr != unitTargets.end(); ++itr)
AddUnitTarget(*itr, effMask, false);
}
if (!gObjTargets.empty())
{
if (uint32 maxTargets = m_spellValue->MaxAffectedTargets)
Trinity::Containers::RandomResizeList(gObjTargets, maxTargets);
for (std::list<GameObject*>::iterator itr = gObjTargets.begin(); itr != gObjTargets.end(); ++itr)
AddGOTarget(*itr, effMask);
for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end(); ++itr)
{
if (Unit* unitTarget = (*itr)->ToUnit())
AddUnitTarget(unitTarget, effMask, false);
else if (GameObject* gObjTarget = (*itr)->ToGameObject())
AddGOTarget(gObjTarget, effMask);
}
}
}
@@ -1411,33 +1290,33 @@ void Spell::SelectImplicitCasterDestTargets(SpellEffIndex effIndex, SpellImplici
break;
case TARGET_DEST_CASTER_FISHING:
{
float min_dis = m_spellInfo->GetMinRange(true);
float max_dis = m_spellInfo->GetMaxRange(true);
float dis = (float)rand_norm() * (max_dis - min_dis) + min_dis;
float x, y, z, angle;
angle = (float)rand_norm() * static_cast<float>(M_PI * 35.0f / 180.0f) - static_cast<float>(M_PI * 17.5f / 180.0f);
m_caster->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE, dis, angle);
float minDist = m_spellInfo->GetMinRange(true);
float maxDist = m_spellInfo->GetMaxRange(true);
float dist = frand(minDist, maxDist);
float x, y, z;
float angle = float(rand_norm()) * static_cast<float>(M_PI * 35.0f / 180.0f) - static_cast<float>(M_PI * 17.5f / 180.0f);
m_caster->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE, dist, angle);
float ground = z;
float liquidLevel = m_caster->GetMap()->GetWaterOrGroundLevel(x, y, z, &ground);
if (liquidLevel <= ground) // When there is no liquid Map::GetWaterOrGroundLevel returns ground level
{
SendCastResult(SPELL_FAILED_NOT_HERE);
SendChannelUpdate(0);
finish(false);
return;
}
float ground = z;
float liquidLevel = m_caster->GetMap()->GetWaterOrGroundLevel(x, y, z, &ground);
if (liquidLevel <= ground) // When there is no liquid Map::GetWaterOrGroundLevel returns ground level
{
SendCastResult(SPELL_FAILED_NOT_HERE);
SendChannelUpdate(0);
finish(false);
return;
}
if (ground + 0.75 > liquidLevel)
{
SendCastResult(SPELL_FAILED_TOO_SHALLOW);
SendChannelUpdate(0);
finish(false);
return;
}
if (ground + 0.75 > liquidLevel)
{
SendCastResult(SPELL_FAILED_TOO_SHALLOW);
SendChannelUpdate(0);
finish(false);
return;
}
dest = SpellDestination(x, y, liquidLevel, m_caster->GetOrientation());
break;
dest = SpellDestination(x, y, liquidLevel, m_caster->GetOrientation());
break;
}
default:
{
+6
View File
@@ -2928,12 +2928,18 @@ void SpellMgr::LoadSpellInfoCustomAttributes()
case 2589:
case 2590:
case 2591:
case 7159:
case 8627:
case 8721:
case 11279:
case 11280:
case 11281:
case 15582:
case 15657:
case 22416:
case 25300:
case 26863:
case 37685:
case 48656:
case 48657:
case 703: // Garrote
+3 -4
View File
@@ -138,13 +138,12 @@ class spell_dk_anti_magic_shell_self : public SpellScriptLoader
absorbAmount = std::min(CalculatePct(dmgInfo.GetDamage(), absorbPct), GetTarget()->CountPctFromMaxHealth(hpPct));
}
void Trigger(AuraEffect* aurEff, DamageInfo & /*dmgInfo*/, uint32 & absorbAmount)
void Trigger(AuraEffect* aurEff, DamageInfo& /*dmgInfo*/, uint32& absorbAmount)
{
Unit* target = GetTarget();
// damage absorbed by Anti-Magic Shell energizes the DK with additional runic power.
// This, if I'm not mistaken, shows that we get back ~20% of the absorbed damage as runic power.
int32 bp = absorbAmount * 2 / 10;
target->CastCustomSpell(target, SPELL_DK_RUNIC_POWER_ENERGIZE, &bp, NULL, NULL, true, NULL, aurEff);
int32 bp = CalculatePct(absorbAmount, 20);
GetTarget()->CastCustomSpell(SPELL_DK_RUNIC_POWER_ENERGIZE, SPELLVALUE_BASE_POINT0, bp, GetTarget(), true, NULL, aurEff);
}
void Register() OVERRIDE
+60
View File
@@ -1152,6 +1152,65 @@ class spell_dru_t10_restoration_4p_bonus : public SpellScriptLoader
}
};
class RaidCheck
{
public:
explicit RaidCheck(Unit const* caster) : _caster(caster) { }
bool operator()(WorldObject* obj) const
{
if (Unit* target = obj->ToUnit())
return !_caster->IsInRaidWith(target);
return true;
}
private:
Unit const* _caster;
};
// -48438 - Wild Growth
class spell_dru_wild_growth : public SpellScriptLoader
{
public:
spell_dru_wild_growth() : SpellScriptLoader("spell_dru_wild_growth") { }
class spell_dru_wild_growth_SpellScript : public SpellScript
{
PrepareSpellScript(spell_dru_wild_growth_SpellScript);
bool Validate(SpellInfo const* spellInfo) OVERRIDE
{
if (spellInfo->Effects[EFFECT_2].IsEffect() || !spellInfo->Effects[EFFECT_2].CalcValue())
return false;
return true;
}
void FilterTargets(std::list<WorldObject*>& targets)
{
targets.remove_if(RaidCheck(GetCaster()));
int32 const maxTargets = GetSpellInfo()->Effects[EFFECT_2].CalcValue(GetCaster());
if (targets.size() > uint32(maxTargets))
{
targets.sort(Trinity::HealthPctOrderPred());
targets.resize(maxTargets);
}
}
void Register() OVERRIDE
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_dru_wild_growth_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ALLY);
}
};
SpellScript* GetSpellScript() const OVERRIDE
{
return new spell_dru_wild_growth_SpellScript();
}
};
void AddSC_druid_spell_scripts()
{
new spell_dru_dash();
@@ -1179,4 +1238,5 @@ void AddSC_druid_spell_scripts()
new spell_dru_tiger_s_fury();
new spell_dru_typhoon();
new spell_dru_t10_restoration_4p_bonus();
new spell_dru_wild_growth();
}
+51 -8
View File
@@ -2796,23 +2796,66 @@ enum Replenishment
SPELL_INFINITE_REPLENISHMENT = 61782
};
class ReplenishmentCheck
{
public:
bool operator()(WorldObject* obj) const
{
if (Unit* target = obj->ToUnit())
return target->getPowerType() != POWER_MANA;
return true;
}
};
class spell_gen_replenishment : public SpellScriptLoader
{
public:
spell_gen_replenishment() : SpellScriptLoader("spell_gen_replenishment") { }
class spell_gen_replenishment_SpellScript : public SpellScript
{
PrepareSpellScript(spell_gen_replenishment_SpellScript);
void RemoveInvalidTargets(std::list<WorldObject*>& targets)
{
// In arenas Replenishment may only affect the caster
if (Player* caster = GetCaster()->ToPlayer())
{
if (caster->InArena())
{
targets.clear();
targets.push_back(caster);
return;
}
}
targets.remove_if(ReplenishmentCheck());
uint8 const maxTargets = 10;
if (targets.size() > maxTargets)
{
targets.sort(Trinity::PowerPctOrderPred(POWER_MANA));
targets.resize(maxTargets);
}
}
void Register() OVERRIDE
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_gen_replenishment_SpellScript::RemoveInvalidTargets, EFFECT_ALL, TARGET_UNIT_CASTER_AREA_RAID);
}
};
SpellScript* GetSpellScript() const OVERRIDE
{
return new spell_gen_replenishment_SpellScript();
}
class spell_gen_replenishment_AuraScript : public AuraScript
{
PrepareAuraScript(spell_gen_replenishment_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
{
if (!sSpellMgr->GetSpellInfo(SPELL_REPLENISHMENT) ||
!sSpellMgr->GetSpellInfo(SPELL_INFINITE_REPLENISHMENT))
return false;
return true;
}
bool Load() OVERRIDE
{
return GetUnitOwner()->GetPower(POWER_MANA);
+3 -3
View File
@@ -303,7 +303,7 @@ class spell_pilgrims_bounty_buff_food : public SpellScriptLoader
public:
spell_pilgrims_bounty_buff_food_AuraScript(uint32 triggeredSpellId) : AuraScript(), _triggeredSpellId(triggeredSpellId) { }
bool Load()
bool Load() OVERRIDE
{
_handled = false;
return true;
@@ -318,7 +318,7 @@ class spell_pilgrims_bounty_buff_food : public SpellScriptLoader
GetTarget()->CastSpell(GetTarget(), _triggeredSpellId, true);
}
void Register()
void Register() OVERRIDE
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_pilgrims_bounty_buff_food_AuraScript::HandleTriggerSpell, EFFECT_2, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
@@ -326,7 +326,7 @@ class spell_pilgrims_bounty_buff_food : public SpellScriptLoader
bool _handled;
};
AuraScript* GetAuraScript() const
AuraScript* GetAuraScript() const OVERRIDE
{
return new spell_pilgrims_bounty_buff_food_AuraScript(_triggeredSpellId);
}
+35
View File
@@ -349,6 +349,40 @@ class spell_item_deviate_fish : public SpellScriptLoader
}
};
// 71610, 71641 - Echoes of Light (Althor's Abacus)
class spell_item_echoes_of_light : public SpellScriptLoader
{
public:
spell_item_echoes_of_light() : SpellScriptLoader("spell_item_echoes_of_light") { }
class spell_item_echoes_of_light_SpellScript : public SpellScript
{
PrepareSpellScript(spell_item_echoes_of_light_SpellScript);
void FilterTargets(std::list<WorldObject*>& targets)
{
if (targets.size() < 2)
return;
targets.sort(Trinity::HealthPctOrderPred());
WorldObject* target = targets.front();
targets.clear();
targets.push_back(target);
}
void Register() OVERRIDE
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_item_echoes_of_light_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ALLY);
}
};
SpellScript* GetSpellScript() const OVERRIDE
{
return new spell_item_echoes_of_light_SpellScript();
}
};
// http://www.wowhead.com/item=47499 Flask of the North
// 67019 Flask of the North
enum FlaskOfTheNorthSpells
@@ -2526,6 +2560,7 @@ void AddSC_item_spell_scripts()
new spell_item_defibrillate("spell_item_gnomish_army_knife", 33);
new spell_item_desperate_defense();
new spell_item_deviate_fish();
new spell_item_echoes_of_light();
new spell_item_flask_of_the_north();
new spell_item_gnomish_death_ray();
new spell_item_make_a_wish();
+52 -18
View File
@@ -524,6 +524,42 @@ class spell_pal_exorcism_and_holy_wrath_damage : public SpellScriptLoader
}
};
// -9799 - Eye for an Eye
class spell_pal_eye_for_an_eye : public SpellScriptLoader
{
public:
spell_pal_eye_for_an_eye() : SpellScriptLoader("spell_pal_eye_for_an_eye") { }
class spell_pal_eye_for_an_eye_AuraScript : public AuraScript
{
PrepareAuraScript(spell_pal_eye_for_an_eye_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
{
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_EYE_FOR_AN_EYE_DAMAGE))
return false;
return true;
}
void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
int32 damage = CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), aurEff->GetAmount());
GetTarget()->CastCustomSpell(SPELL_PALADIN_EYE_FOR_AN_EYE_DAMAGE, SPELLVALUE_BASE_POINT0, damage, eventInfo.GetProcTarget(), true, NULL, aurEff);
}
void Register() OVERRIDE
{
OnEffectProc += AuraEffectProcFn(spell_pal_eye_for_an_eye_AuraScript::HandleEffectProc, EFFECT_0, m_scriptSpellId == SPELL_PALADIN_EYE_FOR_AN_EYE_RANK_1 ? SPELL_AURA_DUMMY : SPELL_AURA_PROC_TRIGGER_SPELL);
}
};
AuraScript* GetAuraScript() const OVERRIDE
{
return new spell_pal_eye_for_an_eye_AuraScript();
}
};
// -75806 - Grand Crusader
class spell_pal_grand_crusader : public SpellScriptLoader
{
@@ -564,39 +600,36 @@ class spell_pal_grand_crusader : public SpellScriptLoader
}
};
// -9799 - Eye for an Eye
class spell_pal_eye_for_an_eye : public SpellScriptLoader
// 54968 - Glyph of Holy Light
class spell_pal_glyph_of_holy_light : public SpellScriptLoader
{
public:
spell_pal_eye_for_an_eye() : SpellScriptLoader("spell_pal_eye_for_an_eye") { }
spell_pal_glyph_of_holy_light() : SpellScriptLoader("spell_pal_glyph_of_holy_light") { }
class spell_pal_eye_for_an_eye_AuraScript : public AuraScript
class spell_pal_glyph_of_holy_light_SpellScript : public SpellScript
{
PrepareAuraScript(spell_pal_eye_for_an_eye_AuraScript);
PrepareSpellScript(spell_pal_glyph_of_holy_light_SpellScript);
bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
void FilterTargets(std::list<WorldObject*>& targets)
{
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_EYE_FOR_AN_EYE_DAMAGE))
return false;
return true;
}
uint32 const maxTargets = GetSpellInfo()->MaxAffectedTargets;
void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
int32 damage = CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), aurEff->GetAmount());
GetTarget()->CastCustomSpell(SPELL_PALADIN_EYE_FOR_AN_EYE_DAMAGE, SPELLVALUE_BASE_POINT0, damage, eventInfo.GetProcTarget(), true, NULL, aurEff);
if (targets.size() > maxTargets)
{
targets.sort(Trinity::HealthPctOrderPred());
targets.resize(maxTargets);
}
}
void Register() OVERRIDE
{
OnEffectProc += AuraEffectProcFn(spell_pal_eye_for_an_eye_AuraScript::HandleEffectProc, EFFECT_0, m_scriptSpellId == SPELL_PALADIN_EYE_FOR_AN_EYE_RANK_1 ? SPELL_AURA_DUMMY : SPELL_AURA_PROC_TRIGGER_SPELL);
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_pal_glyph_of_holy_light_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ALLY);
}
};
AuraScript* GetAuraScript() const OVERRIDE
SpellScript* GetSpellScript() const OVERRIDE
{
return new spell_pal_eye_for_an_eye_AuraScript();
return new spell_pal_glyph_of_holy_light_SpellScript();
}
};
@@ -1073,6 +1106,7 @@ void AddSC_paladin_spell_scripts()
new spell_pal_divine_storm_dummy();
new spell_pal_exorcism_and_holy_wrath_damage();
new spell_pal_eye_for_an_eye();
new spell_pal_glyph_of_holy_light();
new spell_pal_grand_crusader();
new spell_pal_hand_of_sacrifice();
new spell_pal_holy_shock();
+1 -2
View File
@@ -1477,9 +1477,8 @@ public:
// Ravenous Dead. Check just if owner has Ravenous Dead since it's effect is not an aura
if (AuraEffect const* aurEff = owner->GetAuraEffect(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, SPELLFAMILY_DEATHKNIGHT, 3010, 0))
{
mod += aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue()/100; // Ravenous Dead edits the original scale
}
// Glyph of the Ghoul
if (AuraEffect const* aurEff = owner->GetAuraEffect(SPELL_DEATH_KNIGHT_GLYPH_OF_GHOUL, 0))
mod += aurEff->GetAmount()/100;
+151
View File
@@ -37,6 +37,7 @@ enum PriestSpells
SPELL_PRIEST_DISPEL_MAGIC_HOSTILE = 97691,
SPELL_PRIEST_DIVINE_AEGIS = 47753,
SPELL_PRIEST_DIVINE_TOUCH = 63544,
SPELL_PRIEST_GLYPH_OF_CIRCLE_OF_HEALING = 55675,
SPELL_PRIEST_GLYPH_OF_DISPEL_MAGIC = 55677,
SPELL_PRIEST_GLYPH_OF_DISPEL_MAGIC_HEAL = 56131,
SPELL_PRIEST_GLYPH_OF_LIGHTWELL = 55673,
@@ -75,6 +76,40 @@ enum MiscSpells
SPELL_GEN_REPLENISHMENT = 57669
};
class PowerCheck
{
public:
explicit PowerCheck(Powers power) : _power(power) { }
bool operator()(WorldObject* obj) const
{
if (Unit* target = obj->ToUnit())
return target->getPowerType() != _power;
return true;
}
private:
Powers _power;
};
class RaidCheck
{
public:
explicit RaidCheck(Unit const* caster) : _caster(caster) { }
bool operator()(WorldObject* obj) const
{
if (Unit* target = obj->ToUnit())
return !_caster->IsInRaidWith(target);
return true;
}
private:
Unit const* _caster;
};
class spell_pri_body_and_soul : public SpellScriptLoader
{
public:
@@ -126,6 +161,48 @@ class spell_pri_body_and_soul : public SpellScriptLoader
}
};
// 34861 - Circle of Healing
class spell_pri_circle_of_healing : public SpellScriptLoader
{
public:
spell_pri_circle_of_healing() : SpellScriptLoader("spell_pri_circle_of_healing") { }
class spell_pri_circle_of_healing_SpellScript : public SpellScript
{
PrepareSpellScript(spell_pri_circle_of_healing_SpellScript);
bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
{
if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_GLYPH_OF_CIRCLE_OF_HEALING))
return false;
return true;
}
void FilterTargets(std::list<WorldObject*>& targets)
{
targets.remove_if(RaidCheck(GetCaster()));
uint32 const maxTargets = GetCaster()->HasAura(SPELL_PRIEST_GLYPH_OF_CIRCLE_OF_HEALING) ? 6 : 5; // Glyph of Circle of Healing
if (targets.size() > maxTargets)
{
targets.sort(Trinity::HealthPctOrderPred());
targets.resize(maxTargets);
}
}
void Register() OVERRIDE
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_pri_circle_of_healing_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ALLY);
}
};
SpellScript* GetSpellScript() const OVERRIDE
{
return new spell_pri_circle_of_healing_SpellScript();
}
};
// 527 - Dispel magic
class spell_pri_dispel_magic : public SpellScriptLoader
{
@@ -235,6 +312,41 @@ class spell_pri_divine_aegis : public SpellScriptLoader
}
};
// 64844 - Divine Hymn
class spell_pri_divine_hymn : public SpellScriptLoader
{
public:
spell_pri_divine_hymn() : SpellScriptLoader("spell_pri_divine_hymn") { }
class spell_pri_divine_hymn_SpellScript : public SpellScript
{
PrepareSpellScript(spell_pri_divine_hymn_SpellScript);
void FilterTargets(std::list<WorldObject*>& targets)
{
targets.remove_if(RaidCheck(GetCaster()));
uint32 const maxTargets = 3;
if (targets.size() > maxTargets)
{
targets.sort(Trinity::HealthPctOrderPred());
targets.resize(maxTargets);
}
}
void Register() OVERRIDE
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_pri_divine_hymn_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
}
};
SpellScript* GetSpellScript() const OVERRIDE
{
return new spell_pri_divine_hymn_SpellScript();
}
};
// 55680 - Glyph of Prayer of Healing
class spell_pri_glyph_of_prayer_of_healing : public SpellScriptLoader
{
@@ -400,6 +512,42 @@ class spell_pri_guardian_spirit : public SpellScriptLoader
}
};
// 64904 - Hymn of Hope
class spell_pri_hymn_of_hope : public SpellScriptLoader
{
public:
spell_pri_hymn_of_hope() : SpellScriptLoader("spell_pri_hymn_of_hope") { }
class spell_pri_hymn_of_hope_SpellScript : public SpellScript
{
PrepareSpellScript(spell_pri_hymn_of_hope_SpellScript);
void FilterTargets(std::list<WorldObject*>& targets)
{
targets.remove_if(PowerCheck(POWER_MANA));
targets.remove_if(RaidCheck(GetCaster()));
uint32 const maxTargets = 3;
if (targets.size() > maxTargets)
{
targets.sort(Trinity::PowerPctOrderPred(POWER_MANA));
targets.resize(maxTargets);
}
}
void Register() OVERRIDE
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_pri_hymn_of_hope_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
}
};
SpellScript* GetSpellScript() const OVERRIDE
{
return new spell_pri_hymn_of_hope_SpellScript();
}
};
// 92833 - Leap of Faith
class spell_pri_leap_of_faith_effect_trigger : public SpellScriptLoader
{
@@ -1077,9 +1225,12 @@ class spell_pri_vampiric_touch : public SpellScriptLoader
void AddSC_priest_spell_scripts()
{
new spell_pri_body_and_soul();
new spell_pri_circle_of_healing();
new spell_pri_dispel_magic();
new spell_pri_divine_aegis();
new spell_pri_divine_hymn();
new spell_pri_glyph_of_prayer_of_healing();
new spell_pri_hymn_of_hope();
new spell_pri_improved_power_word_shield();
new spell_pri_item_greater_heal_refund();
new spell_pri_guardian_spirit();
+3 -2
View File
@@ -339,10 +339,11 @@ class spell_rog_deadly_poison : public SpellScriptLoader
};
// 51690 - Killing Spree
#define KillingSpreeScriptName "spell_rog_killing_spree"
class spell_rog_killing_spree : public SpellScriptLoader
{
public:
spell_rog_killing_spree() : SpellScriptLoader("spell_rog_killing_spree") { }
spell_rog_killing_spree() : SpellScriptLoader(KillingSpreeScriptName) { }
class spell_rog_killing_spree_SpellScript : public SpellScript
{
@@ -358,7 +359,7 @@ class spell_rog_killing_spree : public SpellScriptLoader
{
if (Aura* aura = GetCaster()->GetAura(SPELL_ROGUE_KILLING_SPREE))
{
if (spell_rog_killing_spree_AuraScript* script = dynamic_cast<spell_rog_killing_spree_AuraScript*>(aura->GetScriptByName("spell_rog_killing_spree")))
if (spell_rog_killing_spree_AuraScript* script = dynamic_cast<spell_rog_killing_spree_AuraScript*>(aura->GetScriptByName(KillingSpreeScriptName)))
script->AddTarget(GetHitUnit());
}
}
@@ -126,6 +126,18 @@ class spell_sha_ancestral_awakening_proc : public SpellScriptLoader
return true;
}
void FilterTargets(std::list<WorldObject*>& targets)
{
if (targets.size() < 2)
return;
targets.sort(Trinity::HealthPctOrderPred());
WorldObject* target = targets.front();
targets.clear();
targets.push_back(target);
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
GetCaster()->CastCustomSpell(SPELL_SHAMAN_ANCESTRAL_AWAKENING_PROC, SPELLVALUE_BASE_POINT0, GetEffectValue(), GetHitUnit(), true);
@@ -133,6 +145,7 @@ class spell_sha_ancestral_awakening_proc : public SpellScriptLoader
void Register() OVERRIDE
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_ancestral_awakening_proc_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID);
OnEffectHitTarget += SpellEffectFn(spell_sha_ancestral_awakening_proc_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
+12 -27
View File
@@ -330,39 +330,24 @@ class spell_warr_glyph_of_sunder_armor : public SpellScriptLoader
{
PrepareAuraScript(spell_warr_glyph_of_sunder_armor_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
void HandleEffectCalcSpellMod(AuraEffect const* aurEff, SpellModifier*& spellMod)
{
if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_SUNDER_ARMOR))
return false;
return true;
}
if (!spellMod)
{
spellMod = new SpellModifier(aurEff->GetBase());
spellMod->op = SpellModOp(aurEff->GetMiscValue());
spellMod->type = SPELLMOD_FLAT;
spellMod->spellId = GetId();
spellMod->mask = GetSpellInfo()->Effects[aurEff->GetEffIndex()].SpellClassMask;
}
bool Load() OVERRIDE
{
_target = NULL;
return true;
}
bool CheckProc(ProcEventInfo& eventInfo)
{
_target = GetTarget()->SelectNearbyTarget(eventInfo.GetProcTarget());
return _target;
}
void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
{
PreventDefaultAction();
GetTarget()->CastSpell(_target, SPELL_WARRIOR_SUNDER_ARMOR, true, NULL, aurEff);
spellMod->value = aurEff->GetAmount();
}
void Register() OVERRIDE
{
DoCheckProc += AuraCheckProcFn(spell_warr_glyph_of_sunder_armor_AuraScript::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_warr_glyph_of_sunder_armor_AuraScript::HandleEffectProc, EFFECT_0, SPELL_AURA_DUMMY);
DoEffectCalcSpellMod += AuraEffectCalcSpellModFn(spell_warr_glyph_of_sunder_armor_AuraScript::HandleEffectCalcSpellMod, EFFECT_0, SPELL_AURA_DUMMY);
}
private:
Unit * _target;
};
AuraScript* GetAuraScript() const OVERRIDE
@@ -638,7 +623,7 @@ class spell_warr_retaliation : public SpellScriptLoader
bool CheckProc(ProcEventInfo& eventInfo)
{
// check attack comes not from behind
// check attack comes not from behind and warrior is not stunned
return GetTarget()->isInFront(eventInfo.GetProcTarget(), M_PI) && !GetTarget()->HasUnitState(UNIT_STATE_STUNNED);
}
+2
View File
@@ -340,7 +340,9 @@ namespace MMAP
/**************************************************************************/
void MapBuilder::buildMap(uint32 mapID)
{
#ifndef __APPLE__
printf("[Thread %u] Building map %03u:\n", uint32(ACE_Thread::self()), mapID);
#endif
std::set<uint32>* tiles = getTileList(mapID);
+1 -1
View File
@@ -442,7 +442,7 @@ bool processArgv(int argc, char ** argv, const char *versionString)
{
hasInputPathParam = true;
strcpy(input_path, argv[i+1]);
if (input_path[strlen(input_path) - 1] != '\\' || input_path[strlen(input_path) - 1] != '/')
if (input_path[strlen(input_path) - 1] != '\\' && input_path[strlen(input_path) - 1] != '/')
strcat(input_path, "/");
++i;
}