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

Quests::Custom Custom Quests here

Reply
 
Thread Tools Display Modes
  #1  
Old 03-29-2011, 10:33 PM
deaddraqear
Sarnak
 
Join Date: May 2008
Location: california
Posts: 45
Default Custom race/class quest

If I was wanting to create a NPC strictly for barbarians to change classes, (getting rid of berserker and adding ranger), how would I do this? My first experiment failed, as the npc will allow any race and class to change to one of the four classes, and there is no change in his dialogue. (was hoping he would tell an erudite for example to go find his own race etc)

If anyone would help me out, correct my mistakes, I would greatly appreciate it. Thank you in advance =)

Code:
#############
#Quest Name: Barbarian Class Choice
#Author: KMFW
#NPCs Involved: 1
#Items Involved: 0
#################
###NPC 1
#Name: Renth_McLanis
#Race: N/A
#Location: N/A
#Level: N/A
#Type: N/A
#Loot: N/A
#############

sub EVENT_SAY
	{
	if($text=~/hail/i)
		{
		if($$class ne 'Berserker')

#Allows the following: ($race == 'Barbarian')
			{
			quest::say("Hello $name, I am Renth McLanis. I was sent here from our home to make sure our fellow barbarians are training where they should. We support the following classes: Ranger, Rogue, Shaman and Warrior. If you are not one of these, you will have to change classes before you are allowed to advance.");
			}
		else
			{
			quest::say("Greetings $race. I'm sorry to be blunt, but I can do nothing for you. Perhaps you should seek out your proper race.");
			}
		}
	if($text=~/warrior/i)
		{
		quest::permaclass(1);
		}
	if($text=~/ranger/i)
		{
		quest::permaclass(4);
		}
	if($text=~/rogue/i)
		{
		quest::permaclass(9);
		}
	if($text=~/shaman/i)
		{
		quest::permaclass(10);
		}
	}
Reply With Quote
  #2  
Old 03-29-2011, 11:04 PM
sorvani
Dragon
 
Join Date: May 2010
Posts: 965
Default

completely untested, but you had a couple logic errors and a double $$ one time.

Code:
sub EVENT_SAY
	{
	if($race == 'Barbarian')
		{
		if($text=~/hail/i)
			{
			quest::say("Hello $name, I am Renth McLanis. I was sent here from our home to make sure our fellow barbarians are training where they should. We support the following classes: Ranger, Rogue, Shaman and Warrior. If you are not one of these, you will have to change classes before you are allowed to advance.");
			}
		else
			{
			quest::say("Greetings $race. I'm sorry to be blunt, but I can do nothing for you. Perhaps you should seek out your proper race.");
			}
		if($text=~/warrior/i)
			{
			quest::permaclass(1);
			}
		if($text=~/ranger/i)
			{
			quest::permaclass(4);
			}
		if($text=~/rogue/i)
			{
			quest::permaclass(9);
			}
		if($text=~/shaman/i)
			{
			quest::permaclass(10);
			}
		}
	}
Reply With Quote
  #3  
Old 03-29-2011, 11:21 PM
deaddraqear
Sarnak
 
Join Date: May 2008
Location: california
Posts: 45
Default

Hrmm, didn't notice the $$ (was copy/pasting a bit).. Thx for pointing mistakes out =)

It honestly works just like it did before tho, allows any race/class to change and no difference in text being any race. Was hoping he'd only talk to me if i was a barb pretty much.
Reply With Quote
  #4  
Old 03-30-2011, 12:03 AM
deaddraqear
Sarnak
 
Join Date: May 2008
Location: california
Posts: 45
Default

Ok, after playing with it for a few minutes, I got him to respond to hail accordingly, (telling me to look for my race if anything but barbarian), but if I just say "warrior", he still changes me, regardless of race..

Code:
sub EVENT_SAY
	{
	if($text=~/hail/i)
		{
		if($race ne 'Iksar' && $race ne 'Troll' && $race ne 'Ogre' &&  $race ne 'Dark Elf' && $race ne 'Froklok' && $race ne 'Gnome' && $race ne 'Vah Shir' && $race ne 'Human' && $race ne 'Erudite' && $race ne 'Wood Elf' && $race ne 'High Elf' && $race ne 'Half Elf' && $race ne 'Dwarf' && $race ne 'Halfling' && $race ne 'Drakkin')

#Allows the following: ($race == 'Barbarian')
			{
			quest::say("Hello $name, I am Renth McLanis. I was sent here from our home to make sure our fellow barbarians are training where they should. We support the following classes: Ranger, Rogue, Shaman and Warrior. If you are not one of these, you will have to change classes before you are allowed to advance.");
			}
		else
			{
			quest::say("Greetings $race. I'm sorry to be blunt, but I can do nothing for you. Perhaps you should seek out your proper race.");
			}
		}
	if($text=~/warrior/i)
		{
		quest::permaclass(1);
		}
	if($text=~/ranger/i)
		{
		quest::permaclass(4);
		}
	if($text=~/rogue/i)
		{
		quest::permaclass(9);
		}
	if($text=~/shaman/i)
		{
		quest::permaclass(10);
		}
	}
Reply With Quote
  #5  
Old 03-30-2011, 12:37 AM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,742
Default

You have a class check for the hail response, but no class check on any of the other options. That's why anyone can say the proper word and change class.

That also seems like a rather roundabout way of limiting the class, but that's up to you.
Reply With Quote
  #6  
Old 03-30-2011, 12:44 AM
deaddraqear
Sarnak
 
Join Date: May 2008
Location: california
Posts: 45
Default

I agree on the roundabout thing.. (first time I've ever messed with scripting) Working on setting the class checks now, but somewhere I missed something and npc changed my class upon hailing so starting over..

I originally wanted 1 npc that could change race/class dependent on what I want, not every race/class. (ie, barb = rogue/war/shm/rang, de = bard etc)

Would you happen to know how to accomplish this?

Well, got it working now =) Thx for shoving me in the right directions I was needing.

Last edited by deaddraqear; 03-30-2011 at 01:19 AM.. Reason: fixed
Reply With Quote
  #7  
Old 03-30-2011, 08:59 AM
sorvani
Dragon
 
Join Date: May 2010
Posts: 965
Default

Go back to my script and change the race check to use 'eq' instead of '=='?

I've barely started pkaying with quests myself so my code syntax may be wrong. But the logic in mine should wrap everything in the barbarian if statement.
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 03:57 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3