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 09-11-2017, 04:53 AM
phentop
Sarnak
 
Join Date: Jul 2010
Location: Army
Posts: 36
Default NPC Buff station - Group error

I found this buff script here on the forums. I edited a small portion to remove the higher levels that were added. It works great when your out of a group, but will not work when your in a group. Any help is appreciated.

@SpellName10 = ("Center", "Spirit of Bear", "Feet like Cat", "Dextrous Aura", "Strengthen", "Quickness", "Breeze", "Spirit of Wolf", "Shield of Brambles", "Complete Heal");
@SpellName20 = ("Daring", "Turtle Skin", "Spirit of Cat", "Protection of Rock", "Spirit Strength", "Alacrity", "Clarity", "Spirit of Wolf", "Shield of Spikes", "Complete Heal");
@SpellName30 = ("Bravery", "Spirit of Ox", "Spirit of Cat", "Rising Dexterity", "Raging Strength", "Augmentation", "Clarity II", "Spirit of the Shrew", "Shield of Thorns", "Complete Heal");
@SpellName40 = ("Valor", "Health", "Nimble", "Deftness", "Furious Strength", "Celerity", "Boon of the Clear Mind", "Pack Spirit", "Legacy of Spike", "Complete Heal");
@SpellName50 = ("Blessing of Temperance", "Stamina", "Agility", "Dexterity", "Strength", "Swift like the Wind", "Gift of Pure Thought", "Spirit of Eagle", "Shield of Blades", "Complete Heal");
@SpellName60 = ("Aegolism", "Talisman of the Brute", "Talisman of the Cat", "Mortal Deftness", "Talisman of the Rhino", "Augment", "Koadic's Endless Intellect", "Spirit of Eagle", "Legacy of Thorn", "Complete Heal");
@SpellName65 = ("Virtue", "Focus of the Seventh", "Sylvan Infusion", "Protection of the Nine", "Visions of Grandeur", "Tranquility", "Circle of Seasons", "Spirit of Eagle", "Shield of Bracken", "Complete Heal");
@SpellName70 = ("Hand of Virtue", "Talisman of Wunshi", "Chlorotrope", "Steeloak Skin", "Vallon's Quickening", "Clairvoyance", "Protection of Seasons", "Flight of Eagles", "Nettle Shield", "Complete Heal");


@spellID10 = ("219", "279", "269", "266", "40", "39", "697", "278", "46", "129", "13");
@spellID20 = ("89", "283", "148", "2512", "147", "170", "174", "278", "46", "432", "13");
@spellID30 = ("244", "149", "148", "349", "151", "10", "1693", "4054", "356", "13");
@spellID40 = ("312", "161", "160", "152", "153", "171", "1694", "169", "1727", "13");
@spellID50 = ("4053", "158", "154", "157", "159", "172", "1695", "2517", "1560", "13");
@spellID60 = ("1447", "1580", "1579", "1596", "1581", "1729", "2570", "2517", "1561", "13");
@spellID65 = ("3467", "3397", "4883", "3234", "1710", "3350", "2519", "2517", "3448", "13");
@spellID70 = ("3479", "5415", "5355", "5352", "3178", "5513", "3444", "3185", "5358", "13");



