mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-19 08:11:30 +00:00
Fixed NPC::GetScore and XS_NPC_GetScore
This commit is contained in:
parent
21a9434f89
commit
f6100ed834
29
zone/npc.cpp
29
zone/npc.cpp
@ -2432,31 +2432,23 @@ int NPC::GetScore()
|
|||||||
|
|
||||||
if(lv < 46)
|
if(lv < 46)
|
||||||
{
|
{
|
||||||
#if _MSC_VER==1600
|
minx = static_cast<int> (ceil( ((lv - (lv / 10.0)) - 1.0) ));
|
||||||
minx = ceil((float) ((lv - (lv / 10)) - 1) );
|
|
||||||
#else
|
|
||||||
minx = ceil( ((lv - (lv / 10)) - 1) );
|
|
||||||
#endif
|
|
||||||
basehp = (lv * 10) + (lv * lv);
|
basehp = (lv * 10) + (lv * lv);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#if _MSC_VER==1600
|
minx = static_cast<int> (ceil( ((lv - (lv / 10.0)) - 1.0) - (( lv - 45.0 ) / 2.0) ));
|
||||||
minx = ceil((float) ((lv - (lv / 10)) - 1) - (( abs(45 - lv) ) / 2) );
|
|
||||||
#else
|
|
||||||
minx = ceil( ((lv - (lv / 10)) - 1) - (( abs(45 - lv) ) / 2) );
|
|
||||||
#endif
|
|
||||||
basehp = (lv * 10) + ((lv * lv) * 4);
|
basehp = (lv * 10) + ((lv * lv) * 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(hp > basehp)
|
if(hp > basehp)
|
||||||
{
|
{
|
||||||
hpcontrib = (int)( (float)((float)hp / (float)basehp) * 1.5);
|
hpcontrib = static_cast<int> (((hp / static_cast<float> (basehp)) * 1.5));
|
||||||
if(hpcontrib > 5) { hpcontrib = 5; }
|
if(hpcontrib > 5) { hpcontrib = 5; }
|
||||||
|
|
||||||
if(maxdmg > basedmg)
|
if(maxdmg > basedmg)
|
||||||
{
|
{
|
||||||
dmgcontrib = ceil( ((maxdmg / basedmg) * 1.5) );
|
dmgcontrib = static_cast<int> (ceil( ((maxdmg / basedmg) * 1.5) ));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(HasNPCSpecialAtk("E")) { spccontrib++; } //Enrage
|
if(HasNPCSpecialAtk("E")) { spccontrib++; } //Enrage
|
||||||
@ -2471,17 +2463,12 @@ int NPC::GetScore()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(npc_spells_id > 12)
|
if(npc_spells_id > 12)
|
||||||
#if _MSC_VER==1600
|
|
||||||
{
|
|
||||||
if(lv < 16) { spccontrib++; }
|
|
||||||
else { spccontrib += (int)floor((float) lv/15); }
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
{
|
{
|
||||||
if(lv < 16) { spccontrib++; }
|
if(lv < 16)
|
||||||
else { spccontrib += (int)floor(lv/15); }
|
spccontrib++;
|
||||||
|
else
|
||||||
|
spccontrib += static_cast<int> (floor(lv/15.0));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
final = minx + hpcontrib + dmgcontrib + spccontrib;
|
final = minx + hpcontrib + dmgcontrib + spccontrib;
|
||||||
final = max(1, final);
|
final = max(1, final);
|
||||||
|
|||||||
@ -2236,7 +2236,7 @@ XS(boot_NPC)
|
|||||||
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, "$");
|
||||||
newXSproto(strcpy(buf, "GetSpawnKillCount"), XS_NPC_GetSpawnKillCount, file, "$");
|
newXSproto(strcpy(buf, "GetSpawnKillCount"), XS_NPC_GetSpawnKillCount, file, "$");
|
||||||
newXSproto(strcpy(buf, "GetScore"), XS_NPC_GetSpawnKillCount, file, "$");
|
newXSproto(strcpy(buf, "GetScore"), XS_NPC_GetScore, file, "$");
|
||||||
XSRETURN_YES;
|
XSRETURN_YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user