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

09-14-2017, 08:14 PM
|
|
Administrator
|
|
Join Date: May 2013
Location: United States
Posts: 1,604
|
|
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;
|
 |
|
 |

09-14-2017, 08:55 PM
|
 |
Discordant
|
|
Join Date: May 2016
Location: Under a rock
Posts: 290
|
|
Quote:
Originally Posted by Kingly_Krab
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);
|
 |
|
 |

09-23-2017, 04:40 PM
|
|
Sarnak
|
|
Join Date: Sep 2017
Posts: 89
|
|
Quote:
Originally Posted by Kingly_Krab
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
|
 |
|
 |
| Thread Tools |
|
|
| Display Modes |
Hybrid Mode
|
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 07:57 PM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |