I don't propose the greatest or most ideal method for doing this. But, I do have a somewhat of ghetto solution for repopping via quest commands using spawn_condition. In my example, I use Freeport west. I first changed all west freeport's spawns to condition 1. In MySQL
Code:
UPDATE spawn2 SET _condition = 1 WHERE zone = 'freportw';
Then, I set up spawn conditions tab for the condition 1:
Code:
INSERT INTO `spawn_conditions` VALUES ('freportw', '1', '0', '2', 'Freeport Spawn');
As explained by FNW's spawn_condition tutorial post, the freportw is the short zone name. 1 is the condition id (we used one for npcs here). The next number is value. This number is compared against the cond_value tab in spawn2 also. If the current value of the spawn condition is greater than or equal to the current value of the cond_value for the particular spawn, the npc will spawn.
The default cond_id for a spawn is 1. Therefore, since our spawn condition value is 0, freport west npcs will not be spawned when you enter the zone. To make them spawn you'd have to change the 0 to 1 or higher. The 2 is the action command to DoRepop. Check out fnw's tutorial on spawn conditions for more action info. Freport Spawn is just for reading it. It has not functional effect.
Okay, now that the value has been set up, it's time to implement ingame quest command control. I created an npc named Trigger. Give him a spawn entry and do not alter his spawn condition info.
Here is a simple example of perl command for Trigger to control this in game:
Code:
sub EVENT_SAY {
if($text=~/Hail/i){
quest::say("Hello, $name. Would you like to [pop], [depop], or [repop] the zone?");
}
if($text=~/\bpop\b/i){
quest::spawn_condition(freportw, 1, 1);
quest::say("popping!");
}
if($text=~/\bdepop\b/i){
quest::spawn_condition(freportw,1,0);
quest::say("depopping!");
}
if($text=~/\brepop\b/i){
quest::spawn_condition(freportw,1,0);
quest::spawn_condition(freportw,1,1);
quest::say("repopping!");
}
}
Again, this is probably not the most ideal usage, but it does what you ask: perl command to repop a zone that is perfect for creating LDoN style zones or encounters