Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

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

Reply
 
Thread Tools Display Modes
  #1  
Old 04-01-2008, 08:26 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default Same Item Turn for Changing Quest Globals - Need Help

So, I am trying to make a quest that will level characters by 1 level each time they turn in 4 ItemID 2835. I can't get it to work properly. I have 2 examples below which I have tried adjustments to, but neither seem to work properly.

First, I tried this script, which uses elsifs, but I haven't really used them much before so it is very possible there could be a mistake. This one does absolutely nothing if I turn in the items. In fact, it doesn't even return them.

Code:
sub EVENT_ITEM {

if (plugin::check_handin(\%itemcount, 2835=>4) {
   
if ($max_level == undef) {
    quest::say("These are in excellent shape!  They will be trophies in my collection!");
$client->Message(6, "Maximus Serilious rewards you with a new level!" );
    quest::exp(9999999);
    quest::setglobal("max_level", 71, 5, "F");
    quest::level(71); }
   
elsif ($max_level == 71) {
    quest::say("These are in excellent shape!  They will be trophies in my collection!");
$client->Message(6, "Maximus Serilious rewards you with a new level!" );
    quest::exp(9999999);
    quest::setglobal("max_level", 72, 5, "F");
    quest::level(72); }
   
elsif ($max_level == 72) {
    quest::say("These are in excellent shape!  They will be trophies in my collection!");
$client->Message(6, "Maximus Serilious rewards you with a new level!" );
    quest::exp(9999999);
    quest::setglobal("max_level", 73, 5, "F");
    quest::level(73); }
   
elsif ($max_level == 73) {
    quest::say("These are in excellent shape!  They will be trophies in my collection!");
$client->Message(6, "Maximus Serilious rewards you with a new level!" );
    quest::exp(9999999);
    quest::setglobal("max_level", 74, 5, "F");
    quest::level(74); }
   
elsif ($max_level == 74) {
    quest::say("These are in excellent shape!  They will be trophies in my collection!");
$client->Message(6, "Maximus Serilious rewards you with a new level!" );
    quest::exp(9999999);
    quest::setglobal("max_level", 75, 5, "F");
    quest::level(75); }

  }

  else {
    plugin::return_items(\%itemcount);
       }

}
The script below is the code that I tried next and it actually works for the first turn in. It gives me the global of 71, the level and everything. But, if I turn in 4 more ItemID 2835s, it just eats them and does nothing. I verified it is putting the global on my character and that the NPC is recognizing globals. I made a simple EVENT_SAY to make sure it responded properly to hails when I had the global max_level at 71 and it responded properly. The npc is flagged for qglobals in the NPC_Entries table. I am stumped as to why it isn't working past the first turn in. My guess is it is something to do with it being the same item that is turned in, which is why I first tried the elseifs in the code above.

Code:
sub EVENT_ITEM {

if (plugin::check_handin(\%itemcount, 2835=>4) && $max_level == undef) {
    quest::say("These are in excellent shape!  They will be trophies in my collection!");
$client->Message(6, "Maximus Serilious rewards you with a new level!" );
    quest::exp(9999999);
    quest::setglobal("max_level", 71, 5, "F");
    quest::level(71); }
   
if (plugin::check_handin(\%itemcount, 2835=>4) && $max_level == 71) {
    quest::say("These are in excellent shape!  They will be trophies in my collection!");
$client->Message(6, "Maximus Serilious rewards you with a new level!" );
    quest::exp(9999999);
    quest::setglobal("max_level", 72, 5, "F");
    quest::level(72); }
   
if (plugin::check_handin(\%itemcount, 2835=>4) && $max_level == 72) {
    quest::say("These are in excellent shape!  They will be trophies in my collection!");
$client->Message(6, "Maximus Serilious rewards you with a new level!" );
    quest::exp(9999999);
    quest::setglobal("max_level", 73, 5, "F");
    quest::level(73); }
   
if (plugin::check_handin(\%itemcount, 2835=>4) && $max_level == 73) {
    quest::say("These are in excellent shape!  They will be trophies in my collection!");
$client->Message(6, "Maximus Serilious rewards you with a new level!" );
    quest::exp(9999999);
    quest::setglobal("max_level", 74, 5, "F");
    quest::level(74); }
   
if (plugin::check_handin(\%itemcount, 2835=>4) && $max_level == 74) {
    quest::say("These are in excellent shape!  They will be trophies in my collection!");
$client->Message(6, "Maximus Serilious rewards you with a new level!" );
    quest::exp(9999999);
    quest::setglobal("max_level", 75, 5, "F");
    quest::level(75); }

  else {
    plugin::return_items(\%itemcount);
       }

}
Any help would be greatly appreciated!
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #2  
Old 04-01-2008, 09:00 PM
ChaosSlayer
Demi-God
 
Join Date: May 2007
Posts: 1,032
Default

hmm could you try this - use the FIRST code sample, but replace "elseif"s with regular "if"s

if it works the way i understand it, it should produce chain leveling reaction =)
Reply With Quote
  #3  
Old 04-01-2008, 09:29 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Actually, I tried that first and it had the same effect as the elsif's, which was no effect.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #4  
Old 04-01-2008, 09:54 PM
Aramid
Discordant
 
Join Date: May 2006
Posts: 356
Default

Try adding $max_level=undef; in the script at the end.
__________________
Random Segments of Code....
Reply With Quote
  #5  
Old 04-01-2008, 10:52 PM
ChaosSlayer
Demi-God
 
Join Date: May 2007
Posts: 1,032
Default

Quote:
Originally Posted by Aramid View Post
Try adding $max_level=undef; in the script at the end.
won't this reset the variable every time script runs?
Reply With Quote
  #6  
Old 04-01-2008, 11:11 PM
mattmeck
Guest
 
Posts: n/a
Default

Why even use the globals in this case seems to be overkill?


a simple if level 70 and you turn in the item the npc does a #level 71
if level 71 and you turn in the items the npc does #level 72
etc etc

dont feel like writing it up but you get the idea.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 07:30 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3