Lil Troll Posted August 31, 2013 Group: Members Topic Count: 38 Topics Per Day: 0.01 Content Count: 276 Reputation: 24 Joined: 07/06/13 Last Seen: April 19, 2014 Share Posted August 31, 2013 (edited) Hi guys/gals, anyone knows the correct usage of callfunc or autobonus item db script using this one: function script Wand { if ( Weapon$ == "Wand" ) { set WeapEquip, 1; callfunc "Effect"; } } function script Effect { if ( WeapEquip == 1 ) { bonus bMatk,5; } return; } and the db: 15000,Wand_,Wand Wand Wand,4,20,,1500,75,,1,4,0xFFFFFFFF,7,2,2,3,3,1,6,{ callfunc "Wand"; },{},{} Edited August 31, 2013 by Lil Troll Quote Link to comment Share on other sites More sharing options...
1 GmOcean Posted August 31, 2013 Group: Members Topic Count: 31 Topics Per Day: 0.01 Content Count: 666 Reputation: 93 Joined: 04/27/12 Last Seen: August 17, 2015 Share Posted August 31, 2013 Your over thinking things. It' just a matter of seperating the bonuses from the NPC that configures everything. 1. Place everything that deals with: if ( WeaponSelect1$ == "Weapon" ) into a separate npc your players can access to get all that changed. 2. Change,your Special1 | Special1_2 | Special1_3 into just 1 special...right now it's redundant, and not necessary. e.g: if( SpecialSet1 ){ bonus bAtk, (50 * EffectLevel ) / 100; if( SpecialSet2 ){ bonus bMatk, ( 50 * EffectLevel ) / 100; 3. Only put what is needed in each weapon, or it starts to get really messy. 4. Put: set Wea_Equip,1; in the {OnEquip} section of the item. 5. Put: set Wea_Equip,0; in the {UnEquip} section of the item. Following those 5 steps, should clear this up, as well, as make it easier to customize in the future. Quote Link to comment Share on other sites More sharing options...
Prevalence Posted August 31, 2013 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 27 Reputation: 1 Joined: 03/05/13 Last Seen: December 11, 2015 Share Posted August 31, 2013 if ( Weapon$ == "Wand" ) { <<< what do you mean? getitemname? Quote Link to comment Share on other sites More sharing options...
nanakiwurtz Posted August 31, 2013 Group: Members Topic Count: 81 Topics Per Day: 0.02 Content Count: 1654 Reputation: 583 Joined: 08/09/12 Last Seen: May 3 Share Posted August 31, 2013 Item bonus can be placed right on the item_db.txt And what do you want to achieve by using callfunc? Quote Link to comment Share on other sites More sharing options...
Lil Troll Posted August 31, 2013 Group: Members Topic Count: 38 Topics Per Day: 0.01 Content Count: 276 Reputation: 24 Joined: 07/06/13 Last Seen: April 19, 2014 Author Share Posted August 31, 2013 (edited) @TTest: I mean, if he/she wears Wand theres a bonus from wearing it. @Nanakiwurtz: basically I wanted to make this script to work , technically its only part of the script but this is the part am really confused. Idk what will I put in the Item_Db.txt. function script Katar { if ( WeaponSelect1$ == "Katar" ) { set EffectLevel1, Wea_Katar; set Wea_Equip, 1; callfunc "EffectMain"; } else if ( WeaponSelect2$ == "Katar" ) { set EffectLevel2, Wea_Katar; set Wea_Equip, 2; callfunc "EffectMain"; } else end; } function script Music { if ( WeaponSelect1$ == "Instruments" ) { set EffectLevel1, Wea_Music; set Wea_Equip, 1; callfunc "EffectMain"; } else if ( WeaponSelect2$ == "Instruments" ) { set EffectLevel2, Wea_Music; set Wea_Equip, 2; callfunc "EffectMain"; } else end; } if ( Wea_Equip == 1 ) { set EffectLevel, EffectLevel1; if ( Special1_1$ == "Atk" || Special1_2$ == "Atk" || Special1_3$ == "Atk" ) bonus bAtk, ( 50 * EffectLevel ) / 100; if ( Special1_1$ == "Matk" || Special1_2$ == "Matk" || Special1_3$ == "Matk" ) bonus bMatk, ( 50 * EffectLevel ) / 100; if ( Special1_1$ == "Hit" || Special1_2$ == "Hit" || Special1_3$ == "Hit" ) bonus bHit, ( 50 * EffectLevel ) / 100; if ( Special1_1$ == "AspdRate" || Special1_2$ == "AspdRate" || Special1_3$ == "AspdRate" ) bonus bAspdRate, ( 10 * EffectLevel ) / 100; if ( Special1_1$ == "Aspd" || Special1_2$ == "Aspd" || Special1_3$ == "Aspd" ) bonus bAspd, ( 2 * EffectLevel ) / 100; if ( Special1_1$ == "HP" || Special1_2$ == "HP" || Special1_3$ == "HP" ) bonus bMaxHPrate, ( 5 * EffectLevel ) / 100; if ( Special1_1$ == "SP" || Special1_2$ == "SP" || Special1_3$ == "SP" ) bonus bMaxSPrate, ( 5 * EffectLevel ) / 100; if ( Special1_1$ == "HP_Recover" || Special1_2$ == "HP_Recover" || Special1_3$ == "HP_Recover" ) bonus bHPrecovRate, ( 10 * EffectLevel ) / 100; if ( Special1_1$ == "SP_Recover" || Special1_2$ == "SP_Recover" || Special1_3$ == "SP_Recover" ) bonus bSPrecovRate, ( 10 * EffectLevel ) / 100; if ( Special1_1$ == "FloatingCast" || Special1_2$ == "FloatingCast" || Special1_3$ == "FloatingCast" ) bonus bCastRate, ( 10 * EffectLevel ) / 100; if ( Special1_1$ == "FixedCast" || Special1_2$ == "FixedCast" || Special1_3$ == "FixedCast" ) bonus bFixCastRate, ( 10 * EffectLevel ) / 100; if ( Special1_1$ == "HpDrain" || Special1_2$ == "HpDrain" || Special1_3$ == "HpDrain" ) bonus2 bHpDrainRate, ( 5 * EffectLevel ), 15; // (100.00%),(100%) if ( Special1_1$ == "CoolDown" || Special1_2$ == "CoolDown" || Special1_3$ == "CoolDown" ) bonus bDelayRate, -( 10 * EffectLevel ) / 100; if ( Special1_1$ == "Heal" || Special1_2$ == "Heal" || Special1_3$ == "Heal" ) bonus bHealPower, ( 15 * EffectLevel ) / 100; Edited August 31, 2013 by Lil Troll Quote Link to comment Share on other sites More sharing options...
Question
Lil Troll
Hi guys/gals, anyone knows the correct usage of callfunc or autobonus item db script using this one:
and the db:
Edited by Lil TrollLink to comment
Share on other sites
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.