Before NPCs spawn I want to set entity variables to them if they have certain special attacks.. that way I can just use the entity variables to dictate what special attacks I want to add to them if any...
My Perl script works well with this so far as in it skips mobs that already have Special attacks set in the database and adds special attacks to the mobs that do not have any (usually trash mobs).
The second loop is only to check if they have ANY of them so that my scaling script will skip them in the process of adding special attacks to NPCs.
My question is... would this bog down the server at all adding that many entity variables to an NPC? Mainly the first loop that adds the specific entity variables based on the type they have.
Code:
void NPC::mod_prespawn(Spawn2 *sp)
{
for( int i = 1; i < 36; i++ )
{
if(GetSpecialAbility(i))
{
const char* HasAbility = "1";
const char* SpecialList[] = {"SPECATK_SUMMON", "SPECATK_ENRAGE", "SPECATK_RAMPAGE", "SPECATK_AREA_RAMPAGE", "SPECATK_FLURRY", "SPECATK_TRIPLE", "SPECATK_QUAD", "SPECATK_INNATE_DW", "SPECATK_BANE", "SPECATK_MAGICAL", "SPECATK_RANGED_ATK", "UNSLOWABLE", "UNMEZABLE", "UNCHARMABLE", "UNSTUNABLE", "UNSNAREABLE", "UNFEARABLE", "UNDISPELLABLE", "IMMUNE_MELEE", "IMMUNE_MAGIC", "IMMUNE_FLEEING", "IMMUNE_MELEE_EXCEPT_BANE", "IMMUNE_MELEE_NONMAGICAL", "IMMUNE_AGGRO", "IMMUNE_AGGRO_ON", "IMMUNE_CASTING_FROM_RANGE", "IMMUNE_FEIGN_DEATH", "IMMUNE_TAUNT", "NPC_TUNNELVISION", "NPC_NO_BUFFHEAL_FRIENDS", "IMMUNE_PACIFY", "LEASH", "TETHER", "DESTRUCTIBLE_OBJECT", "NO_HARM_FROM_CLIENT"};
SetEntityVariable(SpecialList[i-1], HasAbility);
}
}
for( int i = 1; i < 36; i++ )
{
if(GetSpecialAbility(i))
{
const char* HasAbility = "1";
const char* Stuff = "HasSpecial";
SetEntityVariable(Stuff, HasAbility);
break;
}
}
}