Jump to content
  • 0

Help with Script on Arrow Equip


Question

Posted

Hello guys.

Context first:

Late 2018 I had a on going project on rAthena and one of my mods are on Arrows.

Each arrow reads different Stat Points to give you Attack (Instead of DEX = HIT = More Damage)

So this project was done with 2018 rAthena, and recently I updated my rAthena and had to migrate all the code I've changed to the new rAthena 2022.

 

Now for the problem:

bonus bAtkEle,Ele_Fire;
bonus bAtk2,readparam(bInt)*6;
bonus bDex,readparam(bDex)*-90/100;
if(readparam(bInt)>=99){
	bonus bInt,5;
}

This is what my Fire Arrow's Script looks like in my old project, client "2018-06-21aRagexeRE" and works just fine. The more INT I have, It give's me some Atk2 (Bonus Damage) and only counts for 10% Damage as long the source is DEX.

But after having it tested on my new rAthena Build (2022) it's not working as intended. (No bonus damage added).

I wonder if the way we write scripts on items are different or Am I missing something very obvious.

 

I can provide more files information if needed, and despite not having coding experience, I'll take any comments that might enlighten me.

Thanks

2 answers to this question

Recommended Posts

  • 1
Posted

Some bonuses check equip location.

Go to \src\map\pc.cpp then find target bonus and change sd->state.lr_flag to your desire. (Hover at it you will see tooltip)

  • 1
Posted

Changed this:

		case SP_ATK2:
			if(!sd->state.lr_flag) {
				bonus = status->rhw.atk2 + val;
				status->rhw.atk2 = cap_value(bonus, 0, USHRT_MAX);
			}
			else if (sd->state.lr_flag == 1) {
				bonus = status->lhw.atk2 + val;
				status->lhw.atk2 =  cap_value(bonus, 0, USHRT_MAX);
			}

I just removed the "== 1"

I think this is responsible to make all Bonus2 only appliable from Hand Sources. Maybe I'm wrong, but that fixed my problem.

Thanks!

  • Upvote 1

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...