Jump to content
  • 0

How make Script on Ammunition (Arrow) works?


kyenard

Question


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.01
  • Content Count:  18
  • Reputation:   1
  • Joined:  08/19/19
  • Last Seen:  

Title.

I understand that eAthena has some kind of setting that won't read the script line attached to any Arrow/Ammunition Item. I found this line on Status.c but can't really find a way to make it work.

if(sd->equip_index[EQI_AMMO] >= 0) {
		index = sd->equip_index[EQI_AMMO];
		if(sd->inventory_data[index]) { // Arrows
			sd->bonus.arrow_atk += sd->inventory_data[index]->atk;
			sd->param_equip,sd->param_bonus,sizeof(sd->param_equip);
			sd->param_bonus, 0, sizeof(sd->param_bonus);
			sd->state.lr_flag = 2;
			if( !itemdb_group_item_exists(IG_THROWABLE, sd->inventory_data[index]->nameid) ) // Don't run scripts on throwable items
				run_script(sd->inventory_data[index]->script,0,sd->bl.id,0);
			sd->state.lr_flag = 0;
			if (!calculating) // Abort, run_script retriggered status_calc_pc. [Skotlex]
				return 1;
		}
	}

Maybe is not a simples change 0 to 1, I understand, but If you can read better than I do, I would like to hear from you where could I change to make it happen. Thank you guys in advance for the help.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.01
  • Content Count:  18
  • Reputation:   1
  • Joined:  08/19/19
  • Last Seen:  

52 minutes ago, kyenard said:

Title.

I understand that eAthena has some kind of setting that won't read the script line attached to any Arrow/Ammunition Item. I found this line on Status.c but can't really find a way to make it work.


if(sd->equip_index[EQI_AMMO] >= 0) {
		index = sd->equip_index[EQI_AMMO];
		if(sd->inventory_data[index]) { // Arrows
			sd->bonus.arrow_atk += sd->inventory_data[index]->atk;
			sd->param_equip,sd->param_bonus,sizeof(sd->param_equip);
			sd->param_bonus, 0, sizeof(sd->param_bonus);
			sd->state.lr_flag = 2;
			if( !itemdb_group_item_exists(IG_THROWABLE, sd->inventory_data[index]->nameid) ) // Don't run scripts on throwable items
				run_script(sd->inventory_data[index]->script,0,sd->bl.id,0);
			sd->state.lr_flag = 0;
			if (!calculating) // Abort, run_script retriggered status_calc_pc. [Skotlex]
				return 1;
		}
	}

Maybe is not a simples change 0 to 1, I understand, but If you can read better than I do, I would like to hear from you where could I change to make it happen. Thank you guys in advance for the help.

Okay, before posting here I spent 4 straight hours trying a bunch of different things and couldn't find a right way to do it. Moments after posting here I found this post: Arrow Don't Work

The solution presented is to delete the Flag on the script, although Is a different script, the structure is similar and made me think about my script one more time. So I deleted my Flag : "sd-> state.lr_flag = 2;" and that was the solution.

I might leave this post here for future references.

Thanks to rAthena community I was able to solve this one. Thanks guys.

Edited by kyenard
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...