Jump to content
  • 0
Sign in to follow this  
legion

Item Script Request

Question

Hi, this script is complicated, I tried doing this with what I see in item_bonus.txt but can't get it to work, please help.
 
If base STR is 90+, All State +1, MaxHP,MaxSP +1%, STR + 1 for each refine upgrade.
When hunting monsters, EXP and DROP rate increased by 10%.

Share this post


Link to post
Share on other sites

9 answers to this question

Recommended Posts

  • 0
if(readparam(bStr)>=90) bonus bAllStats,1;bonus bMaxHPrate,1;bonus bMaxSPrate,1;bonus bStr,getrefine();sc_start SC_CASH_RECEIVEITEM,-1,10;sc_start SC_CASH_PLUSEXP,-1,10; 

 

 

 

and on unequip add those:

 

sc_end SC_CASH_RECEIVEITEM;sc_end SC_CASH_PLUSEXP; 

 

 

 

PS: I'm not sure of the green value, you need to test it :P

 

@edited thanks mumbles

Edited by evilpuncker

Share this post


Link to post
Share on other sites
  • 0

Item script:

// Item scriptif (readparam(bStr) >= 90) {	bonus bAllStats, 1;	bonus bMaxHPrate, 1;	bonus bMaxSPrate, 1;	bonus bStr, getrefine();}ModDrop = 150;ModExp = 150;

 

Unequip script:

// Unequip scriptModDrop = 100;ModExp = 100;

 

Login / logout check (separate file):

