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

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
  • 0

 

if(getequipid(EQI_HEAD_TOP) || getequipid(EQI_HEAD_MID) || getequipid(EQI_HEAD_LOW)) { bonus bStr,5; } if (getequipid(EQI_ARMOR)) { bonus bVit,5;} if (getequipid(EQI_GARMENT)) { bonus bAgi,5;}

Share this post


Link to post
Share on other sites
  • 0

hmm ok i thought i got it,, but nope...

it works. not the problem is, it gives all the bonuses when i eqquiped the item..

i tried this

 

,{ if (getequipid(EQI_ARMOR)) bonus bVit,5; else if (getequipid(EQI_GARMENT)) bonus bAgi,5; },{},{}

 

it doesnt give the bonus AGI onyl VIT, but when slotted on garment it still gives VIT bonus which is supposed to be AGI



:>

Edited by Critica

Share this post


Link to post
Share on other sites
  • 0

YES.

so the card will have 2 different effects.
ex.
if its sloted on Armor ( +2 str )
if its sloted on Garment ( +2 vit )

on the card effect will be if (eqp armor) +2 STR; else if (eqp garment) + 2 VIT;

so far i have this bonus working

 

{ if (getiteminfo(getequipid(EQI_ARMOR),5)==16) bonus bAgi,5; else if (getiteminfo(getequipid(EQI_GARMENT),5)==4) bonus bVit,5; } 

but the problem is it works on opposite, when armor is eqp it gives VIT and if garm is eqp it gives AGI

and when both item is eqp, the bonus is gone... (it is slotted by card with the effect btw)


Just for the heads up- i costumized the card to be able to slotted on Armor / Garment / HG's
 

4002,Fabre_Card,Fabre Card,6,20,,10,,,,,,,,789,,,,, 


"789" so it can be slotted to those equips,,, this card will have 3 different effects, and will only active depending on which equips it is slotted.

Edited by Critica

Share this post


Link to post
Share on other sites
  • 0

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!

 

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!

try this

 

{ if (getequipid(EQI_ARMOR)) {  bonus bVit,5; } && if (getequipid(EQI_GARMENT)) { bonus bAgi,5; } && if (getequipid(EQI_ARMOR)) { bonus bVit,5; }   },{},{}

 

or removed the if in the 2nd and 3rd....

Edited by unknown

Share this post


Link to post
Share on other sites
  • 0

got an error

 

 

script:add_word: invalid word. A word consists of undercores and/or alfanumeric characters, and valid variable prefixes/postfixes.*  317 : { if (getequipid(EQI_ARMOR)) bonus bVit,5; '&'& if (getequipid(EQI_GARMENT)) bonus bAgi,5; }[Error]: 
Edited by Critica

Share this post


Link to post
Share on other sites
  • 0

try this one,

{ if (getiteminfo(getequipid(EQI_ARMOR),5)==16) { bonus bAgi,5;}  else if (getiteminfo(getequipid(EQI_GARMENT),5)==4) {bonus bVit,5;}  }

 

ur missing only { } inside the effects

Share this post


Link to post
Share on other sites
  • 0

Yep ive tried that, thats one is working,, now the problem is

when you equipped both garment and the armor (with the effects)

it disregard the bonus of the garment, and doubles the effect of the armor,

Here's the result

Equipped with armor ( + 5 AGI ) no garment equipped
Equipped garment ( +5 VIT ) no armor equipped

