Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Custom

Quests::Custom Custom Quests here

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 10-03-2016, 03:42 PM
lordnivek1
Sarnak
 
Join Date: Feb 2013
Posts: 65
Default Chance to spawn NPC on another NPC's death

So I am teaching myself how to code perl. I have zero background in any coding at all. Was wondering if someone could take a look at this and tell me how this looks. The bases is there is a 20% chance when a mob dies that another mob will spawn at its location. The mob that spawns will be 1 of 3 different possibilities.

Code:
 
sub EVENT_DEATH_COMPLETE 
{
    my $random = int(rand 4);
    if($random == 0);
    {
    my @npc_type_id = ('123', '124', '125')
    my $random = int(rand 2);
    my $npc = $npc_type_id[$random];
        quest::say("I am free of this mortal cell! Prepare for my wrath!")
	quest::spawn($npc, 0, 0, $x, $y, $Z, $H)
    {
}
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 04:44 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3