Jump to content
  • 0

dispell on berserk no return hp


Notorius

Question


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.02
  • Content Count:  106
  • Reputation:   1
  • Joined:  09/24/19
  • Last Seen:  

Hello Rathena, I have a problem and I hope you can help me. Now I have a problem trying to edit the function of the skill dispell when it is used on a player in a berserk state. The problem I want to solve is that when a player in a berserk state is Hit by the dispell ability, it remains at 0 hp and sp. What I want is when a dispell is fired at a player with dispell, it remains at 100% hp and 0 sp, any way to do it? I'm trying to edit here but can't get skill.c to work

 

 

				if (i == SC_BERSERK || i == SC_SATURDAYNIGHTFEVER)
					tsc->getSCE(status)->val2 = 0; //Mark a dispelled berserk to avoid setting hp to 100 by setting hp penalty to 0.
				status_change_end(bl, status);

 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.02
  • Content Count:  106
  • Reputation:   1
  • Joined:  09/24/19
  • Last Seen:  

On 7/7/2023 at 3:45 PM, Notorius said:

Hello Rathena, I have a problem and I hope you can help me. Now I have a problem trying to edit the function of the skill dispell when it is used on a player in a berserk state. The problem I want to solve is that when a player in a berserk state is Hit by the dispell ability, it remains at 0 hp and sp. What I want is when a dispell is fired at a player with dispell, it remains at 100% hp and 0 sp, any way to do it? I'm trying to edit here but can't get skill.c to work

 

 

				if (i == SC_BERSERK || i == SC_SATURDAYNIGHTFEVER)
					tsc->getSCE(status)->val2 = 0; //Mark a dispelled berserk to avoid setting hp to 100 by setting hp penalty to 0.
				status_change_end(bl, status);

 

solution: 

	case SA_DISPELL:
		if (flag&1 || (i = skill_get_splash(skill_id, skill_lv)) < 1) {
			if (sd && dstsd && !map_flag_vs(sd->bl.m) && (!sd->duel_group || sd->duel_group != dstsd->duel_group) && (!sd->status.party_id || sd->status.party_id != dstsd->status.party_id))
				break; // Outside PvP it should only affect party members and no skill fail message
			clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
			if((dstsd && (dstsd->class_&MAPID_UPPERMASK) == MAPID_SOUL_LINKER)
				|| (tsc && tsc->getSCE(SC_SPIRIT) && tsc->getSCE(SC_SPIRIT)->val2 == SL_ROGUE) //Rogue's spirit defends againt dispel.
				|| rnd()%100 >= 50+10*skill_lv)
			{
				if (sd)
					clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
				break;
			}
			if(status_isimmune(bl))
				break;

			//Remove bonus berserk by Dispell
			if (dstsd)
				pc_bonus_script_clear(dstsd,BSF_REM_ON_DISPELL);

			if(!tsc || !tsc->count)
				break;
			for (const auto &it : status_db) {
				sc_type status = static_cast<sc_type>(it.first);

				if (!tsc->getSCE(SC_BERSERK))
					continue;

				if (it.second->flag[SCF_NODISPELL])
					continue;
			if (i == SC_BERSERK)
				tsc->getSCE(status)->val2 = 0; //Mark a dispelled berserk to avoid setting hp to 100 by setting hp penalty to 0.
				status_change_end(bl, status);
				status_percent_heal(bl, 100, 0);
			}
			//Statuses that can't be Dispelled
			for (const auto &it : status_db) {
				sc_type status = static_cast<sc_type>(it.first);

				if (!tsc->getSCE(status))
					continue;

				if (it.second->flag[SCF_NODISPELL])
					continue;
				switch (status) {
					// bugreport:4888 these songs may only be dispelled if you're not in their song area anymore
					case SC_WHISTLE:		case SC_ASSNCROS:		case SC_POEMBRAGI:
					case SC_APPLEIDUN:		case SC_HUMMING:		case SC_DONTFORGETME:
					case SC_FORTUNE:		case SC_SERVICE4U:
						if (!battle_config.dispel_song || tsc->getSCE(status)->val4 == 0)
							continue; //If in song area don't end it, even if config enabled
						break;
					case SC_ASSUMPTIO:
						if( bl->type == BL_MOB )
							continue;
						break;
				}
				if (i == SC_SATURDAYNIGHTFEVER)
				tsc->getSCE(status)->val2 = 0; //Mark a dispelled berserk to avoid setting hp to 100 by setting hp penalty to 0.
				status_change_end(bl, status);
			}
			break;
		}

 

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