Advertisement
Guest User

Untitled

a guest
Mar 18th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 1.18 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.     {
  9.         my $manacost = ($responsibleclient->GetMaxMana() * 0.03);
  10.         if ($manacost <= $responsibleclient->GetMana()) {
  11.             $responsibleclient->SetMana($responsibleclient->GetMana() - $manacost);
  12.             my $basefiredamage = int($responsibleclient->GetMaxMana() * 0.1));  # 10% of clients max mana
  13.             my $damagebonus = int (($responsibleclient->GetMaxINT() / 10) * ($responsibleclient->GetMaxMana() * 0.005));
  14.             my $totalfiredamage = $basefiredamage + $damagebonus;
  15.             $entity_list->MessageClose($responsibleclient, 0, 30, 0, "".$responsibleclient->GetCleanName()." conjurs the wrath of hell to scorch ".$npc->GetCleanName()." for $totalfiredamage damage!");
  16.             $npc->Damage($responsibleclient, $totalfiredamage, 600, 24, 0);  # in your spells_new make the mana cost zero as we'll handle that in script below
  17.         } else {
  18.             $client->Message(15, "You have insufficient mana to cast that spell!");
  19.         }
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement