测试一下能否贴上:
sub EVENT_SAY
{
my $NPCName = $npc->GetCleanName();
my $buffme = quest::saylink("blessings", 1);
my $currentmoney = $client->GetCarriedMoney();
my @buffs1 = (219, 279, 269, 266, 40, 39, 697, 2524, 46, 129, 13);
my @buffs2 = (89, 283, 148, 2512, 147, 170, 174, 2524, 46, 432, 13);
my @buffs3 = (244, 149, 148, 349, 151, 10, 1694, 4055, 356, 13); #1694, Your spell is too powerful for your intended target.
my @buffs4 = (312, 161, 160, 152, 153, 171, 1694, 169, 1727, 13);
my @buffs5 = (4053, 158, 154, 157, 159, 172, 1695, 2517, 1560, 13);
my @buffs6 = (1447, 1580, 1579, 1596, 1581, 1729, 2570, 2517, 1561, 13);
my @buffs7 = (3467, 3397, 4883, 3234, 1710, 3350, 2519, 2517, 3448, 13);
my @buffs8 = (27030, 14282, 3472, 3479, 5415, 5355, 5352, 3178, 5513, 3444, 3185, 25228, 26315, 25441, 25468, 13, 432);
$client->Message(7, " ");
$client->Message(315, " ");
if ($text=~/hail/i) {
$client->Message(315, "$NPCName whispers to you, 'Greetings $name. I am the Arcangel of Nurroth and can give you $buffme! All I need in exchange are some platinum.");
plugin::DoAnim("wave");
}
if ($text=~/blessings/i) {
if (($ulevel >= 1)&&($ulevel <= 10)) {
foreach my $buffsid (@buffs1) {
quest::selfcast($buffsid);
}
plugin::DoAnim("chuckle");
$client->Message(315, "$NPCName whispers to you, 'Since you are level 10 or lower you get free blessings, $name! Good luck to you.'");
}
elsif (($ulevel >= 11) && ($ulevel <= 20)) {
if ($currentmoney >= 20000) {
foreach my $buffsid (@buffs2) {
quest::selfcast($buffsid);
}
$client->TakeMoneyFromPP(20000, update_client);
plugin::DoAnim("chuckle");
$client->Message(315, "$NPCName whispers to you, 'Good luck to you $name!'");
}
else {
plugin::DoAnim("yawn");
$client->Message(315, "$NPCName whispers to you, 'Hello $name, I will give you blessings for 20 platinum.'");
}
}
elsif (($ulevel >= 21)&&($ulevel <= 30)) {
if ($currentmoney >= 30000) {
foreach my $buffsid (@buffs3) {
quest::selfcast($buffsid);
}
$client->TakeMoneyFromPP(30000, update_client);
plugin::DoAnim("chuckle");
$client->Message(315, "$NPCName whispers to you, 'Good luck to you $name!'");
}
else {
plugin::DoAnim("yawn");
$client->Message(315, "$NPCName whispers to you, 'Hello $name, I will give you blessings for 30 platinum.'");
}
}
elsif (($ulevel >= 31)&&($ulevel <= 40)) {
if ($currentmoney >= 40000) {
foreach my $buffsid (@buffs4) {
quest::selfcast($buffsid);
}
$client->TakeMoneyFromPP(40000, update_client);
plugin::DoAnim("chuckle");
$client->Message(315, "$NPCName whispers to you, 'Good luck to you $name!'");
}
else {
plugin::DoAnim("yawn");
$client->Message(315, "$NPCName whispers to you, 'Hello $name, I will give you blessings for 40 platinum.'");
}
}
elsif (($ulevel >= 41)&&($ulevel <= 50)) {
if ($currentmoney >= 50000) {
foreach my $buffsid (@buffs5) {
quest::selfcast($buffsid);
}
$client->TakeMoneyFromPP(50000, update_client);
plugin::DoAnim("chuckle");
$client->Message(315, "$NPCName whispers to you, 'Good luck to you $name!'");
}
else {
plugin::DoAnim("yawn");
$client->Message(315, "$NPCName whispers to you, 'Hello $name, I will give you blessings for 50 platinum.'");
}
}
elsif (($ulevel >= 51)&&($ulevel <= 60)) {
if ($currentmoney >= 60000) {
foreach my $buffsid (@buffs6) {
quest::selfcast($buffsid);
}
$client->TakeMoneyFromPP(60000, update_client);
plugin::DoAnim("chuckle");
$client->Message(315, "$NPCName whispers to you, 'Good luck to you $name!'");
}
else {
plugin::DoAnim("yawn");
$client->Message(315, "$NPCName whispers to you, 'Hello $name, I will give you blessings for 60 platinum.'");
}
}
elsif (($ulevel >= 61)&&($ulevel <= 65)) {
if ($currentmoney >= 80000) {
foreach my $buffsid (@buffs7) {
quest::selfcast($buffsid);
}
$client->TakeMoneyFromPP(80000, update_client);
plugin::DoAnim("chuckle");
$client->Message(315, "$NPCName whispers to you, 'Good luck to you $name!'");
}
else {
plugin::DoAnim("yawn");
$client->Message(315, "$NPCName whispers to you, 'Hello $name, I will give you blessings for 80 platinum.'");
}
}
elsif (($ulevel >= 66)&&($ulevel <= 100)) {
if ($currentmoney >= 100000) {
foreach my $buffsid (@buffs8) {
quest::selfcast($buffsid);
}
$client->TakeMoneyFromPP(100000, update_client);
plugin::DoAnim("chuckle");
$client->Message(315, "$NPCName whispers to you, 'Good luck to you $name!'");
}
else {
plugin::DoAnim("yawn");
$client->Message(315, "$NPCName whispers to you, 'Hello $name, I will give you blessings for 100 platinum.'");
}
}
}
}