[12774] Merged cmangos last changes, special thanks for xfurry, Dramacydal, cala, Schmoozerd,

I'm not taking any credits of this commit.

Implement spell effects 62042, 62278 and 64767
Also limit the targets for 62577 and 62603
----------
Update git_id to reflect recent sql formatting changes
----------
Update to a safer code version and also add GO caster scenarios
----------
Allow aura 62038 to stack at every 3 seconds
----------
Improve handling of TargetMMGen
This will have impact on Chase and Follow Movement.
----------
* Refactor code to check if a new position is required for the MMGen into the new function RequiresNewPosition
* Refactor code to get the current targeted distance into function GetDynamicTargetDistance
* Change ChaseMMGen (angle = 0.0f case) chase to best contact point, not zero angle.

Thanks to Cala and X-Savior for testing. Special thanks to cala for also suggesting improved values for the magic numbers
----------
Improve ObjectPosSelector
Now a spot already occupied by the searcher will be prefered
----------
Get rid of bounding radius in GetNearPoint[2D] and ObjectPosSelector
----------
This changes how ObjectPosSelector is used.
It changes the way how the functions Object::GetNearPoint and Object::GetNearPoint2d behave.
----------
So you need to check all places where these functions are used if they are still used correctly.
----------
Especially check your scripts!
----------
Remove not required duplicate indexes
----------
Implement TARGET_92 as TARGET_SUMMONER
This target is used only as TargetA and the related spells are used only by temporary summoned creatures
----------
Implement some spell effects used by Hodir in Ulduar
Dummy spells 62797, 63499, 63545 and 64543
Periodic dummy auras: 61968, 62038, 62039 and 65272
Limit targets for spells: 62797, 63545, 64543, 62476 and 62477
----------
Implement some spells used at Algalon encounter
Spell aura entries 64345, 62018 and 64412
Positive target exception for spell 64996
Aura stacking exception for spells 62169, 62168, 65250 and 64417
----------
Implement effect for spell 63633
----------
EventAI - Ingame output of script state
----------
With this the command .npc aiinfo will give more output about the current state.
Remark that this output is only given if the LogFilter for EventAIDev mode is disabled
----------
FindGit.cmake already ships with CMake
No reason for us to ship it too. Also, we had an outdated version which
had not been used anyway, because we set the include path in such a way,
that the CMake delivered version is always found first.
----------
FindOpenSSL.cmake already ships with CMake
No reason for us to ship it too. Also, we had an outdated version which
had not been used anyway, because we set the include path in such a way,
that the CMake delivered version is always found first.
----------
EventAI - Add more developing error output
----------
Fix some target-type handling for EventAI
Also increase log-output for bad target-types
----------
Fix crash due to bad compiler (author Xfurry)
----------
Add special condition id for Ulduar
Will be used to check the availability of the siege vehicles for players
----------
Update spells 62374 and 62907
* limit spell targets of spell 62374
* implement spell effect for spell 62907
----------
Remove effect for spell 64503
Will be handled in script library. For details please check 8502cdfa64
----------
Implement spells 64489 and 64673
Both are used by Auriaya (Ulduar)
----------
Implement some spells for Ignis the Furnace Master
Spell entries: 62717, 62381, 62488, 62707, 64475 and 64503
----------
Implement spells 61187 and 61190
----------
CMake: generic way to build a script library
Added new parameter INCLUDE_BINDINGS_DIR which can be set to the name of a
folder inside src/bindings/.

Includes the script library in src/bindings/ with the defined name.
The name must correspond to the name of the folder and the folder must contain
a valid CMakeLists.txt

Note: if you currently use a script library, you will probably get a merge
problem on src/bindings/CMakeLists.txt as you will have modified this file
manually. Please use the new version of this file and rerun CMake once with the
parameter -DINCLUDE_BINDINGS_DIR=ScriptDev2 (if you are not using SD2 but
another script library, replace ScriptDev2 with the name of the folder in
src/bindings/).

If you do not use a script library you should not have any merge problems
and you don't need to do anything.
----------
Add CMake source groups to target 'game'
This is the exact same grouping as it is currently in the VC 2012 files.
These groupings will have to be refactored at some point as they are not
very logical.
----------
Add CMake source groups to target 'framework'
This is the exact same grouping as it is currently in the VC 2012 files.
This is part of cmangos/issues#67
----------
Add CMake source groups to target 'shared'
This is the exact same grouping as it is currently in the VC 2012 files.
----------
Add new parameter 'expansion' to command 'account create'
----------
Update some Sunwell Plateau spells

