|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Quests::Q&A This is the quest support section |
|
|
|
10-25-2004, 07:01 PM
|
Hill Giant
|
|
Join Date: Jan 2002
Posts: 141
|
|
1st quest file and I'm having troubles. Please help.
Hi,
I just made my first PERL script for a quest NPC. It is a modified soulbinder script that includes the options to heal HPs, cure poison and disease and finally to bind your soul. I saved the *.pl file into my eqemu\quests\zonesn\ folder on my EQEmu server. I created a NPC and used the #npcspawn create and add. The NPC respawns properly and I used #npcstats to get the NPCs ID. I got the id, so in the c:\eqemu\quests\zonesn\121095.pl 121095 is the NPCID number given to me by #npcstats. When I restarted the server and logged in the NPC was there but the script isn't running. When I hail the NPC he just faces me and does nothing. I'll list my code below. I would love to get this fixed so I can move forward making it more complex.
Also, I'm using the latest version of the CVS 6.0 release of EQEmu with Perl enabled. I also have Perl installed on the EQEmu server and it appears to be running fine. I don't get any error messages when starting up the emulator.
Code:
#Quest made by John Von Draugr 10-25-04
sub EVENT_SAY
{
if($text=~/Hail/i){quest::say("Greetings $name. I am the Qeynos Gate Healer and can offer you various services currently free of charge. As a member of the Order of Eternity it is my duty to [bind your soul] to this location if that is your wish, or to offer [healing], cure [disease], cure [poison].");}
#Binding to Point
if($text=~/bind my soul/i)
{
quest::say("Binding your soul. You will return here when you die.");
quest::castspell($userid,2049);
}
}
#Binding to Point (Alt)
if($text=~/bind/i)
{
quest::say("Binding your soul. You will return here when you die.");
quest::castspell($userid,2049);
}
}
#Full Healing
if($text=~/healing/i)
{
quest::say("Your wounds are washed away. Be well my child.");
quest::castspell($userid,13);
}
}
#Cure Disease
if($text=~/cure disease/i)
{
quest::say("I am removing the vile diseases from thy system. Be well my child.");
quest::castspell($userid,213);
}
}
#Cure Disease (Alt)
if($text=~/disease/i)
{
quest::say("I am removing the vile diseases from thy system. Be well my child.");
quest::castspell($userid,213);
}
}
#Cure Poison
if($text=~/cure poison/i)
{
quest::say("I am cleansing thy system of the noxious posions within. Be well my child.");
quest::castspell($userid,203);
}
}
#Cure Poison (Alt)
if($text=~/poison/i)
{
quest::say("I am cleansing thy system of the noxious posions within. Be well my child.");
quest::castspell($userid,203);
}
}
__________________
John Von Draugr
|
|
|
|
10-25-2004, 07:28 PM
|
Hill Giant
|
|
Join Date: Jan 2002
Posts: 141
|
|
I had a thought and just wanted to post it in case it makes a difference. After installing Perl on my XP machine (Server for EQEmu) I don't have to run any files from within the PERL directories right?
__________________
John Von Draugr
|
|
|
|
10-25-2004, 07:45 PM
|
Fire Beetle
|
|
Join Date: May 2004
Posts: 14
|
|
You had about 5 or 7 closing curly brackets too many, and npcs generally cannot cast beneficial spells on players.
Therefore, use quest::selfcast(spellid);
Code:
#Quest made by John Von Draugr 10-25-04
sub EVENT_SAY
{
if($text =~ /Hail/i)
{
quest::say("Greetings $name. I am the Qeynos Gate Healer and can offer you various services currently free of charge. As a member of the Order of Eternity it is my duty to [bind your soul] to this location if that is your wish, or to offer [healing], cure [disease], cure [poison].");
}
#Binding to Point
if($text =~ /bind my soul/i)
{
quest::say("Binding your soul. You will return here when you die.");
quest::castspell($userid,2049);
}
#Binding to Point (Alt)
if($text =~ /bind/i)
{
quest::say("Binding your soul. You will return here when you die.");
quest::castspell($userid,2049);
}
#Full Healing
if($text =~ /healing/i)
{
quest::say("Your wounds are washed away. Be well my child.");
quest::selfcast(13);
}
#Cure Disease
if($text =~ /cure disease/i)
{
quest::say("I am removing the vile diseases from thy system. Be well my child.");
quest::selfcast(213);
}
#Cure Disease (Alt)
if($text =~ /disease/i)
{
quest::say("I am removing the vile diseases from thy system. Be well my child.");
quest::selfcast(,213);
}
#Cure Poison
if($text =~ /cure poison/i)
{
quest::say("I am cleansing thy system of the noxious posions within. Be well my child.");
quest::selfcast(203);
}
#Cure Poison (Alt)
if($text =~ /poison/i)
{
quest::say("I am cleansing thy system of the noxious posions within. Be well my child.");
quest::selfcast(203);
}
}
The_Horrid
|
|
|
|
10-25-2004, 08:17 PM
|
Hill Giant
|
|
Join Date: Jan 2002
Posts: 141
|
|
Hi,
I cut & Pasted the changes you made to the code, but I'm still having the same issue. I checked my zone.exe and it says
Loading embedded perl
Loading perlemb plugins
So, the zones are loading with PERL enabled, but the NPC is still not responding to my hails or speech, except for turning to face me when I hail them. Is there another command in game that I have to give a NPC that will have a Perl Quest script attached? Sort of initializing the NPC to use the perl script? From what I read, you just make an NPC then attach a .pl file in hte zonesn folder with the pl file having the filename of the NPCs ID.
__________________
John Von Draugr
|
10-25-2004, 08:30 PM
|
Fire Beetle
|
|
Join Date: May 2004
Posts: 14
|
|
This is not the actual path you are using correct? :
Code:
c:\eqemu\quests\zonesn\
If it is, you need to replace "zonesn' with the shortname of the zone that quest is in. (and be sure to create that folder as well.)
Example.. quest is for an npc in Nexus, thus your path for ALL Nexus .pls is:
Code:
c:\eqemu\quests\nexus\
Just verify that you are using the correct shortnames for those folders in ...\quest.
The_Horrid
|
10-26-2004, 03:33 AM
|
Hill Giant
|
|
Join Date: Jan 2002
Posts: 141
|
|
Yes, I have the .pl file in c:\eqemu\quests\qeynos2 for North Qeynos. I did have it in qeynos as I got the two zone names mixed up. I corrected the folder name to qeynos2 and restarted the emulator. Still same thing as above :( Also, when I add new quests or modify current ones, do I have to reboot the server all the time as I have been doing or will a #repop command make the NPCs respawn and then the quests would work? I've tried both but no difference. Just wanted to ask that to see if the process of having to restart world and zone.exe everytime isn't necessary.
Thanks
John
__________________
John Von Draugr
|
10-26-2004, 03:36 AM
|
Dragon
|
|
Join Date: May 2003
Posts: 539
|
|
#reloadqst will refresh the quests.
|
10-26-2004, 03:53 AM
|
Hill Giant
|
|
Join Date: Jan 2002
Posts: 141
|
|
Thanks Muuss. I tried that just in case it made a difference. Sadly, the command worked, but the quest still doesn't. :(
__________________
John Von Draugr
|
10-26-2004, 04:00 AM
|
Dragon
|
|
Join Date: May 2003
Posts: 539
|
|
Try this quest, when you'll make it working, start adding slowly some new stuff. When it stops to work, it means you made a mistake, search and correct it, then start again, that's the best way to learn )
Code:
sub EVENT_SAY {
if($text =~ /Hail/i) { quest::say("You said hail!"); }
}
|
10-26-2004, 04:24 AM
|
Hill Giant
|
|
Join Date: Jan 2002
Posts: 141
|
|
Ok, I did what you suggested and it was a good suggestion. I got the following to work so far.
Code:
sub EVENT_SAY
{
if($text =~ /Hail/i)
{
quest::say("Greetings $name. I am the Qeynos Gate Healer and can offer you various services currently free of charge. As a member of the Order of Eternity it is my duty to [bind your soul] to this location if that is your wish, or to offer [healing], cure [disease], or cure [poison].");
}
But, then I went and added this and when I type bind, still nothing happens.
Code:
#Binding to Point
if($text =~ /bind/i)
{
quest::say("Binding your soul. You will return here when you die.");
quest::castspell($userid,2049);
}
Any idea why that isn't working?
__________________
John Von Draugr
|
|
|
|
10-26-2004, 04:40 AM
|
Hill Giant
|
|
Join Date: Jan 2002
Posts: 141
|
|
I'm actually getting it to work now. What I did was take the code you gave me and just cut and paste the text and cast info into it. I checked over and over, but my pl seems to be the exact same format as the one that I used to start from yours. Not sure why it wasn't working, but the script is starting to work great now. Thanks to all of you who helped me along the way with this issue. I'm sure I'll be posting more here as I have some heavy scripts to build next. Ex: A healer that when a player goes up to he is offered If he would like:
1. Minor Healing (1gp) (NOTE price is not final, just for example)
2. Greater Healing (1pp)
3. Complete Healing. (This is where it gets hard.) (I want it that the script checks the level of the player asking for Complete Healing then muliplies their level against the base fee. So, a Level 24 warrior, wizard, bard, etc... would ask for Complete Healing and the script would say "Complete healing is 5gp base price. 5gp*24lv= 120gp. The NPC would then tell the player that it will require 120gp to completely heal him. The player then has to give the NPC 120gp to get Completely healed. I'm not sure how this part works. Do you just select 120gp and give it to the NPC? Should the NPC just say it will cost 120gp, do you wish to pay? And if the player says "YES" then 120gp is removed from their backpack and they are healed?
There is a lot that is going to have to go into this part. I'm sure I'll be posting questions along the way.
Thanks again to all who have helped me.
John
__________________
John Von Draugr
|
|
|
|
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 05:36 AM.
|
|
|
|
|
|
|
|
|
|
|
|
|