Nullify DISPELL using SC_IGNOREDISPELL

Hadeszeus

New member
Messages
651
Points
0
Location
Philippines
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

 
Last edited by a moderator:
Did you add your SC to db/const.txt? Also there is no need to add:

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

Code:
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
 
Thanks Men! You're always the best!
default_happy.png


 
Last edited by a moderator:
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..

 
@Hadeszeus

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

Code:
	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
Code:
	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
 
Back
Top