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 Critica 2 Posted July 11, 2013 (edited) -- 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 July 11, 2013 by Critica Quote Share this post Link to post Share on other sites
0 jaBote 438 Posted July 11, 2013 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;} Quote Share this post Link to post Share on other sites
0 unknown 5 Posted July 11, 2013 -- 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 Quote Share this post Link to post Share on other sites
0 Critica 2 Posted July 11, 2013 Awsome,!Now this works! hehehe { 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 Quote Share this post Link to post Share on other sites
0 unknown 5 Posted July 11, 2013 mark it a solved Quote Share this post Link to post Share on other sites
0 Critica 2 Posted July 11, 2013 (edited) 1 more question, how do you make it stackable??i just noticed, the bonus doesnt stack Edited July 11, 2013 by Critica Quote Share this post Link to post Share on other sites
0 Critica 2 Posted July 11, 2013 PLS MAKE THIS STACKABLE T___________T Quote Share this post Link to post Share on other sites
0 jaBote 438 Posted July 11, 2013 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... Quote Share this post Link to post Share on other sites
0 Critica 2 Posted July 11, 2013 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... Quote Share this post Link to post Share on other sites
0 jaBote 438 Posted July 11, 2013 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. Quote Share this post Link to post Share on other sites
0 Critica 2 Posted July 11, 2013 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 otherequipment, is there any other way to count only the cards on the equipment where it is slotted?:> 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
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