Jump to content
  • 0

limit castle treasure box


kitty14

Question


  • Group:  Members
  • Topic Count:  103
  • Topics Per Day:  0.02
  • Content Count:  323
  • Reputation:   4
  • Joined:  12/09/13
  • Last Seen:  

Hello! I keep searching how to set treasure castle max to :

10 treasure box only:

5 basic box

5 box with castle drop?

 

 

 


 

Link to comment
Share on other sites

4 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10018
  • Reputation:   2369
  • Joined:  10/28/11
  • Last Seen:  

this line define how many treasure box will be spawned.

https://github.com/rathena/rathena/blob/master/npc/guild/agit_main.txt#L1142

depend on castle economy.

 

if you want fix value, then just edit to something like this

set .@Treasure,5;

5 treasure box.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  103
  • Topics Per Day:  0.02
  • Content Count:  323
  • Reputation:   4
  • Joined:  12/09/13
  • Last Seen:  

thanks for the response emistry.. need to ask some additional info..
what does this mean "(strnpcinfo(2),2)/5+4"?


 

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1282
  • Reputation:   393
  • Joined:  02/03/12
  • Last Seen:  

thanks for the response emistry.. need to ask some additional info..

what does this mean "(strnpcinfo(2),2)/5+4"?

 

strnpcinfo(2)... Is the hidden part of any given npcs name... For example Buffer#prontera <--- the prontera part is hidden from sight.

 

getcastledata(,2)... The ,2 part is for economy ( see spoiler for full list of values below ).

*getcastledata("<map name>",<type of data>)
*setcastledata "<map name>",<type of data>,<value>;

This function returns the castle ownership information for the castle referred 
to by its map name. Castle information is stored in `guild_castle` SQL table.

Types of data correspond to `guild_castle` table columns:

 1 - `guild_id`   - Guild ID.
 2 - `economy`    - Castle Economy score.
 3 - `defense`    - Castle Defense score.
 4 - `triggerE`   - Number of times the economy was invested in today.
 5 - `triggerD`   - Number of times the defense was invested in today.
 6 - `nextTime`   - unused
 7 - `payTime`    - unused
 8 - `createTime` - unused
 9 - `visibleC`   - Is 1 if a Kafra was hired for this castle, 0 otherwise.
10 - `visibleG0`  - Is 1 if the 1st guardian is present (Soldier Guardian)
11 - `visibleG1`  - Is 1 if the 2nd guardian is present (Soldier Guardian)
12 - `visibleG2`  - Is 1 if the 3rd guardian is present (Soldier Guardian)
13 - `visibleG3`  - Is 1 if the 4th guardian is present (Archer Guardian)
14 - `visibleG4`  - Is 1 if the 5th guardian is present (Archer Guardian)
15 - `visibleG5`  - Is 1 if the 6th guardian is present (Knight Guardian)
16 - `visibleG6`  - Is 1 if the 7th guardian is present (Knight Guardian)
17 - `visibleG7`  - Is 1 if the 8th guardian is present (Knight Guardian)

 

So essentially...

 

getcastledata(strnpcinfo(2),2)... Means getcastledata("prontera",2) for the above example ( Buffer#prontera ).

 

So we're getting the economy score for Prontera or whatever guild castle the npc happens to be attached to.

 

Then dividing it by 5 and adding 4...

getcastledata(strnpcinfo(2),2)/5+4

The end result is our .@Treasure variable.

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

Hope that helps.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  103
  • Topics Per Day:  0.02
  • Content Count:  323
  • Reputation:   4
  • Joined:  12/09/13
  • Last Seen:  

thanks for the info /no1

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...