-	script	check_items	-1,{	// Login check	OnPCLoginEvent:		if (isequipped(Knife)) {			ModDrop = 150;			ModExp = 150;		}				end;					// Logout reset	OnPCLogoutEvent:		ModDrop = 100;		ModExp = 100;		end;	}

 


 

I guess @evilpuncker beat me to this haha, but I suppose either solution would work.

 

@evilpuncker: You can use getrefine() to return the value of the invoking equipment's refine level.

Share this post


Link to post
Share on other sites
  • 0

Item script:

// Item scriptif (readparam(bStr) >= 90) {	bonus bAllStats, 1;	bonus bMaxHPrate, 1;	bonus bMaxSPrate, 1;	bonus bStr, getrefine();}ModDrop = 150;ModExp = 150;

 

Unequip script:

// Unequip scriptModDrop = 100;ModExp = 100;

 

Login / logout check (separate file):

-	script	check_items	-1,{	// Login check	OnPCLoginEvent:		if (isequipped(Knife)) {			ModDrop = 150;			ModExp = 150;		}				end;					// Logout reset	OnPCLogoutEvent:		ModDrop = 100;		ModExp = 100;		end;	}

 


 

I guess @evilpuncker beat me to this haha, but I suppose either solution would work.

 

@evilpuncker: You can use getrefine() to return the value of the invoking equipment's refine level.

Either solution works, but as you say it, evilpuncker beat you to this, since his solution doesn't require to add additional script for login/logout, but your solution works as flawless as his, Thanks to both of you! :)

Share this post


Link to post
Share on other sites
  • 0

The only benefit I could see in using my version would be its immunity to this sc_end SC_ALL; as it is not a status condition and would not terminate unexpectedly if a player were to encounter such a script command.

 

Disclaimer: I've never actually bothered to use SC_CASH_* bonuses, so I'm not entirely sure if SC_ALL includes these as well; it may or may not be affected by sc_end SC_ALL;.

Share this post


Link to post
Share on other sites
  • 0

why use OnPCLoginEvent / OnPCLogoutEvent ?

update item_db_re setscript = 'if ( readparam(bStr) >= 90 ) { bonus bAllStats,1; bonus bMaxHPrate,1; bonus bMaxSPrate,1; bonus bStr, getrefine(); }',equip_script = 'if ( readparam(bStr) >= 90 ) { ModExp = ModDrop = 110; }',unequip_script = 'if ( readparam(bStr) >= 90 ) { ModExp = ModDrop = 100; }'where id = 1201;

Share this post


Link to post
Share on other sites
  • 0

 

why use OnPCLoginEvent / OnPCLogoutEvent ?

update item_db_re setscript = 'if ( readparam(bStr) >= 90 ) { bonus bAllStats,1; bonus bMaxHPrate,1; bonus bMaxSPrate,1; bonus bStr, getrefine(); }',equip_script = 'if ( readparam(bStr) >= 90 ) { ModExp = ModDrop = 110; }',unequip_script = 'if ( readparam(bStr) >= 90 ) { ModExp = ModDrop = 100; }'where id = 1201;

 

Interesting shorthand. o.o

 

I added the login/logout events because Ind said it's an account-wide modifications, even though the parameter appears to be character-based; the modification would (in theory) linger for other characters on the account, even if the item is not equipped.

 

 

 

 

[21:01:41] <Luciano> its not a script command its a param like set zeny
[21:01:46] <Luciano> set BaseExp,value;
[21:02:11] <Luciano> ops
[21:02:12] <Luciano> ModExp 125 1
[21:02:13] <Luciano> ModDrop 126 1
[21:02:13] <Luciano> ModDeath 127 1
[21:02:20] <Luciano> ModExp, ModDrop
[21:02:24] <Luciano> e.g.
[21:02:27] <Luciano> set ModExp,150;
[21:02:30] <Mumbles> interesting
[21:02:34] <Luciano> account gets +50% erxp
[21:02:40] <Mumbles> account or char?
[21:03:16] <Luciano> account
[21:03:24] <Luciano> there isnt a built in char exp mod

 

 

Share this post


Link to post
Share on other sites
  • 0

The only benefit I could see in using my version would be its immunity to this sc_end SC_ALL; as it is not a status condition and would not terminate unexpectedly if a player were to encounter such a script command.

 

Disclaimer: I've never actually bothered to use SC_CASH_* bonuses, so I'm not entirely sure if SC_ALL includes these as well; it may or may not be affected by sc_end SC_ALL;.

Actually what I did is to combine evilpuncker's and your script and ended up like this:

 

Script: <"
if(readparam(bStr)>=90) bonus bAllStats,1;
if(readparam(bStr)>=90) bonus bMaxHPrate,1;
if(readparam(bStr)>=90) bonus bMaxSPrate,1;
if(readparam(bStr)>=90) bonus bStr,(getrefine());
ModDrop = 110;
ModExp = 110;
">
OnUnequipScript: <"
ModDrop = 100;
ModExp = 100;
">

 

And works totally great! :)

Share this post


Link to post
Share on other sites
  • 0

no it doesn't

Mumbles is right

when I read the source I saw SP_MOD_EXP and I thought it is like a *bonus type command

 

but it actually store the data in `account_data` table

which this table alter the value for the whole account

 

using my script, or the script in post#8, will have an exploit that

equip the item, logout, login another char in the same account

then that character will be having increased exp/drop rate without equipping the item

(you'll get the brown color announcement upon login ... very easy to spot this bug)

 

no, this ModDrop, ModExp and ModDeath is not meant for item bonuses,

its meant for VIP accounts

 

has to do like EvilPunker did

Share this post


Link to post
Share on other sites
  • 0

no it doesn't

Mumbles is right

when I read the source I saw SP_MOD_EXP and I thought it is like a *bonus type command

 

but it actually store the data in `account_data` table

which this table alter the value for the whole account

 

using my script, or the script in post#8, will have an exploit that

equip the item, logout, login another char in the same account

then that character will be having increased exp/drop rate without equipping the item

(you'll get the brown color announcement upon login ... very easy to spot this bug)

 

no, this ModDrop, ModExp and ModDeath is not meant for item bonuses,

its meant for VIP accounts

 

has to do like EvilPunker did

Oh yeah, it does give the other characters the exp bonus too when one character is wearing the item. Thanks AnnieRuru, gonna use 

 

sc_start SC_CASH_RECEIVEITEM,-1,10;

sc_start SC_CASH_PLUSEXP,-1,10;

 

and

 

sc_end SC_CASH_RECEIVEITEM;

sc_end SC_CASH_PLUSEXP;  then.

Share this post


Link to post
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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.