|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Quests::Q&A This is the quest support section |
04-17-2009, 11:41 AM
|
Dragon
|
|
Join Date: Dec 2007
Posts: 658
|
|
Time limit on zone
How would I make a quest that did this: I want a timer to start when the person zones in, and then 10 minutes later kick them back to Pok. I don't know where I would put that quest if I wrote it.
|
04-17-2009, 12:19 PM
|
|
The PEQ Dude
|
|
Join Date: Apr 2003
Location: -
Posts: 1,988
|
|
Easily done. You'd use player.pl, and set a 10 minute timer under sub EVENT_ENTERZONE. Then, under sub EVENT_TIMER when it expires, move them to PoK. The timer would be on the individual player, so you will have multiple timers going at once for multiple players.
|
04-17-2009, 12:35 PM
|
Dragon
|
|
Join Date: Dec 2007
Posts: 658
|
|
So, basically would it be something like this:
Code:
sub EVENT_ENTERZONE{
quest::settimer("zonekick",30);
}
sub EVENT_TIMER{
if ($timer eq "zonekick"){
quest::stoptimer("zonekick");
quest::movepc(202, -107,-190.-156);
}
}
I have never used timers in any quests before, so I'm not sure what I'm doing
|
04-17-2009, 12:47 PM
|
|
The PEQ Dude
|
|
Join Date: Apr 2003
Location: -
Posts: 1,988
|
|
Yep, that's exactly it, except that timer is for 30 seconds.
|
04-17-2009, 12:50 PM
|
Dragon
|
|
Join Date: Dec 2007
Posts: 658
|
|
Haha, yeah because I was planning on testing it and didn't want to wait 10 minutes to see if it ported me.
|
04-17-2009, 01:06 PM
|
|
The PEQ Dude
|
|
Join Date: Apr 2003
Location: -
Posts: 1,988
|
|
Yeah I do the same.
|
04-17-2009, 01:53 PM
|
Dragon
|
|
Join Date: Dec 2007
Posts: 658
|
|
Another quick question, if I wanted a monster to spawn based on the person's class that enters the zone, would I just do something like if
Code:
if ($class eq "Warrior"){
quest::spawn(ID,0,0,x,y,z)
}
in the sub event_enterzone and repeat that for other classes using elsif?
|
04-17-2009, 02:57 PM
|
|
The PEQ Dude
|
|
Join Date: Apr 2003
Location: -
Posts: 1,988
|
|
I see no reason why that wouldn't work.
|
|
|
|
04-17-2009, 07:25 PM
|
Dragon
|
|
Join Date: Dec 2007
Posts: 658
|
|
Alright, I don't think my timers are working. In the player.pl I made it like this
Code:
sub EVENT_ENTERZONE{
quest::settimer("zonekick",10);
quest::ze("You have 10 minutes to finish.");
if ($class eq "Warrior"){
quest::spawn(1207, 0, 0, 0, 0, 0.50);
}
elsif ($class eq "Ranger"){
quest::spawn(1214, 0, 0, 0, 0, 0.50);
}
}
sub EVENT_TIMER{
if ($timer eq "zonekick"){
quest::stoptimer("zonekick");
quest::movepc(202, -107,-190.-156);
}
}
sub EVENT_DEATH{
quest::depopzone(1);
}
The correct monsters are spawning based on the class, which is good, but the zone-wide emote doesn't show and the timer doesn't seem to work either. I lowered it to 10 seconds just so I could test it. I have this is another quest and the timer doesn't work here either.
Code:
EVENT_SPAWN{
quest::attack($name);
}
sub EVENT_DEATH{
quest::summonitem(20488);
quest::summonitem(20487);
quest::emote("collapses to the ground.");
quest::settimer("peaceout",5);
}
sub EVENT_TIMER{
if ($timer eq "peaceout"){
quest::stoptimer("peaceout");
quest::movepc(202, -107,-190.-156);
}
}
|
|
|
|
04-17-2009, 09:17 PM
|
|
Developer
|
|
Join Date: Mar 2003
Posts: 1,497
|
|
Are you sure the timer isn't working? Or could it be the period instead of a comma in the movepc() commands?
|
04-17-2009, 09:23 PM
|
|
Developer
|
|
Join Date: Mar 2003
Posts: 1,497
|
|
quest::ze ?
|
04-17-2009, 09:36 PM
|
Dragon
|
|
Join Date: Dec 2007
Posts: 658
|
|
I fixed the commas thing, but its still not working. Now the monsters arent even spawning when I zone in.
|
04-17-2009, 09:40 PM
|
|
Developer
|
|
Join Date: Mar 2003
Posts: 1,497
|
|
Hopefully you didn't change the periods in the spawn() statements. Only the movepc() statements.
Did you change anything else or is it still the same script as above?
|
04-17-2009, 09:51 PM
|
Dragon
|
|
Join Date: Dec 2007
Posts: 658
|
|
Same, just changed the commas in the timers.
|
04-18-2009, 08:59 AM
|
|
Developer
|
|
Join Date: Mar 2003
Posts: 1,497
|
|
Is the zone static? I am not sure if once it triggers, it will allow it to trigger again if the zone is still up. I've never tried.
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 09:40 PM.
|
|
|
|
|
|
|
|
|
|
|
|
|