Jump to content
  • 0
Sign in to follow this  
Kuroyama

Random Time Summon

Question

So my current timer right now for thanatos is 4 hours fix when thanatos phantom dies in his tower.

OnTimer28800000:
	$@thana_summon = 0;
	$@thana_summon2 = 0;
	donpcevent "Memory Seal#tt1::OnEnable";
	donpcevent "Memory Seal#tt2::OnEnable";
	donpcevent "Memory Seal#tt3::OnEnable";
	donpcevent "Memory Seal#tt4::OnEnable";
	donpcevent "#thanatos_seal::OnEnable";
	stopnpctimer;
	end;
}

I wan't it to become random like 2, 3 or 4hrs. Not with fix time.

Is that even possible?

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

needs to do some calculation

 

on official repo is OnTimer7200000: means 2 hours

btw OnTimer28800000: is 8 hours, not 4 hours

 

so let's leave it at OnTimer28800000: then

if you want 2 hours then setnpctimer 28800000 - 2*60*60*1000; startnpctimer;

if you want 3 hours then setnpctimer 28800000 - 3*60*60*1000; startnpctimer;

if you want 4 hours then setnpctimer 28800000 - 4*60*60*1000; startnpctimer;

 

so it should look like this

OnTimer36000:
OnTimer37000:
	mapwarp "thana_boss","tha_t12",130,52;
	stopnpctimer;
	setnpctimer 28800000 - F_Rand(2,3,4)*60*60*1000;
	startnpctimer;
	end;
OnTimer28800000:
	$@thana_summon = 0;
	$@thana_summon2 = 0;
	donpcevent "Memory Seal#tt1::OnEnable";
	donpcevent "Memory Seal#tt2::OnEnable";
	donpcevent "Memory Seal#tt3::OnEnable";
	donpcevent "Memory Seal#tt4::OnEnable";
	donpcevent "#thanatos_seal::OnEnable";
	stopnpctimer;
	end;

didn't hard to test ... hopefully you don't say its bug

 

Spoiler

at least I tested with this


prontera,155,185,5	script	kjdsfdsjhf	1_F_MARIA,{
	initnpctimer;
	end;
OnTimer1000:
	stopnpctimer;
	setnpctimer 28800000 - F_Rand(1,2,3,4,5)*1000;
	.start = gettimetick(0);
	startnpctimer;
	end;
OnTimer28800000:
	announce "test = "+(gettimetick(0) - .start), bc_all;
	end;
}

 

 

Share this post


Link to post
Share on other sites
  • 0
On 11/4/2020 at 1:05 AM, AnnieRuru said:

needs to do some calculation

 

on official repo is OnTimer7200000: means 2 hours

btw OnTimer28800000: is 8 hours, not 4 hours

 

so let's leave it at OnTimer28800000: then

if you want 2 hours then setnpctimer 28800000 - 2*60*60*1000; startnpctimer;

if you want 3 hours then setnpctimer 28800000 - 3*60*60*1000; startnpctimer;

if you want 4 hours then setnpctimer 28800000 - 4*60*60*1000; startnpctimer;

 

so it should look like this

OnTimer36000: OnTimer37000: mapwarp "thana_boss","tha_t12",130,52; stopnpctimer; setnpctimer 28800000 - F_Rand(2,3,4)*60*60*1000; startnpctimer; end; OnTimer28800000: $@thana_summon = 0; $@thana_summon2 = 0; donpcevent "Memory Seal#tt1::OnEnable"; donpcevent "Memory Seal#tt2::OnEnable"; donpcevent "Memory Seal#tt3::OnEnable"; donpcevent "Memory Seal#tt4::OnEnable"; donpcevent "#thanatos_seal::OnEnable"; stopnpctimer; end;


OnTimer36000:
OnTimer37000:
	mapwarp "thana_boss","tha_t12",130,52;
	stopnpctimer;
	setnpctimer 28800000 - F_Rand(2,3,4)*60*60*1000;
	startnpctimer;
	end;
OnTimer28800000:
	$@thana_summon = 0;
	$@thana_summon2 = 0;
	donpcevent "Memory Seal#tt1::OnEnable";
	donpcevent "Memory Seal#tt2::OnEnable";
	donpcevent "Memory Seal#tt3::OnEnable";
	donpcevent "Memory Seal#tt4::OnEnable";
	donpcevent "#thanatos_seal::OnEnable";
	stopnpctimer;
	end;

didn't hard to test ... hopefully you don't say its bug

 

  Hide contents

at least I tested with this

prontera,155,185,5 script kjdsfdsjhf 1_F_MARIA,{ initnpctimer; end; OnTimer1000: stopnpctimer; setnpctimer 28800000 - F_Rand(1,2,3,4,5)*1000; .start = gettimetick(0); startnpctimer; end; OnTimer28800000: announce "test = "+(gettimetick(0) - .start), bc_all; end; }



prontera,155,185,5	script	kjdsfdsjhf	1_F_MARIA,{
	initnpctimer;
	end;
OnTimer1000:
	stopnpctimer;
	setnpctimer 28800000 - F_Rand(1,2,3,4,5)*1000;
	.start = gettimetick(0);
	startnpctimer;
	end;
OnTimer28800000:
	announce "test = "+(gettimetick(0) - .start), bc_all;
	end;
}

 

 

Just wanna send a feedback ms @AnnieRuru.

first spawn works, however. After thanatos dies, it won't spawn anymore in the next random time.

Share this post


Link to post
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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.