Need help (item bonus)

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

Code:
{ if (getequipisequiped(EQI_ARMOR)) { bonus bVit,5; } if (getequipisequiped(EQI_GARMENT)) { bonus bAgi,5; } },{},{}
 
Last edited by a moderator:
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?

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

default_ani_meow.gif


 
Last edited by a moderator:
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...

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

 
@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)

 
Last edited by a moderator:
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

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

 
Last edited by a moderator:
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;}

 
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

 
Awsome,!

Now this works! hehehe 
default_biggrin.png
 
default_tongue.png


{ 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
 

 
1 more question, how do you make it stackable??

i just noticed, the bonus doesnt stack 
default_tongue.png


 
Last edited by a moderator:
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...

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

 
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.

 
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?

:>

 
Not as simple as I thought. 
default_wacko.png


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:

Code:
{ callfunc("F_EQP",<card_id>); },{},{}
 
Back
Top