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 03-16-2008, 10:32 AM
Ut0pia
Sarnak
 
Join Date: Feb 2008
Posts: 72
Default My Buff Bot, isn't working

These are my Buff Bots that I created using AnalogX's Illusionist_Nomaad.pl as a reference.

However, neither of them work and I don't know why.

Code:
#Illusionist_Nomaad.pl
sub EVENT_SAY
{
	if(($text=~/hail/i))
	{
		$npc->SetApperance(0);
		quest::emote("sighs at $name");
		quest::say("Once upon a time, I was a very powerful Enchanter. However, during one of my Druken rampages I slaughtered the guards in High Keep. They started to hate me so much that they would [kill] me on sight.");
	}
	elsif(($text=~/kill/i))
	{
		$npc->SetApperance(0);
		quest::emote("shakes his fists in anger");
		quest::say("Then one of those damn nobles got me from behind. She killed me.... ME!!! I wanted to [hurt] myself!");
	}
	elsif(($text=~/hurt/i))
	{
		$npc->SetApperance(0);
		quest::say("I went to bed that night. Sadly, in my durken mess, I forgot that I bound my soul right there in High Keep. The guards slaughtered me over and over till I woke up and I was level 17. Now instead of KEI, all I have for you are these [crap buffs]");
	}
	elsif(($text=~/crap buffs/i)&&($ulevel>=11))
	{
		$npc->SetApperance(0);
		quest::say("Yes, for someone of your level, I can cast [intellectual superiority] for 1 platnium.");
		quest::emote("begins to cry over the loss of income");
	}
	elsif(($text=~/crap buffs/i)&&($ulevel<=10))
		$npc->SetApperance(0);
		quest::say("Yes, fucking crap buffs. I can cast this [intellectual advancement] buff on you for 1 platnium.");
		quest::emote("begins to cry over the loss of income");
	}
	elsif(($text=~/intellectual superiority/i))
	{
		$npc->SetApperance(0);
		quest::say("Intellectual Superiority: Increases your Effective Casting by 6, and lasts for 27 minutes. Open trade and hand me 1 platnium for the buff.");
	}
	elsif(($text=~/intellectual advancement/i))
	{
		$npc->SetApperance(0);
		quest::say("Intellectual Advancement: Increases your Effective Casting by 3, and lasts for 27 minutes. There is an upgraded version once you come back here at level 11. Open trade and hand me 1 platnium for the buff.");
	}
}

sub EVENT_ITEM
{
	if (($platnium>=1)&&($ulevel<=10))
	{
		$npc->SetApperance(0);
		quest::selfcast(2561);
		quest::say("Thanks for the donation, check with Illusionist Mindbender for some mind buffs or Vicar Qadar for health buffs.");
	}
	elsif(($platnium>=1)&&($ulevel>=11))
	{
		$npc->SetApperance(0);
		quest:selfcast(2562);
		quest::say("Thanks for the donation, check with Illusionist Mindbender for some mind buffs or Vicar Qadar for health buffs.");
	}
	else
	{
		quest::say("Thanks for the donation, but it sucked ...");
	}
}

and of course:

