mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 01:11:29 +00:00
Enhanced spawn conditions with new onchange option DoRepopIfReady
This commit is contained in:
parent
a602f70bf4
commit
24c70a04ca
@ -1,5 +1,7 @@
|
||||
EQEMu Changelog (Started on Sept 24, 2003 15:50)
|
||||
-------------------------------------------------------
|
||||
== 02/09/2014 ==
|
||||
Sorvani: Added new spawn condition onchange action: DoRepopIfReady. Choosing this will not repop mobs when the spawn condition is enabled if they have an existing respawn timer. Additionally, this condition will not even attempt repop when the condition is is changed to disabled. Will be in use on PEQ for: Cragbeast Queen in Natimbi.
|
||||
|
||||
== 02/2/2014 ==
|
||||
Kayen: Revised how spell/dot damage is calculated to properly incorporated all current focus effects/bonuses.
|
||||
|
||||
@ -482,6 +482,7 @@ void Spawn2::SpawnConditionChanged(const SpawnCondition &c, int16 old_value) {
|
||||
return; //no change
|
||||
}
|
||||
|
||||
uint32 timer_remaining = 0;
|
||||
switch(c.on_change) {
|
||||
case SpawnCondition::DoNothing:
|
||||
//that was easy.
|
||||
@ -499,6 +500,19 @@ void Spawn2::SpawnConditionChanged(const SpawnCondition &c, int16 old_value) {
|
||||
npcthis->Depop(false); //remove the current mob
|
||||
Repop(); //repop
|
||||
break;
|
||||
case SpawnCondition::DoRepopIfReady:
|
||||
_log(SPAWNS__CONDITIONS, "Spawn2 %d: Our condition is now %s. Preforming a repop if repsawn timer is expired.", spawn2_id, new_state?"enabled":"disabled");
|
||||
if(npcthis != nullptr)
|
||||
npcthis->Depop(false); //remove the current mob
|
||||
if(new_state) { // only get repawn timer remaining when the SpawnCondition is enabled.
|
||||
timer_remaining = database.GetSpawnTimeLeft(spawn2_id,zone->GetInstanceID());
|
||||
_log(SPAWNS__CONDITIONS,"Spawn2 %d: Our condition is now %s. The respawn timer_remaining is %d. Preforming a repop if it is <= 0.", spawn2_id, new_state?"enabled":"disabled", timer_remaining);
|
||||
if(timer_remaining <= 0)
|
||||
Repop();
|
||||
} else {
|
||||
_log(SPAWNS__CONDITIONS,"Spawn2 %d: Our condition is now %s. Not checking respawn timer.", spawn2_id, new_state?"enabled":"disabled");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if(c.on_change < SpawnCondition::DoSignalMin) {
|
||||
_log(SPAWNS__CONDITIONS, "Spawn2 %d: Our condition is now %s. Invalid on-change action %d.", spawn2_id, new_state?"enabed":"disabled", c.on_change);
|
||||
|
||||
@ -101,7 +101,8 @@ public:
|
||||
DoNothing = 0,
|
||||
DoDepop = 1,
|
||||
DoRepop = 2,
|
||||
//... 3...9 reserved for future use
|
||||
DoRepopIfReady = 3,
|
||||
//... 4...9 reserved for future use
|
||||
DoSignalMin = 10 //any number above this value is used as
|
||||
//a base for the signal ID sent. e.g.
|
||||
// value 12 sends signal id 2
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user