Jump to content
  • 0

help on editing castle treasure chest - spawn - drop


jadedlight

Question


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.01
  • Content Count:  53
  • Reputation:   0
  • Joined:  08/14/15
  • Last Seen:  

this will be my 1st time editing the castle drops and spawn wanted to ask here before i do something XD

 

Problem: the treasure box wont spawn even if the castle was already taken 

is there any way to make it spawn with 4 boxes on server reset time?

 

the drops are modified in the db folder right? XD how do i put like make it drop a custom item for 1% chance?

 

Added info: this is a part of the script on the castles 

 

TIA for the replies 


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

OnClock0001:

for (set .@i, 1; .@i <= 7; set .@i, .@i+1) { //START CHANGED
for (set .@i_, 1; .@i_ <= 5; set .@i_, .@i_+1) {
if (getd("$woe_cas"+.@i+"_3$["+.@i_+"]") == strnpcinfo(2) && getd("$woe_cas"+.@i+"_tdisable["+.@i_+"]")) { end; }
}
} //END CHANGED

// Do nothing if this script is the template.
if (strnpcinfo(1) == "Gld_Trea_Spawn") end;

// If there is no owner, do nothing.
if (!GetCastleData(strnpcinfo(2),1)) end;

// Is there Economy in this castle?
set .@Treasure,GetCastleData(strnpcinfo(2),2)/5+4;