Code:
sub EVENT_SAY
{
	if(($text=~/hail/i))
	{
		$npc->SetApperance(0);
		quest::emote("waves at $name");
		quest::say("Welcome, welcome, I am the mighty Illusionist Mindbender and I'll happily bend your [mind] for a price");
	}
	elsif(($text=~/bend/i)&&($ulevel>= 1)&&($ulevel<= 14))
		$npc->SetApperance(0);
		quest::say("Well my friend, your [will] is only proficient for [breeze], it will cost you 1 platnium.");
	}
	elsif(($text=~/bend/i)&&($ulevel>= 15)&&($ulevel<= 29))
		$npc->SetApperance(0);
		quest::say("A lot of puney rats want my mind buffs, sadly their [will] is not as advanced, sadly you fall in this line and can only optain [clarity] from me, this spell will cost you 5 platnium.");
	}
	elsif(($text=~/bend/i)&&($ulevel>= 30)&&($ulevel<= 45))
		$npc->SetApperance(0);
		quest::say("Ha, I'd call you a Mid-be, in other words your [will] is strong enough to handle my [clarity 2] spell but still sucks. It's 10 platnium if you want it.");
	}
	elsif(($text=~/bend/i)&&($ulevel>= 46)&&($ulevel<= 50))
		$npc->SetApperance(0);
		quest::say("Nice, you can now forget Illusionist Orange here to my right, your [will] is quite powerful enough for [KEI]. However, it will cost you 30 platnium.");
	}
	elsif(($text=~/bend/i)&&($ulevel>= 51)&&($ulevel<= 55))
		$npc->SetApperance(0);
		quest::say("You have come to the right place friend, your [will] is capable of [tranquility]. It's better then [KEI], but does not last as long. [KEI] is still 30 platnium if you want it. [tranquility] is 35 platnium.");
	}
	elsif(($text=~/bend/i)&&($ulevel>= 56)&&($ulevel<= 59))
		$npc->SetApperance(0);
		quest::say("Wow, your [will] is quite strong, I can sense it pulse with energy. I can offer you [VOQ] which is much better then [KEI], but does not last as long. [KEI] is still 30 platnium if you want it. [VOQ] is 40 platnium.");
	}
	elsif(($text=~/bend/i)&&($ulevel>= 60))
		$npc->SetApperance(0);
		quest::emote("looks quite happy");
		quest::say("FINALLY, Someone that I can respect! Your [will] is as powerful as mine. If you want [KEI] it's still 30 platnium as always. But why not take advantage of [clairvoyance]. It's much powerful then [KEI] but doesn't last as long. I can cast it on you for just 50 platnium.");
	}
	elsif(($text=~/will/i))
		$npc->SetApperance(0);
		quest::say("I can offer [breeze] starting at level 1, [clarity] at level 15, [clarity 2] at level 30, [KEI] at level 46, [tranquility] at level 51, [VOQ] at level 56, and finally and definitely something that will keep you up at night, [clairvoyance] at level 60.");
	}
	elsif(($text=~/breeze/i))
		$npc->SetApperance(0);
		quest::say("Breeze: 4 to 6 mana per tick, and lasts 27 minutes. This spell will cost you 1 platnium.");
	}
	elsif(($text=~/clarity/i))
		$npc->SetApperance(0);
		quest::say("Clarity: 7 to 9 mana per tick, and lasts 27 minutes. You need a will of at least level 15 to handle it. This spell will cost you 5 platnium.");
	}
	elsif(($text=~/clarity 2/i))
		$npc->SetApperance(0);
		quest::say("Clarity 2: 9 to 11 mana per tick, and lasts 35 minutes. You will need a will of at least level 30 to handle it. This spell will cost you 10 platnium.");
	}
	elsif(($text=~/KEI/i))
		$npc->SetApperance(0);
		quest::say("Koadic's Endless Intelligence: Increases mana pool by 250, 14 mana per tick, +25 WIS, +25 INT, and lasts 2 hours and 30 minutes. You will need a will of at least level 46 to handle this spell. It will cost you 30 platnium.");
	}
	elsif(($text=~/tranquility/i))
		$npc->SetApperance(0);
		quest::say("Tanquility: Increases mana pool by 260, 16 mana per tick, +26INT, +26WIS, and lasts 1 hour and 20 minutes. You will need a will of at least level 51. This spell will cost you 35 platnium.");
	}
	elsif(($text=~/VOQ/i))
		$npc->SetApperance(0);
		quest::say("Voice of Quellious: Increases mana pool by 275, 18 mana per tick, +28WIS, +28INT, and lasts 1 hour and 20 minutes. You will need a will of at least 56. This spell will cost you 40 platnium.");
	}
	elsif(($text=~/clairvoyance/i))
		$npc->SetApperance(0);
		quest::say("Clairvoyance: Increases mana pool by 400, 20 mana per tick, +32WIS, +32INT, and lasts 1 hour and 20 minutes. You will need a will of at least 60. This spell will cost you 50 platnium.");
	}
}

sub EVENT_SPAWN
{
	$x = $npc->GetX();
	$y = $npc->GetY();
	quest::set_proximity($x - 90, $x + 90, $y - 90, $y + 90);
}

sub EVENT_ENTER
{
	$npc->SetApperance(1);
	my $random_result = int(rand(100));
	if ($random_result<=75)
	{
		quest::shout("Casting Mind Buffs for donations on the rock behind the main bank!");
	}
	else
	{
		#Do Nothing
	}
}