Limit targets and allow positive effect for spell 46650
Implement effect for spells 46289 and 46637
Remove effect for spell 44845 - will be handled in script library
----------
Implement some custom use for Effect Activate Object spells
This will fix the summoning events for the Wind Stones, Ice Stones, Skettis bosses and quest 11865
----------
Sync mangos.sql with other versions
----------
Redump sql databases to unify formatting
The main reason for this was because classic/cata has updated the sql formatting and manually syncing would be a pain so redumping from master->tbc->classic->cata is easier.

Only the formatting was changed. The values were not changed at all.

mysqldump was used however manual modifications had to be done.

Dump the database:
C:/mysql/bin/mysqldump.exe mangos > sql/mangos.sql

Split insert values into multiple rows:
Replace "),(" with "),\n("
Replace "VALUES (" with "VALUES\n("

Remove the character sets by replacing them with an empty string

Custom formatting of mangos.sql:
Move db_version to the very top
Create all dbscripts_on_* tables based on dbscripts_on_creature_movement
Preserve our custom insert formatting of spell_affect (tbc/classic), spell_bonus_data, spell_chain, spell_elixir, spell_proc_event, spell_proc_item_enchant, spell_template, spell_threat
Remove autoincrement values from insert values of pet_name_generation and remove AUTO_INCREMENT=261 value from its table structure

Custom formatting of characters.sql:
Move character_db_version to the very top

Custom formatting of realmd.sql:
Move realmd_db_version to the very top
----------
Immediately remove corpses when ForcedDespawn is used
Thanks to Neotmiren for pointing, special thanks to cala for testing!
----------
Fix use of config values related to quest-status and level
This fixes use of negative value in config values Quests.LowLevelHideDiff and Quests.HighLevelHideDiff
Also add some documentation around the related code
Thanks to Neotmiren for pointing and to cala for testing.
----------
Loot-System: Fix reference loading check
This fixes a false error output for loot references that are only used with spell loot.
Thanks to X-Savior for properly reporting both error messages and use case
----------
Add missing spell 61437 to playercreate spells for bloodelves
Thanks to NeatElves for porting from TC and pointing to this
----------
Fix load bar step for alendarMgr::LoadCalendarsFromDB
----------
Cody Style Improvements
Also remove an unused variable (thanks to Den for this!)
----------
Implement the spells used in the Chess Event encounter
Combat spell entries: 37775, 37824, 39338, 39342, 39341, 39344, 45260
Melee spells: 37142, 37143, 37147, 37149, 37150, 37220, 37227, 37228, 37337, 37339, 37345, 37348
Chess movement spells: 30012, 32312, 37388, 30284, 37144, 37146, 37148, 37151, 37152, 37153
Aura stacking exception: 32261 and 39400
----------
And more hotfixes with these format strings
----------
Hotfix to recent text loading functions
----------
Use possible changed model names with vmap extraction
----------
Fix some warnings
----------
Store how many texts are loaded for validity checks. Use this with EventAI
----------
EventAI: Use generic DoDisplayText and loading of additional text data
----------
Add generic DoDisplayText function and use additional data of dbscripts table
----------
Add const-correctness to Text related functions
----------
Add database changes to support more data for DB Script texts
----------
Add stacking exception for spells 39993 and 40041
----------
Allow spell effect 86 - Activate Object to use the misc value
----------
Allow player pets to swim
----------
Enable resummoning of warlock pets
----------
Do not remove FLY auras on Evade
Also consider npcs which have SPELL_AURA_FLY as being able to fly
----------
EventAI: Improve code
* Drop rather pointless bool to check if the number of assigned events is empty
* Before the phase was resetted on death if and only if the npc has Events defined
* DoMeleeAttackIfReady could have been called even though combat state could have changed while processing events
----------
EventAI: Implement ACTION_T_SET_THROW_MASK (46)
This Action can be used to set which AIEvents should be thrown automatically, if you need more flexibility, you can always use the manual ACTION_TH_THROW_AI_EVENT version.
* Also clean some error-log output a bit.
----------
Forward original caster GUID to script library
----------
Fixup commit 12511 Thanks to Zakamurite for pointing
Also thanks to him for giving a helping hand in correcting the commit
----------
Implement some spells for Felmyst encounter
Spell entries: 45714, 45717 and 45918. Limit targets of spell 45391
Also add stacking exception for auras 45068 and 45582
----------
Fix invisible spirit healers & such on death near them
This fixes an issue that occurs if you die close to a spirit healer/guide.
----------
Fix take ammo for most ranged spells
Fix spells like Arcane Shot not taking ammo while they should
----------
Check cast spell 51690
----------
Fix SpellDamage modifier of SPELL_AURA_MOD_DAMAGE_DONE_CREATURE
This aura modifies a flat value, not a percent value.
----------
Implement proc effect of spells 67712, 67758
related to items 47316, 47477.
----------
Improve proc of spell 50421
----------
Add and implement server-side spell 23770
----------
EventAI: Improve TargetSelection related ErrorLog output
----------
DBScripts Engine: Change behaviour to search for a different npc when using buddy-search
With this an npc buddy will be interpreted as "another npc with entry"
Also toggle command 31 - TERMINATE_SCRIPT to also look only for other npcs of entry
----------
DBScripts Engine: Allow pets as buddy
Add new flag SCRIPT_FLAG_BUDDY_IS_PET (0x20) that will search not for a normal npc with buddy-search, but also for pets
----------
DBScripts Engine: Support buddy search by guid
* Add new `data_flags` flag SCRIPT_FLAG_BUDDY_BY_GUID (0x10)
If this flag is set, the content of `search_distance` is interpreted as db-guid of the requested buddy
* Also switch most error log output to DB-error log output (though this will include false positives)
----------
This commit is contained in:
Schmoozerd 2013-08-19 17:03:20 +03:00 committed by Antz
parent 8f8068714c
commit ae7348f6b0
73 changed files with 2633 additions and 1503 deletions

