mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-18 16:38:26 +00:00
[Spells] Rework of Virus Effect code (#1593)
* start of rework * functional * virus updates * Update npc.cpp * updates * updates * update v2 * pre remove old code * removed old code1 * remove debugs * description * Update spell_effects.cpp * changed function name * remove unused var * merge error fix * fix formating issue * Update spdat.cpp * Update spell_effects.cpp * Convert virus entity range code to use vectors and GetCloseMobList * Formatting [skip ci] Co-authored-by: Akkadius <akkadius1@gmail.com>
This commit is contained in:
+13
-13
@@ -928,19 +928,8 @@ bool NPC::Process()
|
||||
SendHPUpdate();
|
||||
}
|
||||
|
||||
if(HasVirus()) {
|
||||
if(viral_timer.Check()) {
|
||||
viral_timer_counter++;
|
||||
for(int i = 0; i < MAX_SPELL_TRIGGER*2; i+=2) {
|
||||
if(viral_spells[i] && spells[viral_spells[i]].viral_timer > 0) {
|
||||
if(viral_timer_counter % spells[viral_spells[i]].viral_timer == 0) {
|
||||
SpreadVirus(viral_spells[i], viral_spells[i+1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(viral_timer_counter > 999)
|
||||
viral_timer_counter = 0;
|
||||
if (viral_timer.Check()) {
|
||||
VirusEffectProcess();
|
||||
}
|
||||
|
||||
if(spellbonuses.GravityEffect == 1) {
|
||||
@@ -2339,6 +2328,10 @@ void NPC::PetOnSpawn(NewSpawn_Struct* ns)
|
||||
strn0cpy(ns->spawn.lastName, tmp_lastname.c_str(), sizeof(ns->spawn.lastName));
|
||||
}
|
||||
}
|
||||
|
||||
if (swarmOwner->IsNPC()) {
|
||||
SetPetOwnerNPC(true);
|
||||
}
|
||||
}
|
||||
else if(GetOwnerID())
|
||||
{
|
||||
@@ -2354,6 +2347,13 @@ void NPC::PetOnSpawn(NewSpawn_Struct* ns)
|
||||
if (tmp_lastname.size() < sizeof(ns->spawn.lastName))
|
||||
strn0cpy(ns->spawn.lastName, tmp_lastname.c_str(), sizeof(ns->spawn.lastName));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (entity_list.GetNPCByID(GetOwnerID()))
|
||||
{
|
||||
SetPetOwnerNPC(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user