Critica 2 Posted July 10, 2013 Halow. just need a quick helpits 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 thanks! Quote Share this post Link to post Share on other sites
0 Joseph 6 Posted July 14, 2013 Not as simple as I thought. 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>); },{},{} 1 jaBote reacted to this Quote Share this post Link to post Share on other sites
0 quesoph 105 Posted July 10, 2013 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;} Quote Share this post Link to post Share on other sites
0 Critica 2 Posted July 10, 2013 thats what im looking for! gona try it later,thanks for the idea! Quote Share this post Link to post Share on other sites
0 Critica 2 Posted July 10, 2013 (edited) 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 July 10, 2013 by Critica Quote Share this post Link to post Share on other sites
0 quesoph 105 Posted July 10, 2013 So you want if you equip your top headgear with card that has +5 str. low and mid headgear card effect wont work ? Quote Share this post Link to post Share on other sites
0 Critica 2 Posted July 10, 2013 (edited) 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 AGIand 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 July 10, 2013 by Critica Quote Share this post Link to post Share on other sites
0 unknown 5 Posted July 10, 2013 (edited) 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 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 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 July 10, 2013 by unknown Quote Share this post Link to post Share on other sites
0 Critica 2 Posted July 10, 2013 (edited) 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 July 10, 2013 by Critica Quote Share this post Link to post Share on other sites
0 unknown 5 Posted July 10, 2013 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 Quote Share this post Link to post Share on other sites
0 Critica 2 Posted July 10, 2013 Yep ive tried that, thats one is working,, now the problem iswhen 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 resultEquipped with armor ( + 5 AGI ) no garment equippedEquipped garment ( +5 VIT ) no armor equippedBoth armor and garment eqquiped ( + VIT gone AGI becomes +10 Quote Share this post Link to post Share on other sites
0 Critica 2 Posted July 10, 2013 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 Quote Share this post Link to post Share on other sites
0 unknown 5 Posted July 10, 2013 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;} } Quote Share this post Link to post Share on other sites
0 unknown 5 Posted July 10, 2013 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;} } Quote Share this post Link to post Share on other sites
0 Critica 2 Posted July 10, 2013 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, Quote Share this post Link to post Share on other sites
0 unknown 5 Posted July 10, 2013 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;} } Quote Share this post Link to post Share on other sites
0 Critica 2 Posted July 10, 2013 dude u posted the same thing 3times now XD Quote Share this post Link to post Share on other sites
0 unknown 5 Posted July 10, 2013 yeah sorry, i will try later bcoz i feel sleepy and i want to share also the bifrost info here Quote Share this post Link to post Share on other sites
0 Critica 2 Posted July 11, 2013 (edited) Now.. id like to work it like this,,,but instead of those it'll be likesomething like this...Helm(Top/Mid/Low) = +5 INTArmor = +5 VITGarment = +5 AGI 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 July 11, 2013 by Critica Quote Share this post Link to post Share on other sites
0 unknown 5 Posted July 11, 2013 (edited) 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 July 11, 2013 by unknown Quote Share this post Link to post Share on other sites
0 Critica 2 Posted July 11, 2013 (edited) (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 July 11, 2013 by Critica Quote Share this post Link to post Share on other sites
0 unknown 5 Posted July 11, 2013 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? Quote Share this post Link to post Share on other sites
0 malufett 247 Posted July 11, 2013 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... Quote Share this post Link to post Share on other sites
0 unknown 5 Posted July 11, 2013 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... what do you mean by @bgiven? can you share it master malufett Quote Share this post Link to post Share on other sites
0 Critica 2 Posted July 11, 2013 (edited) @unknown... uhmm here how it should workCard: 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 ifGarment 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 @malufettSir, 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 July 11, 2013 by Critica Quote Share this post Link to post Share on other sites
0 Critica 2 Posted July 11, 2013 (edited) -- Edited July 11, 2013 by Critica Quote Share this post Link to post Share on other sites
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 thanks!
Share this post
Link to post
Share on other sites