[DiscordArchive] how would i go about adding a pet script type f...
[DiscordArchive] how would i go about adding a pet script type f...
Archived author: Oya • Posted: 2025-06-03T12:25:42.778000+00:00
Original source
message.txt
Archived author: Oya • Posted: 2025-06-03T12:26:14.302000+00:00
Original source
class npc_pet_dk_dancing_rune_weapon : public CreatureScript
{
public:
npc_pet_dk_dancing_rune_weapon() : CreatureScript("npc_pet_dk_dancing_rune_weapon") { }
struct npc_pet_dk_dancing_rune_weaponAI : public NullCreatureAI
{
npc_pet_dk_dancing_rune_weaponAI(Creature* creature) : NullCreatureAI(creature) { }
void InitializeAI() override
{
// Xinef: Hit / Expertise scaling
me->AddAura(61017, me);
if (Unit* owner = me->GetOwner())
me->GetMotionMaster()->MoveFollow(owner, 0.01f, me->GetFollowAngle(), MOTION_SLOT_CONTROLLED);
NullCreatureAI::InitializeAI();
}
};
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_pet_dk_dancing_rune_weaponAI (creature);
}
};
class spell_pet_dk_gargoyle_strike : public SpellScript
{
PrepareSpellScript(spell_pet_dk_gargoyle_strike);
void HandleDamageCalc(SpellEffIndex /*effIndex*/)
{
int32 damage = 60;
if (Unit* caster = GetCaster())
{
if (caster->GetLevel() >= 60)
{
damage += (caster->GetLevel() - 60) * 4;
}
}
SetEffectValue(damage);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_pet_dk_gargoyle_strike::HandleDamageCalc, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
}
};
void AddSC_deathknight_pet_scripts()
{
new npc_pet_dk_ebon_gargoyle();
new npc_pet_dk_ghoul();
new npc_pet_dk_risen_ally();
new npc_pet_dk_army_of_the_dead();
new npc_pet_dk_dancing_rune_weapon();
RegisterSpellScript(spell_pet_dk_gargoyle_strike);
}
Archived author: Oya • Posted: 2025-06-03T12:27:32.083000+00:00
Original source
those are the scripts i see
Archived author: Isaiah • Posted: 2025-06-03T12:41:17.406000+00:00
Original source
Is this AC or Mangos?
Archived author: Oya • Posted: 2025-06-03T12:46:03.037000+00:00
Original source
azeroth core
Archived author: Isaiah • Posted: 2025-06-03T12:52:28.816000+00:00
Original source
The TC one seems to be easier to work with, and it does checks in a different way, also player.m_Controlled is available on both cores, so maybe you can work with the variation of this script from TC. Just make sure you change the m_Controlled ID check in handleProc to whatever your mirror image NPC ID is, change all of the spells in the Validate function, change them in the enum as well and make sure to properly attach the spell scripts in the databse ^^
Archived author: Isaiah • Posted: 2025-06-03T12:53:00.210000+00:00
Original source
```// 49028 - Dancing Rune Weapon
class spell_dk_dancing_rune_weapon : public AuraScript
{
PrepareAuraScript(spell_dk_dancing_rune_weapon);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({
SPELL_DK_BLOOD_STRIKE,
SPELL_DK_ICY_TOUCH,
SPELL_DK_PLAGUE_STRIKE,
SPELL_DK_DEATH_COIL_DAMAGE,
SPELL_DK_DEATH_STRIKE,
SPELL_DK_HEART_STRIKE,
SPELL_DK_OBLITERATE,
SPELL_DK_RUNE_STRIKE
});
}
void HandleTarget(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* caster = GetCaster();
if (!caster)
return;
std::list<Creature*> runeWeapons;
caster->GetAllMinionsByEntry(runeWeapons, NPC_DK_DANCING_RUNE_WEAPON);
for (Creature* temp : runeWeapons)
{
if (temp->IsAIEnabled())
temp->AI()->SetGUID(GetTarget()->GetGUID(), DATA_INITIAL_TARGET_GUID);
temp->GetThreatManager().RegisterRedirectThreat(GetId(), caster->GetGUID(), 100);
}
}
```
Archived author: Isaiah • Posted: 2025-06-03T12:53:15.115000+00:00
Original source
```bool CheckProc(ProcEventInfo& eventInfo)
{
if (SpellInfo const* procSpell = eventInfo.GetSpellInfo())
{
if (procSpell->IsRankOf(sSpellMgr->GetSpellInfo(SPELL_DK_BLOOD_STRIKE)) ||
procSpell->IsRankOf(sSpellMgr->GetSpellInfo(SPELL_DK_ICY_TOUCH)) ||
procSpell->IsRankOf(sSpellMgr->GetSpellInfo(SPELL_DK_PLAGUE_STRIKE)) ||
procSpell->IsRankOf(sSpellMgr->GetSpellInfo(SPELL_DK_DEATH_COIL_DAMAGE)) ||
procSpell->IsRankOf(sSpellMgr->GetSpellInfo(SPELL_DK_DEATH_STRIKE)) ||
procSpell->IsRankOf(sSpellMgr->GetSpellInfo(SPELL_DK_HEART_STRIKE)) ||
procSpell->IsRankOf(sSpellMgr->GetSpellInfo(SPELL_DK_OBLITERATE)) ||
procSpell->IsRankOf(sSpellMgr->GetSpellInfo(SPELL_DK_RUNE_STRIKE)))
return true;
}
return false;
}```
Archived author: Isaiah • Posted: 2025-06-03T12:53:19.067000+00:00
Original source
``` void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Unit* owner = GetUnitOwner();
if (!owner)
return;
SpellInfo const* procSpell = eventInfo.GetSpellInfo();
Unit* runeWeapon = nullptr;
for (auto itr = owner->m_Controlled.begin(); itr != owner->m_Controlled.end() && !runeWeapon; itr++)
if ((*itr)->GetEntry() == NPC_DK_DANCING_RUNE_WEAPON)
runeWeapon = *itr;
if (!runeWeapon)
return;
if (runeWeapon->IsInCombat() && runeWeapon->GetVictim())
runeWeapon->CastSpell(runeWeapon->GetVictim(), procSpell->Id, CastSpellExtraArgs(TriggerCastFlags::TRIGGERED_IGNORE_POWER_AND_REAGENT_COST));
}
void Register() override
{
AfterEffectApply += AuraEffectApplyFn(spell_dk_dancing_rune_weapon::HandleTarget, EFFECT_2, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
DoCheckProc += AuraCheckProcFn(spell_dk_dancing_rune_weapon::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_dk_dancing_rune_weapon::HandleProc, EFFECT_1, SPELL_AURA_DUMMY);
}
};````
Archived author: Isaiah • Posted: 2025-06-03T12:53:37.764000+00:00
Original source
Sorry I had to send it in parts discord doesn't allow for more than 2000 characters per message