EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   help with custom quest please (https://www.eqemulator.org/forums/showthread.php?t=30312)

jkennedy 01-14-2010 02:36 AM

help with custom quest please
 
sub EVENT_SAY {
if($text=~/hail/i) {
quest::say("How Are you today, $name Bring me One Peice of Epic to receive your epic?");
}
}

sub EVENT_ITEM {

if(plugin::check_handin(\%itemcount, 1387 => 1) && $class eq "Warrior") {
quest::say("Well done. Here are your Epic");
quest::summonitem(10909);
quest::summonitem(10910); }
}

elsif(plugin::check_handin(\%itemcount, 1387 => 1) && $class eq "Ranger") {
quest::say("Well done. Here are your Epic");
quest::summonitem(20487);
quest::summonitem(20488);

}
}



Ok my problem is i cant give the npc to give the ranger his epic but the warrior can get his am i doing something wrong or maybe i need to change something but if i change the itemcount on the ranger to 2 of the 1387 it works just not one

bthomsen0312 01-14-2010 09:38 AM

Quote:

Originally Posted by jkennedy (Post 182785)
sub EVENT_SAY {
if($text=~/hail/i) {
quest::say("How Are you today, $name Bring me One Peice of Epic to receive your epic?");
}
}

sub EVENT_ITEM {

if(plugin::check_handin(\%itemcount, 1387 => 1) && $class eq "Warrior") {
quest::say("Well done. Here are your Epic");
quest::summonitem(10909);
quest::summonitem(10910); }
}

elsif(plugin::check_handin(\%itemcount, 1387 => 1) && $class eq "Ranger") {
quest::say("Well done. Here are your Epic");
quest::summonitem(20487);
quest::summonitem(20488);

}
}



Ok my problem is i cant give the npc to give the ranger his epic but the warrior can get his am i doing something wrong or maybe i need to change something but if i change the itemcount on the ranger to 2 of the 1387 it works just not one

um your code was screwed up for one
Code:

sub EVENT_SAY {
  if($text=~/hail/i) {
    quest::say("How Are you today, $name Bring me One Peice of Epic to receive your epic?");
  }
}

sub EVENT_ITEM {
 
  if (($itemcount {1387} == 1) && ($class eq "Warrior")) {
    quest::say("Well done. Here are your Epic");
    quest::summonitem(10909);
    quest::summonitem(10910); }

 elsif(($itemcount {1387} == 1) && ($class eq "Ranger")) {
    quest::say("Well done. Here are your Epic");
    quest::summonitem(20487);
    quest::summonitem(20488); }
  }

there is a fixed copy of your code, you were screwing up your syntax and you don't really need to use the plugin to do item hand ins. use notepad++ or georges perl quest editor as it makes checking these things alot easier

jkennedy 01-14-2010 02:02 PM

thank you so much one last question is there a way to maek a npc check to see if a player has a item but not take it and also make it so u cant repeat a quest

joligario 01-14-2010 04:30 PM

You should use the plugin for checking items. And you can return unused items.

Code:

sub EVENT_SAY {
  if($text=~/hail/i) {
    quest::say("How Are you today, $name Bring me One Peice of Epic to receive your epic?");
  }
}

sub EVENT_ITEM {
  if (plugin::check_handin(\%itemcount, 1387 => 1)) {
    if ($class eq "Warrior") {
      quest::say("Well done. Here are your Epic");
      quest::summonitem(10909);
      quest::summonitem(10910);
    }
    elsif ($class eq "Ranger") {
      quest::say("Well done. Here are your Epic");
      quest::summonitem(20487);
      quest::summonitem(20488);
    }
    else {
      quest::say("Sorry, your class does not get an epic on this server.");
      quest::summonitem(1387);
    }
  }
  else {
    quest::say("I do not need this.");
    plugin::return_items(\%itemcount);
  }
}


bthomsen0312 01-14-2010 06:19 PM

that else won't work there man

joligario 01-14-2010 06:45 PM

Sure it will. Try it.

Secrets 01-15-2010 06:45 AM

Quote:

Originally Posted by bthomsen0312 (Post 182853)
that else won't work there man

That else is for the other if, read the brackets :P

Secrets 01-15-2010 07:09 AM

Quote:

Originally Posted by bthomsen0312 (Post 182794)
um your code was screwed up for one
Code:

sub EVENT_SAY {
  if($text=~/hail/i) {
    quest::say("How Are you today, $name Bring me One Peice of Epic to receive your epic?");
  }
}

sub EVENT_ITEM {
 
  if (($itemcount {1387} == 1) && ($class eq "Warrior")) {
    quest::say("Well done. Here are your Epic");
    quest::summonitem(10909);
    quest::summonitem(10910); }

 elsif(($itemcount {1387} == 1) && ($class eq "Ranger")) {
    quest::say("Well done. Here are your Epic");
    quest::summonitem(20487);
    quest::summonitem(20488); }
  }

there is a fixed copy of your code, you were screwing up your syntax and you don't really need to use the plugin to do item hand ins. use notepad++ or georges perl quest editor as it makes checking these things alot easier

edit: too tired. can't read posts.

jkennedy 01-15-2010 09:16 AM

bthomsen0312 got it right and thank you


All times are GMT -4. The time now is 08:48 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.