Jump to content
  • 0

How do i make "Stealth Field" (Mado skill) not cancelled by land protector


anjasoleil1

Question


  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  65
  • Reputation:   0
  • Joined:  05/11/14
  • Last Seen:  

How do i make "Stealth Field" (Mado skill) not cancelled by land protector

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.03
  • Content Count:  112
  • Reputation:   9
  • Joined:  09/22/19
  • Last Seen:  

On 8/18/2020 at 9:06 AM, anjasoleil1 said:

How do i make "Stealth Field" (Mado skill) not cancelled by land protector


The easiest way would be to go into the skill_db (either .yml or .txt, depending on how old your file is) and adding it as not being affected by land protector. Look for the inf3 section. If you want to do it the more difficult way, you could:


In skill.cpp, look for this:

	switch (skill_id) {
		case SA_LANDPROTECTOR:
			if( unit->group->skill_id == SA_LANDPROTECTOR ) {//Check for offensive Land Protector to delete both. [Skotlex]
				(*alive) = 0;
				skill_delunit(unit);
				return 1;
			}
			//It deletes everything except traps and barriers
			if ((!(skill_get_inf2(unit->group->skill_id)&(INF2_TRAP)) && !(skill_get_inf3(unit->group->skill_id)&(INF3_NOLP))) || unit->group->skill_id == WZ_FIREPILLAR || unit->group->skill_id == GN_HELLS_PLANT) {
				if (skill_get_unit_flag(unit->group->skill_id)&UF_RANGEDSINGLEUNIT) {
					if (unit->val2&UF_RANGEDSINGLEUNIT)
						skill_delunitgroup(unit->group);
				} else
					skill_delunit(unit);
				return 1;
			}
			break;


And change it to this:
 

	switch (skill_id) {
		case SA_LANDPROTECTOR:
			if( unit->group->skill_id == SA_LANDPROTECTOR ) {//Check for offensive Land Protector to delete both. [Skotlex]
				(*alive) = 0;
				skill_delunit(unit);
				return 1;
			}
			//It deletes everything except traps and barriers
			if ((!(skill_get_inf2(unit->group->skill_id)&(INF2_TRAP)) && !(skill_get_inf3(unit->group->skill_id)&(INF3_NOLP))) || unit->group->skill_id == WZ_FIREPILLAR || unit->group->skill_id == NC_STEALTHFIELD || unit->group->skill_id == GN_HELLS_PLANT) {
				if (skill_get_unit_flag(unit->group->skill_id)&UF_RANGEDSINGLEUNIT) {
					if (unit->val2&UF_RANGEDSINGLEUNIT)
						skill_delunitgroup(unit->group);
				} else
					skill_delunit(unit);
				return 1;
			}
			break;



And also look for this: 
 

	if( !(skill_get_inf2(group->skill_id)&(INF2_SONG_DANCE|INF2_TRAP)) && !(skill_get_inf3(group->skill_id)&(INF3_NOLP)) && group->skill_id != NC_NEUTRALBARRIER && map_getcell(unit->bl.m, unit->bl.x, unit->bl.y, CELL_CHKLANDPROTECTOR) )
		return 0; //AoE skills are ineffective. [Skotlex]


And change it to this:
 

	if( !(skill_get_inf2(group->skill_id)&(INF2_SONG_DANCE|INF2_TRAP)) && !(skill_get_inf3(group->skill_id)&(INF3_NOLP)) && group->skill_id != NC_NEUTRALBARRIER  && group->skill_id != NC_STEALTHFIELD && map_getcell(unit->bl.m, unit->bl.x, unit->bl.y, CELL_CHKLANDPROTECTOR) )
		return 0; //AoE skills are ineffective. [Skotlex]



I haven't tested the skill.cpp changes to know that they work though. Just a guess.

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