Jump to content
  • 0

Specificly timed warps.


gekigengar

Question


  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  174
  • Reputation:   2
  • Joined:  08/30/13
  • Last Seen:  

I am making a dungeon that has 2 entrance, one entrance only appear at morning, and the other at night. (The entrance is using regular field warps)

(So I am guessing it will be using the OnClock function.)

(Day starts after 01:00)

(Night starts at 20:00)

OnInit:
	if (Time is > 20:00 or Time < 01:00) {
		// Enable night field warp.
	} else {
		// Enable day field warp.
	}
	end;

OnClock2000: //On 8 PM 
	// Enable night field warps.
	// Disable day field warp.
	end;

OnClock0100: //on 1 AM
	// Disable night field warp
	// Enable day field warp

I get the main Idea, but how do I put these into script?

 

Thanks Brian for editing! (I am not sure why my Mozilla browser failed to post the original post with the tags.)

Edited by gekigengar
added [code] tags
Link to comment
Share on other sites

4 answers to this question

Recommended Posts


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

-	script	day_night_npc	-1,{
OnClock0100:
OnClock2000:
OnInit:
	sleep 1; // if you want to use different script file, then slow down the script execution
	if ( gettime(3) >= 1 && gettime(3) < 20 ) { // day warp
		enablenpc "daywarp#1";
		disablenpc "nightwarp#1";
	}
	else {
		enablenpc "nightwarp#1";
		disablenpc "daywarp#1";
	}
	end;
}

prontera,152,192,0	warp	daywarp#1	2,2,morocc,156,93
prontera,152,192,0	warp	nightwarp#1	2,2,geffen,119,59
if it is different file, then you have to make sure that your custom script is being read later

read npc\re\scripts_main.conf, or npc\scripts_custom.conf

make sure the warp npc is being read 1st before the day_night_npc

or ... just easily put a sleep command before enablenpc/disablenpc

  • Upvote 1
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:  

doc/woe_time_explanation.txt

npc/guild/agit_controller.txt

change AgitStart into enablenpc

change AgitEnd into disablenpc

  • Upvote 2
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  174
  • Reputation:   2
  • Joined:  08/30/13
  • Last Seen:  

So how do I refer to a warp NPC?

 

for example..



yuno_fild04,251,21,0 warp ein001 1,1,ein_fild06,252,363
ein_fild06,252,365,0 warp ein001a 1,1,yuno_fild04,251,23


do I just create them, then "disablenpc ein001" after creating them?

 

What if they are created on different script file? is that still okay?

Edited by gekigengar
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  174
  • Reputation:   2
  • Joined:  08/30/13
  • Last Seen:  

-	script	day_night_npc	-1,{
OnClock0100:
OnClock2000:
OnInit:
	sleep 1; // if you want to use different script file, then slow down the script execution
	if ( gettime(3) >= 1 && gettime(3) < 20 ) { // day warp
		enablenpc "daywarp#1";
		disablenpc "nightwarp#1";
	}
	else {
		enablenpc "nightwarp#1";
		disablenpc "daywarp#1";
	}
	end;
}

prontera,152,192,0	warp	daywarp#1	2,2,morocc,156,93
prontera,152,192,0	warp	nightwarp#1	2,2,geffen,119,59
if it is different file, then you have to make sure that your custom script is being read laterread npc\re\scripts_main.conf, or npc\scripts_custom.confmake sure the warp npc is being read 1st before the day_night_npcor ... just easily put a sleep command before enablenpc/disablenpc

thank you, that solves everything!

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...