// Set information
if (strnpcinfo(2) == "aldeg_cas01") { 
set .@treasurebox,1324;
setarray .@treasurex[0],115,122,115,122,116,117,118,119,120,121,121,121,121,121,121,120,119,118,117,116,116,116,116,116;
setarray .@treasurey[0],226,226,219,219,225,225,225,225,225,225,224,223,222,221,220,220,220,220,220,220,221,222,223,224;
}
else if (strnpcinfo(2) == "aldeg_cas02") { 
set .@treasurebox,1326;
setarray .@treasurex[0],134,135,135,134,132,133,134,135,136,137,137,137,137,137,137,136,135,134,133,132,132,132,132,132;
setarray .@treasurey[0],231,231,230,230,233,233,233,233,233,233,232,231,230,229,228,228,228,228,228,228,229,230,231,232;
}
else if (strnpcinfo(2) == "aldeg_cas03") { 
set .@treasurebox,1328;
setarray .@treasurex[0],224,225,225,224,222,223,224,225,226,227,227,227,227,227,227,226,225,224,223,222,222,222,222,222;
setarray .@treasurey[0],269,269,268,268,271,271,271,271,271,271,270,269,268,267,266,266,266,266,266,266,267,268,269,270;
}
else if (strnpcinfo(2) == "aldeg_cas04") { 
set .@treasurebox,1330;
setarray .@treasurex[0],84,85,85,84,82,83,84,85,86,87,87,87,87,87,87,86,85,84,83,82,82,82,82,82;
setarray .@treasurey[0],13,13,12,12,15,15,15,15,15,15,14,13,12,11,10,10,10,10,10,10,11,12,13,14;
}
else if (strnpcinfo(2) == "aldeg_cas05") { 
set .@treasurebox,1332;
setarray .@treasurex[0],61,62,62,61,59,60,61,62,63,64,64,64,64,64,64,63,62,61,60,59,59,59,59,59;
setarray .@treasurey[0],12,12,11,11,14,14,14,14,14,14,13,12,11,10,9,9,9,9,9,9,10,11,12,13;
}
else if (strnpcinfo(2) == "gefg_cas01") { 
set .@treasurebox,1334;
setarray .@treasurex[0],153,154,154,153,151,152,153,154,155,156,156,156,156,156,156,155,154,153,152,151,151,151,151,151;
setarray .@treasurey[0],113,113,112,112,115,115,115,115,115,115,114,113,112,111,110,110,110,110,110,110,111,112,113,114;
}
else if (strnpcinfo(2) == "gefg_cas02") { 
set .@treasurebox,1336;
setarray .@treasurex[0],139,140,140,139,137,138,139,140,141,142,142,142,142,142,142,141,140,139,138,137,137,137,137,137;
setarray .@treasurey[0],115,115,114,114,117,117,117,117,117,117,116,115,114,113,112,112,112,112,112,112,113,114,115,116;
}
else if (strnpcinfo(2) == "gefg_cas03") { 
set .@treasurebox,1338;
setarray .@treasurex[0],269,270,270,269,267,268,269,270,271,272,272,272,272,272,272,271,270,269,268,267,267,267,267,267;
setarray .@treasurey[0],291,291,290,290,293,293,293,293,293,293,292,291,290,289,288,288,288,288,288,288,289,290,291,292;
}
else if (strnpcinfo(2) == "gefg_cas04") { 
set .@treasurebox,1340;
setarray .@treasurex[0],115,116,116,115,113,114,115,116,117,118,118,118,118,118,118,117,116,115,114,113,113,113,113,113;
setarray .@treasurey[0],119,119,118,118,121,121,121,121,121,121,120,119,118,117,116,116,116,116,116,116,117,118,119,120;
}
else if (strnpcinfo(2) == "gefg_cas05") { 
set .@treasurebox,1342;
setarray .@treasurex[0],143,144,144,143,141,142,143,144,145,146,146,146,146,146,146,145,144,143,142,141,141,141,141,141;
setarray .@treasurey[0],110,110,109,109,112,112,112,112,112,112,111,110,109,108,107,107,107,107,107,107,108,109,110,111;
}
else if (strnpcinfo(2) == "payg_cas01") { 
set .@treasurebox,1344;
setarray .@treasurex[0],289,292,292,289,288,289,290,291,292,293,293,293,293,293,293,292,291,290,289,288,288,288,288,288;
setarray .@treasurey[0],10,10,7,7,11,11,11,11,11,11,10,9,8,7,6,6,6,6,6,6,7,8,9,10;
}
else if (strnpcinfo(2) == "payg_cas02") { 
set .@treasurebox,1346;
setarray .@treasurex[0],143,146,146,143,142,143,144,145,146,147,147,147,147,147,147,146,145,144,143,142,142,142,142,142;
setarray .@treasurey[0],146,146,143,143,147,147,147,147,147,147,146,145,144,143,142,142,142,142,142,142,143,144,145,146;
}
else if (strnpcinfo(2) == "payg_cas03") { 
set .@treasurebox,1348;
setarray .@treasurex[0],158,159,159,158,156,157,158,159,160,161,161,161,161,161,161,160,159,158,157,156,156,156,156,156;
setarray .@treasurey[0],169,169,168,168,171,171,171,171,171,171,170,169,168,167,166,166,166,166,166,166,167,168,169,170;
}
else if (strnpcinfo(2) == "payg_cas04") { 
set .@treasurebox,1350;
setarray .@treasurex[0],146,147,147,146,144,145,146,147,148,149,149,149,149,149,149,148,147,146,145,144,144,144,144,144;
setarray .@treasurey[0],48,48,47,47,50,50,50,50,50,50,49,48,47,46,45,45,45,45,45,45,46,47,48,49;
}
else if (strnpcinfo(2) == "payg_cas05") { 
set .@treasurebox,1352;
setarray .@treasurex[0],155,158,158,155,154,155,156,157,158,159,159,159,159,159,159,158,157,156,155,154,154,154,154,154;
setarray .@treasurey[0],134,134,131,131,135,135,135,135,135,135,134,133,132,131,130,130,130,130,130,130,131,132,133,134;
}
else if (strnpcinfo(2) == "prtg_cas01") { 
set .@treasurebox,1354;
setarray .@treasurex[0],10,11,11,10,8,9,10,11,12,13,13,13,13,13,13,12,11,10,9,8,8,8,8,8;
setarray .@treasurey[0],209,209,208,208,211,211,211,211,211,211,210,209,208,207,206,206,206,206,206,206,207,208,209,210;
}
else if (strnpcinfo(2) == "prtg_cas02") { 
set .@treasurebox,1356;
setarray .@treasurex[0],201,202,202,201,199,200,201,202,203,204,204,204,204,204,204,203,202,201,200,199,199,199,199,199;
setarray .@treasurey[0],228,228,227,227,230,230,230,230,230,230,229,228,227,226,225,225,225,225,225,225,226,227,228,229;
}
else if (strnpcinfo(2) == "prtg_cas03") { 
set .@treasurebox,1358;
setarray .@treasurex[0],187,188,188,187,185,186,187,188,189,190,190,190,190,190,190,189,188,187,186,185,185,185,185,185;
setarray .@treasurey[0],132,132,131,131,134,134,134,134,134,134,133,132,131,130,129,129,129,129,129,129,130,131,132,133;
}
else if (strnpcinfo(2) == "prtg_cas04") { 
set .@treasurebox,1360;
setarray .@treasurex[0],269,270,270,269,267,268,269,270,271,272,272,272,272,272,272,271,270,269,268,267,267,267,267,267;
setarray .@treasurey[0],162,162,161,161,164,164,164,164,164,164,163,162,161,160,159,159,159,159,159,159,160,161,162,163;
}
else if (strnpcinfo(2) == "prtg_cas05") { 
set .@treasurebox,1362;
setarray .@treasurex[0],275,276,276,275,273,274,275,276,277,278,278,278,278,278,278,277,276,275,274,273,273,273,273,273;
setarray .@treasurey[0],178,178,177,177,180,180,180,180,180,180,179,178,177,176,175,175,175,175,175,175,176,177,178,179;
}
// Add custom Guild Castles here.
else {
end;
}

// Reset daily investment limit.
setcastledata strnpcinfo(2),4,0;
setcastledata strnpcinfo(2),5,0;

// Spawn boxes in proper order.
for (set .@i,0; .@i <= .@Treasure ; set .@i,.@i+1) {
// set treasure box ID
set .@boxid, .@treasurebox + (.@i+2) % 2;
set .@box,1 << .@i;
// Spawn or do not spawn chests if one already exists.
if ((getd("$@"+strnpcinfo(2)+"_treasure") & .@box) == 0) {
monster strnpcinfo(2),.@treasurex[.@i],.@treasurey[.@i],"Treasure Chest",.@boxid,1,"Treasure#"+strnpcinfo(2)+"::OnTreasureDied"+.@i;
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") | .@box;
}
}
end;

// Individual "You killed a chest" events to ensure proper spawning at the change of day.
OnTreasureDied0:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~1;
end;
OnTreasureDied1:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~2;
end;
OnTreasureDied2:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~4;
end;
OnTreasureDied3:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~8;
end;
OnTreasureDied4:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~16;
end;
OnTreasureDied5:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~32;
end;
OnTreasureDied6:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~64;
end;
OnTreasureDied7:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~128;
end;
OnTreasureDied8:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~256;
end;
OnTreasureDied9:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~512;
end;
OnTreasureDied10:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~1024;
end;
OnTreasureDied11:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~2048;
end;
OnTreasureDied12:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~4096;
end;
OnTreasureDied13:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~8192;
end;
OnTreasureDied14:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~16384;
end;
OnTreasureDied15:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~32768;
end;
OnTreasureDied16:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~65536;
end;
OnTreasureDied17:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~131072;
end;
OnTreasureDied18:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~262144;
end;
OnTreasureDied19:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~524288;
end;
OnTreasureDied20:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~1048576;
end;
OnTreasureDied21:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~2097152;
end;
OnTreasureDied22:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~4194304;
end;
OnTreasureDied23:
setd "$@"+strnpcinfo(2)+"_treasure",getd("$@"+strnpcinfo(2)+"_treasure") & ~8388608;
end;
}
 
Edited by Emistry
codebox
Link to comment
Share on other sites

11 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.01
  • Content Count:  53
  • Reputation:   0
  • Joined:  08/14/15
  • Last Seen:  

ok SOLVED. 

for future reference 

people that would read this pls remember to set it on your configurations

newbie developer and scripter :) dont lose hope :D GO ON AND DONT BE AFRAID TO TEST OUT 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  45
  • Topics Per Day:  0.01
  • Content Count:  157
  • Reputation:   18
  • Joined:  08/18/15
  • Last Seen:  

