Jump to content
  • 0

Question

Posted (edited)

I tried adding this code in skill.c

   		if (skill_id == SL_PRIEST) {
			clif_skill_nodamage(src,bl,skill_id,skill_lv,
				sc_start4(src,bl,SC_REFLECTSHIELD,100,7,skill_id,0,0,skill_get_time(skill_id,skill_lv)));
		}

To Automatically receives Lv.7 "Reflect Shield" status that will make melee attacks to be reflected.

It worked fine when a Soul Linker Job casts the spell on the priest.

But when i created an item with this item bonus:

skilleffect "SL_PRIEST",0; sc_start4 SC_SPIRIT,350000,5,454,0,0;

After the using item, the soul link doesn't work.

 

I provided screenshots:

a) When used an item with the given itembonus. NOT WORKING

b) When a Soul Linker casts the spell. WORKING

screenYourServerName005.jpg

screenYourServerName004.jpg

Edited by xilence01

4 answers to this question

Recommended Posts

  • 1
Posted (edited)

I think you'd rather put it in status.c instead of skill.c. This is because script.c BUILDIN(sc_start) directly accesses status.c's status_change_start() instead of skill.c's skill_castend_nodamage_id(). So you'll never achieve it if using your current implementation.

hence:

status.c

status_change_start

		case SC_SPIRIT:
			//1st Transcendent Spirit works similar to Marionette Control
			if(sd && val2 == SL_HIGH) {
				int stat,max_stat;
				struct status_data *status2 = status_get_base_status(bl);

				val3 = 0;
				val4 = 0;
				max_stat = (status_get_lv(bl)-10<50)?status_get_lv(bl)-10:50;
				stat = max(0, max_stat - status2->str); val3 |= cap_value(stat,0,0xFF)<<16;
				stat = max(0, max_stat - status2->agi ); val3 |= cap_value(stat,0,0xFF)<<8;
				stat = max(0, max_stat - status2->vit ); val3 |= cap_value(stat,0,0xFF);
				stat = max(0, max_stat - status2->int_); val4 |= cap_value(stat,0,0xFF)<<16;
				stat = max(0, max_stat - status2->dex ); val4 |= cap_value(stat,0,0xFF)<<8;
				stat = max(0, max_stat - status2->luk ); val4 |= cap_value(stat,0,0xFF);
			}
			if (sd && val2 == SL_PRIEST) {
				int skill_id = val2;
				int skill_lv = val1;
				clif_skill_nodamage(src, bl, skill_id, skill_lv,
					sc_start4(src, bl, SC_REFLECTSHIELD, 100, 7, skill_id, 0, 0, skill_get_time(skill_id, skill_lv)));
			}
			break;

 

I noticed that you are still using ".c" which means you're not using the latest rA. I've tested this in latest rA and might not work for you. Try it nonetheless.

Edited by Ninja
  • Love 1
  • 0
Posted
1 hour ago, Ninja said:

I think you'd rather put it in status.c instead of skill.c. This is because script.c BUILDIN(sc_start) directly accesses status.c's status_change_start() instead of skill.c's skill_castend_nodamage_id(). So you'll never achieve it if using your current implementation.

hence:

status.c

status_change_start


		case SC_SPIRIT:
			//1st Transcendent Spirit works similar to Marionette Control
			if(sd && val2 == SL_HIGH) {
				int stat,max_stat;
				struct status_data *status2 = status_get_base_status(bl);

				val3 = 0;
				val4 = 0;
				max_stat = (status_get_lv(bl)-10<50)?status_get_lv(bl)-10:50;
				stat = max(0, max_stat - status2->str); val3 |= cap_value(stat,0,0xFF)<<16;
				stat = max(0, max_stat - status2->agi ); val3 |= cap_value(stat,0,0xFF)<<8;
				stat = max(0, max_stat - status2->vit ); val3 |= cap_value(stat,0,0xFF);
				stat = max(0, max_stat - status2->int_); val4 |= cap_value(stat,0,0xFF)<<16;
				stat = max(0, max_stat - status2->dex ); val4 |= cap_value(stat,0,0xFF)<<8;
				stat = max(0, max_stat - status2->luk ); val4 |= cap_value(stat,0,0xFF);
			}
			if (sd && val2 == SL_PRIEST) {
				int skill_id = val2;
				int skill_lv = val1;
				clif_skill_nodamage(src, bl, skill_id, skill_lv,
					sc_start4(src, bl, SC_REFLECTSHIELD, 100, 7, skill_id, 0, 0, skill_get_time(skill_id, skill_lv)));
			}
			break;

 

I noticed that you are still using ".c" which means you're not using the latest rA. I've tested this in latest rA and might not work for you. Try it nonetheless.

Its working fine now. Thanks a lot!

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...