View Single Post
  #6  
Old 12-22-2012, 05:04 AM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

Code:
use List::Util qw(first);

sub EVENT_COMBAT
{
    return()unless($combat_state);
    $npc->Heal();
    quest::say(($npc->GetRace()==54?"Your blood will spill.":"Time to die, $name!"));
}

sub EVENT_DEATH
{
    return()if($npc->GetRace()==54);
    my($extra_loot)={
        join(' ',1..3)=>[15270,15275,15075,15271,15279,15212,15079,15274,15272],
        join(' ',4..6)=>[5043,6032,6030,7022,7024,94155,6031],
        join(' ',7..9)=>[2031,2036,2030,2034,2027,2038,2026,2029,2025,2032,2028,2033]
    };
    $extra_loot->{'10 10'}=$extra_loot->{join(' ',4..6)};
    my($roll)=quest::ChooseRandom(1..10);
    quest::addloot(quest::ChooseRandom(@{$extra_loot->{first{$roll~~[split(' ',$_)]}keys(%$extra_loot)}}),1);
}
Reply With Quote