I'm a little confused. Are you saying your treasure boxes don't spawn at all?

 

As for how you add a custom item to your treasure chests...

 

Go into your mob_db, look for where your treasure chests. In my db they start at 1324.

1324,TREASURE_BOX1,Treasure Chest,Treasure Chest,99,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,0,0,20,0x120,0,0,0,0,0,0,0,0,0,0,0,0,732,7760,608,3000,607,2500,2504,800,2404,800,2315,800,2104,800,616,1000,0,0,0,0

Let's say your custom item is ID 4200. If you want this chest to drop it, you can change any item ID to 4200. So for example...

 

Change this ---> 616,1000,0,0,0,0

To this ---> 616,1000,4200,500,0,0

 

And that will make your chest spawn with that custom item. The first number (4200) is your item ID, the second number is the rate at which the item drops.

 

I hope this is what you needed!

Edited by greenmagic469
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.01
  • Content Count:  53
  • Reputation:   0
  • Joined:  08/14/15
  • Last Seen:  

thank you..

about the treasure box it wont show on the treasure room at all been changing it rescripting and looking for tutorials on the web cant seem to find the right one :/ they dont spawn at all at server reset.. 

 

wanted it to have 4 treasure box  on sever reset and would have addition boxes for like ever 5 levels of the castle

Edited by jadedlight
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  45
  • Topics Per Day:  0.01
  • Content Count:  157
  • Reputation:   18
  • Joined:  08/18/15
  • Last Seen:  

Hmm... I'm not sure what could be causing this, but there are some possible solutions.

 

Have you considered making an NPC that only a GM can access which lets you spawn chests? This way, when you reset the server, you could use the NPC to manually spawn the boxes in a particular location. It isn't an automatic system but it would probably work for you.

 

Check your settings, maybe treasures got disabled somehow.

Edited by greenmagic469
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.01
  • Content Count:  53
  • Reputation:   0
  • Joined:  08/14/15
  • Last Seen:  

ok thank you will do this one :3 

mind if i ask you have some script like that XD i might end up making it worst than solving it XD kinda new in the scripting world.. made my life FUN as in FUN since i started scripting XD

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  45
  • Topics Per Day:  0.01
  • Content Count:  157
  • Reputation:   18
  • Joined:  08/18/15
  • Last Seen:  

Unfortunately I don't have a script like this but it wouldn't be hard to make. If you're familiar with the basics of scripting you can probably piece it together from scripts around the forum. Just make a standard NPC like you would to display a message but add a menu with a parameter to prevent anyone under a certain GM level from accessing the menu and then add an option to spawn a chest at a particular location. It'll take a little bit of fiddling but I'm sure you'll get it. Practice makes perfect!

 

Good luck.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.01
  • Content Count:  53
  • Reputation:   0
  • Joined:  08/14/15
  • Last Seen:  

thanks will posting my 1st work here XD

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  374
  • Reputation:   46
  • Joined:  03/27/13
  • Last Seen:  

Or just use toasty's woe controller [by ToastOfDoom], it really works very well.

 

https://rathena.org/board/topic/57377-dead-link-toastys-woe-controller/

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  51
  • Topics Per Day:  0.01
  • Content Count:  452
  • Reputation:   33
  • Joined:  12/18/14
  • Last Seen:  

I heard it leaks memory. Wouldn't it be safer to use Euphy's?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.01
  • Content Count:  53
  • Reputation:   0
  • Joined:  08/14/15
  • Last Seen:  

leaking memory :o

that lags the unit right?


ok confirmed that it showed at level 10 castle lol wanted to make it like show 4 TB on a starting level everyday on server reset :/

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.01
  • Content Count:  53
  • Reputation:   0
  • Joined:  08/14/15
  • Last Seen:  

boooooo UPDATE:

 

:/ only shows on other castle.. 

 

anyone know what the ontimer for server reset is?

Link to comment
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.   Paste as plain text instead

  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.

×
×
  • Create New...