Jump to content
  • 0

Request- Night Only Mob Spawns


grobyczen

Question


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  20
  • Reputation:   0
  • Joined:  04/07/13
  • Last Seen:  

Hello everyone,

 

First of all, I apologize in advance for my english. I hope it's clear enough because it's not my first language.

 

This is my first post in the community, I've been doing some basic scripting for my private server and my curiosity grows with every script I try to make. However, my understanding of how the rAthena emulator works is almost nonexistent and sadly I don't have the time to become an expert. That's why I would apreciate a lot if someone could help me with this, and explain me how this is done:

 

Is there a way to make a mob_spawning.txt file like the ones in \npc\re\mobs that only spawns the monsters when the server is in NightMode?

 

That would allow some interesting features for the sever i'm trying to make.

 

I've already made a floating NPC that spawns a monster on night by making some src modifications, following this instructions:

 

by Michy23:

 

Hmm, i once made a script like this. It was a zombie invasion script that summoned zombie's in all the towns during night and they came in waves.. and were auto killed when day came.

I couldn't find an OnDay type script to use, so i made a little source mod. You can try it if you want.

eA folder/src/map/pc.c 
Find:

CODE
    if (!night_flag)
        return 0; //Already day.

Add Under:
CODE
    npc_event_doall("OnNightEnd");


Find:
CODE
    if (night_flag)
        return 0; //Already nigth.

Add Under:
CODE
    npc_event_doall("OnNightStart");


And in your NPC script, you can add the labels OnNightStart: and OnNightEnd:

On the OnNightStart script, you can add a code to spawn the monsters you want in the towns or fields. On the OnNightEnd script, you can just do a killmonster command on the maps.

 

But as you can imagine, monsters spawned by this NPC won't respawn after they're killed.

 

So, again, the question is: How can you make a natural respawning system, similar to the vanilla one, but that works only when the server is in night mode?

 

Thank's in advance, for your help. and more importantly, for your time.

Link to comment
Share on other sites

1 answer 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:  

Instead of using a Permanent_Monster_Spawn, you could use a script:

  • OnInit --> spawn X monsters (use the monster script command)
  • spawn the monsters with an attached even label
  • when the monster dies, that label triggers --> (re)spawn 1 more monster
  • add the OnDay and OnNight source edit
  • OnDay --> killmonster (kill the monsters with your event label)
  • OnNight --> respawn the monsters (same trigger as OnInit)
Example:
-	script	night_only_mob_spawns	-1,{

OnInit:

OnNight:

killmonster "prontera", strnpcinfo(3)+"::OnZombieDead";

monster "prontera",155,180,"Zombie",1015,10,strnpcinfo(3)+"::OnZombieDead";

end;

OnZombieDead:

if (isnight())

monster "prontera",155,180,"Zombie",1015,1 ,strnpcinfo(3)+"::OnZombieDead";

end;

OnDay:

killmonster "prontera", strnpcinfo(3)+"::OnZombieDead";

end;

}

  • Love 1
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...