|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Quests::Custom Custom Quests here |
|
|
|
05-10-2011, 10:55 PM
|
Sarnak
|
|
Join Date: Jan 2010
Location: USA
Posts: 51
|
|
I used the same set up, but I can't figure out what is wrong here, can anyone help?
Code:
sub EVENT_SAY{
$client->Message(7, " ");
my $NPCName = $npc->Ram();
if($text=~/Hail/i) {
if ($ulevel <= 10) {
quest::selfcast(5415);
quest::selfcast(5312);
quest::selfcast(5405);
quest::selfcast(5409);
quest::selfcast(5521);
quest::selfcast(5365);
quest::selfcast(278);
quest::selfcast(939);
quest::selfcast(3391);
quest::selfcast(5390);
$client->Message(315, "$NPCName whispers to you, 'Since you are level 10 or lower you get free buffs, $name! Good luck to you.'");
}
if (($ulevel > 10) && ($ulevel < 25)) {
$client->Message(315, "$NPCName whispers to you, 'Hello $name, I will give you buffs in exchange for 100 platinum.'");
}
if (($ulevel >= 25) && ($ulevel < 70)) {
$client->Message(315, "$NPCName whispers to you, 'Hello $name, I will give you buffs in exchange for 500 platinum.'");
}
if ($ulevel >= 70) {
$client->Message(315, "$NPCName whispers to you, 'Hello $name, I will give you buffs in exchange for 1,000 platinum.'");
}
}
}
sub EVENT_ITEM {
$client->Message(7, " ");
my $NPCName = $npc->Ram();
if ($platinum == 1000) {
if ($ulevel >= 70) {
quest::selfcast(5278);
quest::selfcast(5415);
quest::selfcast(5312);
quest::selfcast(5405);
quest::selfcast(5409);
quest::selfcast(5521);
quest::selfcast(5365);
quest::selfcast(278);
quest::selfcast(939);
quest::selfcast(3391);
quest::selfcast(5390);
$client->Message(315, "$NPCName whispers to you, 'Thank you $name!'");
} else {
$client->Message(315, "$NPCName whispers to you, 'Use the correct amount of platinum, $name!'");
quest::givecash($copper,$silver,$gold,$platinum);
}
}
if ($platinum == 500) {
if (($ulevel < 75)&&($ulevel >= 25)) {
quest::selfcast(5278);
quest::selfcast(5415);
quest::selfcast(5312);
quest::selfcast(5405);
quest::selfcast(5409);
quest::selfcast(5521);
quest::selfcast(5365);
quest::selfcast(278);
quest::selfcast(939);
quest::selfcast(3391);
quest::selfcast(5390);
$client->Message(315, "$NPCName whispers to you, 'Thank you $name!'");
} else {
$client->Message(315, "$NPCName whispers to you, 'Use the correct amount of platinum, $name!'");
quest::givecash($copper,$silver,$gold,$platinum);
}
}
if ($platinum == 100) {
if (($ulevel > 10) && ($ulevel < 25)) {
quest::selfcast(5415);
quest::selfcast(5312);
quest::selfcast(5405);
quest::selfcast(5409);
quest::selfcast(5521);
quest::selfcast(5365);
quest::selfcast(278);
quest::selfcast(939);
quest::selfcast(3391);
quest::selfcast(5390);
$client->Message(315, "$NPCName whispers to you, 'Thank you $name!'");
} else {
$client->Message(315, "$NPCName whispers to you, 'Use the correct amount platinum, $name!'");
quest::givecash($copper,$silver,$gold,$platinum);
}
}
if (($platinum < 100) || ($platinum < 500) && ($platinum > 100) || ($platinum < 1000) && ($platinum > 100) && ($platinum > 500) || ($platinum > 1000)) {
$client->Message(315, "$NPCName whispers to you, 'Use the correct amount of platinum, $name!'");
quest::givecash($copper,$silver,$gold,$platinum);
}
}
|
|
|
|
05-10-2011, 11:16 PM
|
Demi-God
|
|
Join Date: Aug 2010
Posts: 1,742
|
|
Can you give us more details of what works and what doesn't? Have you tried slimming down the script to the bare minimum and adding additional functions one at a time to see when it breaks?
|
05-11-2011, 07:11 AM
|
Sarnak
|
|
Join Date: Jun 2006
Location: Tennessee, USA
Posts: 77
|
|
Without any details as to what's causing you the problems...
Try using:
Code:
my $NPCName = $npc->GetCleanName();
instead of:
Code:
my $NPCName = $npc->Ram();
|
05-11-2011, 07:35 AM
|
Sarnak
|
|
Join Date: Jan 2010
Location: USA
Posts: 51
|
|
Ok I'll try that, and the problem is when i hail the npc (Ram) just a blank line appears on my chat window.
|
05-11-2011, 07:38 AM
|
Sarnak
|
|
Join Date: Jun 2006
Location: Tennessee, USA
Posts: 77
|
|
Quote:
Originally Posted by Durge
Ok I'll try that, and the problem is when i hail the npc (Ram) just a blank line appears on my chat window.
|
If it still appears as a blank line, I would suggest removing everything inside of the if statement, and replacing it with a single output to test that your NPC functions.
example:
Code:
if($text=~/Hail/i) { $client->Message(315, "$NPCName whispers to you, 'Ugh... do I work?'"); }
If it works with the single line statement, in this post, and not with all of the other checks... that simply means you have an error inside of the IF bracket. Remove everything, then add one line at a time. (Remember to change your level, to the desired level that you want to check to make sure that it works.)
Usually, you will get a blank line if none of the IF brackets are triggered.
|
05-11-2011, 08:42 AM
|
Demi-God
|
|
Join Date: Aug 2010
Posts: 1,742
|
|
I would guess the blank lines come from this:
$client->Message(7, " ");
|
05-11-2011, 08:43 AM
|
Sarnak
|
|
Join Date: Jun 2006
Location: Tennessee, USA
Posts: 77
|
|
Quote:
Originally Posted by lerxst2112
I would guess the blank lines come from this:
$client->Message(7, " ");
|
That's correct... and since it isn't within the IF bracket, it will always execute as long as there isn't an error prior to that point in the script.
|
05-12-2011, 07:36 AM
|
Sarnak
|
|
Join Date: Jan 2010
Location: USA
Posts: 51
|
|
I tried even one small message and it still didn't work.
Here is what I have.
I also tried with the name you gave me and it didn't work.
Code:
sub EVENT_SAY {
$client->Message(7, " ");
my $NPCName = $npc->Ram();
my $Hello = quest::saylink("Hello", 1);
if($text=~/Hail/i) {
$client->Message(315, "$NPCName whispers to you, '[$Hello], I am a test bot.'");
}
}
|
05-12-2011, 07:41 AM
|
Sarnak
|
|
Join Date: Jun 2006
Location: Tennessee, USA
Posts: 77
|
|
After changing the quest files, are you reloading quest memory? If I remember correctly, the command is: #reload pl (I haven't worked on the Emu in a while.)
|
05-12-2011, 07:13 PM
|
Sarnak
|
|
Join Date: Jan 2010
Location: USA
Posts: 51
|
|
hmm, that didn't work either.
|
05-12-2011, 08:28 PM
|
Demi-God
|
|
Join Date: Aug 2010
Posts: 1,742
|
|
This line is wrong.
my $NPCName = $npc->Ram();
Replace with this as noted above:
my $NPCName = $npc->GetCleanName();
|
05-12-2011, 08:43 PM
|
|
Demi-God
|
|
Join Date: Nov 2007
Posts: 2,175
|
|
Quote:
Originally Posted by lich2594
After changing the quest files, are you reloading quest memory? If I remember correctly, the command is: #reload pl (I haven't worked on the Emu in a while.)
|
#reloadquest
|
05-12-2011, 10:24 PM
|
Sarnak
|
|
Join Date: Jan 2010
Location: USA
Posts: 51
|
|
Yes i know it was wrong, I had already tried with "GetCleanName" and changed it back.
|
05-12-2011, 10:27 PM
|
Demi-God
|
|
Join Date: Aug 2010
Posts: 1,742
|
|
Well, like I said before. Strip the script down to the bare minimum, no saylinks, no npc name, nothing but a simple response to the hail, and if that works add things and see where you break it.
|
05-13-2011, 12:08 PM
|
|
Demi-God
|
|
Join Date: Nov 2007
Posts: 2,175
|
|
Since this thread popped back up, I got back on finalizing my buff bot.
One thing I was never able to do is get the chanter or Cleric bot to cast spells that have a target of group v2. Spells like the Druid Skin like Nature work just fine.
I have tried combinations like these. I have in remarks what happened with each spell.
Code:
#$npc->SpellFinished(3479, $client->GetID()); #Buff bot cast virtue on herself
#$ent->CastSpell(3479, $ent, 10, -1, -1); #I cast virtue on myself
#$npc->CastSpell(3479, $ent, 10, -1, -1); #Buff bot cast virtue on herself
#$npc->CastSpell(3479, $userid); #Buff bot cast virtue on herself
Yeah I could code it to where I cast Virtue on myself but that seems really lame. Plus people will complain they did not get it, because they moved or something.
|
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 11:57 PM.
|
|
|
|
|
|
|
|
|
|
|
|
|