My first .pl
Starting my questing tradeskill out on something easy, I thought, on a soulbinder in gfay. I used Soulbinder Oakstout. Here is two texts I used off the boards and both brought on a reply to "Hail", but when I said bind my soul, nothing happens on either of the two pl's I tried.
sub EVENT_SAY { if ($text=~/Hail/i){quest::say("Greetings $name . When a hero of our world is slain. their soul returns to the place it was last bound and the body is reincarnated. As a member of the Order of Eternity. it is my duty to [bind your soul] to this location if that is your wish."); } if ($text=~/bind my soul/i) { quest::say("Very well. You will return to this spot when you die."); quest::selfcast(2049); } } #END OF FILE ZONE:GFAYDARK NPCID:54179 SOULBINDER_OAKSTOUT "and the other one" sub EVENT_SAY { if($text=~/Hail/i){quest::say("Greetings $name. When a hero of our world is slain their soul returns to the place it was last bound and the body is reincarnated. As a member of the Order of Eternity it is my duty to [bind your soul] to this location if that is your wish.");} if($text=~/bind my soul/i) { quest::say("Binding your soul. You will return here when you die."); quest::castspell($userid,2049); } } Notice I tried both ways to cast and it didnt work. Thanks. |
Does he say anything in response to [bind my soul]?
|
Try
Code:
if($text=~/bind/i) |
doesn't say anything to bind my soul, just looks at me.
|
Quote:
|
When you change the text to read as Cisyouc says, don't forget to reboot your server entirely to make sure your change takes. The server tends to cache perl files it's already ran once.
|
Well the fix Cisyouc suggested worked, but I don't even have to say anything to get bound. When I hail him he just jumps to next line of text and auto binds me. Guess that would be ok, but wonder why he binds automatically?
Also, if I have a default.pl in the /quests folder he soulbinder won't respond to hails. I have to remove default.pl before the soulbinder will work. I have file labeled as Soulbinder_Oakstout.pl, which is what it was named as when I downloaded the quest pack. Just wish the default.pl could stay in the quest folder for all the other npcs. BTW here is default.pl....... sub EVENT_SAY { if($text=~/Hail/i) {quest::say("Hello $name");} } sub EVENT_DEATH{ quest::me("falls to the ground."); } sub EVENT_ATTACK{ quest::me("charges at $name ready to attack."); } ---------------------------------------------- and here is the soulbinder pl after cisyouc's suggested fix..... sub EVENT_SAY { if ($text=~/Hail/i){quest::say("Greetings $name . When a hero of our world is slain. their soul returns to the place it was last bound and the body is reincarnated. As a member of the Order of Eternity. it is my duty to [bind your soul] to this location if that is your wish."); } if($text=~/bind/i) { quest::say("Very well. You will return to this spot when you die."); quest::selfcast(2049); } } #END OF FILE ZONE:GFAYDARK NPCID:54179 SOULBINDER_OAKSTOUT |
the NPC says "bind" and you have that for the second trigger so the NPC triggers it and the second line happens,
Yeasy fix have the NPC ask if they want there soul bound, then have that trigger as Yes, that way the yes isnt part of the text and he wont trigger it. |
Quote:
|
That or use elsif to process the Bind line.
|
I dont think elsif would help here....
|
So just change-
if($text=~/bind/i) TO if($text=~/yes/i) ? |
yes. And people will have to reply 'yes' to get bound.
|
Actually the reason hes doing both is because HAIL, SoulBINDer blah...
both hail and bind are in the test the players send the NPC. So, elsif would fix it. |
That's the reason on eqlive you have to say the phrase "bind my soul". But Perl will misinterpret it if you just try to put the phrase in there with spaces.
Try to put backslashes in front of the spaces in the regex. Code:
if($text=~/bind\ my\ soul/i) |
All times are GMT -4. The time now is 12:22 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.