-
Notifications
You must be signed in to change notification settings - Fork 502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Scourge invasion Event Rework #1717
base: development
Are you sure you want to change the base?
Changes from 34 commits
53773b2
055a0e0
ca2a9d8
d4ba23d
316367d
7cf9791
bb3c6f8
22b2b57
92dbb02
e433797
8ab1eb4
5e27480
eddbd22
cc06ac3
44170ed
21541d1
d4918b8
c96e8d6
1bc208e
4edf859
a7dce2a
d9c9d62
e369b75
cceb32d
2efd1a8
835653f
9e236d5
d15b566
6f05f7c
2c7c3ae
49d298b
2cebde4
393be4e
00ce0b0
0555496
d769cc4
118764b
fa6d7a2
02924cf
42d19ce
520ffc0
b98da6b
915a202
0c31930
3d90dca
04e1491
ff07868
fa1c27a
45e3eb4
ffa328d
31114c9
fbd45b2
541f9ed
dfefdfd
ca75f7e
cdc9995
4445733
b8616cb
dc2bafa
8f4fcce
b02f96b
489c974
845a467
764795c
ef7d1db
ca45f8a
4cbd7f9
b82437d
507a861
a22ef54
3bc66ba
871ec83
e304783
904ae51
89080ef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,6 +49,9 @@ | |
#include "InstanceData.h" | ||
#include "ScriptMgr.h" | ||
#include "SocialMgr.h" | ||
#include "TemporarySummon.h" | ||
#include "scriptPCH.h" | ||
|
||
|
||
using namespace Spells; | ||
|
||
|
@@ -413,11 +416,35 @@ void Spell::EffectSchoolDMG(SpellEffectIndex effect_idx) | |
damage = 0; | ||
break; | ||
} | ||
case 24933: // Cannon (Darkmoon Steam Tonk) | ||
case 24933: // Cannon (Darkmoon Steam Tonk) | ||
{ | ||
m_caster->CastSpell(unitTarget, 27766, true); | ||
break; | ||
} | ||
case 28056: // [Event: Scourge Invasion] Zap Crystal Corpse | ||
{ | ||
if (unitTarget->GetEntry() == 16172) // Damaged Necrotic Shard | ||
{ | ||
if (m_caster->GetEntry() == 16143) // Casted by Shadow of Doom. | ||
damage = unitTarget->CountPctFromMaxHealth(25); | ||
else // Casted by Damaged Necrotic Shard. https://classic.wowhead.com/spell=348571/zap-crystal-corpse | ||
damage = unitTarget->CountPctFromMaxHealth(6); | ||
} | ||
break; | ||
} | ||
case 28386: // [Event: Scourge Invasion] Zap Necropolis | ||
{ | ||
if (unitTarget->GetEntry() == 16421) // Necropolis health | ||
{ | ||
/* | ||
This Spell is castet on the NPC "Necropolis Health" if a Shard dies. | ||
There are always 3 Necrotic Shards spawns per Necropolis. | ||
*/ | ||
unitTarget->SetArmor(0); | ||
damage = unitTarget->CountPctFromMaxHealth(34); | ||
} | ||
break; | ||
} | ||
} | ||
break; | ||
} | ||
|
@@ -587,20 +614,87 @@ void Spell::EffectDummy(SpellEffectIndex effIdx) | |
pCaster->m_Events.AddLambdaEventAtOffset([pCaster, spellId] | ||
{ | ||
pCaster->CastSpell(pCaster, spellId, false); | ||
}, 1); | ||
}, 500); | ||
return; | ||
} | ||
case 10389: // [Event: Scourge Invasion] Spawn Smoke | ||
{ | ||
if (Creature* pCreature = ToCreature(m_casterUnit)) | ||
{ | ||
// This should be already set in creature_template, otherwise the player will quickly enter and leave combat on spawn and thats not Blizzlike. | ||
pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PLAYER); | ||
pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC); | ||
|
||
// This is the only way to get it Blizzlike... (And who knows? maybe it is!) | ||
pCreature->m_Events.AddLambdaEventAtOffset([pCreature] | ||
{ | ||
if (pCreature->IsTemporarySummon()) | ||
{ | ||
if (Player* player = pCreature->GetMap()->GetPlayer(((TemporarySummon*)pCreature)->GetSummonerGuid())) | ||
{ | ||
pCreature->GetThreatManager().addThreat(player, 1.0f); | ||
// DoScriptText(PickRandomValue(12420, 12421, 12422, 12243), pCreature, player, CHAT_TYPE_SAY); | ||
} | ||
} | ||
}, 1); | ||
} | ||
return; | ||
} | ||
case 27894: // [Event: Scourge Invasion] Kill Summoner, who will Summon Boss | ||
{ | ||
Player* pPlayer = ToPlayer(m_casterUnit); | ||
{ | ||
if (Creature* pCreature = ToCreature(unitTarget)) // Target is Cultist Engineer | ||
{ | ||
pCreature->CastSpell(pPlayer, 31316, true); // Summon Boss Buff | ||
pCreature->CastSpell(pCreature, 3617, true); // Quiet Suicide | ||
} | ||
} | ||
return; | ||
} | ||
case 28091: // [Event: Scourge Invasion] (Despawner, self) triggers (Spirit Spawn-out)? | ||
{ | ||
if (!m_casterUnit->IsInCombat()) | ||
m_casterUnit->CastSpell(m_casterUnit, 17680, false); | ||
m_casterUnit->CastSpell(m_casterUnit, 17680, false); | ||
return; | ||
} | ||
case 28203: // [Event: Scourge Invasion] Find Camp Type | ||
{ | ||
|
||
// Lets the finder spawn the associated spawner. | ||
if (unitTarget->HasAura(28197)) | ||
m_casterUnit->CastSpell(m_casterUnit, 28186, true); | ||
else if (unitTarget->HasAura(28198)) | ||
m_casterUnit->CastSpell(m_casterUnit, 27883, true); | ||
else if (unitTarget->HasAura(28199)) | ||
m_casterUnit->CastSpell(m_casterUnit, 28187, true); | ||
|
||
return; | ||
} | ||
case 28345: // [Event: Scourge Invasion] (Communique Trigger) triggers (Communique, Camp-to-Relay)? | ||
{ | ||
unitTarget->CastSpell(unitTarget, 28281, true); | ||
return; | ||
} | ||
case 28349: // [Event: Scourge Invasion] Despawner, other | ||
{ | ||
std::list<GameObject*> necropolisList; | ||
GetGameObjectListWithEntryInGrid(necropolisList, unitTarget, { 181154,181373,181374,181215,181223 }, ATTACK_DISTANCE); | ||
for (const auto pNecropolis : necropolisList) | ||
pNecropolis->Despawn(); | ||
|
||
unitTarget->ToCreature()->RemoveFromWorld(); | ||
m_casterUnit->ToCreature()->RemoveFromWorld(); | ||
return; | ||
} | ||
case 28351: // [Event: Scourge Invasion] Communique, Camp-to-Relay, Death | ||
{ | ||
if (Creature* pCreature = ToCreature(m_casterUnit)) | ||
{ | ||
pCreature->DisappearAndDie(); | ||
pCreature->RemoveFromWorld(); | ||
} | ||
return; | ||
} | ||
case 23383: // Alliance Flag Click | ||
case 23384: // Horde Flag Click | ||
{ | ||
|
@@ -5015,6 +5109,61 @@ void Spell::EffectScriptEffect(SpellEffectIndex effIdx) | |
unitTarget->CastSpell(unitTarget, 27699, true); | ||
return; | ||
} | ||
case 28201: // [Event: Scourge Invasion] Choose Camp Type | ||
{ | ||
// Casted by Necrotic Shard and Damaged Necrotic Shard on spawn. They should have 0 Armor and a huge visibility. | ||
m_casterUnit->SetArmor(0); | ||
m_casterUnit->SetActiveObjectState(true); | ||
m_casterUnit->SetVisibilityModifier(DEFAULT_VISIBILITY_BG); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this is correct, they have a set visibility distance already set. Perhaps just set the active state for these camps. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the shard is spawned by a spell, i can't change the visibilty in the database. |
||
m_casterUnit->CastSpell(m_casterUnit, PickRandomValue(28199, 28198, 28197), true); | ||
return; | ||
} | ||
case 28314: // [Event: Scourge Invasion] Flameshocker's Touch | ||
{ | ||
m_casterUnit->CastSpell(unitTarget, 28329, true); | ||
return; | ||
} | ||
case 28183: // [Event: Scourge Invasion] [PH] Summon Minion parent (ghost/ghoul) | ||
case 28184: // [Event: Scourge Invasion] [PH] Summon Minion parent (ghost/skeleton) | ||
case 28185: // [Event: Scourge Invasion] [PH] Summon Minion parent (ghoul/skeleton) | ||
{ | ||
// 0.2% Chance of a Rare Spawn. | ||
uint32 roll = urand(1, 500); | ||
|
||
bool UncommonMinionspawner = false; | ||
bool CanSummon = true; | ||
|
||
if (roll == 1) | ||
UncommonMinionspawner = true; | ||
|
||
uint32 Entry = PickRandomValue(16298, 16141, 16299); // just in case. | ||
|
||
switch (m_spellInfo->Id) | ||
{ | ||
case 28183: Entry = UncommonMinionspawner ? PickRandomValue(16379, 14697) : PickRandomValue(16298, 16141); break; | ||
case 28184: Entry = UncommonMinionspawner ? PickRandomValue(16379, 16380) : PickRandomValue(16298, 16299); break; | ||
case 28185: Entry = UncommonMinionspawner ? PickRandomValue(14697, 16380) : PickRandomValue(16141, 16299); break; | ||
default: Entry = PickRandomValue(16298, 16141, 16299); break; | ||
} | ||
|
||
std::list<Creature*> minions; | ||
GetCreatureListWithEntryInGrid(minions, m_casterUnit, { 16299, 16141, 16298, 14697, 16380, 16379 }, INTERACTION_DISTANCE); | ||
|
||
for (const auto pMinion : minions) | ||
if (pMinion->IsAlive()) | ||
CanSummon = false; | ||
|
||
if (CanSummon) | ||
{ | ||
if (Creature* pMinion = m_casterUnit->SummonCreature(Entry, m_casterUnit->GetPositionX(), m_casterUnit->GetPositionY(), m_casterUnit->GetPositionZ(), m_casterUnit->GetOrientation(), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, IN_MILLISECONDS * HOUR, true, IN_MILLISECONDS * 2)) | ||
{ | ||
m_casterUnit->SendSpellGo(m_casterUnit, 28234); | ||
UncommonMinionspawner ? pMinion->SetWanderDistance(5.0f) : pMinion->SetWanderDistance(1.0f); // Seems to be very low for common Minions but not for Rares. | ||
} | ||
} | ||
|
||
return; | ||
} | ||
case 28374: // Decimate (Naxxramas: Gluth) | ||
{ | ||
//implemented in SpellEffects::EffectSchoolDMG instead, under case 28375 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wtf are these changes to spell target code? it is supposed to search around the x, y, z which are set above according to target type
you are also assuming caster is always unit by using m_casterUnit, which can crash server