Jump to content
  • 0
Critica

Need help (item bonus)

Question

Halow. just need a quick help

its this possible?

adds +5 to STR if equipped in HELM, if equipped with GARMENT +5 to AGI, if eqp with ARMOR +5 to VIT.

only 1 bonus will work, and depends on where it was equipped, this is a card bonus btw.


im making a custom card type item that can be slotted to HELM or GARMENT or ARMOR but will change bonus depends on where it is equp.

an example bonus would much be appriciated biggrin.png thanks!

Share this post


Link to post
Share on other sites

37 answers to this question

Recommended Posts

  • 0

 

--

Card: Bonus effec ( + 5 AGI when eqiupped on Armor , + 5 VIT when equipped on Garment ) 

 

only one effect should work, and depends where it is slotted...

 

the post is your answer

 

you said it depends where it is slotted, but you put it also in item which is slotted thats why they are both have effects

 

yes! it does work, now the problem is"

 

when you have the "card" for example

 

Garment with the slotted card, it gives me bonus but when i equipped "Any" armor, i suddenly get 

the bonus for armor too, even tho i dont have the "card" on that armor,,, get what im trying to say?

 

my english is bad sorry., :<

Edited by Critica

Share this post


Link to post
Share on other sites
  • 0

Maybe something taking Malu's good idea would work?

 

{ if (getiteminfo(getequipid(EQI_ARMOR),5)==16 && @bgiven == 0) { bonus bAgi,5; set @bgiven,1;} if (getiteminfo(getequipid(EQI_GARMENT),5)==4 && @bgiven2 == 0) {bonus bVit,5; set @bgiven2,1;}  },{},{set @bgiven,0; set @bgiven2,0;}

Share this post


Link to post
Share on other sites
  • 0

 

 

--

Card: Bonus effec ( + 5 AGI when eqiupped on Armor , + 5 VIT when equipped on Garment ) 

 

only one effect should work, and depends where it is slotted...

 

the post is your answer

 

you said it depends where it is slotted, but you put it also in item which is slotted thats why they are both have effects

 

yes! it does work, now the problem is"

 

when you have the "card" for example

 

Garment with the slotted card, it gives me bonus but when i equipped "Any" armor, i suddenly get 

the bonus for armor too, even tho i dont have the "card" on that armor,,, get what im trying to say?

 

my english is bad sorry., :<

yeah i get what ur saying now, try jaBote script it will work now

Share this post


Link to post
Share on other sites
  • 0

Awsome,!

Now this works! hehehe  :D  :P

{ if (getiteminfo(getequipid(EQI_ARMOR),5)==16 && @bgiven == 0) { bonus bAgi,5; set @bgiven,1;} if (getiteminfo(getequipid(EQI_GARMENT),5)==4 && @bgiven2 == 0) {bonus bVit,5; set @bgiven2,1;}  },{},{set @bgiven,0; set @bgiven2,0;}


a slight problem, when you eqp the item 1 by 1, the 1st bonus will be gone but when you reequipped it again it will work perfectly.

THANK YOU ALL!! i knew this is possible, i just didnt knew about that "@bgiven" thing


THANKSTHANKSTHANKS
 

Share this post


Link to post
Share on other sites
  • 0

I can't find right now any way of making this possible, since it supposes armors will have only up to 1 slot. Thinking for a possible solution...

Share this post


Link to post
Share on other sites
  • 0

Hey guys, im thingking something like this might work...

im still working on it, 

 

{ if (getiteminfo(getequipid(EQI_ARMOR),5)==16 && @bgiven == 0) { bonus bAgi,5 + isequipped(4002); set @bgiven,1;} if (getiteminfo(getequipid(EQI_GARMENT),5)==4 && @bgiven2 == 0) {bonus bVit,5 + isequipped(4002); set @bgiven2,1;}  },{},{set @bgiven,0; set @bgiven2,0;}

adding + isequipped(4002) then just multiply it by 5, something like that... 

Share this post


Link to post
Share on other sites
  • 0

You could also get 4 versions of this card, with 4 different couples of @vars and making the user able to exchange them. Maybe it'll work.

Share this post


Link to post
Share on other sites
  • 0

ok right now this works,

{ if (getiteminfo(getequipid(EQI_ARMOR),5)==16 && @bgiven == 0) { bonus bAgi,5 + isequippedcnt(4002)*5-5; set @bgiven,1;} if (getiteminfo(getequipid(EQI_GARMENT),5)==4 && @bgiven2 == 0) {bonus bVit,5 + isequippedcnt(4002)*5-5; set @bgiven2,1;}  },{},{set @bgiven,0; set @bgiven2,0;}


problem now is... (love this part) that it also counts the cards with the same name(ID's) on the other
equipment, is there any other way to count only the cards on the equipment where it is slotted?

:>

Share this post


Link to post
Share on other sites
  • 0

Not as simple as I thought.  :wacko:

function	script	F_EQP	{	// End all other sessions	if (@totalSession > 0) {		@totalSession--;		return;	}	.@card_id = getarg(0);				// Equipment Slot	.@type[0] = EQI_HEAD_TOP;	.@type[1] = EQI_ARMOR;	.@type[2] = EQI_GARMENT;			for (.@i = 0; .@i < getarraysize(.@type); .@i++)		for (.@c = 0; .@c < getequipcardcnt(.@type[.@i]); .@c++)			if (getequipcardid(.@type[.@i],.@c) == .@card_id)				setd ".@tmp_eqp[" + .@i + "]", getd(".@tmp_eqp[" + .@i + "]") + 1;					for (.@i = 0; .@i < getarraysize(.@type); .@i++)		if (getd(".@tmp_eqp[" + .@i + "]") > 0)			@totalSession++;				if (@totalSession == 0) {		debugmes "Unexpected return... o.o";		return;	}	for (.@i = 0; .@i < getarraysize(.@type); .@i++)		if (getd(".@tmp_eqp[" + .@i + "]") != @eqp[.@i]) {			.@check = .@check | (1 << .@i);			break;		}		if (.@check < 1) 		@totalSession--;		for (.@i = 0; .@i < getarraysize(.@type); .@i++) {		switch (.@i) {	// .@type index number		case 0: bonus bStr,getd(".@tmp_eqp[" + .@i + "]") * 5; break;		case 1: bonus bAgi,getd(".@tmp_eqp[" + .@i + "]") * 5; break;		case 2: bonus bVit,getd(".@tmp_eqp[" + .@i + "]") * 5; break;		}		if (.@check & (1 << .@i) > 0) {			@totalSession--;			@eqp[.@i] = getd(".@tmp_eqp[" + .@i + "]");		}	}	return;	} 

 

Usage:

{ callfunc("F_EQP",<card_id>); },{},{}

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

×
×
  • Create New...

Important Information

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