Jump to content
  • 0

Spawn custom nightmare mobs at night with event labels?


huntax

Question


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  44
  • Reputation:   0
  • Joined:  12/11/12
  • Last Seen:  

Hello rathena! On my server i wanted to have @night like every 2 hours and while its night the script spawns nightmare mobs (custom mobs) on certain maps. And then after like 30 mins of night time it turns @day and kills all the spawned nightmare mobs. Can anyone help me with a simple script to start me off please. Thank you

BUMP

Link to comment
Share on other sites

5 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

I had left this topic in my open tabs (todo)!

I'll post the version I was working on soon.

1. make sure your settings in trunk/conf/battle/misc.conf are like this:

night_at_start: no
day_duration: 0
night_duration: 0

2. then add this script (see adding a Script)

-	script	night_mobs	-1,{
OnInit:
// Spawn nightmare mobs on which maps?
setarray .maps[0], "prontera","morocc","payon";
OnMinute00:
if (gettime(3)%2 == 0) { // hours: 00, 02, 04, ... (even hours)
	if (isnight()) {
		day;
		announce "The sun is rising.", bc_all;
		for (set .@i,0; .@i<getarraysize(.maps); set .@i,.@i+1)
			killmonster .maps[.@i], strnpcinfo(3)+"::OnZombieDead";
	}
} else if (gettime(3)%2 == 1) { // hours: 01, 03, 05, ... (odd hours)
	if (isday()) {
		night;
		announce "Night has fallen... beware of the undead!", bc_all|bc_blue;
		for (set .@i,0; .@i<getarraysize(.maps); set .@i,.@i+1)
			monster .maps[.@i],0,0, "Nightmare",1427,30, strnpcinfo(3)+"::OnZombieDead";

	}
}
end;

OnZombieDead:
// open 1 Old Purple Box
getrandgroupitem IG_VioletBox,1;
// 2% chance to get Ygg Berry
if (rand(100) < 2) getitem 607,1; // Yggdrasil Berry

// spawn a new mob each time one is killed?
// Delete the next line to have mobs stay dead until the next night cycle.
monster "this",0,0, "Nightmare",1427,1, strnpcinfo(3)+"::OnZombieDead";
end;
}

Link to comment
Share on other sites

  • 1

  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

-    script    Nightmare    -1,{
OnMinute00:
   if (gettime(3)%2 || .Active) end; // Activate every 2 hours.
   set .Active,1;
   night;

   // Spawn monsters with this format:
   monster "map_name",x,y,"name",mobID,amount,strnpcinfo(0)+"::OnNight";

   end;

OnMinute30:
   if (gettime(3)%2 || !.Active) end; // Activate every 2 hours.
   set .Active,0;
   day;
   killmonster "map_name",strnpcinfo(0)+"::OnNight";
   end;

OnNight:
   end;
}

Edited by Euphy
(oops, see below)
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  15
  • Reputation:   0
  • Joined:  04/22/17
  • Last Seen:  

its seems that the monster didnt spawn.. can u help me?

this is my current script

 

-	script	night_mobs	-1,{
OnInit:
// Spawn nightmare mobs on which maps?
setarray .maps[0], "prontera";
OnMinute00:
if (gettime(3)%2 == 0) { // hours: 00, 02, 04, ... (even hours)
	if (isnight()) {
		day;
		announce "The sun is rising.", bc_all;
		for (set .@i,0; .@i<getarraysize(.maps); set .@i,.@i+1)
			killmonster .maps[.@i], strnpcinfo(3)+"::OnZombieDead";
	}
} else if (gettime(3)%2 == 1) { // hours: 01, 03, 05, ... (odd hours)
	if (isday()) {
		night;
		announce "Night has fallen... beware of the undead!", bc_all|bc_blue;
		for (set .@i,0; .@i<getarraysize(.maps); set .@i,.@i+1)
			monster .maps[.@i],0,0, "Nightmare",1420,200, strnpcinfo(3)+"::OnZombieDead";

	}
}
end;

OnZombieDead:
// open 1 Old Purple Box
getrandgroupitem IG_VioletBox,1;
// 2% chance to get Ygg Berry
if (rand(100) < 2) getitem 607,1; // Yggdrasil Berry

// spawn a new mob each time one is killed?
// Delete the next line to have mobs stay dead until the next night cycle.
monster "this",0,0, "Nightmare",1427,1, strnpcinfo(3)+"::OnZombieDead";
end;
}

 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

ahaha, you forgot to put

OnNight:

end;

otherwise the server will spam error like

[Error]: npc_event: event not found [Nightmare::OnNight]

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  44
  • Reputation:   0
  • Joined:  12/11/12
  • Last Seen:  

Thanks you fixed it!

Edited by huntax
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...