No treasure box when using @reloadscript

Kuroyama

New member
Messages
128
Points
0
When the server restart or used @reloadscript the Guild Master cannot get any treasure box.

This happen always when I restart the server.

Any help for this? I even tried to change

- script Gld_Trea_Spawn::Gld_Trea_Spawn -1,{
end;

OnClock2000: <--- to make it 10pm


but whenever I reload or server restart, treasure box is not showng

 
I don't know how to do it myself. ms annie. Is it okay to request another thread on the request section for this concern?

I don't want this script to be affected by @reloadscrip and I am afraid of having reported as spam. D:

I'll just wait for your reply.

 
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

 
Last edited by a moderator:
I suddenly remember I did this stuff years ago, forgot where is the topic
or maybe its in eathena forum which already gone

yeah suddenly it came back to me
 

https://gist.github.com/AnnieRuru/aef19ddbaf2bd1f432bd53ea78a32d5d

REALLY TESTED IT THIS TIME

screen2020Hercules002.jpg


note in the screenshot, I change my computer time to 12:00am and wait until it respawn,

now its evening here but I change my computer time just to test the OnClock0001: works

 
Last edited by a moderator:
It's working fine now. I keep doing restart and the treasure box is respawning every OnClock0001. Thanks ms. @AnnieRuru, this is wonderful.

 
Back
Top