Random Time Summon

Kuroyama

New member
Messages
128
Points
0
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?

 
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

at least I tested with this

Code:
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;
}

 
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

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.

 
Back
Top