View file

@ -1365,6 +1365,16 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
unitTarget->CastSpell(unitTarget, unitTarget->GetMap()->IsRegularDifficulty() ? 32302 : 38382, true);
return;
}
case 32312: // Move 1 (Chess event AI short distance move)
case 37388: // Move 2 (Chess event AI long distance move)
{
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT)
return;
// cast generic move spell
m_caster->CastSpell(unitTarget, 30012, true);
return;
}
case 33060: // Make a Wish
{
if (m_caster->GetTypeId() != TYPEID_PLAYER)
@ -1700,21 +1710,6 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
m_caster->CastSpell(unitTarget, 44455, true, m_CastItem);
return;
}
case 44845: // Spectral Realm
{
if (!unitTarget)
return;
// teleport all targets which have the spectral realm aura
if (unitTarget->HasAura(46021))
{
unitTarget->RemoveAurasDueToSpell(46021);
unitTarget->CastSpell(unitTarget, 46020, true);
unitTarget->CastSpell(unitTarget, 44867, true);
}
return;
}
case 44869: // Spectral Blast
{
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
@ -1961,6 +1956,14 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
m_caster->CastSpell(unitTarget, 46359, true);
return;
}
case 46289: // Negative Energy
{
if (!unitTarget)
return;
m_caster->CastSpell(unitTarget, 46285, true);
return;
}
case 46430: // Synch Health
{
if (!unitTarget)
@ -2728,6 +2731,47 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
unitTarget->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
return;
}
case 62278: // Lightning Orb Charger
{
if (!unitTarget)
return;
unitTarget->CastSpell(m_caster, 62466, true);
unitTarget->CastSpell(unitTarget, 62279, true);
return;
}
case 62797: // Storm Cloud
{
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
m_caster->CastSpell(unitTarget, m_caster->GetMap()->IsRegularDifficulty() ? 65123 : 65133, true);
return;
}
case 62907: // Freya's Ward
{
if (!unitTarget)
return;
for (uint8 i = 0; i < 5; ++i)
m_caster->CastSpell(unitTarget, effect->CalculateSimpleValue(), true);
return;
}
case 63499: // Dispel Magic
{
if (!unitTarget)
return;
unitTarget->RemoveAurasDueToSpell(effect->CalculateSimpleValue());
return;
}
case 63545: // Icicle
{
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
m_caster->CastSpell(unitTarget, effect->CalculateSimpleValue(), true);
}
case 63820: // Summon Scrap Bot Trigger (Ulduar - Mimiron) for Scrap Bots
case 64425: // Summon Scrap Bot Trigger (Ulduar - Mimiron) for Assault Bots
case 64620: // Summon Fire Bot Trigger (Ulduar - Mimiron) for Fire Bots
@ -2750,6 +2794,31 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
m_caster->SetFacingTo(frand(0, M_PI_F * 2));
return;
}
case 64489: // Feral Rush
{
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
m_caster->CastSpell(unitTarget, 64496, true);
return;
}
case 64543: // Melt Ice
{
if (!unitTarget)
return;
m_caster->CastSpell(unitTarget, effect->CalculateSimpleValue(), true);
m_caster->CastSpell(m_caster, 64540, true);
return;
}
case 64673: // Feral Rush (h)
{
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
m_caster->CastSpell(unitTarget, 64674, true);
return;
}
case 64981: // Summon Random Vanquished Tentacle
{
uint32 spell_id = 0;
@ -3055,6 +3124,35 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
m_caster->CastCustomSpell(unitTarget, 23885, &damage, NULL, NULL, true, NULL);
return;
}
case 30012: // Move
{
if (!unitTarget || unitTarget->HasAura(39400))
return;
unitTarget->CastSpell(m_caster, 30253, true);
}
case 30284: // Change Facing
{
if (!unitTarget)
return;
unitTarget->CastSpell(m_caster, 30270, true);
return;
}
case 37144: // Move (Chess event player knight move)
case 37146: // Move (Chess event player pawn move)
case 37148: // Move (Chess event player queen move)
case 37151: // Move (Chess event player rook move)
case 37152: // Move (Chess event player bishop move)
case 37153: // Move (Chess event player king move)
{
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT)
return;
// cast generic move spell
m_caster->CastSpell(unitTarget, 30012, true);
return;
}
}
break;
}
@ -3678,12 +3776,12 @@ void Spell::EffectDummy(SpellEffectEntry const* effect)
// So called only for not processed cases
bool libraryResult = false;
if (gameObjTarget)
libraryResult = sScriptMgr.OnEffectDummy(m_caster, m_spellInfo->Id, SpellEffectIndex(effect->EffectIndex), gameObjTarget);
libraryResult = sScriptMgr.OnEffectDummy(m_caster, m_spellInfo->Id, SpellEffectIndex(effect->EffectIndex), gameObjTarget, m_originalCasterGUID);
else if (unitTarget && unitTarget->GetTypeId() == TYPEID_UNIT)
libraryResult = sScriptMgr.OnEffectDummy(m_caster, m_spellInfo->Id, SpellEffectIndex(effect->EffectIndex), (Creature*)unitTarget);
libraryResult = sScriptMgr.OnEffectDummy(m_caster, m_spellInfo->Id, SpellEffectIndex(effect->EffectIndex), (Creature*)unitTarget, m_originalCasterGUID);
else if (itemTarget)
libraryResult = sScriptMgr.OnEffectDummy(m_caster, m_spellInfo->Id, SpellEffectIndex(effect->EffectIndex), itemTarget);
libraryResult = sScriptMgr.OnEffectDummy(m_caster, m_spellInfo->Id, SpellEffectIndex(effect->EffectIndex), itemTarget, m_originalCasterGUID);
if (libraryResult || !unitTarget)
return;
@ -3812,10 +3910,6 @@ void Spell::EffectTriggerSpell(SpellEffectEntry const* effect)
m_caster->CastSpell(unitTarget, spellId, true);
return;
}
// just skip
case 23770: // Sayge's Dark Fortune of *
// not exist, common cooldown can be implemented in scripts if need.
return;
case 29284: // Brittle Armor - (need add max stack of 24575 Brittle Armor)
m_caster->CastSpell(unitTarget, 24575, true, m_CastItem, NULL, m_originalCasterGUID);
return;
@ -6284,7 +6378,7 @@ void Spell::EffectSummonPet(SpellEffectEntry const* effect)
// if pet requested type already exist
if (OldSummon)
{
if (petentry == 0 || OldSummon->GetEntry() == petentry)
if ((petentry == 0 || OldSummon->GetEntry() == petentry) && OldSummon->getPetType() != SUMMON_PET)
{
// pet in corpse state can't be summoned
if (OldSummon->isDead())
@ -6759,31 +6853,6 @@ void Spell::EffectWeaponDmg(SpellEffectEntry const* effect)
if (m_caster->GetTypeId() == TYPEID_PLAYER)
((Player*)m_caster)->AddComboPoints(unitTarget, 1);
}
// take ammo
if (m_attackType == RANGED_ATTACK && m_caster->GetTypeId() == TYPEID_PLAYER)
{
Item* pItem = ((Player*)m_caster)->GetWeaponForAttack(RANGED_ATTACK, true, false);
// wands don't have ammo
if (!pItem || pItem->GetProto()->SubClass == ITEM_SUBCLASS_WEAPON_WAND)
return;
if (pItem->GetProto()->InventoryType == INVTYPE_THROWN)
{
if (pItem->GetMaxStackCount() == 1)
{
// decrease durability for non-stackable throw weapon
((Player*)m_caster)->DurabilityPointLossForEquipSlot(EQUIPMENT_SLOT_RANGED);
}
else
{
// decrease items amount for stackable throw weapon
uint32 count = 1;
((Player*)m_caster)->DestroyItemCount(pItem, count, true);
}
}
}
}
void Spell::EffectThreat(SpellEffectEntry const* /*effect*/)
@ -7217,7 +7286,7 @@ void Spell::EffectScriptEffect(SpellEffectEntry const* effect)
float angle = unitTarget->GetOrientation();
for (uint8 i = 0; i < 4; ++i)
{
unitTarget->GetNearPoint(unitTarget, x, y, z, unitTarget->GetObjectBoundingRadius(), 5.0f, angle + i * M_PI_F / 2);
unitTarget->GetNearPoint(unitTarget, x, y, z, unitTarget->GetObjectBoundingRadius(), INTERACTION_DISTANCE, angle + i * M_PI_F / 2);
unitTarget->SummonCreature(16119, x, y, z, angle, TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, 10 * MINUTE * IN_MILLISECONDS);
}
return;
@ -7347,6 +7416,25 @@ void Spell::EffectScriptEffect(SpellEffectEntry const* effect)
unitTarget->RemoveAurasAtMechanicImmunity(IMMUNE_TO_ROOT_AND_SNARE_MASK, 30918, true);
break;
}
case 37142: // Karazhan - Chess NPC Action: Melee Attack: Conjured Water Elemental
case 37143: // Karazhan - Chess NPC Action: Melee Attack: Charger
case 37147: // Karazhan - Chess NPC Action: Melee Attack: Human Cleric
case 37149: // Karazhan - Chess NPC Action: Melee Attack: Human Conjurer
case 37150: // Karazhan - Chess NPC Action: Melee Attack: King Llane
case 37220: // Karazhan - Chess NPC Action: Melee Attack: Summoned Daemon
case 32227: // Karazhan - Chess NPC Action: Melee Attack: Footman
case 32228: // Karazhan - Chess NPC Action: Melee Attack: Grunt
case 37337: // Karazhan - Chess NPC Action: Melee Attack: Orc Necrolyte
case 37339: // Karazhan - Chess NPC Action: Melee Attack: Orc Wolf
case 37345: // Karazhan - Chess NPC Action: Melee Attack: Orc Warlock
case 37348: // Karazhan - Chess NPC Action: Melee Attack: Warchief Blackhand
{
if (!unitTarget)
return;
m_caster->CastSpell(unitTarget, 32247, true);
return;
}
case 32301: // Ping Shirrak
{
if (!unitTarget)
@ -7372,7 +7460,7 @@ void Spell::EffectScriptEffect(SpellEffectEntry const* effect)
float x, y, z;
for (uint8 i = 0; i < 4; ++i)
{
m_caster->GetNearPoint(m_caster, x, y, z, 0, 5.0f, M_PI_F * .5f * i + M_PI_F * .25f);
m_caster->GetNearPoint(m_caster, x, y, z, 0.0f, INTERACTION_DISTANCE, M_PI_F * .5f * i + M_PI_F * .25f);
m_caster->SummonCreature(21002, x, y, z, 0, TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, 30000);
}
return;
@ -7385,6 +7473,22 @@ void Spell::EffectScriptEffect(SpellEffectEntry const* effect)
unitTarget->CastSpell(unitTarget, urand(0, 1) ? 37429 : 37430, true);
return;
}
case 37775: // Karazhan - Chess NPC Action - Poison Cloud
{
if (!unitTarget)
return;
m_caster->CastSpell(unitTarget, 37469, true);
return;
}
case 37824: // Karazhan - Chess NPC Action - Shadow Mend
{
if (!unitTarget)
return;
m_caster->CastSpell(unitTarget, 37456, true);
return;
}
case 38358: // Tidal Surge
{
if (!unitTarget)
@ -7393,6 +7497,24 @@ void Spell::EffectScriptEffect(SpellEffectEntry const* effect)
unitTarget->CastSpell(unitTarget, 38353, true, NULL, NULL, m_caster->GetObjectGuid());
return;
}
case 39338: // Karazhan - Chess, Medivh CHEAT: Hand of Medivh, Target Horde
case 39342: // Karazhan - Chess, Medivh CHEAT: Hand of Medivh, Target Alliance
{
if (!unitTarget)
return;
m_caster->CastSpell(unitTarget, 39339, true);
return;
}
case 39341: // Karazhan - Chess, Medivh CHEAT: Fury of Medivh, Target Horde
case 39344: // Karazhan - Chess, Medivh CHEAT: Fury of Medivh, Target Alliance
{
if (!unitTarget)
return;
m_caster->CastSpell(unitTarget, effect->CalculateSimpleValue(), true);
return;
}
case 41055: // Copy Weapon
{
if (m_caster->GetTypeId() != TYPEID_UNIT || !unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
@ -7538,9 +7660,10 @@ void Spell::EffectScriptEffect(SpellEffectEntry const* effect)
}
// Teleport target to the spectral realm, add debuff and force faction
unitTarget->CastSpell(unitTarget, 44852, true);
unitTarget->CastSpell(unitTarget, 46019, true);
unitTarget->CastSpell(unitTarget, 46021, true);
unitTarget->CastSpell(unitTarget, 44845, true);
unitTarget->CastSpell(unitTarget, 44852, true);
return;
}
case 45141: // Burn
@ -7600,6 +7723,14 @@ void Spell::EffectScriptEffect(SpellEffectEntry const* effect)
unitTarget->CastSpell(unitTarget, 45236, true, NULL, NULL, m_caster->GetObjectGuid());
return;
}
case 45260: // Karazhan - Chess - Force Player to Kill Bunny
{
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
unitTarget->CastSpell(unitTarget, 45259, true);
return;
}
case 45668: // Ultra-Advanced Proto-Typical Shortening Blaster
{
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT)
@ -7704,6 +7835,22 @@ void Spell::EffectScriptEffect(SpellEffectEntry const* effect)
m_caster->SetDisplayId(display_id);
return;
}
case 45714: // Fog of Corruption (caster inform)
{
if (!unitTarget || m_caster->GetTypeId() != TYPEID_PLAYER)
return;
unitTarget->CastSpell(m_caster, effect->CalculateSimpleValue(), true);
return;
}
case 45717: // Fog of Corruption (player buff)
{
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
unitTarget->CastSpell(unitTarget, 45726, true);
return;
}
case 45785: // Sinister Reflection Clone
{
if (!unitTarget)
@ -7730,6 +7877,15 @@ void Spell::EffectScriptEffect(SpellEffectEntry const* effect)
unitTarget->CastSpell(unitTarget, 45891, true, NULL, NULL, m_caster->GetObjectGuid());
return;
}
case 45918: // Soul Sever
{
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER || !unitTarget->HasAura(45717))
return;
// kill all charmed targets
unitTarget->CastSpell(unitTarget, 45917, true);
return;
}
case 45958: // Signal Alliance
{
// "escort" aura not present, so let nothing happen
@ -8438,6 +8594,37 @@ void Spell::EffectScriptEffect(SpellEffectEntry const* effect)
return;
}
case 62042: // Stormhammer
{
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
unitTarget->CastSpell(unitTarget, 62470, true);
unitTarget->CastSpell(m_caster, 64909, true);
return;
}
case 62381: // Chill
{
if (!unitTarget)
return;
unitTarget->RemoveAurasDueToSpell(62373);
unitTarget->CastSpell(unitTarget, 62382, true);
return;
}
case 62488: // Activate Construct
{
if (!unitTarget || !unitTarget->HasAura(62468))
return;
unitTarget->RemoveAurasDueToSpell(62468);
unitTarget->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
unitTarget->CastSpell(unitTarget, 64474, true);
if (m_caster->getVictim())
((Creature*)unitTarget)->AI()->AttackStart(m_caster->getVictim());
return;
}
case 62524: // Attuned to Nature 2 Dose Reduction
case 62525: // Attuned to Nature 10 Dose Reduction
case 62521: // Attuned to Nature 25 Dose Reduction
@ -8479,6 +8666,23 @@ void Spell::EffectScriptEffect(SpellEffectEntry const* effect)
return;
}
case 62707: // Grab
{
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
unitTarget->CastSpell(unitTarget, 62708, true);
return;
}
case 63633: // Summon Rubble
{
if (!unitTarget)
return;
for (uint8 i = 0; i < 5; ++i)
unitTarget->CastSpell(unitTarget, effect->CalculateSimpleValue(), true);
return;
}
case 64456: // Feral Essence Application Removal
{
if (!unitTarget)
@ -8488,6 +8692,29 @@ void Spell::EffectScriptEffect(SpellEffectEntry const* effect)
unitTarget->RemoveAuraHolderFromStack(spellId);
return;
}
case 64475: // Strength of the Creator
{
if (!unitTarget)
return;
unitTarget->RemoveAuraHolderFromStack(64473);
return;
}
case 64767: // Stormhammer
{
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT)
return;
if (Creature* target = (Creature*)unitTarget)
{
target->AI()->EnterEvadeMode();
target->CastSpell(target, 62470, true);
target->CastSpell(m_caster, 64909, true);
target->CastSpell(target, 64778, true);
target->ForcedDespawn(10000);
}
return;
}
case 66477: // Bountiful Feast
{
if (!unitTarget)
@ -9057,7 +9284,7 @@ void Spell::EffectScriptEffect(SpellEffectEntry const* effect)
// So called only for not processed cases
if (unitTarget->GetTypeId() == TYPEID_UNIT)
{
if (sScriptMgr.OnEffectScriptEffect(m_caster, m_spellInfo->Id, SpellEffectIndex(effect->EffectIndex), (Creature*)unitTarget))
if (sScriptMgr.OnEffectScriptEffect(m_caster, m_spellInfo->Id, SpellEffectIndex(effect->EffectIndex), (Creature*)unitTarget, m_originalCasterGUID))
return;
}
@ -9230,7 +9457,7 @@ static ScriptInfo generateActivateCommand()
si.command = SCRIPT_COMMAND_ACTIVATE_OBJECT;
si.id = 0;
si.buddyEntry = 0;
si.searchRadius = 0;
si.searchRadiusOrGuid = 0;
si.data_flags = 0x00;
return si;
}
@ -9240,11 +9467,145 @@ void Spell::EffectActivateObject(SpellEffectEntry const* effect)
if (!gameObjTarget)
return;
static ScriptInfo activateCommand = generateActivateCommand();
uint32 misc_value = uint32(effect->EffectMiscValue);
int32 delay_secs = effect->CalculateSimpleValue();
switch (misc_value)
{
case 1: // GO simple use
case 2: // unk - 2 spells
case 4: // unk - 1 spell
case 5: // GO trap usage
case 7: // unk - 2 spells
case 8: // GO usage with TargetB = none or random
case 10: // GO explosions
case 11: // unk - 1 spell
case 19: // unk - 1 spell
case 20: // unk - 2 spells
{
static ScriptInfo activateCommand = generateActivateCommand();
gameObjTarget->GetMap()->ScriptCommandStart(activateCommand, delay_secs, m_caster, gameObjTarget);
int32 delay_secs = effect->CalculateSimpleValue();
gameObjTarget->GetMap()->ScriptCommandStart(activateCommand, delay_secs, m_caster, gameObjTarget);
break;
}
case 3: // GO custom anim - found mostly in Lunar Fireworks spells
gameObjTarget->SendGameObjectCustomAnim(gameObjTarget->GetObjectGuid());
break;
case 12: // GO state active alternative - found mostly in Simon Game spells
gameObjTarget->UseDoorOrButton(0, true);
break;
case 13: // GO state ready - found only in Simon Game spells
gameObjTarget->ResetDoorOrButton();
break;
case 15: // GO destroy
gameObjTarget->SetLootState(GO_JUST_DEACTIVATED);
break;
case 16: // GO custom use - found mostly in Wind Stones spells, Simon Game spells and other GO target summoning spells
{
switch (m_spellInfo->Id)
{
case 24734: // Summon Templar Random
case 24744: // Summon Templar (fire)
case 24756: // Summon Templar (air)
case 24758: // Summon Templar (earth)
case 24760: // Summon Templar (water)
case 24763: // Summon Duke Random
case 24765: // Summon Duke (fire)
case 24768: // Summon Duke (air)
case 24770: // Summon Duke (earth)
case 24772: // Summon Duke (water)
case 24784: // Summon Royal Random
case 24786: // Summon Royal (fire)
case 24788: // Summon Royal (air)
case 24789: // Summon Royal (earth)
case 24790: // Summon Royal (water)
{
uint32 npcEntry = 0;
uint32 templars[] = {15209, 15211, 15212, 15307};
uint32 dukes[] = {15206, 15207, 15208, 15220};
uint32 royals[] = {15203, 15204, 15205, 15305};
switch (m_spellInfo->Id)
{
case 24734: npcEntry = templars[urand(0, 3)]; break;
case 24763: npcEntry = dukes[urand(0, 3)]; break;
case 24784: npcEntry = royals[urand(0, 3)]; break;
case 24744: npcEntry = 15209; break;
case 24756: npcEntry = 15212; break;
case 24758: npcEntry = 15307; break;
case 24760: npcEntry = 15211; break;
case 24765: npcEntry = 15206; break;
case 24768: npcEntry = 15220; break;
case 24770: npcEntry = 15208; break;
case 24772: npcEntry = 15207; break;
case 24786: npcEntry = 15203; break;
case 24788: npcEntry = 15204; break;
case 24789: npcEntry = 15205; break;
case 24790: npcEntry = 15305; break;
}
gameObjTarget->SummonCreature(npcEntry, gameObjTarget->GetPositionX(), gameObjTarget->GetPositionY(), gameObjTarget->GetPositionZ(), gameObjTarget->GetAngle(m_caster), TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, MINUTE * IN_MILLISECONDS);
gameObjTarget->SetLootState(GO_JUST_DEACTIVATED);
break;
}
case 40176: // Simon Game pre-game Begin, blue
case 40177: // Simon Game pre-game Begin, green
case 40178: // Simon Game pre-game Begin, red
case 40179: // Simon Game pre-game Begin, yellow
case 40283: // Simon Game END, blue
case 40284: // Simon Game END, green
case 40285: // Simon Game END, red
case 40286: // Simon Game END, yellow
case 40494: // Simon Game, switched ON
case 40495: // Simon Game, switched OFF
case 40512: // Simon Game, switch...disable Off switch
gameObjTarget->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NO_INTERACT);
break;
case 40632: // Summon Gezzarak the Huntress
case 40640: // Summon Karrog
case 40642: // Summon Darkscreecher Akkarai
case 40644: // Summon Vakkiz the Windrager
case 41004: // Summon Terokk
gameObjTarget->SetLootState(GO_JUST_DEACTIVATED);
break;
case 46085: // Place Fake Fur
{
float x, y, z;
gameObjTarget->GetClosePoint(x, y, z, gameObjTarget->GetObjectBoundingRadius(), 2 * INTERACTION_DISTANCE, frand(0, M_PI_F * 2));
// Note: event script is implemented in script library
gameObjTarget->SummonCreature(25835, x, y, z, gameObjTarget->GetOrientation(), TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, 15000);
gameObjTarget->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
break;
}
case 46592: // Summon Ahune Lieutenant
{
uint32 npcEntry = 0;
switch (gameObjTarget->GetEntry())
{
case 188049: npcEntry = 26116; break; // Frostwave Lieutenant (Ashenvale)
case 188137: npcEntry = 26178; break; // Hailstone Lieutenant (Desolace)
case 188138: npcEntry = 26204; break; // Chillwind Lieutenant (Stranglethorn)
case 188148: npcEntry = 26214; break; // Frigid Lieutenant (Searing Gorge)
case 188149: npcEntry = 26215; break; // Glacial Lieutenant (Silithus)
case 188150: npcEntry = 26216; break; // Glacial Templar (Hellfire Peninsula)
}
gameObjTarget->SummonCreature(npcEntry, gameObjTarget->GetPositionX(), gameObjTarget->GetPositionY(), gameObjTarget->GetPositionZ(), gameObjTarget->GetAngle(m_caster), TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, MINUTE * IN_MILLISECONDS);
gameObjTarget->SetLootState(GO_JUST_DEACTIVATED);
break;
}
}
break;
}
case 17: // GO unlock - found mostly in Simon Game spells
gameObjTarget->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NO_INTERACT);
break;
default:
sLog.outError("Spell::EffectActivateObject called with unknown misc value. Spell Id %u", m_spellInfo->Id);
break;
}
}
void Spell::EffectApplyGlyph(SpellEffectEntry const* effect)
@ -9540,7 +9901,7 @@ void Spell::EffectLeapForward(SpellEffectEntry const* effect)
if (unitTarget->IsTaxiFlying())
return;
if (m_spellInfo->rangeIndex == 1) // self range
if (m_spellInfo->rangeIndex == SPELL_RANGE_IDX_SELF_ONLY)
{
float dis = GetSpellRadius(sSpellRadiusStore.LookupEntry(effect->GetRadiusIndex()));
@ -9935,7 +10296,7 @@ void Spell::EffectTransmitted(SpellEffectEntry const* effect)
// calculate angle variation for roughly equal dimensions of target area
float max_angle = (max_dis - min_dis) / (max_dis + m_caster->GetObjectBoundingRadius());
float angle_offset = max_angle * (rand_norm_f() - 0.5f);
m_caster->GetNearPoint2D(fx, fy, dis, m_caster->GetOrientation() + angle_offset);
m_caster->GetNearPoint2D(fx, fy, dis + m_caster->GetObjectBoundingRadius(), m_caster->GetOrientation() + angle_offset);
GridMapLiquidData liqData;
if (!m_caster->GetTerrain()->IsInWater(fx, fy, m_caster->GetPositionZ() + 1.f, &liqData))