Both armor and garment eqquiped ( + VIT gone AGI becomes +10
 

Share this post


Link to post
Share on other sites
  • 0

Ok now.. this works now

{ if (getiteminfo(getequipid(EQI_ARMOR),5)==16) { bonus bAgi,5;} if (getiteminfo(getequipid(EQI_GARMENT),5)==4) {bonus bVit,5;}  }

problem now is,,, it doubles both effects...

so it gives +10 VIT and +10 AGI when both equipped (with the card effect)
which is supposed to be only +5 VIT and AGI

Share this post


Link to post
Share on other sites
  • 0

yes it will gone because we use else if, try if only or use &&(and) or this two line ||

 

{ if (getiteminfo(getequipid(EQI_ARMOR),5)==16) { bonus bAgi,5;}  && if(getiteminfo(getequipid(EQI_GARMENT),5)==4) {bonus bVit,5;}  }

Share this post


Link to post
Share on other sites
  • 0

yes it will gone because we use else if, try if only or use &&(and) or this two line ||

 

{ if (getiteminfo(getequipid(EQI_ARMOR),5)==16) { bonus bAgi,5;}  && if(getiteminfo(getequipid(EQI_GARMENT),5)==4) {bonus bVit,5;}  }

Share this post


Link to post
Share on other sites
  • 0

im getting an error when using || and &&

 

{ if (getiteminfo(getequipid(EQI_ARMOR),5)==16) { bonus bAgi,5;} || if (getiteminfo(getequipid(EQI_GARMENT),5)==4) {bonus bVit,5;}  }


as i posted above, the only problem now is it doubled the bonus effect, 

Share this post


Link to post
Share on other sites
  • 0

yes it will gone because we use else if, try if only or use &&(and) or this two line ||

 

{ if (getiteminfo(getequipid(EQI_ARMOR),5)==16) { bonus bAgi,5;}  && if(getiteminfo(getequipid(EQI_GARMENT),5)==4) {bonus bVit,5;}  }

Share this post


Link to post
Share on other sites
  • 0

Now.. id like to work it like this,,,

but instead of those it'll be like
something like this...

Helm(Top/Mid/Low) = +5 INT
Armor = +5 VIT
Garment = +5 AGI

 

Gems.png

 

so far this is the bonus that is working right now but there is still a problem

{ if (getiteminfo(getequipid(EQI_ARMOR),5)==16) { bonus bAgi,5;} if (getiteminfo(getequipid(EQI_GARMENT),5)==4) {bonus bVit,5;}  }

it doulbes the effect when you equipped both of them at the same time (the item with the same slotted card)

Edited by Critica

Share this post


Link to post
Share on other sites
  • 0

sorry im wrong again, let me try it

 

{ { if (getiteminfo(getequipid(EQI_ARMOR),5)==16) { bonus bAgi,5; } } { if (getiteminfo(getequipid(EQI_GARMENT),5)==4) { bonus bVit,5; } } }

 

try this above

Edited by unknown

Share this post


Link to post
Share on other sites
  • 0

(getiteminfo(getequipid(EQI_ARMOR),5)==16

5 = equip , 16 = is Armor ( as far as i know... since it works..)

getiteminfo(getequipid(EQI_GARMENT),5)==4

 

5 = equip , 16 = is Garment
 

Loc: Equipment's placement. Values are:
2^8  256 = Upper Headgear
2^9  512 = Middle Headgear
2^0  001 = Lower Headgear
2^4  016 = Armor
2^1  002 = Weapon
2^5  032 = Shield
2^2  004 = Garment
2^6  064 = Footgear
2^3  008 = Accessory 1

2^7  128 = Accessory 2

 

the problem is that... for ex

when i equipped the Garment(with the card bonus) i get the + AGI only but...

when i equipped any armor i get the "Armor bonus" too ( +VIT )

its like. the bonus works even tho its not equipped on the proper slot( Head/Garment/Armor) as long as you have something equipped on it., the bonus effect will work

 

ive tried this too, but the same problem.

{ if (getequipisequiped(EQI_ARMOR)) { bonus bVit,5; } if (getequipisequiped(EQI_GARMENT)) { bonus bAgi,5; } },{},{}

 

Edited by Critica

Share this post


Link to post
Share on other sites
  • 0

based on the script i made it will get also the bonus when equip the armor while equipping also the garment.

 

i think i know what you want,

 

you want is like this

 

if i equip the armor, i can have the bonus of that armor also

but if i equip the garment, i will loss the bonus of the armor and gained the bonus of garment

 

Am i right?

Share this post


Link to post
Share on other sites
  • 0

try this

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

note: not yet tested...and the effect now is unstackable...

 

:meow:

Share this post


Link to post
Share on other sites
  • 0

try this

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

note: not yet tested...and the effect now is unstackable...

 

:meow:

what do you mean by @bgiven? can you share it master malufett

Share this post


Link to post
Share on other sites
  • 0

@unknown... uhmm here how it should work

Card: Bonus effec ( + 5 AGI when slotted on Armor , + 5 VIT when slotted on Garment ) 
only one effect should work, and depends where it is slotted...

so if

Garment Slotted with this card i gain + 5 VIT ( no AGI )
if Armor Slotted i gain + 5 AGI ( no VIT )


its like getting 2 different kinds of effect, with 1 card but only 1 will work
 

@malufett
Sir, when it works but only when you equipped it 1 @ the same time, but when you equipped both with the "card" the bonus is gone

>> pag inequip mo isa lng gagana ung effect, pero pag dalawa na nka equip with the effect, nwawala na ung effect, ( naubusan na ng egnlish lol)

Edited by Critica

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.