View Single Post
  #7  
Old 09-29-2018, 07:05 AM
N0ctrnl's Avatar
N0ctrnl
Discordant
 
Join Date: Jan 2007
Posts: 443
Default

I've been using this for a few years now. Mostly to prevent the farming of greens for random drops.

Code:
sub EVENT_SPAWN {
  $roll = int(rand(1000)) + 1;

  if($roll >= 995 && $mlevel >= 46) {
    my $itemid=(132522);
    $npc->AddItem($itemid);
  }

  if($roll >= 989 && $roll <= 994 && $mlevel >= 46) {
    my $itemid=(132530);
    $npc->AddItem($itemid);
  }

  if($roll >= 910 && $roll <= 920) {
    my $itemid=(40605);
    $npc->AddItem($itemid);
  }
}

sub EVENT_HATE_LIST {
        if ($hate_state == 1 && $client && $client->GetLevel() > ($mlevel + 10) && $npc->GetEntityVariable("removed") != 1) {
                $npc->RemoveItem(132522);
                $npc->RemoveItem(40605);
                $npc->SetEntityVariable("removed", 1); #so it stops trying to remove the item when more people aggro it
        }
}
__________________
Ender - Lead GM/Developer
Vegarlson Asylum Server - http://www.vegarlson-server.org/
Reply With Quote