|
|
 |
 |
 |
 |
|
 |
 |
|
 |
 |
|
 |
|
Quests::Q&A This is the quest support section |

04-16-2009, 08:03 PM
|
Fire Beetle
|
|
Join Date: Apr 2005
Posts: 7
|
|
hashes are now used instead of the old $porter restricted vars. Consider using $qglobals{porter} as the old method is deprecated. Using the new way does not require you to use all of the $porter = undef; as there are many potential errors when using that.
example:
Code:
if ($qglobals{porter} >= 50) {
|

04-17-2009, 12:55 PM
|
Dragon
|
|
Join Date: Dec 2007
Posts: 658
|
|
Ok, I have a new problem. I am trying to make a quest that checks the persons class. I have tried all formats I can think of and it will not check the class properly. Right now it is just an extremely simple quest because I am trying to figure out what's wrong with it. Knowing me, I probably just have something out of order.
Code:
sub EVENT_SAY{
if ($text=~/hail/i){
if ($class == "shadowknight"){
quest::say("Hello.");
}
}
}
For the class I have also tried
if ($class = "shadowknight"){
if ($class = 'shadowknight'){
if ($class == 'shadowknight'){
if ($class eq "shadowknight"){
if ($class eq 'shadowknight'){
|

04-17-2009, 01:04 PM
|
Dragon
|
|
Join Date: Feb 2007
Posts: 659
|
|
Have you tried $class eq "Shadowknight" ? I think they are capitalized.
|

04-17-2009, 01:22 PM
|
Dragon
|
|
Join Date: Dec 2007
Posts: 658
|
|
Nice, that fixed it. Thanks
|

04-17-2009, 03:47 PM
|
Dragon
|
|
Join Date: Dec 2007
Posts: 658
|
|
New problem. I am trying to make a monster spawn adds at 75% and 25% and on death, but the only time one spawns is on death. This is the monsters quest
Code:
sub EVENT_SPAWN{
quest::attacknpctype(1211);
}
sub EVENT_HP{
if ($hpevent <=75){
quest::spawn(1210,0,0,76,11,0.50);
}
if ($hpevent <=25){
quest::spawn(1210,0,0,76,11,0.50);
}
}
sub EVENT_DEATH{
quest::spawn(1209,0,0,76,11,0.50);
}
|

04-17-2009, 03:54 PM
|
Dragon
|
|
Join Date: Feb 2007
Posts: 659
|
|
Are you using quest::setnexthpevent()?
|
 |
|
 |

04-17-2009, 04:01 PM
|
 |
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
Here is an example from a simple script on my server:
Code:
my $x;
my $y;
my $z;
my $h;
sub EVENT_SPAWN {
quest::setnexthpevent(91);
}
sub EVENT_HP {
if($hpevent == 91) {
my $x = $npc->GetX();
my $y = $npc->GetY();
my $z = $npc->GetZ();
my $h = $npc->GetHeading();
quest::spawn2(quest::ChooseRandom(223002,223003),0,0,$x,$y + 10,$z,$h);
quest::spawn2(quest::ChooseRandom(223002,223003),0,0,$x,$y - 10,$z,$h);
quest::setnexthpevent(76);
}
if($hpevent == 76) {
my $x = $npc->GetX();
my $y = $npc->GetY();
my $z = $npc->GetZ();
my $h = $npc->GetHeading();
quest::spawn2(quest::ChooseRandom(223002,223003),0,0,$x,$y + 10,$z,$h);
quest::spawn2(quest::ChooseRandom(223002,223003),0,0,$x,$y - 10,$z,$h);
quest::setnexthpevent(56);
}
if($hpevent == 56) {
my $x = $npc->GetX();
my $y = $npc->GetY();
my $z = $npc->GetZ();
my $h = $npc->GetHeading();
quest::spawn2(quest::ChooseRandom(223002,223003),0,0,$x,$y + 10,$z,$h);
quest::spawn2(quest::ChooseRandom(223002,223003),0,0,$x,$y - 10,$z,$h);
quest::setnexthpevent(26);
}
if($hpevent == 26) {
my $x = $npc->GetX();
my $y = $npc->GetY();
my $z = $npc->GetZ();
my $h = $npc->GetHeading();
quest::spawn2(quest::ChooseRandom(223002,223003),0,0,$x,$y + 10,$z,$h);
quest::spawn2(quest::ChooseRandom(223002,223003),0,0,$x,$y - 10,$z,$h);
}
}
sub EVENT_DEATH {
quest::shout ("$name and the others may have beaten me, but they are no match for the beast!");
quest::depop(2700255);
quest::depop(2700256);
}
|
 |
|
 |
Thread Tools |
|
Display Modes |
Hybrid Mode
|
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 07:09 PM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |