trenzerai Posted February 2, 2016 Posted February 2, 2016 Hello everyone, Can anybody help me with this database script. Im using it as function instead of item combo function script str_r { bonus bStr,40; if(isequipped(38089,38089)) { bonus bStr,-20; end; } else if(isequipped(38090,28089)) { bonus bStr,-10; bonus bAgi,30; end; } } Usage: Sample items: str belt a and b and 1 agi belt When i equip the str belt a it should give me +40 to str (single accessory equipped) When i equip both Belts, It would give me a +80 str but will deduct 20 to str, so str = 60 (both accessory equipped) When i equip Str belt a or b and the agi belt, the bonus to agi and str will be +30 P.S. If im @ wrong thread just move this Thanks in advance Quote
0 sotf Posted February 2, 2016 Posted February 2, 2016 Uhm.. Question, why not use item_combo_db.txt? item_db: 30000,str_belt,str_belt,4,30000,,100,,0,,1,0xFFFFFFFF,7,2,136,,0,0,0,{ bonus bStr,40; },{},{} 30001,agi_belt,agi_belt,4,30000,,100,,0,,1,0xFFFFFFFF,7,2,136,,0,0,0,{ bonus bAgi,10; },{},{} item_combo_db: 30000:30000,{ bonus bStr,-20; } 30000:30001,{ bonus bAgi,30; bonus bStr,30; } Quote
0 Moriarty Posted February 2, 2016 Posted February 2, 2016 And to correct your if, use if(isequipped(38089) && isequipped(38089)) { Quote
0 Emistry Posted February 3, 2016 Posted February 3, 2016 { bonus bStr,40; if ( isequippedcnt( 30000 ) >= 2 ) bonus bStr,-10; },{ },{ } 1 Quote
0 trenzerai Posted February 4, 2016 Author Posted February 4, 2016 (edited) { bonus bStr,40; if ( isequippedcnt( 30000 ) >= 2 ) bonus bStr,-10; },{ },{ } Solved @ this script, Im using function because im going to bind the script for 6 different items with 5 different stat additions/deductions, I used this code as the root (on quoted message" and comes up like this: [Start of Single item function script] function script str_r { bonus bStr,40; if( isequippedcnt( 35089 ) >= 2 ) {bonus bStr,-10;} if( isequippedcnt( 35090 ) >= 1 ) {bonus bAgi,15;bonus bStr,-25;} if( isequippedcnt( 35091 ) >= 1 ) {bonus bVit,15;bonus bStr,-25;} if( isequippedcnt( 35092 ) >= 1 ) {bonus bInt,15;bonus bStr,-25;} if( isequippedcnt( 35093 ) >= 1 ) {bonus bDex,15;bonus bStr,-25;} if( isequippedcnt( 35094 ) >= 1 ) {bonus bLuk,15;bonus bStr,-25;} end; } Thx so much for replies. i hope my script would be useful for everybody Edited February 4, 2016 by trenzerai Quote
Question
trenzerai
Hello everyone,
Can anybody help me with this database script.
Im using it as function instead of item combo
Usage:
Sample items: str belt a and b and 1 agi belt
When i equip the str belt a it should give me +40 to str (single accessory equipped)
When i equip both Belts, It would give me a +80 str but will deduct 20 to str, so str = 60 (both accessory equipped)
When i equip Str belt a or b and the agi belt, the bonus to agi and str will be +30
P.S. If im @ wrong thread just move this
Thanks in advance
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.