[DiscordArchive] how to make a creature re-check if a waypoint has been reached?
[DiscordArchive] how to make a creature re-check if a waypoint has been reached?
Archived author: Chaz • Posted: 2023-06-24T15:55:02.147000+00:00
Original source
how to make a creature re-check if a waypoint has been reached?
Archived author: Chaz • Posted: 2023-06-24T15:55:13.598000+00:00
Original source
and if not, proceed to that waypoint
Archived author: Chaz • Posted: 2023-06-24T15:55:31.142000+00:00
Original source
for example sometimes creatures bug out and don't reach their waypoint
Archived author: Chaz • Posted: 2023-06-24T15:56:08.231000+00:00
Original source
casting the gm spell banish on brann bronzebeard does this for example
Archived author: Deleted User • Posted: 2023-06-24T15:59:52.757000+00:00
Original source
I don't get why this doesn't work
```cpp
// 58914 - Kill Command
class spell_hun_kill_command_pet : public AuraScript
{
PrepareAuraScript(spell_hun_kill_command_pet);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_HUNTER_KILL_COMMAND_HUNTER });
}
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
{
// prevent charge drop (aura has both proc charge and stacks)
PreventDefaultAction();
if (Unit* owner = eventInfo.GetActor()->GetOwner())
owner->RemoveAuraFromStack(SPELL_HUNTER_KILL_COMMAND_HUNTER);
ModStackAmount(-1);
}
void HandleDummy()
{
Unit* caster = GetCaster();
if (!caster)
return;
// clear hunter crit aura state
//caster->ModifyAuraState(AURA_STATE_WARRIOR_VICTORY_RUSH_OR_HUNTER_CRIT_STRIKE, false);
if (caster->HasAura(SPELL_HUNTER_IMPROVED_KILL_COMMAND))
caster->CastSpell(caster, SPELL_HUNTER_IMPROVED_KILL_COMMAND_EXPLOIT_WEAKNESS, true);
// additional damage from pet to pet target
Unit* pet = caster->GetGuardianPet(); // It was GetPet but i get fatal error: no member named 'GetPet' in 'Unit'
if (!pet || !pet->GetVictim())
return;
pet->CastSpell(pet->GetVictim(), GetSpellInfo()->GetEffect(EFFECT_0).CalcValue(), true);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_hun_kill_command_pet::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
```
Archived author: Deleted User • Posted: 2023-06-24T16:00:08.181000+00:00
Original source
```cpp
SPELL_HUNTER_KILL_COMMAND_HUNTER = 34027,
SPELL_HUNTER_IMPROVED_KILL_COMMAND = 37483, // Dungeon Set 4P Bonus
SPELL_HUNTER_IMPROVED_KILL_COMMAND_EXPLOIT_WEAKNESS = 37482 // Dungeon Set 4P Bonus
```
Archived author: Deleted User • Posted: 2023-06-24T16:00:36.677000+00:00
Original source
RegisterSpellScript(spell_hun_kill_command_pet);
and i've added spell to spell_script_names ofc