Zero out default SpawnNPC stats

This commit is contained in:
Akkadius 2018-11-07 00:11:58 -06:00
parent 06e668108a
commit 0752edcab0

View File

@ -911,7 +911,8 @@ bool NPC::DatabaseCastAccepted(int spell_id) {
return false; return false;
} }
bool NPC::SpawnZoneController(){ bool NPC::SpawnZoneController()
{
if (!RuleB(Zone, UseZoneController)) if (!RuleB(Zone, UseZoneController))
return false; return false;
@ -1040,90 +1041,7 @@ NPC* NPC::SpawnNPC(const char* spawncommand, const glm::vec4& position, Client*
sprintf(sep.arg[10], "0"); sprintf(sep.arg[10], "0");
//Calc MaxHP if client neglected to enter it... //Calc MaxHP if client neglected to enter it...
if (!sep.IsNumber(4)) { if (!sep.IsNumber(4)) {
//Stolen from Client::GetMaxHP... sep.arg[4] = 0;
uint8 multiplier = 0;
int tmplevel = atoi(sep.arg[2]);
switch(atoi(sep.arg[5]))
{
case WARRIOR:
if (tmplevel < 20)
multiplier = 22;
else if (tmplevel < 30)
multiplier = 23;
else if (tmplevel < 40)
multiplier = 25;
else if (tmplevel < 53)
multiplier = 27;
else if (tmplevel < 57)
multiplier = 28;
else
multiplier = 30;
break;
case DRUID:
case CLERIC:
case SHAMAN:
multiplier = 15;
break;
case PALADIN:
case SHADOWKNIGHT:
if (tmplevel < 35)
multiplier = 21;
else if (tmplevel < 45)
multiplier = 22;
else if (tmplevel < 51)
multiplier = 23;
else if (tmplevel < 56)
multiplier = 24;
else if (tmplevel < 60)
multiplier = 25;
else
multiplier = 26;
break;
case MONK:
case BARD:
case ROGUE:
//case BEASTLORD:
if (tmplevel < 51)
multiplier = 18;
else if (tmplevel < 58)
multiplier = 19;
else
multiplier = 20;
break;
case RANGER:
if (tmplevel < 58)
multiplier = 20;
else
multiplier = 21;
break;
case MAGICIAN:
case WIZARD:
case NECROMANCER:
case ENCHANTER:
multiplier = 12;
break;
default:
if (tmplevel < 35)
multiplier = 21;
else if (tmplevel < 45)
multiplier = 22;
else if (tmplevel < 51)
multiplier = 23;
else if (tmplevel < 56)
multiplier = 24;
else if (tmplevel < 60)
multiplier = 25;
else
multiplier = 26;
break;
}
sprintf(sep.arg[4],"%i",5+multiplier*atoi(sep.arg[2])+multiplier*atoi(sep.arg[2])*75/300);
} }
// Autoselect NPC Gender // Autoselect NPC Gender
@ -1153,13 +1071,13 @@ NPC* NPC::SpawnNPC(const char* spawncommand, const glm::vec4& position, Client*
npc_type->merchanttype = atoi(sep.arg[9]); npc_type->merchanttype = atoi(sep.arg[9]);
npc_type->bodytype = atoi(sep.arg[10]); npc_type->bodytype = atoi(sep.arg[10]);
npc_type->STR = 150; npc_type->STR = 0;
npc_type->STA = 150; npc_type->STA = 0;
npc_type->DEX = 150; npc_type->DEX = 0;
npc_type->AGI = 150; npc_type->AGI = 0;
npc_type->INT = 150; npc_type->INT = 0;
npc_type->WIS = 150; npc_type->WIS = 0;
npc_type->CHA = 150; npc_type->CHA = 0;
npc_type->attack_delay = 3000; npc_type->attack_delay = 3000;