Advertisement
Guest User

Untitled

a guest
Mar 18th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 1.50 KB | None | 0 0
  1. ## Hell's Wrath; Deals 0.5% of NPC's MaxHP for every 10 points of client (casters) maximum INT
  2. ## /quests/global/spells/600.pl   <-- or whatever spell ID it will be of course
  3.  
  4. sub EVENT_SPELL_EFFECT_NPC
  5. {
  6.     $responsibleclient = $entity_list->GetClientByID($caster_id);
  7.     if ($responsibleclient)
  8.     $npc->Shout("".$responsibleclient->GetCleanName()."is responsible for this!");
  9.     {
  10.         $npc->Shout("Mana Cost: ".$manacost."");
  11.         my $manacost = ($responsibleclient->GetMaxMana() * 0.03);
  12.         if ($manacost <= $responsibleclient->GetMana()) {
  13.             $responsibleclient->SetMana($responsibleclient->GetMana() - $manacost);
  14.             $npc->Shout("New Mana Amount Set");
  15.             my $basefiredamage = int($responsibleclient->GetMaxMana() * 0.1);  # 10% of clients max mana
  16.             $npc->Shout("Base Fire Damage: ".$basefiredamage."");
  17.             my $damagebonus = int(($responsibleclient->GetMaxINT() / 10) * ($responsibleclient->GetMaxMana() * 0.005));
  18.             $npc->Shout("Bonus Damage: ".$damagebonus."");
  19.             my $totalfiredamage = $basefiredamage + $damagebonus;
  20.             $npc->Shout("Total Damage :".$totalfiredamage."");
  21.             $entity_list->MessageClose($responsibleclient, 0, 30, 0, "".$responsibleclient->GetCleanName()." conjurs the wrath of hell to scorch ".$npc->GetCleanName()." for $totalfiredamage damage!");
  22.             $npc->Damage($responsibleclient, $totalfiredamage, 600, 24, 0);  # in your spells_new make the mana cost zero as we'll handle that in script below
  23.         } else {
  24.             $client->Message(15, "You have insufficient mana to cast that spell!");
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement