Jump to content
  • 0

Item bonus callfunc..


Lil Troll

Question


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  276
  • Reputation:   24
  • Joined:  07/06/13
  • Last Seen:  

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 by Lil Troll
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

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.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  27
  • Reputation:   1
  • Joined:  03/05/13
  • Last Seen:  

if ( Weapon$ == "Wand" ) { <<< what do you mean? getitemname?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  1654
  • Reputation:   583
  • Joined:  08/09/12
  • Last Seen:  

Item bonus can be placed right on the item_db.txt

And what do you want to achieve by using callfunc?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  276
  • Reputation:   24
  • Joined:  07/06/13
  • Last Seen:  

@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 by Lil Troll
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...