|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Quests::Custom Custom Quests here |
|
|
|
03-29-2011, 10:33 PM
|
Sarnak
|
|
Join Date: May 2008
Location: california
Posts: 45
|
|
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);
}
}
|
|
|
|
03-29-2011, 11:04 PM
|
Dragon
|
|
Join Date: May 2010
Posts: 965
|
|
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);
}
}
}
|
03-29-2011, 11:21 PM
|
Sarnak
|
|
Join Date: May 2008
Location: california
Posts: 45
|
|
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.
|
|
|
|
03-30-2011, 12:03 AM
|
Sarnak
|
|
Join Date: May 2008
Location: california
Posts: 45
|
|
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);
}
}
|
|
|
|
03-30-2011, 12:37 AM
|
Demi-God
|
|
Join Date: Aug 2010
Posts: 1,742
|
|
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.
|
03-30-2011, 12:44 AM
|
Sarnak
|
|
Join Date: May 2008
Location: california
Posts: 45
|
|
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
|
03-30-2011, 08:59 AM
|
Dragon
|
|
Join Date: May 2010
Posts: 965
|
|
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.
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 03:57 PM.
|
|
|
|
|
|
|
|
|
|
|
|
|