mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-07 00:42:26 +00:00
send graphic to target correctly (#1785)
This commit is contained in:
parent
8d3a179ecc
commit
8f3cce6585
14
zone/mob.cpp
14
zone/mob.cpp
@ -2910,13 +2910,21 @@ void Mob::CameraEffect(uint32 duration, uint32 intensity, Client *c, bool global
|
|||||||
safe_delete(outapp);
|
safe_delete(outapp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Mob::SendSpellEffect(uint32 effect_id, uint32 duration, uint32 finish_delay, bool zone_wide, uint32 unk020, bool perm_effect, Client *c) {
|
void Mob::SendSpellEffect(uint32 effect_id, uint32 duration, uint32 finish_delay, bool zone_wide, uint32 unk020, bool perm_effect, Client *c, uint32 caster_id, uint32 target_id) {
|
||||||
|
|
||||||
|
if (!caster_id) {
|
||||||
|
caster_id = GetID();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!target_id) {
|
||||||
|
target_id = GetID();
|
||||||
|
}
|
||||||
|
|
||||||
auto outapp = new EQApplicationPacket(OP_SpellEffect, sizeof(SpellEffect_Struct));
|
auto outapp = new EQApplicationPacket(OP_SpellEffect, sizeof(SpellEffect_Struct));
|
||||||
SpellEffect_Struct* se = (SpellEffect_Struct*) outapp->pBuffer;
|
SpellEffect_Struct* se = (SpellEffect_Struct*) outapp->pBuffer;
|
||||||
se->EffectID = effect_id; // ID of the Particle Effect
|
se->EffectID = effect_id; // ID of the Particle Effect
|
||||||
se->EntityID = GetID();
|
se->EntityID = caster_id; //casting graphic animation
|
||||||
se->EntityID2 = GetID(); // EntityID again
|
se->EntityID2 = target_id; // //target graphic animation
|
||||||
se->Duration = duration; // In Milliseconds
|
se->Duration = duration; // In Milliseconds
|
||||||
se->FinishDelay = finish_delay; // Seen 0
|
se->FinishDelay = finish_delay; // Seen 0
|
||||||
se->Unknown020 = unk020; // Seen 3000
|
se->Unknown020 = unk020; // Seen 3000
|
||||||
|
|||||||
@ -291,7 +291,7 @@ public:
|
|||||||
|
|
||||||
//Spell
|
//Spell
|
||||||
void SendSpellEffect(uint32 effect_id, uint32 duration, uint32 finish_delay, bool zone_wide,
|
void SendSpellEffect(uint32 effect_id, uint32 duration, uint32 finish_delay, bool zone_wide,
|
||||||
uint32 unk020, bool perm_effect = false, Client *c = nullptr);
|
uint32 unk020, bool perm_effect = false, Client *c = nullptr, uint32 caster_id = 0, uint32 target_id = 0);
|
||||||
bool IsBeneficialAllowed(Mob *target);
|
bool IsBeneficialAllowed(Mob *target);
|
||||||
virtual int GetCasterLevel(uint16 spell_id);
|
virtual int GetCasterLevel(uint16 spell_id);
|
||||||
void ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses* newbon, uint16 casterID = 0,
|
void ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses* newbon, uint16 casterID = 0,
|
||||||
|
|||||||
@ -4864,8 +4864,8 @@ XS(XS_Mob_CameraEffect) {
|
|||||||
XS(XS_Mob_SpellEffect); /* prototype to pass -Wmissing-prototypes */
|
XS(XS_Mob_SpellEffect); /* prototype to pass -Wmissing-prototypes */
|
||||||
XS(XS_Mob_SpellEffect) {
|
XS(XS_Mob_SpellEffect) {
|
||||||
dXSARGS;
|
dXSARGS;
|
||||||
if (items < 2 || items > 8)
|
if (items < 2 || items > 10)
|
||||||
Perl_croak(aTHX_ "Usage: Mob::SpellEffect(THIS, uint32 effect, [uint32 duration = 5000], [uint32 finish_delay = 0], [bool zone_wide = false], [uint32 unk20 = 3000], [bool perm_effect = false], [Client* single_client])"); // @categories Spells and Disciplines
|
Perl_croak(aTHX_ "Usage: Mob::SpellEffect(THIS, uint32 effect, [uint32 duration = 5000], [uint32 finish_delay = 0], [bool zone_wide = false], [uint32 unk20 = 3000], [bool perm_effect = false], [Client* single_client]), [caster_id = 0], [target_id = 0]"); // @categories Spells and Disciplines
|
||||||
{
|
{
|
||||||
Mob *THIS;
|
Mob *THIS;
|
||||||
uint32 effect = (uint32) SvUV(ST(1));
|
uint32 effect = (uint32) SvUV(ST(1));
|
||||||
@ -4875,6 +4875,8 @@ XS(XS_Mob_SpellEffect) {
|
|||||||
uint32 unk20 = 3000;
|
uint32 unk20 = 3000;
|
||||||
bool perm_effect = false;
|
bool perm_effect = false;
|
||||||
Client *client = nullptr;
|
Client *client = nullptr;
|
||||||
|
uint32 caster_id = 0;
|
||||||
|
uint32 target_id = 0;
|
||||||
VALIDATE_THIS_IS_MOB;
|
VALIDATE_THIS_IS_MOB;
|
||||||
if (items > 2) { duration = (uint32) SvUV(ST(2)); }
|
if (items > 2) { duration = (uint32) SvUV(ST(2)); }
|
||||||
if (items > 3) { finish_delay = (uint32) SvUV(ST(3)); }
|
if (items > 3) { finish_delay = (uint32) SvUV(ST(3)); }
|
||||||
@ -4890,9 +4892,11 @@ XS(XS_Mob_SpellEffect) {
|
|||||||
if (client == nullptr)
|
if (client == nullptr)
|
||||||
Perl_croak(aTHX_ "client is nullptr, avoiding crash.");
|
Perl_croak(aTHX_ "client is nullptr, avoiding crash.");
|
||||||
}
|
}
|
||||||
|
if (items > 8) { caster_id = (uint32)SvUV(ST(8)); }
|
||||||
|
if (items > 9) { target_id = (uint32)SvUV(ST(9)); }
|
||||||
|
|
||||||
|
|
||||||
THIS->SendSpellEffect(effect, duration, finish_delay, zone_wide, unk20, perm_effect, client);
|
THIS->SendSpellEffect(effect, duration, finish_delay, zone_wide, unk20, perm_effect, client, caster_id, target_id);
|
||||||
}
|
}
|
||||||
XSRETURN_EMPTY;
|
XSRETURN_EMPTY;
|
||||||
}
|
}
|
||||||
@ -6743,7 +6747,7 @@ XS(boot_Mob) {
|
|||||||
newXSproto(strcpy(buf, "ShieldAbility"), XS_Mob_ShieldAbility, file, "$$$$$$$$");
|
newXSproto(strcpy(buf, "ShieldAbility"), XS_Mob_ShieldAbility, file, "$$$$$$$$");
|
||||||
newXSproto(strcpy(buf, "Shout"), XS_Mob_Shout, file, "$$;@");
|
newXSproto(strcpy(buf, "Shout"), XS_Mob_Shout, file, "$$;@");
|
||||||
newXSproto(strcpy(buf, "SignalClient"), XS_Mob_SignalClient, file, "$$$");
|
newXSproto(strcpy(buf, "SignalClient"), XS_Mob_SignalClient, file, "$$$");
|
||||||
newXSproto(strcpy(buf, "SpellEffect"), XS_Mob_SpellEffect, file, "$$;$$$$$$");
|
newXSproto(strcpy(buf, "SpellEffect"), XS_Mob_SpellEffect, file, "$$;$$$$$$$$");
|
||||||
newXSproto(strcpy(buf, "SpellFinished"), XS_Mob_SpellFinished, file, "$$;$$");
|
newXSproto(strcpy(buf, "SpellFinished"), XS_Mob_SpellFinished, file, "$$;$$");
|
||||||
newXSproto(strcpy(buf, "Spin"), XS_Mob_Spin, file, "$");
|
newXSproto(strcpy(buf, "Spin"), XS_Mob_Spin, file, "$");
|
||||||
newXSproto(strcpy(buf, "StartEnrage"), XS_Mob_StartEnrage, file, "$");
|
newXSproto(strcpy(buf, "StartEnrage"), XS_Mob_StartEnrage, file, "$");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user