WIP maexxna web wrap

This commit is contained in:
Jelle Meeus
2024-04-26 23:44:34 +02:00
parent 03f6dde549
commit 87e7b8163e
2 changed files with 134 additions and 17 deletions

View File

@@ -0,0 +1,33 @@
--
--DELETE FROM spell_script_target WHERE entry IN(28617, 29280, 29281, 29282, 29283, 29285, 29287);
--INSERT INTO spell_script_target(entry,type,targetentry) VALUES
--(28617,3,@CGUID+851),
--(29280,3,@CGUID+852),
--(29281,3,@CGUID+854),
--(29282,3,@CGUID+855),
--(29283,3,@CGUID+856),
--(29285,3,@CGUID+857),
--(29287,3,@CGUID+858);
SET @CGUID = 127529;
DELETE FROM `creature` WHERE `guid` BETWEEN @CGUID AND @CGUID+7;
INSERT INTO `creature`
(`guid`, `id1`, `id2`, `id3`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `wander_distance`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `ScriptName`, `VerifiedBuild`, `CreateObject`, `Comment`) VALUES
(@CGUID+0, 15384, 0, 0, 533, 3456, 3456, 3, 1, 0, 3496.615, -3834.182, 320.7863, 2.670354, 7200, 0, 0, 17010, 0, 0, 0, 0, 0, 'boss_maexxna_webwrap_trigger', 0, 0, 'Maexxna (web wrap)'),
(@CGUID+1, 15384, 0, 0, 533, 3456, 3456, 3, 1, 0, 3509.108, -3833.922, 320.4750, 1.710423, 7200, 0, 0, 17010, 0, 0, 0, 0, 0, 'boss_maexxna_webwrap_trigger', 0, 0, 'Maexxna (web wrap)'),
-- (@CGUID+2, 15384, 0, 0, 533, 3456, 3456, 3, 1, 0, 3499.137, -3890.790, 292.3595, 5.358161, 7200, 0, 0, 17010, 0, 0, 0, 0, 0, 'boss_maexxna_webwrap_trigger', 0, 0, 'Maexxna (web wrap) - not used for targeting like the others'),
(@CGUID+3, 15384, 0, 0, 533, 3456, 3456, 3, 1, 0, 3523.644, -3838.309, 320.5775, 2.775074, 7200, 0, 0, 17010, 0, 0, 0, 0, 0, 'boss_maexxna_webwrap_trigger', 0, 0, 'Maexxna (web wrap)'),
(@CGUID+4, 15384, 0, 0, 533, 3456, 3456, 3, 1, 0, 3538.152, -3846.353, 320.5188, 1.431170, 7200, 0, 0, 17010, 0, 0, 0, 0, 0, 'boss_maexxna_webwrap_trigger', 0, 0, 'Maexxna (web wrap)'),
(@CGUID+5, 15384, 0, 0, 533, 3456, 3456, 3, 1, 0, 3546.219, -3856.167, 320.9324, 2.932153, 7200, 0, 0, 17010, 0, 0, 0, 0, 0, 'boss_maexxna_webwrap_trigger', 0, 0, 'Maexxna (web wrap)'),
(@CGUID+6, 15384, 0, 0, 533, 3456, 3456, 3, 1, 0, 3555.135, -3869.507, 320.8307, 0.9424778, 7200, 0, 0, 17010, 0, 0, 0, 0, 0, 'boss_maexxna_webwrap_trigger', 0, 0, 'Maexxna (web wrap)'),
(@CGUID+7, 15384, 0, 0, 533, 3456, 3456, 3, 1, 0, 3560.282, -3886.143, 321.2827, 3.874631, 7200, 0, 0, 17010, 0, 0, 0, 0, 0, 'boss_maexxna_webwrap_trigger', 0, 0, 'Maexxna (web wrap)');
--(28618, 0, 0, 0, 2304, 268435456, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 101, 0, 0, 0, 0, 36, 0, 0, 0, 0, 0, 13, 0.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 124, 6, 6, 0, 0, 0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0, 25, 25, 25, 0, 0, 0, 0, 0, 0, 0, 23, 60, 0, 2000, 0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0, 200, 0, 0, 0, 0, 0, 0, 28622, 0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Web Wrap', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.0, 1.0, 1.0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0.0, 0.0, 0.0, 0, 0),
-- Change 36 and 1000
DELETE FROM `spell_dbc` WHERE `ID` BETWEEN 28618 AND 28621;
INSERT INTO `spell_dbc` (`ID`,`Category`,`DispelType`,`Mechanic`,`Attributes`,`AttributesEx`,`AttributesEx2`,`AttributesEx3`,`AttributesEx4`,`AttributesEx5`,`AttributesEx6`,`AttributesEx7`,`ShapeshiftMask`,`unk_320_2`,`ShapeshiftExclude`,`unk_320_3`,`Targets`,`TargetCreatureType`,`RequiresSpellFocus`,`FacingCasterFlags`,`CasterAuraState`,`TargetAuraState`,`ExcludeCasterAuraState`,`ExcludeTargetAuraState`,`CasterAuraSpell`,`TargetAuraSpell`,`ExcludeCasterAuraSpell`,`ExcludeTargetAuraSpell`,`CastingTimeIndex`,`RecoveryTime`,`CategoryRecoveryTime`,`InterruptFlags`,`AuraInterruptFlags`,`ChannelInterruptFlags`,`ProcTypeMask`,`ProcChance`,`ProcCharges`,`MaxLevel`,`BaseLevel`,`SpellLevel`,`DurationIndex`,`PowerType`,`ManaCost`,`ManaCostPerLevel`,`ManaPerSecond`,`ManaPerSecondPerLevel`,`RangeIndex`,`Speed`,`ModalNextSpell`,`CumulativeAura`,`Totem_1`,`Totem_2`,`Reagent_1`,`Reagent_2`,`Reagent_3`,`Reagent_4`,`Reagent_5`,`Reagent_6`,`Reagent_7`,`Reagent_8`,`ReagentCount_1`,`ReagentCount_2`,`ReagentCount_3`,`ReagentCount_4`,`ReagentCount_5`,`ReagentCount_6`,`ReagentCount_7`,`ReagentCount_8`,`EquippedItemClass`,`EquippedItemSubclass`,`EquippedItemInvTypes`,`Effect_1`,`Effect_2`,`Effect_3`,`EffectDieSides_1`,`EffectDieSides_2`,`EffectDieSides_3`,`EffectRealPointsPerLevel_1`,`EffectRealPointsPerLevel_2`,`EffectRealPointsPerLevel_3`,`EffectBasePoints_1`,`EffectBasePoints_2`,`EffectBasePoints_3`,`EffectMechanic_1`,`EffectMechanic_2`,`EffectMechanic_3`,`ImplicitTargetA_1`,`ImplicitTargetA_2`,`ImplicitTargetA_3`,`ImplicitTargetB_1`,`ImplicitTargetB_2`,`ImplicitTargetB_3`,`EffectRadiusIndex_1`,`EffectRadiusIndex_2`,`EffectRadiusIndex_3`,`EffectAura_1`,`EffectAura_2`,`EffectAura_3`,`EffectAuraPeriod_1`,`EffectAuraPeriod_2`,`EffectAuraPeriod_3`,`EffectMultipleValue_1`,`EffectMultipleValue_2`,`EffectMultipleValue_3`,`EffectChainTargets_1`,`EffectChainTargets_2`,`EffectChainTargets_3`,`EffectItemType_1`,`EffectItemType_2`,`EffectItemType_3`,`EffectMiscValue_1`,`EffectMiscValue_2`,`EffectMiscValue_3`,`EffectMiscValueB_1`,`EffectMiscValueB_2`,`EffectMiscValueB_3`,`EffectTriggerSpell_1`,`EffectTriggerSpell_2`,`EffectTriggerSpell_3`,`EffectPointsPerCombo_1`,`EffectPointsPerCombo_2`,`EffectPointsPerCombo_3`,`EffectSpellClassMaskA_1`,`EffectSpellClassMaskA_2`,`EffectSpellClassMaskA_3`,`EffectSpellClassMaskB_1`,`EffectSpellClassMaskB_2`,`EffectSpellClassMaskB_3`,`EffectSpellClassMaskC_1`,`EffectSpellClassMaskC_2`,`EffectSpellClassMaskC_3`,`SpellVisualID_1`,`SpellVisualID_2`,`SpellIconID`,`ActiveIconID`,`SpellPriority`,`Name_Lang_enUS`,`Name_Lang_enGB`,`Name_Lang_koKR`,`Name_Lang_frFR`,`Name_Lang_deDE`,`Name_Lang_enCN`,`Name_Lang_zhCN`,`Name_Lang_enTW`,`Name_Lang_zhTW`,`Name_Lang_esES`,`Name_Lang_esMX`,`Name_Lang_ruRU`,`Name_Lang_ptPT`,`Name_Lang_ptBR`,`Name_Lang_itIT`,`Name_Lang_Unk`,`Name_Lang_Mask`,`NameSubtext_Lang_enUS`,`NameSubtext_Lang_enGB`,`NameSubtext_Lang_koKR`,`NameSubtext_Lang_frFR`,`NameSubtext_Lang_deDE`,`NameSubtext_Lang_enCN`,`NameSubtext_Lang_zhCN`,`NameSubtext_Lang_enTW`,`NameSubtext_Lang_zhTW`,`NameSubtext_Lang_esES`,`NameSubtext_Lang_esMX`,`NameSubtext_Lang_ruRU`,`NameSubtext_Lang_ptPT`,`NameSubtext_Lang_ptBR`,`NameSubtext_Lang_itIT`,`NameSubtext_Lang_Unk`,`NameSubtext_Lang_Mask`,`Description_Lang_enUS`,`Description_Lang_enGB`,`Description_Lang_koKR`,`Description_Lang_frFR`,`Description_Lang_deDE`,`Description_Lang_enCN`,`Description_Lang_zhCN`,`Description_Lang_enTW`,`Description_Lang_zhTW`,`Description_Lang_esES`,`Description_Lang_esMX`,`Description_Lang_ruRU`,`Description_Lang_ptPT`,`Description_Lang_ptBR`,`Description_Lang_itIT`,`Description_Lang_Unk`,`Description_Lang_Mask`,`AuraDescription_Lang_enUS`,`AuraDescription_Lang_enGB`,`AuraDescription_Lang_koKR`,`AuraDescription_Lang_frFR`,`AuraDescription_Lang_deDE`,`AuraDescription_Lang_enCN`,`AuraDescription_Lang_zhCN`,`AuraDescription_Lang_enTW`,`AuraDescription_Lang_zhTW`,`AuraDescription_Lang_esES`,`AuraDescription_Lang_esMX`,`AuraDescription_Lang_ruRU`,`AuraDescription_Lang_ptPT`,`AuraDescription_Lang_ptBR`,`AuraDescription_Lang_itIT`,`AuraDescription_Lang_Unk`,`AuraDescription_Lang_Mask`,`ManaCostPct`,`StartRecoveryCategory`,`StartRecoveryTime`,`MaxTargetLevel`,`SpellClassSet`,`SpellClassMask_1`,`SpellClassMask_2`,`SpellClassMask_3`,`MaxTargets`,`DefenseType`,`PreventionType`,`StanceBarOrder`,`EffectChainAmplitude_1`,`EffectChainAmplitude_2`,`EffectChainAmplitude_3`,`MinFactionID`,`MinReputation`,`RequiredAuraVision`,`RequiredTotemCategoryID_1`,`RequiredTotemCategoryID_2`,`RequiredAreasID`,`SchoolMask`,`RuneCostID`,`SpellMissileID`,`PowerDisplayID`,`EffectBonusMultiplier_1`,`EffectBonusMultiplier_2`,`EffectBonusMultiplier_3`,`SpellDescriptionVariableID`,`SpellDifficultyID`) VALUES
(28618, 0, 0, 0, 2304, 268435456, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 101, 0, 0, 0, 0, 39, 0, 0, 0, 0, 0, 13, 0.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 124, 6, 6, 0, 0, 0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0, 25, 25, 25, 0, 0, 0, 0, 0, 0, 0, 23, 60, 0, 2000, 0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0, 500, 0, 0, 0, 0, 0, 0, 28622, 0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Web Wrap', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.0, 1.0, 1.0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0.0, 0.0, 0.0, 0, 0),
(28619, 0, 0, 0, 2304, 268435456, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 101, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, 13, 0.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 124, 6, 6, 0, 0, 0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0, 25, 25, 25, 0, 0, 0, 0, 0, 0, 0, 23, 60, 0, 4000, 0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0, 500, 0, 0, 0, 0, 0, 0, 28622, 0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Web Wrap', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.0, 1.0, 1.0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0.0, 0.0, 0.0, 0, 0),
(28620, 0, 0, 0, 2304, 268435456, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 101, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 13, 0.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 124, 6, 6, 0, 0, 0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0, 25, 25, 25, 0, 0, 0, 0, 0, 0, 0, 23, 60, 0, 5000, 0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0, 500, 0, 0, 0, 0, 0, 0, 28622, 0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Web Wrap', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.0, 1.0, 1.0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0.0, 0.0, 0.0, 0, 0),
(28621, 0, 0, 0, 2304, 268435456, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 101, 0, 0, 0, 0, 165, 0, 0, 0, 0, 0, 13, 0.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 124, 6, 6, 0, 0, 0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0, 25, 25, 25, 0, 0, 0, 0, 0, 0, 0, 23, 60, 0, 7000, 0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0, 500, 0, 0, 0, 0, 0, 0, 28622, 0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Web Wrap', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.0, 1.0, 1.0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0.0, 0.0, 0.0, 0, 0);

View File

@@ -22,7 +22,11 @@
enum Spells
{
SPELL_WEB_WRAP = 28622,
SPELL_WEB_WRAP_200 = 28618,
SPELL_WEB_WRAP_300 = 28619,
SPELL_WEB_WRAP_400 = 28620,
SPELL_WEB_WRAP_500 = 28621,
SPELL_WEB_SPRAY_10 = 29484,
SPELL_WEB_SPRAY_25 = 54125,
SPELL_POISON_SHOCK_10 = 28741,
@@ -30,7 +34,12 @@ enum Spells
SPELL_NECROTIC_POISON_10 = 54121,
SPELL_NECROTIC_POISON_25 = 28776,
SPELL_FRENZY_10 = 54123,
SPELL_FRENZY_25 = 54124
SPELL_FRENZY_25 = 54124,
SPELL_WEB_WRAP_STUN = 28622, // STUN Triggered by spells
SPELL_WEB_WRAP_SCRIPT_EFFECT_10 = 28673, // SCRIPT_EFFECT 0, INIT
SPELL_WEB_WRAP_SCRIPT_EFFECT_25 = 54127, // SCRIPT_EFFECT 0, INIT
SPELL_SUMMON_SPIDERLINGS_10 = 54130, // DOES NOT EXIST IN WRATH, 29434 1.12
SPELL_SUMMON_SPIDERLINGS_25 = 29434, // DOES NOT EXIST, CUSTOM
};
enum Events
@@ -53,7 +62,8 @@ enum Emotes
enum Misc
{
NPC_WEB_WRAP = 16486,
NPC_MAEXXNA_SPIDERLING = 17055
NPC_MAEXXNA_SPIDERLING = 17055,
NPC_WEB_WRAP_TRIGGER = 15384
};
const Position PosWrap[3] =
@@ -112,12 +122,13 @@ public:
{
BossAI::JustEngagedWith(who);
me->SetInCombatWithZone();
events.ScheduleEvent(EVENT_WEB_WRAP, 20s);
events.ScheduleEvent(EVENT_WEB_SPRAY, 40s);
events.ScheduleEvent(EVENT_POISON_SHOCK, 10s);
events.ScheduleEvent(EVENT_NECROTIC_POISON, 5s);
events.ScheduleEvent(EVENT_HEALTH_CHECK, 1s);
events.ScheduleEvent(EVENT_SUMMON_SPIDERLINGS, 30s);
events.ScheduleEvent(EVENT_WEB_WRAP, 5s); // 20-20, repeat 40-40
//events.ScheduleEvent(EVENT_WEB_WRAP, 20s); // 20-20, repeat 40-40
//events.ScheduleEvent(EVENT_WEB_SPRAY, 40s); // 40-40, repeat 40-40
//events.ScheduleEvent(EVENT_POISON_SHOCK, 10s); // 10-20, repeat 10-20
//events.ScheduleEvent(EVENT_NECROTIC_POISON, 5s); // 20-30, repeat 10-30
//events.ScheduleEvent(EVENT_HEALTH_CHECK, 1s);
//events.ScheduleEvent(EVENT_SUMMON_SPIDERLINGS, 30s); // 30, repeat 40-40
if (pInstance)
{
if (GameObject* go = me->GetMap()->GetGameObject(pInstance->GetGuidData(DATA_MAEXXNA_GATE)))
@@ -199,17 +210,51 @@ public:
break;
case EVENT_WEB_WRAP:
Talk(EMOTE_WEB_WRAP);
for (uint8 i = 0; i < RAID_MODE(1, 2); ++i)
//for (uint8 i = 0; i < RAID_MODE(1, 2); ++i)
for (uint8 i = 0; i < 1; ++i)
{
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 0, true, true, -SPELL_WEB_WRAP))
// TODO: this can select the same target twice
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 0, true, true, -SPELL_WEB_WRAP_STUN))
{
target->RemoveAura(RAID_MODE(SPELL_WEB_SPRAY_10, SPELL_WEB_SPRAY_25));
uint8 pos = urand(0, 2);
if (Creature* wrap = me->SummonCreature(NPC_WEB_WRAP, PosWrap[pos].GetPositionX(), PosWrap[pos].GetPositionY(), PosWrap[pos].GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 60000))
std::list<Creature*> triggers;
me->GetCreatureListWithEntryInGrid(triggers, NPC_WEB_WRAP_TRIGGER, 150.0f);
if (!triggers.empty())
{
wrap->AI()->SetGUID(target->GetGUID());
target->GetMotionMaster()->MoveJump(PosWrap[pos].GetPositionX(), PosWrap[pos].GetPositionY(), PosWrap[pos].GetPositionZ(), 20, 20);
std::list<Creature*>::iterator itr = triggers.begin();
std::advance(itr, urand(0, triggers.size() - 1));
Creature* triggerNPC;
triggerNPC = *itr;
triggers.erase(std::remove(triggers.begin(), triggers.end(), triggerNPC), triggers.end());
float dist = me->GetDistance(target);
uint32 spellId = SPELL_WEB_WRAP_500;
if (dist <= 20.f)
spellId = SPELL_WEB_WRAP_200;
else if (dist <= 30.f)
spellId = SPELL_WEB_WRAP_300;
else if (dist <= 40.f)
spellId = SPELL_WEB_WRAP_400;
//triggerNPC->CastCustomSpell(SPELL_WEB_WRAP_200, SPELLVALUE_AURA_DURATION, 1000, target, true);
//triggerNPC->CastSpell(target, spellId, true);
triggerNPC->CastSpell(target, 28620, true); // 4 seconds
//triggerNPC->AI()->SetGUID(target->GetGUID());
//target->RemoveAura(RAID_MODE(SPELL_WEB_SPRAY_10, SPELL_WEB_SPRAY_25));
//uint8 pos = urand(0, 2);
//if (Creature* wrap = me->SummonCreature(NPC_WEB_WRAP, PosWrap[pos].GetPositionX(), PosWrap[pos].GetPositionY(), PosWrap[pos].GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 60000))
//{
// wrap->AI()->SetGUID(target->GetGUID());
// target->GetMotionMaster()->MoveJump(PosWrap[pos].GetPositionX(), PosWrap[pos].GetPositionY(), PosWrap[pos].GetPositionZ(), 20, 20);
//}
}
}
}
events.Repeat(40s);
@@ -220,6 +265,44 @@ public:
};
};
class boss_maexxna_webwrap_trigger : public CreatureScript
{
public:
boss_maexxna_webwrap_trigger() : CreatureScript("boss_maexxna_webwrap_trigger") { }
CreatureAI* GetAI(Creature* pCreature) const override
{
return GetNaxxramasAI<boss_maexxna_webwrap_triggerAI>(pCreature);
}
struct boss_maexxna_webwrap_triggerAI : public NullCreatureAI
{
explicit boss_maexxna_webwrap_triggerAI(Creature* c) : NullCreatureAI(c) {}
ObjectGuid victimGUID;
void SetGUID(ObjectGuid guid, int32 /*param*/) override
{
victimGUID = guid;
if (Unit* victim = ObjectAccessor::GetUnit(*me, victimGUID))
{
float dist = me->GetDistance(victim);
uint32 duration = 4000;
if (dist <= 20.f)
duration = 1000;
else if (dist <= 30.f)
duration = 2000;
else if (dist <= 40.f)
duration = 3000;
me->CastCustomSpell(SPELL_WEB_WRAP_200, SPELLVALUE_AURA_DURATION, duration, victim, true);
}
}
};
};
class boss_maexxna_webwrap : public CreatureScript
{
public:
@@ -265,5 +348,6 @@ public:
void AddSC_boss_maexxna()
{
new boss_maexxna();
new boss_maexxna_webwrap();
//new boss_maexxna_webwrap();
new boss_maexxna_webwrap_trigger();
}