EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   What is wrong with this script? (https://www.eqemulator.org/forums/showthread.php?t=31305)

blackdragonsdg 05-15-2010 04:10 AM

What is wrong with this script?
 
It seems like the easier the script should be the more of a headache it is for me.....EVENT_SAY works just fine but EVENT_ITEM just eats the handin and nothing else happens. What did I do wrong?


Code:

sub EVENT_SAY {
    if($text=~/Hail/i) {
    quest::say("Hi there young one. I require some assistance, would you be willing to [help] me.");
    }
    if($text=~/help/i) {
    quest::say("I am a collector of sorts and over the years I have managed to collect items or bones from the various monsters around Norrarth. Right now I am looking for something from the king of Kael. Seek out the one named Tormax and bring me his head. Do this for me and I shall bestow a great reward upon you.");
    }
}

sub EVENT_ITEM {
  if(plugin::check_handin(\%itemcount, 30516 => 1)) {
    quest::say("Oh, you actually found him! That is great news now I can add his head to my collection. Thank you very much for your help. Here is your reward! If you wish to return to Relic at some point in the future simply hand me the Relic Stone of Return and I will send you back.");
    quest::summonitem(119590);
    quest::movepc(370,99,1177,-273);
    }
elsif (plugin::check_handin(\%itemcount, 119590 => 1)) {
    quest::say("So you want to return to Relic, very well then, off you go!");
    quest::summonitem(119590);
    quest::movepc(370,99,1177,-273);
    }
else {
    quest::say("I don't need this.");
    plugin::return_items(\%itemcount);
    }
}


joligario 05-15-2010 04:39 AM

Do you have the plugins in your emu\plugins folder or your quests\plugins folder?

EqTitan 05-15-2010 01:47 PM

Ive found when writing quests that if I copy paste things, no rhyme or reason they just don't work sometimes. But if I sit there and manually type every letter of the script I just copyed, it works. Very odd I know but what are ya gonna do ....

nilbog 05-15-2010 03:17 PM

What text editor are you using to write/modify your scripts, EqTitan?

blackdragonsdg 05-15-2010 06:21 PM

Quote:

Originally Posted by joligario (Post 187938)
Do you have the plugins in your emu\plugins folder or your quests\plugins folder?

Yup, that was the problem. The simple stuff always gets me....thanks for the help.

Angelox 05-15-2010 06:45 PM

This;
(plugin::check_handin(\%itemcount, 30516 => 1)
does not always work for me - for whatever reason, it just will not work some times.

This;
($itemcount{30516} >= 1)
Always works for me. So try changing all your "plugin::check_handin's" to this.

I do always include this at the end of the script;
Code:

  else{
    quest::say("Sorry, I can't use this.");
    plugin::return_items(\%itemcount);
  }

So the player doesn't loose anything


All times are GMT -4. The time now is 02:52 AM.

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