Jump to content

[script] itembonus with certain flags to use.


RyotoRyo

Recommended Posts


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   1
  • Joined:  06/04/13
  • Last Seen:  

Hi everyone,

I am not the owner of this script command thought, but I implement it with my style.  :)

I test on r17348 and use VS2010 to compile.

 

This Command format is,

*itembonus "{script}",<duration>,<group>,<priority>{,<flags>};

You can use this command on Usable item.

such as,

12710,Guyak_Pudding,Guyak Pudding,2,40,,200,,,,,0xFFFFFFFF,7,2,,,,,,{ itembonus "{bonus bSpeedAddRate,100;}",300000,41,1,7; },{},{}

Guyak Pudding will have effect to speed player up 100% for 5min and

the effect will go away if player 1. time limit match 2. disconnect 3. change map 4.dead.

 

Arguments of this command are,

"{script}" -
bonus that you want to attach to player, such as bonus bAspd,n; ... etc.
<durantion> -
time limit for the effect, when time's up, the effect will go away.
<group> -
<priority> -
to set the group and priority of this itembonus. It's limited to 999.

When two itembonus is the same group, it will compare the priority that which one is more higher then keep older itembonus or use new itembonus to replace. 
For example :
A: itembonus "{bonus bAspd,3;}",300000,10,1;
B: itembonus "{bonus bAspd,5;}",500000,10,3;

the group for A and B is the same, but A's priority is lower than B.

if player eat B after A, the effect of B will replace A's effect.
player Aspd xxx+3 -> xxx+5

if player eat A after B, since A'priority is lower than B, it will keep B's effect.
Player Aspd xxx+5 -> xxx+5

but, if player eat A after A?
For example : 
C: itembonus "{bonus bAspd,3;}",300000,10,3;
D: itembonus "{bonus bAspd,3;}",500000,10,3;

C and D have same group and priority, if player eat D after C, 
what kind of situation will occur?

if two itembonus have same group and priority, 
the longer duration itembonus will be use.

for upper situation, the remaining time of C is less than D, 
D's effect will replace C's effect.

but if player eat D for a while than eat C, if the remaining time of D is less than C.
C's effect will replace D.
such as, if player eat C after D passed 3min, the remaining time of D is 2min and C will have 3min effect, C's effect will replace D.

{,<flags>} - 
there four flags,
0 - keep effect until time's up.
1 - if player disconnect, the effect will not keep.
2 - if player change map, the effect will not keep.
4 - if player dead, the effect will not keep.

you can just add them to meet the situation you want, such as
3 - if player disconnect or change map, the effect will not keep.
5 - if player disconnect or dead, the effect will not keep.
... etc.
this value default is 0.

 

For more notice, I think "{script}" should just use item_bonus script, if you want to use conditional statement command.

I recommend used like below.

if(BaseLevel > 90){itembonus "{ bonus bMaxHPrate,40; }",1200000,1,4,4; } -- O
itembonus "{ if(BaseLevel > 90){ bonus bMaxHPrate,40; } }",1200000,1,4,4;-- X

 

*And two things you should be careful, bonus script cannot over 128 characters and I set each players can only have 20 itembonus. /spit

 

And ..... Thanks for everyone to read my poor English. /thx

 

itembonus.7z

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


  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  509
  • Reputation:   80
  • Joined:  11/20/11
  • Last Seen:  

the simple word is SC_START itemBonus; ?



nice script /no1

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   1
  • Joined:  06/04/13
  • Last Seen:  

@OceanBlue

mm.. itemBonus is not a SC_ effect, its a depend script command used on usable items.  :)  

 

such as,

30108,S_HP_SP,S_HP_SP,2,10,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ itembonus "{ bonus bMaxHPrate,40; bonus bMaxSPrate,40; }",1200000,1,4,4; },{},{}
 

this item will make player hp + 40% and sp + 40% for 20min and the effect only go away when player dead or time's up.  /shy

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
Reply to this topic...

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