sub EVENT_ITEM
{
	if (($platnium>=1)&&($platnium<=4)&&($ulevel<=45))
	{
		$npc->SetApperance(0);
		quest::selfcast(697);
		quest::say("Thanks for the donation, check with Vicar Qadar for health buffs.");
	}
	elseif (($platnium>=5)&&($platnium<=9)&&($ulevel<=45)&&($ulevel>=15))
	{
		$npc->SetApperance(0);
		quest::selfcast(174);
		quest::say("Thanks for the donation, check with Vicar Qadar for health buffs.");
	}
	elseif (($platnium>=10)&&($platnium<=29)&&($ulevel<=45)&&($ulevel>=30))
	{
		$npc->SetApperance(0);
		quest::selfcast(1693);
		quest::say("Thanks for the donation, check with Vicar Qadar for health buffs.");
	}
	elseif (($platnium>=30)&&($platnium<=34)&&($ulevel>=46))
	{
		$npc->SetApperance(0);
		quest::selfcast(2570);
		quest::say("Thanks for the donation, check with Vicar Qadar for health buffs.");
	}
	elseif (($platnium>=35)&&($platnium<=39)&&($ulevel>=51))
	{
		$npc->SetApperance(0);
		quest::selfcast(3350);
		quest::say("Thanks for the donation, check with Vicar Qadar for health buffs.");
	}
	elseif (($platnium>=40)&&($platnium<=49)&&($ulevel>=56))
	{
		$npc->SetApperance(0);
		quest::selfcast(3360);
		quest::say("Thanks for the donation, check with Vicar Qadar for health buffs.");
	}
	elseif (($platnium>=50)&&($ulevel>=60))
	{
		$npc->SetApperance(0);
		quest::selfcast(5522);
		quest::say("Thanks for the donation, check with Vicar Qadar for health buffs.");
	}
My questions are:

Why do my buff bots not work?

Is there a column in the npc_type table (or any other) that if set to a specific value will prevent scripts from running?

Thanks
Reply With Quote
  #2  
Old 03-16-2008, 03:54 PM
Ut0pia
Sarnak
 
Join Date: Feb 2008
Posts: 72
Default

Just to post a quick note. I'm aware there are a few spelling errors in the script, all of which I've done my best to correct after I made this post. But the problem is the script does not work at all. Which leads me to my 3rd question.

If there is 1 error in the script, does it prevent the whole script from working?

Sorry, I'm really new at this.
Reply With Quote
  #3  
Old 03-16-2008, 10:00 PM
Ut0pia
Sarnak
 
Join Date: Feb 2008
Posts: 72
Default

Ok, after getting a little help and using the quest editor from GeorgeS, I was able to solve all the syntax problems. But they still don't work, oh joy.

So here is what I have so far:

Code:
#Illusionist_Nomaad.pl
#zone:poknowledge
#Magicdragon

sub EVENT_SAY
{
	if($text=~/hail/i)
	{
		$npc->SetApperance(0);
		quest::emote("sighs at $name");
		quest::say("Once upon a time, I was a very powerful Enchanter. However, during one of my Drunken rampages I slaughtered the guards in High Keep. They started to hate me so much that they would [kill] me on sight.");
	}
	if($text=~/kill/i)
	{
		$npc->SetApperance(0);
		quest::emote("shakes his fists in anger");
		quest::say("Then one of those damn nobles got me from behind. She killed me.... ME!!! I wanted to [hurt] myself!");
	}
	if($text=~/hurt/i)
	{
		$npc->SetApperance(0);
		quest::say("I went to bed that night. Sadly, in my drunken mess, I forgot that I bound my soul right there in High Keep. The guards slaughtered me over and over till I woke up and I was level 17. Now instead of KEI, all I have for you are these [crap buffs]");
	}
	if($text=~/crap buffs/i && $ulevel>=11)
	{
		$npc->SetApperance(0);
		quest::say("Yes, for someone of your level, I can cast [intellectual superiority] for 1 platnium.");
		quest::emote("begins to cry over the loss of income");
	}
	if($text=~/crap buffs/i && $ulevel<=10)
	{
		$npc->SetApperance(0);
		quest::say("Yes, fucking crap buffs. I can cast this [intellectual advancement] buff on you for 1 platnium.");
		quest::emote("begins to cry over the loss of income");
	}
	if($text=~/intellectual superiority/i)
	{
		$npc->SetApperance(0);
		quest::say("Intellectual Superiority: Increases your Effective Casting by 6, and lasts for 27 minutes. Open trade and hand me 1 platnium for the buff.");
	}
	if($text=~/intellectual advancement/i)
	{
		$npc->SetApperance(0);
		quest::say("Intellectual Advancement: Increases your Effective Casting by 3, and lasts for 27 minutes. There is an upgraded version once you come back here at level 11. Open trade and hand me 1 platnium for the buff.");
	}
}

sub EVENT_ITEM
{
	if ($platnium>=1 && $ulevel<=10)
	{
		$npc->SetApperance(0);
		quest::selfcast(2561);
		quest::say("Thanks for the donation, check with Illusionist Mindbender for some mind buffs or Vicar Qadar for health buffs.");
	}
	if($platnium>=1 && $ulevel>=11)
	{
		$npc->SetApperance(0);
		quest:selfcast(2562);
		quest::say("Thanks for the donation, check with Illusionist Mindbender for some mind buffs or Vicar Qadar for health buffs.");
	}
	else
	{
		quest::say("Thanks for the donation, but it sucked ...");
	}
}
Now I know the code kind of works, he may not say a darn thing when you hail him. But he does say "Thanks for the donation, but it sucked... no matter how much platnium you give him. So blah. Of course I just realized I spelled PLATINUM wrong.. but that still does not give a reason why his hails won't work. Please get back to me on that one. Thanks

Here is the updaded Illusionist Mindbender:

Code:
#Illusionist_Mindbender.pl
#zone:poknowledge
#Magicdragon

sub EVENT_SAY
{
	if(($text=~/hail/i))
	{
		$npc->SetApperance(0);
		quest::emote("waves at $name");
		quest::say("Welcome, welcome, I am the mighty Illusionist Mindbender and I'll happily [bend] your mind for a price");
	}
	if($text=~/bend/i && $ulevel>= 1 && $ulevel<= 14)
	{
		$npc->SetApperance(0);
		quest::say("Well my friend, your [will] is only proficient for [breeze], it will cost you 1 platnium.");
	}
	if($text=~/bend/i && $ulevel>= 15 && $ulevel<= 29)
	{
		$npc->SetApperance(0);
		quest::say("A lot of puney rats want my mind buffs, sadly their [will] is not as advanced, sadly you fall in this line and can only obtain [clarity] from me, this spell will cost you 5 platnium.");
	}
	if($text=~/bend/i && $ulevel>= 30 && $ulevel<= 45)
	{
		$npc->SetApperance(0);
		quest::say("Ha, I'd call you a Mid-be, in other words your [will] is strong enough to handle my [clarity 2] spell which still sucks. It's 10 platnium if you want it.");
	}
	if($text=~/bend/i && $ulevel>= 46 && $ulevel<= 50)
	{
		$npc->SetApperance(0);
		quest::say("Nice, you can now forget Illusionist Orange here to my right, your [will] is quite powerful enough for [KEI]. However, it will cost you 30 platnium.");
	}
	if($text=~/bend/i && $ulevel>= 51 && $ulevel<= 55)
	{
		$npc->SetApperance(0);
		quest::say("You have come to the right place friend, your [will] is capable of [tranquility]. It's better then [KEI], but does not last as long. [KEI] is still 30 platnium if you want it. [tranquility] is 35 platnium.");
	}
	if($text=~/bend/i && $ulevel>= 56 && $ulevel<= 59)
	{
		$npc->SetApperance(0);
		quest::say("Wow, your [will] is quite strong, I can sense it pulse with energy. I can offer you [VOQ] which is much better then [KEI], but does not last as long. [KEI] is still 30 platnium if you want it. [VOQ] is 40 platnium.");
	}
	if($text=~/bend/i && $ulevel>= 60)
	{
		$npc->SetApperance(0);
		quest::emote("looks quite happy");
		quest::say("FINALLY, Someone that I can respect! Your [will] is as powerful as mine. If you want [KEI] it's still 30 platnium as always. But why not take advantage of [clairvoyance]. It's much more powerful then [KEI] but doesn't last as long. I can cast it on you for just 50 platnium.");
	}
	if($text=~/will/i)
	{
		$npc->SetApperance(0);
		quest::say("I can offer [breeze] starting at level 1, [clarity] at level 15, [clarity 2] at level 30, [KEI] at level 46, [tranquility] at level 51, [VOQ] at level 56, and finally and definitely something that will keep you up at night, [clairvoyance] at level 60.");
	}
	if($text=~/breeze/i)
	{
		$npc->SetApperance(0);
		quest::say("Breeze: 4 to 6 mana per tick, and lasts 27 minutes. This spell will cost you 1 platnium.");
	}
	if($text=~/clarity/i)
	{
		$npc->SetApperance(0);
		quest::say("Clarity: 7 to 9 mana per tick, and lasts 27 minutes. You need a will of at least level 15 to handle it. This spell will cost you 5 platnium.");
	}
	if($text=~/clarity 2/i)
	{
		$npc->SetApperance(0);
		quest::say("Clarity 2: 9 to 11 mana per tick, and lasts 35 minutes. You will need a will of at least level 30 to handle it. This spell will cost you 10 platnium.");
	}
	if($text=~/KEI/i)
	{
		$npc->SetApperance(0);
		quest::say("Koadic's Endless Intelligence: Increases mana pool by 250, 14 mana per tick, +25 WIS, +25 INT, and lasts 2 hours and 30 minutes. You will need a will of at least level 46 to handle this spell. It will cost you 30 platnium.");
	}
	if($text=~/tranquility/i)
	{
		$npc->SetApperance(0);
		quest::say("Tanquility: Increases mana pool by 260, 16 mana per tick, +26INT, +26WIS, and lasts 1 hour and 20 minutes. You will need a will of at least level 51. This spell will cost you 35 platnium.");
	}
	if($text=~/VOQ/i)
	{
		$npc->SetApperance(0);
		quest::say("Voice of Quellious: Increases mana pool by 275, 18 mana per tick, +28WIS, +28INT, and lasts 1 hour and 20 minutes. You will need a will of at least 56. This spell will cost you 40 platnium.");
	}
	if($text=~/clairvoyance/i)
	{
		$npc->SetApperance(0);
		quest::say("Clairvoyance: Increases mana pool by 400, 20 mana per tick, +32WIS, +32INT, and lasts 1 hour and 20 minutes. You will need a will of at least 60. This spell will cost you 50 platnium.");
	}
}

sub EVENT_SPAWN
{
	$x = $npc->GetX();
	$y = $npc->GetY();
	quest::set_proximity($x - 90, $x + 90, $y - 90, $y + 90);
}

sub EVENT_ENTER
{
	$npc->SetApperance(1);
	my $random_result = int(rand(100));
	if($random_result<=75)
	{
		quest::shout("Casting Mind Buffs for donations on the rock behind the main bank!");
	}
	else
	{
		#Do Nothing
	}
}

sub EVENT_ITEM
{
	if($platnium>=1 && $platnium<=4 && $ulevel<=45)
	{
		$npc->SetApperance(0);
		quest::selfcast(697);
		quest::say("Thanks for the donation, check with Vicar Qadar for health buffs.");
	}
	if($platnium>=5 && $platnium<=9 && $ulevel<=45 && $ulevel>=15)
	{
		$npc->SetApperance(0);
		quest::selfcast(174);
		quest::say("Thanks for the donation, check with Vicar Qadar for health buffs.");
	}
	if($platnium>=10 && $platnium<=29 && $ulevel<=45 && $ulevel>=30)
	{
		$npc->SetApperance(0);
		quest::selfcast(1693);
		quest::say("Thanks for the donation, check with Vicar Qadar for health buffs.");
	}
	if($platnium>=30 && $platnium<=34 && $ulevel>=46)
	{
		$npc->SetApperance(0);
		quest::selfcast(2570);
		quest::say("Thanks for the donation, check with Vicar Qadar for health buffs.");
	}
	if($platnium>=35 && $platnium<=39 && $ulevel>=51)
	{
		$npc->SetApperance(0);
		quest::selfcast(3350);
		quest::say("Thanks for the donation, check with Vicar Qadar for health buffs.");
	}
	if($platnium>=40 && $platnium<=49 && $ulevel>=56)
	{
		$npc->SetApperance(0);
		quest::selfcast(3360);
		quest::say("Thanks for the donation, check with Vicar Qadar for health buffs.");
	}
	if($platnium>=50 && $ulevel>=60)
	{
		$npc->SetApperance(0);
		quest::selfcast(5522);
		quest::say("Thanks for the donation, check with Vicar Qadar for health buffs.");
	}
}
Now again, these scripts were based off AnalogX's Illusionist_Nomaad.pl scripts as a reference. Aighty, thanks a bunch
Reply With Quote
  #4  
Old 03-16-2008, 10:55 PM
Ut0pia
Sarnak
 
Join Date: Feb 2008
Posts: 72
Default

Just as a another note, AnalogX... sorry..

Correction: Angelox
Reply With Quote
  #5  
Old 03-17-2008, 12:35 AM
So_1337
Dragon
 
Join Date: May 2006
Location: Cincinnati, OH
Posts: 689
Default

Saw this in the first file: "quest:selfcast(2562);"

Need to have another colon there. "quest::selfcast(2562);"
Reply With Quote
  #6  
Old 03-17-2008, 04:36 AM
Aramid
Discordant
 
Join Date: May 2006
Posts: 356
Default

It's not working because the word Apperance is misspelled. It should be Appearance. Once I changed that it works on my system.
__________________
Random Segments of Code....
Reply With Quote
  #7  
Old 03-17-2008, 05:02 AM
Aramid
Discordant
 
Join Date: May 2006
Posts: 356
Default

Here is your Illusionist_Nomad Quest
Code:
#Illusionist_Nomaad.pl
#zone:poknowledge
#Magicdragon

sub EVENT_SAY
{
	if($text=~/hail/i)
	{
		$npc->SetAppearance(0);
		quest::emote("sighs at $name");
		quest::say("Once upon a time, I was a very powerful Enchanter. However, during one of my Drunken rampages I slaughtered the guards in High Keep. They started to hate me so much that they would [kill] me on sight.");
	}
	if($text=~/kill/i)
	{
		$npc->SetAppearance(0);
		quest::emote("shakes his fists in anger");
		quest::say("Then one of those damn nobles got me from behind. She killed me.... ME!!! I wanted to [hurt] myself!");
	}
	if($text=~/hurt/i)
	{
		$npc->SetAppearance(0);
		quest::say("I went to bed that night. Sadly, in my drunken mess, I forgot that I bound my soul right there in High Keep. The guards slaughtered me over and over till I woke up and I was level 17. Now instead of KEI, all I have for you are these [crap buffs]");
	}
	if($text=~/crap buffs/i && $ulevel>=11)
	{
		$npc->SetAppearance(0);
		quest::say("Yes, for someone of your level, I can cast [intellectual superiority] for 1 Platinum.");
		quest::emote("begins to cry over the loss of income");
	}
	if($text=~/crap buffs/i && $ulevel<=10)
	{
		$npc->SetAppearance(0);
		quest::say("Yes, fucking crap buffs. I can cast this [intellectual advancement] buff on you for 1 Platinum.");
		quest::emote("begins to cry over the loss of income");
	}
	if($text=~/intellectual superiority/i)
	{
		$npc->SetAppearance(0);
		quest::say("Intellectual Superiority: Increases your Effective Casting by 6, and lasts for 27 minutes. Open trade and hand me 1 Platinum for the buff.");
	}
	if($text=~/intellectual advancement/i)
	{
		$npc->SetAppearance(0);
		quest::say("Intellectual Advancement: Increases your Effective Casting by 3, and lasts for 27 minutes. There is an upgraded version once you come back here at level 11. Open trade and hand me 1 Platinum for the buff.");
	}
}

sub EVENT_ITEM
{
	if ($platinum >= '1' && $ulevel <= '10')
	{
		$npc->SetAppearance(0);
		quest::selfcast(2561);
		quest::say("Thanks for the donation, check with Illusionist Mindbender for some mind buffs or Vicar Qadar for health buffs.");
	}
	if($platinum >= '1' && $ulevel >= '11')
	{
		$npc->SetAppearance(0);
		quest::selfcast(2562);
		quest::say("Thanks for the donation, check with Illusionist Mindbender for some mind buffs or Vicar Qadar for health buffs.");
	}
	else
	{
		quest::say("Thanks for the donation, but it sucked ...");
	}
}
__________________
Random Segments of Code....
Reply With Quote
  #8  
Old 03-17-2008, 05:37 AM
Aramid
Discordant
 
Join Date: May 2006
Posts: 356
Default

Here's a working version of your Illusionist_Mindbender.pl

Code:
#Illusionist_Mindbender.pl
#zone:poknowledge
#Magicdragon

sub EVENT_SAY
{
	if(($text=~/hail/i))
	{
		$npc->SetAppearance(0);
		quest::emote("waves at $name");
		quest::say("Welcome, welcome, I am the mighty Illusionist Mindbender and I'll happily [bend] your mind for a price");
	}
	if($text=~/bend/i && $ulevel>= 1 && $ulevel<= 14)
	{
		$npc->SetAppearance(0);
		quest::say("Well my friend, your [will] is only proficient for [breeze], it will cost you 1 platinum.");
	}
	if($text=~/bend/i && $ulevel>= 15 && $ulevel<= 29)
	{
		$npc->SetAppearance(0);
		quest::say("A lot of puney rats want my mind buffs, sadly their [will] is not as advanced, sadly you fall in this line and can only obtain [clarity] from me, this spell will cost you 5 platinum.");
	}
	if($text=~/bend/i && $ulevel>= 30 && $ulevel<= 45)
	{
		$npc->SetAppearance(0);
		quest::say("Ha, I'd call you a Mid-be, in other words your [will] is strong enough to handle my [clarity 2] spell which still sucks. It's 10 platinum if you want it.");
	}
	if($text=~/bend/i && $ulevel>= 46 && $ulevel<= 50)
	{
		$npc->SetAppearance(0);
		quest::say("Nice, you can now forget Illusionist Orange here to my right, your [will] is quite powerful enough for [KEI]. However, it will cost you 30 platinum.");
	}
	if($text=~/bend/i && $ulevel>= 51 && $ulevel<= 55)
	{
		$npc->SetAppearance(0);
		quest::say("You have come to the right place friend, your [will] is capable of [tranquility]. It's better then [KEI], but does not last as long. [KEI] is still 30 platinum if you want it. [tranquility] is 35 platinum.");
	}
	if($text=~/bend/i && $ulevel>= 56 && $ulevel<= 59)
	{
		$npc->SetAppearance(0);
		quest::say("Wow, your [will] is quite strong, I can sense it pulse with energy. I can offer you [VOQ] which is much better then [KEI], but does not last as long. [KEI] is still 30 platinum if you want it. [VOQ] is 40 platinum.");
	}
	if($text=~/bend/i && $ulevel>= 60)
	{
		$npc->SetAppearance(0);
		quest::emote("looks quite happy");
		quest::say("FINALLY, Someone that I can respect! Your [will] is as powerful as mine. If you want [KEI] it's still 30 platinum as always. But why not take advantage of [clairvoyance]. It's much more powerful then [KEI] but doesn't last as long. I can cast it on you for just 50 platinum.");
	}
	if($text=~/will/i)
	{
		$npc->SetAppearance(0);
		quest::say("I can offer [breeze] starting at level 1, [clarity] at level 15, [clarity 2] at level 30, [KEI] at level 46, [tranquility] at level 51, [VOQ] at level 56, and finally and definitely something that will keep you up at night, [clairvoyance] at level 60.");
	}
	if($text=~/breeze/i)
	{
		$npc->SetAppearance(0);
		quest::say("Breeze: 4 to 6 mana per tick, and lasts 27 minutes. This spell will cost you 1 platinum.");
	}
	if($text=~/clarity/i)
	{
		$npc->SetAppearance(0);
		quest::say("Clarity: 7 to 9 mana per tick, and lasts 27 minutes. You need a will of at least level 15 to handle it. This spell will cost you 5 platinum.");
	}
	if($text=~/clarity 2/i)
	{
		$npc->SetAppearance(0);
		quest::say("Clarity 2: 9 to 11 mana per tick, and lasts 35 minutes. You will need a will of at least level 30 to handle it. This spell will cost you 10 platinum.");
	}
	if($text=~/KEI/i)
	{
		$npc->SetAppearance(0);
		quest::say("Koadic's Endless Intelligence: Increases mana pool by 250, 14 mana per tick, +25 WIS, +25 INT, and lasts 2 hours and 30 minutes. You will need a will of at least level 46 to handle this spell. It will cost you 30 platinum.");
	}
	if($text=~/tranquility/i)
	{
		$npc->SetAppearance(0);
		quest::say("Tanquility: Increases mana pool by 260, 16 mana per tick, +26INT, +26WIS, and lasts 1 hour and 20 minutes. You will need a will of at least level 51. This spell will cost you 35 platinum.");
	}
	if($text=~/VOQ/i)
	{
		$npc->SetAppearance(0);
		quest::say("Voice of Quellious: Increases mana pool by 275, 18 mana per tick, +28WIS, +28INT, and lasts 1 hour and 20 minutes. You will need a will of at least 56. This spell will cost you 40 platinum.");
	}
	if($text=~/clairvoyance/i)
	{
		$npc->SetAppearance(0);
		quest::say("Clairvoyance: Increases mana pool by 400, 20 mana per tick, +32WIS, +32INT, and lasts 1 hour and 20 minutes. You will need a will of at least 60. This spell will cost you 50 platinum.");
	}
}

sub EVENT_SPAWN
{
	$x = $npc->GetX();
	$y = $npc->GetY();
	quest::set_proximity($x - 90, $x + 90, $y - 90, $y + 90);
}

sub EVENT_ENTER
{
	$npc->SetAppearance(1);
	my $random_result = int(rand(100));
	if($random_result <= '75')
	{
		quest::shout("Casting Mind Buffs for donations on the rock behind the main bank!");
	}
	else
	{
		#Do Nothing
	}
}

sub EVENT_ITEM
{
	if($platinum >= '1' && $platinum <= '4' && $ulevel <= '45')
	{
		$npc->SetAppearance(0);
		quest::selfcast(697);
		quest::say("Thanks for the donation, check with Vicar Qadar for health buffs.");
	}
	if($platinum >= '5' && $platinum <= '9' && $ulevel <= '45' && $ulevel >= '15')
	{
		$npc->SetAppearance(0);
		quest::selfcast(174);
		quest::say("Thanks for the donation, check with Vicar Qadar for health buffs.");
	}
	if($platinum >= '10' && $platinum <= '29' && $ulevel <= '45' && $ulevel >= '30')
	{
		$npc->SetAppearance(0);
		quest::selfcast(1693);
		quest::say("Thanks for the donation, check with Vicar Qadar for health buffs.");
	}
	if($platinum >= '30' && $platinum <= '34' && $ulevel >= '46')
	{
		$npc->SetAppearance(0);
		quest::selfcast(2570);
		quest::say("Thanks for the donation, check with Vicar Qadar for health buffs.");
	}
	if($platinum >= '35' && $platinum <= '39' && $ulevel >= '51')
	{
		$npc->SetAppearance(0);
		quest::selfcast(3350);
		quest::say("Thanks for the donation, check with Vicar Qadar for health buffs.");
	}
	if($platinum >= '40' && $platinum <= '49' && $ulevel >= '56')
	{
		$npc->SetAppearance(0);
		quest::selfcast(3360);
		quest::say("Thanks for the donation, check with Vicar Qadar for health buffs.");
	}
	if($platinum >= '50' && $ulevel >= '60')
	{
		$npc->SetAppearance(0);
		quest::selfcast(5522);
		quest::say("Thanks for the donation, check with Vicar Qadar for health buffs.");
	}
}
__________________
Random Segments of Code....
Reply With Quote
  #9  
Old 03-17-2008, 04:40 PM
Ut0pia
Sarnak
 
Join Date: Feb 2008
Posts: 72
Default

Wow, was it just the word Appearance in all of the code? I really suck at spelling, wow I can't believe it. Where there any other errors in the code? I really do want to learn what I did wrong as I plan to do many quest scripts in the future.
Reply With Quote
  #10  
Old 03-17-2008, 09:26 PM
Aramid
Discordant
 
Join Date: May 2006
Posts: 356
Default

Quote:
Originally Posted by Ut0pia View Post
Wow, was it just the word Appearance in all of the code? I really suck at spelling, wow I can't believe it. Where there any other errors in the code? I really do want to learn what I did wrong as I plan to do many quest scripts in the future.
It turned out to be a little bit more than that. Appearance was causing the Hail's to not work, but Platinum was also misspelled. Check out the differences in sub EVENT_ITEM area to see where I made other changes.
__________________
Random Segments of Code....
Reply With Quote
  #11  
Old 03-17-2008, 11:21 PM
Ut0pia
Sarnak
 
Join Date: Feb 2008
Posts: 72
Default

Yeah, I figured that out after I posted the original scripts.

Well now that my scripts work, I want to take it a little further.

My mindbender script works very nicely, except for the fact that when you hail her, she responds to her own name. Since bend is a trigger, when she says something and since her name has the word bend in it, is there a way to script a trigger that says if something is said && player said it? I also run into this same problem with the soulbinders. Which is why I can't use "bind: as a trigger unless I change their names.

I also wanted to ask another question, but I honestly can't remember what it was, so I'll just ask it later.

Also I wanted to give credit where it is deserved. Aramid thanks a lot for correcting my scripts so that all I had to do was copy and paste. GeorgeS also helped out by helping me getting his script editor to work so I can check my syntax. But although it's not obvious here on this post, leslamarch helped me out a lot by explaining to me the uses of elsif's through private messages. He almost had both my scripts completely correctly, but Aramid beat him to it.
Reply With Quote
  #12  
Old 03-18-2008, 12:14 AM
So_1337
Dragon
 
Join Date: May 2006
Location: Cincinnati, OH
Posts: 689
Default

I have a script similar to that. I turned my girlfriend into an NPC vendor on our server, and have her use custom sayings for everyone on our server (all friends) who come up to her:

Code:
sub EVENT_SAY {
 if($text =~ /hail/i && $name =~ /Greenmistlolz/) {
  quest::say("You're so scaly! <3");
 }
 elsif($text =~ /hail/i && $name =~ /Tissirja/) {
  quest::say("My favorite cleric! <3");
 }
 elsif($text =~ /hail/i && $name =~ /Chinc/) {
  quest::say("Haha. You're hung like a five year old. Go back to playing Starcraft, we all hate you.");
 }
 elsif($text =~ /hail/i && $name =~ /Mabey/) {
  quest::say("Either step away from me, or I'm going to Rambo your throat.");
 }
 elsif($text =~ /hail/i && $name =~ /Snacko/) {
  quest::say("You're a tiny troll Jesus. Best shaman evar <3'");
 }
 elsif($text =~ /hail/i && $name =~ /Panthro/) {
  quest::say("A black panther? You effing racist.");
 }
 elsif($text =~ /hail/i) {
  quest::say("Welcome to the Order of Hasson server, how can I help you today?");
 }
}

sub EVENT_ITEM {
 if(($platinum==1) && ($gold==3) && ($silver==3) && ($copper==7)) {
  quest::selfcast(6593);
  quest::say("Hehe, enjoy!");
}
else{
  quest::say("What the hell am I supposed to do with that? Take it back. And get away from me, freak!");
  plugin::return_items(\%itemcount);
 }
}

#Submitted by Jim Mills
Edited out a few of the more harshly worded ones :P

She has a basic hail that works for anyone, and then customized ones that work for anyone with a specific name. Hope this gets you on the right track.
Reply With Quote
  #13  
Old 03-18-2008, 12:46 AM
Ut0pia
Sarnak
 
Join Date: Feb 2008
Posts: 72
Default

Yeah, but sadly that script is for specific players. But after looking at your script, it gave me an idea. This would work as long as $name can't be used for an npc name. I wonder if this would work and thus would allow the words like bend work in my script.

Code:
sub EVENT_SAY {
 if($text =~ /hail/i && $name =~ $name) {
  quest::say("I'm a stupid NPC");
It's it is doing is hail and then checking name to equal name. Well, the only way to know if this word work is a stronger understanding of the code which I lack. So yeah, I definitely have a lot more questions including the one I forgot earilier. So here they go.

1. Can $name =~ $name be used to check to make sure it's a player name and not an npc name?

2. What does ~ tell the script to do?

3. What does /i tell the script to do?

4. When you update a script, will the new script work right away without doing anything to the server? Or do you have to #repop, restart the zone, or do you always have to restart the server?

5. When you add a new npc to the database, to have him spawn, do you have to #repop, restart the zone, or do you always have to restart the server?

6. When you change specific values in a table regarding a specific npc, again, when do the changes take affect?

Well there they are, I'm asking those last three b/c it's a real pain in the butt to restart my server. I could always just figure them out on my own through trial and error. However, if someone knows that would be great, in addition, I'm a bit weary of such trial and error as the last time I did that, I somehow screwed up my server and caused my zone.exe to crash everytime someone connected. And to this day, i have no idea what I did.
Reply With Quote
  #14  
Old 03-18-2008, 01:22 AM
So_1337
Dragon
 
Join Date: May 2006
Location: Cincinnati, OH
Posts: 689
Default

Admittedly, I skimmed your post. Was checking the forums real quick before leaving for work. Saw this:
Quote:
... is there a way to script a trigger that says if something is said && player said it?
And replied. I see what you're meaning now.

1. Can $name =~ $name be used to check to make sure it's a player name and not an npc name?
Haven't tested, but that seems to be your idea, and it seems like it should work just fine. You'll have to give it a shot. However, keep reading through this post, and you might see where it's unnecessary.

2. What does ~ tell the script to do?
3. What does /i tell the script to do?
Quote:
Originally Posted by From the quest tutorial wiki
Note the /i. This means it is case insensitive. It is always better to include this.

$text =~/Hello/ - Would match "Hello", but not "hello".
$text =~/hello/ - Would match "hello", but not "Hello".
$text =~/hello/i - Would match "Hello" and "hello".
$text =~/me/ - Would match the "me" in name.
$text =~/\bme\b/ - Would not match the "me" in name. The "\b" means there must not be text next to the match so "me" must be by itself.
$text =~/^me$/i - Would only match if me is the only text said. The "^" tells it it must be the first thing said and the "$" tells it it must be the last thing.
4. When you update a script, will the new script work right away without doing anything to the server? Or do you have to #repop, restart the zone, or do you always have to restart the server?
5. When you add a new npc to the database, to have him spawn, do you have to #repop, restart the zone, or do you always have to restart the server?
6. When you change specific values in a table regarding a specific npc, again, when do the changes take affect?
Quote:
Originally Posted by Cavedude
Changes to items, loot, spells, and factions in anyway require a full server reboot.

Creating new spawns, adding doors/objects, changing merchantlists, and some quests in addition to #reloadqst also require a zone reboot.

Changing/creating NPCs only require a #repop. This includes changing their faction/loot/spell id, provided the new ID already exists and doesn't need to be created.

Most quests only require a #reloadpl, though ones that use a lot of globals or user defined variables often require a zone shutdown in addition. Thelin Poxbourne and the Nexus port scripts are two examples.

Just about everything else can be done on the fly, or has a command that does so.
And just a final thought, but is "bend" really causing him to only reply to his hail script? The trigger for that is the "hail" portion, not his name.

Last edited by So_1337; 03-18-2008 at 09:25 AM..
Reply With Quote
  #15  
Old 03-18-2008, 01:53 AM
Ut0pia
Sarnak
 
Join Date: Feb 2008
Posts: 72
Default

I had the same problem with the soulbinder. I did a script for her, but when you hailed her, she would automatically bind your soul because the trigger for binding your soul was the word "bind". When she gave her trigger for "hail", it picked up the word "bind" in her name.

Same issue is happening with my Illusionist_Mindbender. You hail her and the trigger is "hail" She says what she needs to but then the say command "bend" is triggered because she just talked and she has the word "bend" in her name.

This is why I want to try the $name =~ $name to see if $name is for players only and not npcs. Adding that as to the if statement would allow the script to check to see if it's a player saying the word and not an npc.

However, if that does not work, the alternative would be slightly editing the NPCs name so that the word Mindbender would become MindBender. Thus the case sensitive bend would not be picked up.
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 12:13 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