|
|
 |
 |
 |
 |
|
 |
 |
|
 |
 |
|
 |
|
Archive::Quests Archive area for Quests's posts that were moved here after an inactivity period of 90 days. |
 |
|
 |

05-13-2004, 06:03 PM
|
Discordant
|
|
Join Date: May 2004
Location: The DeathStar of David
Posts: 337
|
|
Zone Crash on quest execute.
When i load this script and hand in anything but 100pp zone.exe crashes. any ideas on why? i have a feeling its in
Code:
if(($myplatinum = 100) && ($mygold = 0) && ($mysilver = 0) && ($mycopper = 0))
Code:
sub EVENT_SAY
{
if($mname=~ /^Soulbinder/i)
{
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 you are an adventurer and are in need of a heal, perhaps you could help to fill my coin purse in exchange for heal? Nothing to extreme just give me a [Healing emblem] and i shall heall all your wounds.");
}
if($text=~/bind my soul/i)
{
quest::say("Binding your soul. You will return here when you die.");
quest::castspell($userid,2049);
}
if($text=~/Healing Emblem/i)
{
quest::say("Yes, yes a healing emblem, don't have have one? well.. for a small fee i can give you one, nothing to much, lets say 100pp per emblem, only in platinum please? No? well fine you can make the trip to the nexus then, our leader resides there he sells the emblems, go buy one from him, otherwise you have to pay my price.")
}
}
}
sub EVENT_ITEM
{
if($mname=~ /^Soulbinder/i)
{
if($itemcount{18700} && $itemcount{18700} == 1)
##changed item to tome of discord incase anyone wants to try it on their server to try to debug.
{
quest::say("A Healing Emblem? Very well got one heal comming your way!");
quest::castspell($userid,13);
}
$myplatinum = ($platinum);
$mygold = ($gold);
$mysilver = ($silver);
$mycopper = ($copper);
if(($myplatinum = 100) && ($mygold = 0) && ($mysilver = 0) && ($mycopper = 0))
{
quest::say("Very good, here you are, One Healing Emblem, just hand it back to me when you
are in need of a heal");
quest::summonitem(18700,1);
}
else
{
quest::say("I said 100 platinum, in Platinum coins only, Here take back your money");
quest::givecash($mycopper,$mysilver,$mygold,$myplatinum);
}
}
}
Handing him 100 pp results in the item, and handing the item results in a CH, this part works. but if i hand in any other coin combo it should say no and hand back the money, but zone is crashing, just wondering if anyone has any ideas on why its crashing, and secondly , i used the new may 12th code and the EVENT_ITEM section of this script didn't work in anyway, the text did but handing in any items didn't result in anything, any ideas on this as well? Thanks all for the help =)
__________________
Mess with the Jews, and we will take all your money
Grunties Rule
And with that... I end
Any Other Questions, please refer to the Following:
http://iliilllli1.netfirms.com
|
 |
|
 |

05-13-2004, 07:21 PM
|
Sarnak
|
|
Join Date: Apr 2004
Location: West Sacramento, CA
Posts: 84
|
|
Just a thought...
Code:
if(($myplatinum = 100) && ($mygold = 0) && ($mysilver = 0) && ($mycopper = 0))
Should be:
Code:
if(($myplatinum == 100) && ($mygold == 0) && ($mysilver == 0) && ($mycopper == 0))
Again, that's just my guess... Be sure to let me know! :P
|

05-13-2004, 08:23 PM
|
Discordant
|
|
Join Date: May 2004
Location: The DeathStar of David
Posts: 337
|
|
hmm again i forget how important a syntax is.. strange though, i didn't get any compiling errors when starting zone.exe, however iw ill try this edit and report back to ya =)
__________________
Mess with the Jews, and we will take all your money
Grunties Rule
And with that... I end
Any Other Questions, please refer to the Following:
http://iliilllli1.netfirms.com
|

05-13-2004, 08:28 PM
|
Discordant
|
|
Join Date: May 2004
Location: The DeathStar of David
Posts: 337
|
|
aswome it worked, thanks, however for some reason when i am giving the item in i still get the message saying i only asked for 100pp so i need to change the code around a bit, hmm anyway thanks for the help =)
What is the syntax for somthing does not equal, like if $variable1 *doesnot equal* 100, how would i do this? perhaps i could make it work for me!
__________________
Mess with the Jews, and we will take all your money
Grunties Rule
And with that... I end
Any Other Questions, please refer to the Following:
http://iliilllli1.netfirms.com
|

05-14-2004, 12:15 AM
|
Dragon
|
|
Join Date: Jan 2004
Posts: 860
|
|
It is syntavtiavlly correct to do it with jsut = like you had,but it will not do what you want and was crashing because of how you used the single =. != == not equals 
|

