Jump to content
  • 0
Hadeszeus

Nullify DISPELL using SC_IGNOREDISPELL

Question

Can someone help me fix this src modification to create a status effect that nullify DISPELL for certain period of time?

 

enumerating the sc_type:

 

srcmapstatus.h:

 

    SC_SKILLATKBONUS,+    SC_IGNOREDISPELL,    SC_MAX, //Automatically updated max, used in for's to check we are within bounds.

 


srcmapstatus.c:

 

   StatusChangeFlagTable[SC_WALKSPEED] |= SCB_SPEED;+  StatusChangeFlagTable[SC_IGNOREDISPELL] |= SC_NONE;

 

Applying the status to block dispell

srcmapskill.c:

 

case SA_DISPELL:		{			int splash;			if (flag&1 || (splash = skill->get_splash(skill_id, skill_lv)) < 1) {				int i;				if( sd && dstsd && !map_flag_vs(sd->bl.m)					&& (sd->status.party_id == 0 || sd->status.party_id != dstsd->status.party_id) ) {					// Outside PvP it should only affect party members and no skill fail message.					break;				}				clif->skill_nodamage(src,bl,skill_id,skill_lv,1);				if((dstsd && (dstsd->class_&MAPID_UPPERMASK) == MAPID_SOUL_LINKER)					|| (tsc && tsc->data[SC_SOULLINK] && tsc->data[SC_SOULLINK]->val2 == SL_ROGUE) //Rogue's spirit defends againt dispel.					|| rnd()%100 >= 50+10*skill_lv  					|| (tsc && tsc->data[SC_IGNOREDISPELL]))  //SC_IGNOREDISPELL									{

 

 

Sample IGNOREDISPELL Script using 501

 

{Id: 501Inherit: trueScript: <" sc_start SC_IGNOREDISPELL,300000,0; ">} 

 

EXPECTED RESULT: When RED POTION consumed. Nullify DISPELL for 3 minutes

 

ACTUAL RESULT:

Character turns to black (like stone cursed) and unable to move.

Casting DISPELL will cancel abnormal status.

 

Credits to ORIG SOURCE

Edited by Hadeszeus

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0

 

 

Did you add your SC to db/const.txt? Also there is no need to add:

StatusChangeFlagTable[SC_IGNOREDISPELL] |= SC_NONE;
Maybe that's the line that's causing this misbehavior. I added this status without it and everything seemed to work just fine.

 

 

Yes pan. That line was the problem. I was able to fixed mine using SC_ALL? BTW, dunno what is the purpose of this line..

 

 

 

 

Did you add your SC to db/const.txt? Also there is no need to add:

StatusChangeFlagTable[SC_IGNOREDISPELL] |= SC_NONE;
Maybe that's the line that's causing this misbehavior. I added this status without it and everything seemed to work just fine.

 

 

Yes pan. That line was the problem. I was able to fixed mine using SC_ALL? BTW, dunno what is the purpose of this line..

 

 

SC_ALL is used for checking purposes, it must always be the last status change. It serves this purpose because of the way that enums work in C.

Here is my diff file with all modifications needed in the source:

diff --git a/src/map/skill.c b/src/map/skill.cindex 0df90a5..c10f89c 100644--- a/src/map/skill.c+++ b/src/map/skill.c@@ -6628,7 +6628,8 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin 				clif->skill_nodamage(src,bl,skill_id,skill_lv,1); 				if((dstsd && (dstsd->class_&MAPID_UPPERMASK) == MAPID_SOUL_LINKER) 					|| (tsc && tsc->data[SC_SOULLINK] && tsc->data[SC_SOULLINK]->val2 == SL_ROGUE) //Rogue's spirit defends againt dispel.-					|| rnd()%100 >= 50+10*skill_lv )+					|| rnd()%100 >= 50+10*skill_lv || (tsc && tsc->data[SC_IGNOREDISPELL])+					) 				{ 					if (sd) 						clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);diff --git a/src/map/status.h b/src/map/status.hindex d3148b4..ed2f182 100644--- a/src/map/status.h+++ b/src/map/status.h@@ -699,7 +699,8 @@ typedef enum sc_type { 	SC_OKTOBERFEST, 	SC_STRANGELIGHTS, 	SC_DECORATION_OF_MUSIC,-	++	SC_IGNOREDISPELL, 	SC_MAX, //Automatically updated max, used in for's to check we are within bounds. } sc_type; // Official status change ids, used to display status icons on the client.
Regards

Share this post


Link to post
Share on other sites
  • 0

Did you add your SC to db/const.txt? Also there is no need to add:

StatusChangeFlagTable[SC_IGNOREDISPELL] |= SC_NONE;
Maybe that's the line that's causing this misbehavior. I added this status without it and everything seemed to work just fine.

Share this post


Link to post
Share on other sites
  • 0

 

Did you add your SC to db/const.txt? Also there is no need to add:

StatusChangeFlagTable[SC_IGNOREDISPELL] |= SC_NONE;
Maybe that's the line that's causing this misbehavior. I added this status without it and everything seemed to work just fine.

Yes pan. That line was the problem. I was able to fixed mine using SC_ALL? BTW, dunno what is the purpose of this line..

Share this post


Link to post
Share on other sites
  • 0

 

 

Did you add your SC to db/const.txt? Also there is no need to add:

StatusChangeFlagTable[SC_IGNOREDISPELL] |= SC_NONE;
Maybe that's the line that's causing this misbehavior. I added this status without it and everything seemed to work just fine.

 

Yes pan. That line was the problem. I was able to fixed mine using SC_ALL? BTW, dunno what is the purpose of this line..

 

 

Did you add your SC to db/const.txt? Also there is no need to add:

StatusChangeFlagTable[SC_IGNOREDISPELL] |= SC_NONE;
Maybe that's the line that's causing this misbehavior. I added this status without it and everything seemed to work just fine.
Yes pan. That line was the problem. I was able to fixed mine using SC_ALL? BTW, dunno what is the purpose of this line..
SC_ALL is used for checking purposes, it must always be the last status change. It serves this purpose because of the way that enums work in C.

Here is my diff file with all modifications needed in the source:

diff --git a/src/map/skill.c b/src/map/skill.cindex 0df90a5..c10f89c 100644--- a/src/map/skill.c+++ b/src/map/skill.c@@ -6628,7 +6628,8 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin 				clif->skill_nodamage(src,bl,skill_id,skill_lv,1); 				if((dstsd && (dstsd->class_&MAPID_UPPERMASK) == MAPID_SOUL_LINKER) 					|| (tsc && tsc->data[SC_SOULLINK] && tsc->data[SC_SOULLINK]->val2 == SL_ROGUE) //Rogue's spirit defends againt dispel.-					|| rnd()%100 >= 50+10*skill_lv )+					|| rnd()%100 >= 50+10*skill_lv || (tsc && tsc->data[SC_IGNOREDISPELL])+					) 				{ 					if (sd) 						clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);diff --git a/src/map/status.h b/src/map/status.hindex d3148b4..ed2f182 100644--- a/src/map/status.h+++ b/src/map/status.h@@ -699,7 +699,8 @@ typedef enum sc_type { 	SC_OKTOBERFEST, 	SC_STRANGELIGHTS, 	SC_DECORATION_OF_MUSIC,-	++	SC_IGNOREDISPELL, 	SC_MAX, //Automatically updated max, used in for's to check we are within bounds. } sc_type; // Official status change ids, used to display status icons on the client.
Regards

 

 

PAN can you check this please.. its not working anymore on latest rev..

Share this post


Link to post
Share on other sites
  • 0

@Hadeszeus

It should be working, by quick looking into the latest revision the only change that can 'mess' with this snippet is:

	SC_DECORATION_OF_MUSIC,		SC__MAELSTROM,	SC__CHAOS,	SC_MAX, //Automatically updated max, used in for's to check we are within bounds.} sc_type;
Just remember to add SC_IGNOREDISPELL before SC_MAX and update its const number
	SC_DECORATION_OF_MUSIC,		SC__MAELSTROM,	SC__CHAOS,	SC_IGNOREDISPELL,	SC_MAX, //Automatically updated max, used in for's to check we are within bounds.} sc_type;
Now it should be 578

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
Answer this question...

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