yeah upon re-read it again, seem like what I did was, once the guild master claimed the treasure, forever no treasure chest spawn
so let's reaffirm the theory, OFFICIALLY
-> the treasure chest are only spawn every 12:01am
-> if the guild master killed it, it will respawn on next 12:01am
-> if the guild master didn't kill it, it won't respawn on next 12:01am
-> if server restart, the treasure chest are gone <-- OFFICIAL
since you want unofficial behavior anyway - how about let's do unofficial way
revert your agit_main.txt to original then apply this
https://gist.github.com/AnnieRuru/aef19ddbaf2bd1f432bd53ea78a32d5d
what this does ->
1. every time the server restart, it respawn the treasure chest, whether the guild master killed it or not
-> the treasure chest are respawn every 12:01am AND server restart
-> if the guild master forgot to kill treasure chest, it will respawn upon server restart
-> the guild master that ALREADY kill treasure chest, it will ALSO respawn upon server restart, they get 2x for that day
2. everytime the server restart, and 12:01am if the guild master invested in economy and defence, the value also gone up
if you still want to separate the OnInit and OnClock, I just realize needs to set another server variable
1 for day, 1 for treasure, I don't want to do that unpaid (needs to rewrite that whole damn function)
so let's keep things simple for everyone
- script main FAKE_NPC,{
OnClock0000:
for (.@i = 0; .@i < 4; ++.@i) {
if ((.treasure & (1<<.@i)) == 0) {
monster "prontera", 150+.@i, 185, "Treasure Chest", 1354,1, strnpcinfo(NPC_NAME)+"::OnTreasureDied"+.@i;
.treasure |= (1<<.@i);
}
}
end;
OnTreasureDied0: .treasure &= ~1; end;
OnTreasureDied1: .treasure &= ~2; end;
OnTreasureDied2: .treasure &= ~4; end;
OnTreasureDied3: .treasure &= ~8; end;
end;
}
prontera,155,180,5 script next day 1_F_MARIA,{
donpcevent "main::OnClock0000";
}
prontera,149,180,5 script cleanmap 1_F_MARIA,{
cleanmap strcharinfo(PC_MAP);
}
prontera,151,180,5 script mobcount 1_F_MARIA,{
dispbottom getunits(BL_MOB, .@a, 0, "prontera") +"";
}
nvm let me try again
- script sdfksdjf 1_F_MARIA,{
OnInit:
OnClock0000:
for (.@i = 0; .@i < 4; ++.@i) {
if ($killedday[.@i] != atoi(gettimestr("%Y%m%d", 20))) {
monster "prontera", 150 +.@i, 185, "Treasure Chest", 1354,1, strnpcinfo(NPC_NAME)+"::OnTreasureDied"+ .@i;
}
}
end;
OnTreasureDied0: $killedday[0] = atoi(gettimestr("%Y%m%d", 20)); end;
OnTreasureDied1: $killedday[1] = atoi(gettimestr("%Y%m%d", 20)); end;
OnTreasureDied2: $killedday[2] = atoi(gettimestr("%Y%m%d", 20)); end;
OnTreasureDied3: $killedday[3] = atoi(gettimestr("%Y%m%d", 20)); end;
end;
}
prontera,155,180,5 script debug 1_F_MARIA,{
dispbottom $killedday[0] +"";
dispbottom $killedday[1] +"";
dispbottom $killedday[2] +"";
dispbottom $killedday[3] +"";
}
prontera,149,180,5 script reset 1_F_MARIA,{
deletearray $killedday;
}
now combine these 2 scripts