mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 10:31:29 +00:00
commit
87a75c6100
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++; }
|
if(lv < 16)
|
||||||
else { spccontrib += (int)floor((float) lv/15); }
|
spccontrib++;
|
||||||
|
else
|
||||||
|
spccontrib += static_cast<int> (floor(lv/15.0));
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
{
|
|
||||||
if(lv < 16) { spccontrib++; }
|
|
||||||
else { spccontrib += (int)floor(lv/15); }
|
|
||||||
}
|
|
||||||
#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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1158,7 +1158,7 @@ void TaskManager::SendTaskSelector(Client *c, Mob *mob, int TaskCount, int *Task
|
|||||||
if(Tasks[TaskList[i]] != nullptr) break;
|
if(Tasks[TaskList[i]] != nullptr) break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: The 10 and 5 values in this calculation are to account for the string "nullptr" we are putting in 3 times.
|
// FIXME: The 10 and 5 values in this calculation are to account for the string "ABCD" we are putting in 3 times.
|
||||||
//
|
//
|
||||||
// Calculate how big the packet needs to be pased on the number of tasks and the
|
// Calculate how big the packet needs to be pased on the number of tasks and the
|
||||||
// size of the variable length strings.
|
// size of the variable length strings.
|
||||||
@ -1236,9 +1236,9 @@ void TaskManager::SendTaskSelector(Client *c, Mob *mob, int TaskCount, int *Task
|
|||||||
// FIXME: In live packets, these two strings appear to be the same as the Text1 and Text2
|
// FIXME: In live packets, these two strings appear to be the same as the Text1 and Text2
|
||||||
// strings from the first activity in the task, however the task chooser/selector
|
// strings from the first activity in the task, however the task chooser/selector
|
||||||
// does not appear to make use of them.
|
// does not appear to make use of them.
|
||||||
sprintf(Ptr, "nullptr");
|
sprintf(Ptr, "ABCD");
|
||||||
Ptr = Ptr + strlen(Ptr) + 1;
|
Ptr = Ptr + strlen(Ptr) + 1;
|
||||||
sprintf(Ptr, "nullptr");
|
sprintf(Ptr, "ABCD");
|
||||||
Ptr = Ptr + strlen(Ptr) + 1;
|
Ptr = Ptr + strlen(Ptr) + 1;
|
||||||
|
|
||||||
AvailableTaskTrailer = (AvailableTaskTrailer_Struct*)Ptr;
|
AvailableTaskTrailer = (AvailableTaskTrailer_Struct*)Ptr;
|
||||||
@ -1253,7 +1253,7 @@ void TaskManager::SendTaskSelector(Client *c, Mob *mob, int TaskCount, int *Task
|
|||||||
|
|
||||||
// In some packets, this next string looks like a short task summary, however it doesn't
|
// In some packets, this next string looks like a short task summary, however it doesn't
|
||||||
// appear anywhere in the client window.
|
// appear anywhere in the client window.
|
||||||
sprintf(Ptr, "nullptr");
|
sprintf(Ptr, "ABCD");
|
||||||
Ptr = Ptr + strlen(Ptr) + 1;
|
Ptr = Ptr + strlen(Ptr) + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user