Kuroyama 6 Posted October 4, 2020 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 Quote Share this post Link to post Share on other sites
0 AnnieRuru 957 Posted October 4, 2020 well of course it doesn't last through `@reloadscript` because it uses `$@var` type, temporary global variable https://github.com/HerculesWS/Hercules/blob/stable/npc/woe-fe/agit_main.txt#L1263-L1279 so you need to change them into `$var` type variable, and add OnInit: just above OnClock0001: label to spawn treasure box this is script support so assume you know how to do it yourself Quote Share this post Link to post Share on other sites
0 Kuroyama 6 Posted October 5, 2020 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. Quote Share this post Link to post Share on other sites
0 AnnieRuru 957 Posted October 5, 2020 https://gist.github.com/AnnieRuru/aef19ddbaf2bd1f432bd53ea78a32d5d this should work, didn't test though 1 Kuroyama reacted to this Quote Share this post Link to post Share on other sites
0 Kuroyama 6 Posted October 13, 2020 On 10/5/2020 at 5:42 PM, AnnieRuru said: https://gist.github.com/AnnieRuru/aef19ddbaf2bd1f432bd53ea78a32d5d this should work, didn't test though Hi ms. @AnnieRuru, it's still having an issue. When the server restarted or @reloadscript has been used, castle won't give treasure box/drop or completely no treasure chest at all. Already tried to live server. Sorry for late update also. Quote Share this post Link to post Share on other sites
0 AnnieRuru 957 Posted October 15, 2020 (edited) 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 Edited October 15, 2020 by AnnieRuru Quote Share this post Link to post Share on other sites
0 AnnieRuru 957 Posted October 15, 2020 (edited) 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 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 Edited October 15, 2020 by AnnieRuru Quote Share this post Link to post Share on other sites
0 Kuroyama 6 Posted October 15, 2020 It's working fine now. I keep doing restart and the treasure box is respawning every OnClock0001. Thanks ms. @AnnieRuru, this is wonderful. Quote Share this post Link to post Share on other sites
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
Share this post
Link to post
Share on other sites