Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #1  
Old 12-28-2010, 11:55 PM
Huppy's Avatar
Huppy
Demi-God
 
Join Date: Oct 2010
Posts: 1,332
Default Trying to fix Exploit in buff script

This buff bot script works perfect except for one little glitch.
Normally it won't cast the gallantry on any toon lower than 61.
As long as the toon that hails the npc is 61+, it will cast either
single or group buff. BUT, if that same 61+ toon lets a lower
level toon in the group, that lower toon will also get the gallantry.
Is there a way the script can check all the toons in the group,
to see that they are all 61+, before casting the gallantry ?
Even if the npc doesn't cast at all with the lower toon in group.

sub EVENT_SAY {
if(($text=~/hail/i)&&($ulevel<=60)){
quest::say("Sorry $name, your level is too low for my buffs.");
}
elsif(($text=~/hail/i)&&($ulevel=>61)){
my $Group = $client->GetGroup();
if($Group) {
$Group->CastGroupSpell($npc, 18323)
}
else {
my $GetPlayerID = $client->GetID();
quest::selfcast(1824;
}
quest::say("Incoming Gallantry for $name");
}
}
Reply With Quote
  #2  
Old 12-29-2010, 12:44 AM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,498
Default

You may be looking for something like this? (Not tested)

Code:
sub EVENT_SAY {
  if (($text=~/hail/i) && ($ulevel<=60)) {
    quest::say("Sorry $name, your level is too low for my buffs.");
  }
  elsif (($text=~/hail/i) && ($ulevel=>61)) {
    my $Group = $client->GetGroup();
    if ($Group) {
      my $Valid = 1;
      for ($count = 0; $count < $Group->GroupCount(); $count++) {
        if ($Group->GetMember($count)-GetLevel() < 61) {
          $Valid = 0;
         }
      }
      if ($Valid == 1) {
        quest::say("Incoming Gallantry for $name's group.");
        $Group->CastGroupSpell($npc, 18323);
      }
      else {
        quest::say("Sorry $name, someone's level in your group is too low for my buffs.");
      }
    }
    else {
      quest::say("Incoming Gallantry for $name");
      quest::selfcast(18248);
    }
  }
}
Reply With Quote
  #3  
Old 12-29-2010, 03:01 AM
Huppy's Avatar
Huppy
Demi-God
 
Join Date: Oct 2010
Posts: 1,332
Default

Quote:
Originally Posted by joligario View Post
You may be looking for something like this? (Not tested)

Code:
sub EVENT_SAY {
  if (($text=~/hail/i) && ($ulevel<=60)) {
    quest::say("Sorry $name, your level is too low for my buffs.");
  }
  elsif (($text=~/hail/i) && ($ulevel=>61)) {
    my $Group = $client->GetGroup();
    if ($Group) {
      my $Valid = 1;
      for ($count = 0; $count < $Group->GroupCount(); $count++) {
        if ($Group->GetMember($count)-GetLevel() < 61) {
          $Valid = 0;
         }
      }
      if ($Valid == 1) {
        quest::say("Incoming Gallantry for $name's group.");
        $Group->CastGroupSpell($npc, 18323);
      }
      else {
        quest::say("Sorry $name, someone's level in your group is too low for my buffs.");
      }
    }
    else {
      quest::say("Incoming Gallantry for $name");
      quest::selfcast(18248);
    }
  }
}
Thank you joligario. I was just testing this out. The script will cast a single
buff on a toon 61+ when he's not grouped, and also give the "too low"
message to a lower toon that hails, but it won't cast the group buff, or
give any response, no matter what level the toons are in the group.
If the lower toon in the group hails, it gives the right message, but if the
61 toon hails, the npc won't cast or give any response.
I tried it with group toons, lvl 61 and 62, and the npc would not respond
or cast either.
Reply With Quote
  #4  
Old 12-29-2010, 03:48 AM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,742
Default

This line looks wrong to me:

if ($Group->GetMember($count)-GetLevel() < 61) {

Should be:

if ($Group->GetMember($count)->GetLevel() < 61) {

I think.
Reply With Quote
  #5  
Old 12-29-2010, 04:30 AM
Huppy's Avatar
Huppy
Demi-God
 
Join Date: Oct 2010
Posts: 1,332
Default

Quote:
Originally Posted by lerxst2112 View Post
This line looks wrong to me:

if ($Group->GetMember($count)-GetLevel() < 61) {

Should be:

if ($Group->GetMember($count)->GetLevel() < 61) {

I think.
Yes lerxst2112 , you were right. I changed it to -> and the whole script
works absolutely perfect
Thanx again you guys, this one is awesome.

**EDIT**
Just thought I would add something I noticed, which is not a concern of mine.
But just in case others want to know, I tested this out with a low toon and
a 61+ toon grouped together, but left the low toon in a different zone, just
to see what the buff npc would do when hailed by the 61+ toon.
The npc would not respond to hail or do any casting. But as soon as I disbanded
the npc casted when hailed. I guess this wouldn't be a problem for anyone,
unless someone was innocently grouped with a low toon in another zone ( maybe
a druid that ported someone and forgot to disband)
and did not know why the npc is not casting or responding. (chuckle)

Last edited by Huppy; 12-29-2010 at 05:27 AM.. Reason: new info
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 10:49 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3