mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-11 00:32:25 +00:00
Clean up of perl based NPC spell scaling functions.
Added Perl - $npc->GetSpellFocusDMG(), $npc->GetSpellFocusHeal()
This commit is contained in:
parent
9f3a0a3f95
commit
31b46efcac
@ -56,7 +56,7 @@ int32 NPC::GetActSpellDamage(uint16 spell_id, int32 value, Mob* target) {
|
|||||||
value -= target->GetFcDamageAmtIncoming(this, spell_id)/spells[spell_id].buffduration;
|
value -= target->GetFcDamageAmtIncoming(this, spell_id)/spells[spell_id].buffduration;
|
||||||
}
|
}
|
||||||
|
|
||||||
value += dmg*SpellFocusDMG/100;
|
value += dmg*GetSpellFocusDMG()/100;
|
||||||
|
|
||||||
if (AI_HasSpellsEffects()){
|
if (AI_HasSpellsEffects()){
|
||||||
int16 chance = 0;
|
int16 chance = 0;
|
||||||
@ -275,7 +275,7 @@ int32 NPC::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target) {
|
|||||||
|
|
||||||
//Scale all NPC spell healing via SetSpellFocusHeal(value)
|
//Scale all NPC spell healing via SetSpellFocusHeal(value)
|
||||||
|
|
||||||
value += value*SpellFocusHeal/100;
|
value += value*GetSpellFocusHeal()/100;
|
||||||
|
|
||||||
if (target) {
|
if (target) {
|
||||||
value += target->GetFocusIncoming(focusFcHealAmtIncoming, SE_FcHealAmtIncoming, this, spell_id);
|
value += target->GetFocusIncoming(focusFcHealAmtIncoming, SE_FcHealAmtIncoming, this, spell_id);
|
||||||
|
|||||||
@ -388,6 +388,12 @@ public:
|
|||||||
inline void SetHealScale(float amt) { healscale = amt; }
|
inline void SetHealScale(float amt) { healscale = amt; }
|
||||||
inline float GetHealScale() { return healscale; }
|
inline float GetHealScale() { return healscale; }
|
||||||
|
|
||||||
|
inline void SetSpellFocusDMG(int32 NewSpellFocusDMG) {SpellFocusDMG = NewSpellFocusDMG;}
|
||||||
|
inline int32 GetSpellFocusDMG() const { return SpellFocusDMG;}
|
||||||
|
|
||||||
|
inline void SetSpellFocusHeal(int32 NewSpellFocusHeal) {SpellFocusHeal = NewSpellFocusHeal;}
|
||||||
|
inline int32 GetSpellFocusHeal() const {return SpellFocusHeal;}
|
||||||
|
|
||||||
uint32 GetSpawnKillCount();
|
uint32 GetSpawnKillCount();
|
||||||
int GetScore();
|
int GetScore();
|
||||||
void SetMerchantProbability(uint8 amt) { probability = amt; }
|
void SetMerchantProbability(uint8 amt) { probability = amt; }
|
||||||
@ -452,6 +458,8 @@ protected:
|
|||||||
uint32 npc_mana;
|
uint32 npc_mana;
|
||||||
float spellscale;
|
float spellscale;
|
||||||
float healscale;
|
float healscale;
|
||||||
|
int32 SpellFocusDMG;
|
||||||
|
int32 SpellFocusHeal;
|
||||||
|
|
||||||
//pet crap:
|
//pet crap:
|
||||||
uint16 pet_spell_id;
|
uint16 pet_spell_id;
|
||||||
|
|||||||
@ -1991,6 +1991,32 @@ XS(XS_NPC_SetSpellFocusDMG)
|
|||||||
XSRETURN_EMPTY;
|
XSRETURN_EMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
XS(XS_NPC_GetSpellFocusDMG); /* prototype to pass -Wmissing-prototypes */
|
||||||
|
XS(XS_NPC_GetSpellFocusDMG)
|
||||||
|
{
|
||||||
|
dXSARGS;
|
||||||
|
if (items != 1)
|
||||||
|
Perl_croak(aTHX_ "Usage: NPC::GetSpellFocusDMG(THIS)");
|
||||||
|
{
|
||||||
|
NPC * THIS;
|
||||||
|
int32 RETVAL;
|
||||||
|
dXSTARG;
|
||||||
|
|
||||||
|
if (sv_derived_from(ST(0), "NPC")) {
|
||||||
|
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
||||||
|
THIS = INT2PTR(NPC *,tmp);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Perl_croak(aTHX_ "THIS is not of type NPC");
|
||||||
|
if(THIS == nullptr)
|
||||||
|
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||||
|
|
||||||
|
RETVAL = THIS->GetSpellFocusDMG();
|
||||||
|
XSprePUSH; PUSHu((UV)RETVAL);
|
||||||
|
}
|
||||||
|
XSRETURN(1);
|
||||||
|
}
|
||||||
|
|
||||||
XS(XS_NPC_SetSpellFocusHeal); /* prototype to pass -Wmissing-prototypes */
|
XS(XS_NPC_SetSpellFocusHeal); /* prototype to pass -Wmissing-prototypes */
|
||||||
XS(XS_NPC_SetSpellFocusHeal)
|
XS(XS_NPC_SetSpellFocusHeal)
|
||||||
{
|
{
|
||||||
@ -2015,6 +2041,32 @@ XS(XS_NPC_SetSpellFocusHeal)
|
|||||||
XSRETURN_EMPTY;
|
XSRETURN_EMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
XS(XS_NPC_GetSpellFocusHeal); /* prototype to pass -Wmissing-prototypes */
|
||||||
|
XS(XS_NPC_GetSpellFocusHeal)
|
||||||
|
{
|
||||||
|
dXSARGS;
|
||||||
|
if (items != 1)
|
||||||
|
Perl_croak(aTHX_ "Usage: NPC::GetSpellFocusHeal(THIS)");
|
||||||
|
{
|
||||||
|
NPC * THIS;
|
||||||
|
int32 RETVAL;
|
||||||
|
dXSTARG;
|
||||||
|
|
||||||
|
if (sv_derived_from(ST(0), "NPC")) {
|
||||||
|
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
||||||
|
THIS = INT2PTR(NPC *,tmp);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Perl_croak(aTHX_ "THIS is not of type NPC");
|
||||||
|
if(THIS == nullptr)
|
||||||
|
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||||
|
|
||||||
|
RETVAL = THIS->GetSpellFocusHeal();
|
||||||
|
XSprePUSH; PUSHu((UV)RETVAL);
|
||||||
|
}
|
||||||
|
XSRETURN(1);
|
||||||
|
}
|
||||||
|
|
||||||
XS(XS_NPC_GetSlowMitigation); /* prototype to pass -Wmissing-prototypes */
|
XS(XS_NPC_GetSlowMitigation); /* prototype to pass -Wmissing-prototypes */
|
||||||
XS(XS_NPC_GetSlowMitigation)
|
XS(XS_NPC_GetSlowMitigation)
|
||||||
{
|
{
|
||||||
@ -2286,6 +2338,8 @@ XS(boot_NPC)
|
|||||||
newXSproto(strcpy(buf, "RemoveAISpell"), XS_NPC_RemoveSpellFromNPCList, file, "$$");
|
newXSproto(strcpy(buf, "RemoveAISpell"), XS_NPC_RemoveSpellFromNPCList, file, "$$");
|
||||||
newXSproto(strcpy(buf, "SetSpellFocusDMG"), XS_NPC_SetSpellFocusDMG, file, "$$");
|
newXSproto(strcpy(buf, "SetSpellFocusDMG"), XS_NPC_SetSpellFocusDMG, file, "$$");
|
||||||
newXSproto(strcpy(buf, "SetSpellFocusHeal"), XS_NPC_SetSpellFocusHeal, file, "$$");
|
newXSproto(strcpy(buf, "SetSpellFocusHeal"), XS_NPC_SetSpellFocusHeal, file, "$$");
|
||||||
|
newXSproto(strcpy(buf, "GetSpellFocusDMG"), XS_NPC_GetSpellFocusDMG, file, "$");
|
||||||
|
newXSproto(strcpy(buf, "GetSpellFocusHeal"), XS_NPC_GetSpellFocusHeal, file, "$");
|
||||||
newXSproto(strcpy(buf, "GetSlowMitigation"), XS_NPC_GetAttackSpeed, file, "$");
|
newXSproto(strcpy(buf, "GetSlowMitigation"), XS_NPC_GetAttackSpeed, file, "$");
|
||||||
newXSproto(strcpy(buf, "GetAttackSpeed"), XS_NPC_GetSlowMitigation, file, "$");
|
newXSproto(strcpy(buf, "GetAttackSpeed"), XS_NPC_GetSlowMitigation, file, "$");
|
||||||
newXSproto(strcpy(buf, "GetAccuracyRating"), XS_NPC_GetAccuracyRating, file, "$");
|
newXSproto(strcpy(buf, "GetAccuracyRating"), XS_NPC_GetAccuracyRating, file, "$");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user