return false;
}
-spawnfunc(monster_mage) { Monster_Spawn(this, MON_MAGE.monsterid); }
+spawnfunc(monster_mage) { Monster_Spawn(this, true, MON_MAGE.monsterid); }
#endif // SVQC
return false;
}
-spawnfunc(monster_shambler) { Monster_Spawn(this, MON_SHAMBLER.monsterid); }
+spawnfunc(monster_shambler) { Monster_Spawn(this, true, MON_SHAMBLER.monsterid); }
#endif // SVQC
#ifdef SVQC
return false;
}
-spawnfunc(monster_spider) { Monster_Spawn(this, MON_SPIDER.monsterid); }
+spawnfunc(monster_spider) { Monster_Spawn(this, true, MON_SPIDER.monsterid); }
#endif // SVQC
#ifdef SVQC
return false;
}
-spawnfunc(monster_wyvern) { Monster_Spawn(this, MON_WYVERN.monsterid); }
+spawnfunc(monster_wyvern) { Monster_Spawn(this, true, MON_WYVERN.monsterid); }
#endif // SVQC
#ifdef SVQC
return false;
}
-spawnfunc(monster_zombie) { Monster_Spawn(this, MON_ZOMBIE.monsterid); }
+spawnfunc(monster_zombie) { Monster_Spawn(this, true, MON_ZOMBIE.monsterid); }
#endif // SVQC
#ifdef SVQC
if(actor.spawnflags & MONSTERFLAG_NORESPAWN)
actor.spawnflags &= ~MONSTERFLAG_NORESPAWN; // zombies always respawn
+ actor.spawnflags &= ~MONSTERFLAG_APPEAR; // once it's appeared, it will respawn quickly, we don't want it to appear
+
actor.spawnflags |= MONSTER_RESPAWN_DEATHPOINT;
actor.monster_loot = spawnfunc_item_health_medium;
return true;
}
-void Monster_Respawn(entity this) { Monster_Spawn(this, this.monsterid); }
+void Monster_Respawn(entity this) { Monster_Spawn(this, true, this.monsterid); }
.vector pos1, pos2;
void Monster_Appear(entity this, entity actor, entity trigger)
{
this.enemy = actor;
- this.spawnflags &= ~MONSTERFLAG_APPEAR; // otherwise, we get an endless loop
- Monster_Spawn(this, this.monsterid);
+ Monster_Spawn(this, false, this.monsterid);
}
bool Monster_Appear_Check(entity this, int monster_id)
return true;
}
-bool Monster_Spawn(entity this, int mon_id)
+bool Monster_Spawn(entity this, bool check_appear, int mon_id)
{
// setup the basic required properties for a monster
entity mon = Monsters_from(mon_id);
if(!(this.spawnflags & MONSTERFLAG_RESPAWNED))
IL_PUSH(g_monsters, this);
- if(Monster_Appear_Check(this, mon_id)) { return true; } // return true so the monster isn't removed
+ if(check_appear && Monster_Appear_Check(this, mon_id)) { return true; } // return true so the monster isn't removed
if(!this.monster_skill)
this.monster_skill = cvar("g_monsters_skill");
void monsters_setstatus(entity this);
-bool Monster_Spawn(entity this, int mon_id);
+bool Monster_Spawn(entity this, bool check_appear, int mon_id);
void monster_setupcolors(entity this);
}
// Monster_Spawn checks if monster is valid
- Monster_Spawn(e, monster_id);
+ Monster_Spawn(e, false, monster_id);
return e;
}