EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Support::Windows Servers (https://www.eqemulator.org/forums/forumdisplay.php?f=587)
-   -   Adding random loot to specific NPCs (https://www.eqemulator.org/forums/showthread.php?t=41327)

Aquaojo 05-08-2017 05:58 PM

Adding random loot to specific NPCs
 
Ok - I had this working this morning...Then fried my brain on another project and must be missing something now.

Basically just adds random loot to chest spawns that come up after mobs are killed. Chests are spawning fine. Just no loot.

Code:

sub EVENT_SPAWN {

        if($npc_id >= 705003 && $npc_id <= 705007)
      {
        my $itemid = ( int rand 95000 ) + 1001;
      $npc->AddItem($itemid); 
        }
}

As always - Thanks for the help!!

Coenxai 05-08-2017 06:20 PM

Why are you checking npc id? Also, you should fix your rand() function.

atrayas 05-08-2017 06:51 PM

Use the add loot plugin, simple and works great. You are creating steps that are not needed with what you have there.

Look it up on the wiki, akkadius has instructions there for it.

Aquaojo 05-08-2017 07:11 PM

Tunnel vision...Didn't even think about using AddLoot. :p

Thanks fellas


All times are GMT -4. The time now is 11:13 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.