05-14-2004, 03:56 AM
|
Discordant
|
|
Join Date: Jun 2003
Location: England
Posts: 267
|
|
What I always do before putting a quest on , is open a cmd window , go to the directory of quests, and type *.pl
Start > Run > cmd
dir EQEmu\quests
questname.pl
That checks to make sure the quest works ... yummy
__________________
;o)
|

05-14-2004, 04:07 AM
|
Hill Giant
|
|
Join Date: Dec 2003
Posts: 166
|
|
= is the assignment operator, == is the equality operator
It's somewhat common to write:
Code:
if(($myplatinum == 100) && ($mygold == 0) && ($mysilver == 0) && ($mycopper == 0))
as:
Code:
if((100 == $myplatinum) && (0 == $mygold) && (0 == $mysilver) && (0 == $mycopper))
so that if you make a typo (ie: 100 = $myplatinum) it will give an error.
Not too sure why it was crashing. Your if-statement should have always evaluated to false, and executed the "quest::givecash($mycopper,$mysilver,$mygold,$mypl atinum);" part, I think. Maybe $mysilver and $mycopper were undef, and passing those back caused the crash?
|
 |
|
 |

05-14-2004, 04:53 AM
|
Sarnak
|
|
Join Date: Apr 2004
Location: West Sacramento, CA
Posts: 84
|
|
I also thought that the code should have evaluated to false. That's why I was unsure if my suggestion would actually fix it since it was (sorta) working.
= assigns a value
== checks equality
!= not equal
I agree with M0oni9 - by reversing the variable and value, you can easily make sure that it your code is correct because you can never assign a value to a number. maybe a typo, but might not be flagged as an error, where is both a typo AND an error.
I also agree with Dave987 - always run the Perl script from the command line to check for bugs - easier to spot and fix there.
About your turn in code:
Code:
if($itemcount{18700} && $itemcount{18700} == 1)
could be changed to
Code:
if($itemcount{18700} == 1)
When learning to work with the quest system, most of the quests that were already completed use the second example and that's what I've been using while setting up my custom quests.
Anyway, good luck!
~Gandar
|
 |
|
 |

05-14-2004, 11:44 AM
|
Discordant
|
|
Join Date: May 2004
Location: The DeathStar of David
Posts: 337
|
|
Cool thanks all for the info, it doesn't crash now, only part i am having issue with is i keep getting the msg saying i only want 100pp in plat take back you money when i hand in the item, i am going to try using a statment where if something doesn't equal this, i.e if((100 != $myplatinum)){quest::say("i only want 100pp in Plat only, take back your money); problem is i need to make it so it will ignore any item turn ins, becuase even using this will still return the fact that i am giving him 0 plat and 0 != 100 so... hmm
__________________
Mess with the Jews, and we will take all your money
Grunties Rule
And with that... I end
Any Other Questions, please refer to the Following:
http://iliilllli1.netfirms.com
|

05-14-2004, 12:15 PM
|
Sarnak
|
|
Join Date: Apr 2004
Location: West Sacramento, CA
Posts: 84
|
|
Hmm - another suggestion...
That else at the end seems to be catching everything, including your item turn in (because it's not 100 pp! ) try changing it to elsif.
I'm going to load your script onto my Soulbinder and test it pretty quick - I'll let you know if it doesn't work.
Wish me luck! :P
~Gandar
Edit: Nevermind - I'll still test it, though, and see if I can figure it out - elsif isn't the way to go, I'm not sure what I was thinking
|

05-14-2004, 01:13 PM
|
Discordant
|
|
Join Date: May 2004
Location: The DeathStar of David
Posts: 337
|
|
hehe tried it, got same problem, i need to find a way to make it so it says
Code:
if i give you 100pp
give me item
If i don't give you 100pp but i give you this item then
heal me and stfu
if i don't give you 100pp but i give you 100gp, then
give back my 100gp say you want 100pp
etc....
however i am getting
Code:
if i give you 100pp then
you give me item
if i don't give you 100pp but i give you item then
you take item heal me then say you want 100pp
if i don't give you 100pp but give you 100gp then
you give me my 100gp back and say you want 100pp
Go IF/Then Statments!
__________________
Mess with the Jews, and we will take all your money
Grunties Rule
And with that... I end
Any Other Questions, please refer to the Following:
http://iliilllli1.netfirms.com
|

05-14-2004, 01:49 PM
|
Hill Giant
|
|
Join Date: Dec 2003
Posts: 166
|
|
I haven't checked the accuracy of this, but the variables ($platinum, etc) may be undefined. If that is true, the following may help you out (replace your current four lines). It will assure that none of the $myMONEY variables are undefined.
Code:
$myplatinum = (defined($platinum) ? $platinum : 0);
$mygold = (defined($gold) ? $gold : 0);
$mysilver = (defined($silver) ? $silver : 0);
$mycopper = (defined($copper) ? $copper : 0);
edit: I didn't thoroughly read your problem! I think that all you should need to do is add a condition (on the "if ($itemcount.." line) to see if they handed any money also. After you've healed then, you could just return from the sub.
|
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 10:13 AM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |