Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Custom

Quests::Custom Custom Quests here

Reply
 
Thread Tools Display Modes
  #16  
Old 05-10-2011, 10:55 PM
Durge
Sarnak
 
Join Date: Jan 2010
Location: USA
Posts: 51
Default

I used the same set up, but I can't figure out what is wrong here, can anyone help?


Code:
sub EVENT_SAY{

	$client->Message(7, " ");
	my $NPCName = $npc->Ram();

	if($text=~/Hail/i) {
		if ($ulevel <= 10) {
			quest::selfcast(5415);
			quest::selfcast(5312);
			quest::selfcast(5405);
			quest::selfcast(5409);
			quest::selfcast(5521);
			quest::selfcast(5365);
			quest::selfcast(278);
			quest::selfcast(939);
			quest::selfcast(3391);
			quest::selfcast(5390);
			$client->Message(315, "$NPCName whispers to you, 'Since you are level 10 or lower you get free buffs, $name! Good luck to you.'");
		}
		if (($ulevel > 10) && ($ulevel < 25)) {
		$client->Message(315, "$NPCName whispers to you, 'Hello $name, I will give you buffs in exchange for 100 platinum.'");
		}
		if (($ulevel >= 25) && ($ulevel < 70)) {
		$client->Message(315, "$NPCName whispers to you, 'Hello $name, I will give you buffs in exchange for 500 platinum.'");
		}
		if ($ulevel >= 70) {
		$client->Message(315, "$NPCName whispers to you, 'Hello $name, I will give you buffs in exchange for 1,000 platinum.'");
		}
	}
}


sub EVENT_ITEM {

	$client->Message(7, " ");
	my $NPCName = $npc->Ram();
	
	if ($platinum == 1000) {
		if ($ulevel >= 70) {
			quest::selfcast(5278);
			quest::selfcast(5415);
			quest::selfcast(5312);
			quest::selfcast(5405);
			quest::selfcast(5409);
			quest::selfcast(5521);
			quest::selfcast(5365);
			quest::selfcast(278);
			quest::selfcast(939);
			quest::selfcast(3391);
			quest::selfcast(5390);
			$client->Message(315, "$NPCName whispers to you, 'Thank you $name!'");
		} else {
			$client->Message(315, "$NPCName whispers to you, 'Use the correct amount of platinum, $name!'");
			quest::givecash($copper,$silver,$gold,$platinum);
		}
	}
	if ($platinum == 500) {
		if (($ulevel < 75)&&($ulevel >= 25)) {
			quest::selfcast(5278);
			quest::selfcast(5415);
			quest::selfcast(5312);
			quest::selfcast(5405);
			quest::selfcast(5409);
			quest::selfcast(5521);
			quest::selfcast(5365);
			quest::selfcast(278);
			quest::selfcast(939);
			quest::selfcast(3391);
			quest::selfcast(5390);
			$client->Message(315, "$NPCName whispers to you, 'Thank you $name!'");
		} else {
			$client->Message(315, "$NPCName whispers to you, 'Use the correct amount of platinum, $name!'");
			quest::givecash($copper,$silver,$gold,$platinum);
		}
	}
	if ($platinum == 100) {
		if (($ulevel > 10) && ($ulevel < 25)) {
			quest::selfcast(5415);
			quest::selfcast(5312);
			quest::selfcast(5405);
			quest::selfcast(5409);
			quest::selfcast(5521);
			quest::selfcast(5365);
			quest::selfcast(278);
			quest::selfcast(939);
			quest::selfcast(3391);
			quest::selfcast(5390);
			$client->Message(315, "$NPCName whispers to you, 'Thank you $name!'");
		} else {
			$client->Message(315, "$NPCName whispers to you, 'Use the correct amount platinum, $name!'");
			quest::givecash($copper,$silver,$gold,$platinum);
		}
	}
	if (($platinum < 100) || ($platinum < 500) && ($platinum > 100) || ($platinum < 1000) && ($platinum > 100) && ($platinum > 500) || ($platinum > 1000)) {
		$client->Message(315, "$NPCName whispers to you, 'Use the correct amount of platinum, $name!'");
		quest::givecash($copper,$silver,$gold,$platinum);
	}
}
Reply With Quote
  #17  
Old 05-10-2011, 11:16 PM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,743
Default

Can you give us more details of what works and what doesn't? Have you tried slimming down the script to the bare minimum and adding additional functions one at a time to see when it breaks?
Reply With Quote
  #18  
Old 05-11-2011, 07:11 AM
lich2594
Sarnak
 
Join Date: Jun 2006
Location: Tennessee, USA
Posts: 77
Default

Without any details as to what's causing you the problems...

Try using:

Code:
my $NPCName = $npc->GetCleanName();
instead of:

Code:
my $NPCName = $npc->Ram();
__________________
Reply With Quote
  #19  
Old 05-11-2011, 07:35 AM
Durge
Sarnak
 
Join Date: Jan 2010
Location: USA
Posts: 51
Default

Ok I'll try that, and the problem is when i hail the npc (Ram) just a blank line appears on my chat window.
Reply With Quote
  #20  
Old 05-11-2011, 07:38 AM
lich2594
Sarnak
 
Join Date: Jun 2006
Location: Tennessee, USA
Posts: 77
Default

Quote:
Originally Posted by Durge View Post
Ok I'll try that, and the problem is when i hail the npc (Ram) just a blank line appears on my chat window.
If it still appears as a blank line, I would suggest removing everything inside of the if statement, and replacing it with a single output to test that your NPC functions.

example:

Code:
if($text=~/Hail/i) { $client->Message(315, "$NPCName whispers to you, 'Ugh... do I work?'");  }
If it works with the single line statement, in this post, and not with all of the other checks... that simply means you have an error inside of the IF bracket. Remove everything, then add one line at a time. (Remember to change your level, to the desired level that you want to check to make sure that it works.)

Usually, you will get a blank line if none of the IF brackets are triggered.
__________________
Reply With Quote
  #21  
Old 05-11-2011, 08:42 AM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,743
Default

I would guess the blank lines come from this:

$client->Message(7, " ");
Reply With Quote
  #22  
Old 05-11-2011, 08:43 AM
lich2594
Sarnak
 
Join Date: Jun 2006
Location: Tennessee, USA
Posts: 77
Default

Quote:
Originally Posted by lerxst2112 View Post
I would guess the blank lines come from this:

$client->Message(7, " ");
That's correct... and since it isn't within the IF bracket, it will always execute as long as there isn't an error prior to that point in the script.
__________________
Reply With Quote
  #23  
Old 05-12-2011, 07:36 AM
Durge
Sarnak
 
Join Date: Jan 2010
Location: USA
Posts: 51
Default

I tried even one small message and it still didn't work.
Here is what I have.
I also tried with the name you gave me and it didn't work.
Code:
sub EVENT_SAY {

$client->Message(7, " ");
my $NPCName = $npc->Ram();
my $Hello = quest::saylink("Hello", 1);

	if($text=~/Hail/i) {
	$client->Message(315, "$NPCName whispers to you, '[$Hello], I am a test bot.'");
	}
}
Reply With Quote
  #24  
Old 05-12-2011, 07:41 AM
lich2594
Sarnak
 
Join Date: Jun 2006
Location: Tennessee, USA
Posts: 77
Default

After changing the quest files, are you reloading quest memory? If I remember correctly, the command is: #reload pl (I haven't worked on the Emu in a while.)
__________________
Reply With Quote
  #25  
Old 05-12-2011, 07:13 PM
Durge
Sarnak
 
Join Date: Jan 2010
Location: USA
Posts: 51
Default

hmm, that didn't work either.
Reply With Quote
  #26  
Old 05-12-2011, 08:28 PM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,743
Default

This line is wrong.

my $NPCName = $npc->Ram();

Replace with this as noted above:

my $NPCName = $npc->GetCleanName();
Reply With Quote
  #27  
Old 05-12-2011, 08:43 PM
provocating's Avatar
provocating
Demi-God
 
Join Date: Nov 2007
Posts: 2,175
Default

Quote:
Originally Posted by lich2594 View Post
After changing the quest files, are you reloading quest memory? If I remember correctly, the command is: #reload pl (I haven't worked on the Emu in a while.)
#reloadquest
Reply With Quote
  #28  
Old 05-12-2011, 10:24 PM
Durge
Sarnak
 
Join Date: Jan 2010
Location: USA
Posts: 51
Default

Yes i know it was wrong, I had already tried with "GetCleanName" and changed it back.
Reply With Quote
  #29  
Old 05-12-2011, 10:27 PM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,743
Default

Well, like I said before. Strip the script down to the bare minimum, no saylinks, no npc name, nothing but a simple response to the hail, and if that works add things and see where you break it.
Reply With Quote
  #30  
Old 05-13-2011, 12:08 PM
provocating's Avatar
provocating
Demi-God
 
Join Date: Nov 2007
Posts: 2,175
Default

Since this thread popped back up, I got back on finalizing my buff bot.

One thing I was never able to do is get the chanter or Cleric bot to cast spells that have a target of group v2. Spells like the Druid Skin like Nature work just fine.

I have tried combinations like these. I have in remarks what happened with each spell.

Code:
#$npc->SpellFinished(3479,  $client->GetID()); #Buff bot cast virtue on herself
#$ent->CastSpell(3479, $ent, 10, -1, -1); #I cast virtue on myself
#$npc->CastSpell(3479, $ent, 10, -1, -1); #Buff bot cast virtue on herself
#$npc->CastSpell(3479, $userid); #Buff bot cast virtue on herself
Yeah I could code it to where I cast Virtue on myself but that seems really lame. Plus people will complain they did not get it, because they moved or something.
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 10:18 AM.


 

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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3