Icc Raid: Dreamwalker

hello there!

because i’m not the best programmer i need some help with the below two classes of the dreamwalker script out of the trinitycore:


class spell_dreamwalker_decay_periodic_timer : public SpellScriptLoader

{

	public:

		spell_dreamwalker_decay_periodic_timer() : SpellScriptLoader("spell_dreamwalker_decay_periodic_timer") { }

		class spell_dreamwalker_decay_periodic_timer_AuraScript : public AuraScript

		{

			PrepareAuraScript(spell_dreamwalker_decay_periodic_timer_AuraScript);

			bool Load()

			{

				_decayRate = GetId() != SPELL_TIMER_BLAZING_SKELETON ? 1000 : 5000;

				return true;

			}

			void DecayPeriodicTimer(AuraEffect* aurEff)

			{

				int32 timer = aurEff->GetPeriodicTimer();

				if (timer <= 5)

					return;

				aurEff->SetPeriodicTimer(timer - _decayRate);

			}

			void Register()

			{

				OnEffectUpdatePeriodic += AuraEffectUpdatePeriodicFn(spell_dreamwalker_decay_periodic_timer_AuraScript::DecayPeriodicTimer, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);

			}

			int32 _decayRate;

		};

		AuraScript* GetAuraScript() const

		{

			return new spell_dreamwalker_decay_periodic_timer_AuraScript();

		}

};


class spell_dreamwalker_summoner : public SpellScriptLoader

{

	public:

		spell_dreamwalker_summoner() : SpellScriptLoader("spell_dreamwalker_summoner") { }

		class spell_dreamwalker_summoner_SpellScript : public SpellScript

		{

			PrepareSpellScript(spell_dreamwalker_summoner_SpellScript);

			void FilterTargets(std::list<Unit*>& targets)

			{

				targets.remove_if(Trinity::UnitAuraCheck(true, SPELL_RECENTLY_SPAWNED));

				if (targets.empty())

					return;

				std::list<Unit*>::iterator itr = targets.begin();

				std::advance(itr, urand(0, targets.size() - 1));

				Unit* target = *itr;

				targets.clear();

				targets.push_back(target);

			}

			void Register()

			{

				OnUnitTargetSelect += SpellUnitTargetFn(spell_dreamwalker_summoner_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);

			}

		};

		SpellScript* GetSpellScript() const

		{

			return new spell_dreamwalker_summoner_SpellScript();

		}

};

what (exactly) do these classes? i know they have to do with the delay for the adds to spawm them.

because the script (these classes) doesn’t work like they should (the delay is always the same) i have to understand it right. on the offi the adds spawn always with a little less delay. how longer the encounter runs the shorter are the spawn delays.

i want to understand where i’ve to modify which numbers to do this job in the right way.

many thanks in advance! /emoticons/default_wink.png

The first script is what you need to look at, on each spell tick, it will decrease the time in which the adds will spawn.

It should be working as it is, im not sure of the problem, i’ve not tested it

ah… okay… i thought it must be spell_dreamwalker_decay_periodic_timer but i was not sure… before i modify something i’m gladly sure what i’m doing, thx! /emoticons/default_wink.png

if i read it right it should work but if i see what happends at the encounter then there is no decreasement of the delay to see…

perhaps the decreasement is simple to low…

and the second class simple randomise the trigger where the next will be spawnt, right!?

EDIT: i think i found the fault:

_decayRate = GetId() != SPELL_TIMER_BLAZING_SKELETON ? 1000 : 5000

the 1000 : 5000 should be 5000 : 1000 if i’m not complete wrong…

_decayRate = GetId() != SPELL_TIMER_BLAZING_SKELETON ? 1000 : 5000

This thing just says that if the id of the spell is the one that is summoning the skeletons the timer should be 1 second, otherwise 5.

no. it says that the decay (decreasement) should be 1000 if it’s the skeleton which is substructed of the timer.

EDIT: i’m talking about this 5000 : 1000 version. if it’s not the blazing then it uses 5000 to substruct of the timer.

The second script filters the targets of the spell, in this case, the spell will not hit npc’s that have spawned recently, and it will then select a random target from the remaining options.

Im still not sure of why that script is not working, the periodicTimer handles the time on which an aura should tick, maybe its not set on DB, try this query and see how many rows it returns: “SELECT * FROM spell_scriptnames WHERE scriptname = ‘spell_dreamwalker_decay_periodic_timer’;”

spell_script_names /emoticons/default_wink.png

±---------±---------------------------------------+| spell_id | ScriptName |

±---------±---------------------------------------+

| 70912 | spell_dreamwalker_decay_periodic_timer |

| 70913 | spell_dreamwalker_decay_periodic_timer |

| 70915 | spell_dreamwalker_decay_periodic_timer |

| 70916 | spell_dreamwalker_decay_periodic_timer |

±---------±---------------------------------------+

i’ve now (in my core):

_decayRate = GetId() != SPELL_TIMER_BLAZING_SKELETON ? 5000 : 2000

we’ll see whether it helps. i think 1000:5000 is to less to really make differences until the encounter ends. and in addition the blazing should not come more frequently as the rest of the trash.

if i remember right (offi icc time) the other adds should come more frequently as the blazings. if we were not fast enough the blazings were not our death but the other adds. /emoticons/default_wink.png

I think you should use a helper …

#define SPELL_BLAZING_SKELETON_HELPER RAID_MODE<uint32>(70912, 70913, 70915, 70916)

Then use it instead of the hardcoded spell ID.

However, Shauren might have thought about that, I did not doublecheck.

[/CODE]