sub EVENT_SAY
{
my $Buff = quest::saylink("buffs", 1);
my $heal = quest::saylink("heal", 1);
my $cure = quest::saylink("cure", 1);
my $speed = quest::saylink("speed", 1);
my $KEI = quest::saylink("KEI", 1);
my $NPCName = $npc->GetCleanName();
my $total = 11;
my $n = 0;
my $Group = $client->GetGroup();

if($text=~/Hail/i)
{
$client->Message(315, "$NPCName whispers to you, 'Hello, $name. Do you need $Buff? If you're in a Group you will get Group Buffs, if you're alone you will get Solo Buffs. Or maybe you need a $cure, $speed, $KEI, or a $heal?'");
}

if($text=~/Heal/i)
{
quest::selfcast(13);
$client->Message(315, "$NPCName whispers to you, 'You have been healed! Enjoy!'");
}

if($text=~/Cure/i)
{
quest::selfcast(11274);
$client->Message(315, "$NPCName whispers to you, 'You have been cured! Enjoy!'");
}

if($text=~/Speed/i)
{
quest::selfcast(1212);
$client->Message(315, "$NPCName whispers to you, 'Enjoy!'");
}

if($text=~/KEI/i)
{
quest::selfcast(2570);
$client->Message(315, "$NPCName whispers to you,' Enjoy!");
}

if($text=~/Buffs/i)
{
if($Group)
{

if($ulevel<=10)
{

$Group->CastGroupSpell($npc, $_) for @spellID10;
}

if($ulevel>=11 && $ulevel<=20)
{

$Group->CastGroupSpell($npc, $_) for @spellID20;
}

if($ulevel>=21 && $ulevel<=30)
{

$Group->CastGroupSpell($npc, $_) for @spellID30;
}

if($ulevel>=31 && $ulevel<=40)
{

$Group->CastGroupSpell($npc, $_) for @spellID40;
}


if($ulevel>=41 && $ulevel<=50)
{

$Group->CastGroupSpell($npc, $_) for @spellID50;
}

if($ulevel>=51 && $ulevel<=60)
{

$Group->CastGroupSpell($npc, $_) for @spellID60;
}

if($ulevel>=61 && $ulevel<=65)
{

$Group->CastGroupSpell($npc, $_) for @spellID70;
}

if($ulevel>=66 && $ulevel<=85)
{

$Group->CastGroupSpell($npc, $_) for @spellID80;
}
}
else
{
if ($ulevel <= 10)
{
quest::selfcast(219);
quest::selfcast(279);
quest::selfcast(269);
quest::selfcast(266);
quest::selfcast(40);
quest::selfcast(39);
quest::selfcast(697);
quest::selfcast(27;
quest::selfcast(46);
quest::selfcast(129);
$client->Message(315, "$NPCName whispers to you, 'Enjoy!'");
}
if (($ulevel > 10) && ($ulevel < 25))
{
quest::selfcast(89);
quest::selfcast(283);
quest::selfcast(14;
quest::selfcast(2512);
quest::selfcast(147);
quest::selfcast(170);
quest::selfcast(174);
quest::selfcast(27;
quest::selfcast(46);
quest::selfcast(432);
$client->Message(315, "$NPCName whispers to you, 'Enjoy!'");
}
if (($ulevel >= 25) && ($ulevel < 51))
{
quest::selfcast(312);
quest::selfcast(161);
quest::selfcast(160);
quest::selfcast(152);
quest::selfcast(153);
quest::selfcast(171);
quest::selfcast(1694);
quest::selfcast(169);
quest::selfcast(1727);
quest::selfcast(13);
quest::selfcast(1560);
$client->Message(315, "$NPCName whispers to you, 'Enjoy!'");
}
if ($ulevel >= 51)
{
quest::selfcast(4053);
quest::selfcast(15;
quest::selfcast(154);
quest::selfcast(157);
quest::selfcast(159);
quest::selfcast(1742);
quest::selfcast(1695);
quest::selfcast(2517);
quest::selfcast(1560);
quest::selfcast(13);
quest::selfcast(1561);
$client->Message(315, "$NPCName whispers to you, 'Enjoy!'");
}
}
}
}
}
Reply With Quote
  #2  
Old 09-12-2017, 03:46 AM
Secrets's Avatar
Secrets
Demi-God
 
Join Date: May 2007
Location: b
Posts: 1,447
Default

Two things:

One, use if(defined($Group)) - it's safer.

Two, the reason the CastGroupSpell function fails to work is because the function needs all spells in the list to have an 'aoe range' specified in the spell.

https://github.com/EQEmu/Server/blob...roups.cpp#L855

You will have to loop through the group members to buff everyone in the group, that function will not work as you intend it to.
Reply With Quote
  #3  
Old 09-13-2017, 09:07 AM
phentop
Sarnak
 
Join Date: Jul 2010
Location: Army
Posts: 36
Default

I removed

my $Group = $client->GetGroup();

and it will buff me in a group or out of a group.
Reply With Quote
  #4  
Old 09-14-2017, 08:14 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,594
Default

Here's my buff NPC.

NPC:
Code:
sub EVENT_SAY {
    if ($text=~/Hail/i) {
        plugin::Whisper("Hail, $name. I can provide you with " . quest::saylink("buffs", 1) . ".")
    } elsif ($text=~/Buffs/i) {
        plugin::HandleBuffBot($client);
    }
}
Plugins:
Code:
sub BuffsHash {
    my %hash = (1 => [1, 10, [219, 279, 269, 266, 40, 39, 697, 2524, 46, 129, 13]],
    2 => [11, 20, [89, 283, 148, 2512, 147, 170, 174, 2524, 46, 432, 13]],
    3 => [21, 30, [244, 149, 148, 349, 151, 10, 1693, 4055, 356, 13]],
    4 => [31, 40, [312, 161, 160, 152, 153, 171, 1694, 169, 1727, 13]],
    5 => [41, 50, [4053, 158, 154, 157, 159, 172, 1695, 2517, 1560, 13]],
    6 => [51, 60, [1447, 1580, 1579, 1596, 1581, 1729, 2570, 2517, 1561, 13]],
    7 => [61, 65, [3467, 3397, 4883, 3234, 1710, 3350, 2519, 2517, 3448, 13]],
    8 => [66, 100, [27030, 14282, 3472, 3479, 5415, 5355, 5352, 3178, 5513, 3444, 3185, 25228, 26315, 25441, 25468, 13, 432]]);
    return %hash;
}

sub HandleBuffBot {
    my %buffsHash = plugin::BuffsHash();
    my $client = shift;
    my $npc = plugin::val('npc');
    my $ulevel = plugin::val('ulevel');
    if (!$client->GetGroup())) {
        foreach my $k (keys %buffsHash) {
            if ($ulevel >= $buffsHash{$k}[0] && $ulevel <= $buffsHash{$k}[1]) {
                quest::selfcast($_) for @{$buffsHash{$k}[2]};
            }
        }
    } else {
        foreach my $k (keys %buffsHash) {
            if ($ulevel >= $buffsHash{$k}[0] && $ulevel <= $buffsHash{$k}[1]) {
                for ($i = 0; $i < 6; $i++) {
                    if ($client->GetGroup()->GetMember($i) && $client->GetGroup()->GetMember($i)->IsClient()) {
                        plugin::BuffTarget($client->GetGroup()->GetMember($i));
                    }
                }
            }
        }
    }
    plugin::Whisper("Enjoy your buffs!");
}

sub BuffTarget {
    my %buffsHash = plugin::BuffsHash();
    my $client = shift;
    foreach my $k (keys %buffsHash) {
        if ($client->GetLevel() >= $buffsHash{$k}[0] && $client->GetLevel() <= $buffsHash{$k}[1]) {
            $client->SpellFinished($_, $client, 0) for @{$buffsHash{$k}[2]};
        }
    }
}

return 1;
Reply With Quote
  #5  
Old 09-14-2017, 08:55 PM
The_Beast's Avatar
The_Beast
Discordant
 
Join Date: May 2016
Location: Under a rock
Posts: 290
Default

Quote:
Originally Posted by Kingly_Krab View Post
Here's my buff NPC.
I use yours from an older post, but edited the whisper for 41+ levels.

I don't care much for selfcast, so I use these for low end buffer and if NPC is high enough level,
it gives full duration buffs, even if player is level 1 (This spell id is temp and group temp)

$npc->CastSpell(3692, $GetPlayerID );

$Group->CastGroupSpell($npc, 4053);
Reply With Quote
  #6  
Old 09-23-2017, 04:40 PM
Cusser
Sarnak
 
Join Date: Sep 2017
Posts: 89
Default

Quote:
Originally Posted by Kingly_Krab View Post
Here's my buff NPC.

NPC:
Code:
sub EVENT_SAY {
    if ($text=~/Hail/i) {
        plugin::Whisper("Hail, $name. I can provide you with " . quest::saylink("buffs", 1) . ".")
    } elsif ($text=~/Buffs/i) {
        plugin::HandleBuffBot($client);
    }
}
Plugins:
Code:
sub BuffsHash {
    my %hash = (1 => [1, 10, [219, 279, 269, 266, 40, 39, 697, 2524, 46, 129, 13]],
    2 => [11, 20, [89, 283, 148, 2512, 147, 170, 174, 2524, 46, 432, 13]],
    3 => [21, 30, [244, 149, 148, 349, 151, 10, 1693, 4055, 356, 13]],
    4 => [31, 40, [312, 161, 160, 152, 153, 171, 1694, 169, 1727, 13]],
    5 => [41, 50, [4053, 158, 154, 157, 159, 172, 1695, 2517, 1560, 13]],
    6 => [51, 60, [1447, 1580, 1579, 1596, 1581, 1729, 2570, 2517, 1561, 13]],
    7 => [61, 65, [3467, 3397, 4883, 3234, 1710, 3350, 2519, 2517, 3448, 13]],
    8 => [66, 100, [27030, 14282, 3472, 3479, 5415, 5355, 5352, 3178, 5513, 3444, 3185, 25228, 26315, 25441, 25468, 13, 432]]);
    return %hash;
}

sub HandleBuffBot {
    my %buffsHash = plugin::BuffsHash();
    my $client = shift;
    my $npc = plugin::val('npc');
    my $ulevel = plugin::val('ulevel');
    if (!$client->GetGroup())) {
        foreach my $k (keys %buffsHash) {
            if ($ulevel >= $buffsHash{$k}[0] && $ulevel <= $buffsHash{$k}[1]) {
                quest::selfcast($_) for @{$buffsHash{$k}[2]};
            }
        }
    } else {
        foreach my $k (keys %buffsHash) {
            if ($ulevel >= $buffsHash{$k}[0] && $ulevel <= $buffsHash{$k}[1]) {
                for ($i = 0; $i < 6; $i++) {
                    if ($client->GetGroup()->GetMember($i) && $client->GetGroup()->GetMember($i)->IsClient()) {
                        plugin::BuffTarget($client->GetGroup()->GetMember($i));
                    }
                }
            }
        }
    }
    plugin::Whisper("Enjoy your buffs!");
}

sub BuffTarget {
    my %buffsHash = plugin::BuffsHash();
    my $client = shift;
    foreach my $k (keys %buffsHash) {
        if ($client->GetLevel() >= $buffsHash{$k}[0] && $client->GetLevel() <= $buffsHash{$k}[1]) {
            $client->SpellFinished($_, $client, 0) for @{$buffsHash{$k}[2]};
        }
    }
}

return 1;
this makes a good buff bot, but its not great for a level 1 since most of it is 3 minute buffs which will be gone by the time you get to your first kill
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 03:47 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3