Jump to content
bWolfie

Magic Rod - Old Behavior

Recommended Posts

Do you remember a long time ago in eAthena when Magic Rod used to only activate when you are being bolted? Do you miss this behavior?
Well, now you can have it that way. Here's how!

Step 1: Go to src\map\skill.c and find the following lines:

		case SA_MAGICROD:
			clif->skill_nodamage(src,src,SA_MAGICROD,skill_lv,1);
			sc_start(src,bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv));
			break;

Comment the second line so it looks like this:
 

		case SA_MAGICROD:
			//clif->skill_nodamage(src,src,SA_MAGICROD,skill_lv,1);
			sc_start(src,bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv));
			break;

Step 2: Still in skill.c, find the following code:

		#endif /* MAGIC_REFLECTION_TYPE */
		}
		if(sc && sc->data[SC_MAGICROD] && src == dsrc) {
			int sp = skill->get_sp(skill_id,skill_lv);
			dmg.damage = dmg.damage2 = 0;
			dmg.dmg_lv = ATK_MISS; //This will prevent skill additional effect from taking effect. [Skotlex]
			sp = sp * sc->data[SC_MAGICROD]->val2 / 100;
			if(skill_id == WZ_WATERBALL && skill_lv > 1)
				sp = sp/((skill_lv|1)*(skill_lv|1)); //Estimate SP cost of a single water-ball
			status->heal(bl, 0, sp, 2);
		}

Add the following line below status->heal(bl, 0, sp, 2); so it looks like this:
 

		#endif /* MAGIC_REFLECTION_TYPE */
		}
		if(sc && sc->data[SC_MAGICROD] && src == dsrc) {
			int sp = skill->get_sp(skill_id,skill_lv);
			dmg.damage = dmg.damage2 = 0;
			dmg.dmg_lv = ATK_MISS; //This will prevent skill additional effect from taking effect. [Skotlex]
			sp = sp * sc->data[SC_MAGICROD]->val2 / 100;
			if(skill_id == WZ_WATERBALL && skill_lv > 1)
				sp = sp/((skill_lv|1)*(skill_lv|1)); //Estimate SP cost of a single water-ball
			status->heal(bl, 0, sp, 2);
			clif->skill_nodamage(bl, bl, SA_MAGICROD, sc->data[SC_MAGICROD]->val1, 1);
		}


Ta-da! All done. Compile your server and you're good to go. Magic rod now works like the old way!
Pst to devs, maybe we can have configs for stuff like this?

Share this post


Link to post
Share on other sites

please don't instruct them to manually edit the core engine as it makes updating much harder; you should instead make a plugin

and yes, I could add a config flag if many people need this

Share this post


Link to post
Share on other sites

Sad life. I guess this is why no one posts here anymore. Don't know how to make it plugin. Since I don't know how to overwrite stuff from source, only add on top of it (e.g. BUILDIN).

Edited by Myriad

Share this post


Link to post
Share on other sites
5 hours ago, meko said:

please don't instruct them to manually edit the core engine as it makes updating much harder; you should instead make a plugin

and yes, I could add a config flag if many people need this

Why not remove the "source releases" section then?

Share this post


Link to post
Share on other sites
7 hours ago, Myriad said:

Sad life. I guess this is why no one posts here anymore. Don't know how to make it plugin. Since I don't know how to overwrite stuff from source, only add on top of it (e.g. BUILDIN).

Try to create a patch via git :D

Share this post


Link to post
Share on other sites
37 minutes ago, Hirist said:

Try to create a patch via git :D

Yea I know how to do that, but it's the same thing meko don't want which is editing source.

I'm trying to find examples of how to turn the above into a plugin, but kinda struggling. I know how to make atcommands and scriptcommands but not stuff like this.

Share this post


Link to post
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
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.