Jump to content
  • 0

Body Relocation with Trap


guhx

Question


  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  27
  • Reputation:   0
  • Joined:  04/03/14
  • Last Seen:  

I wanted to know how to block the body relocation when the character fall into a trap

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Developer
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  802
  • Reputation:   229
  • Joined:  01/30/13
  • Last Seen:  

Depends on what trap. For ankle snare for example you can simply add a check for the skill in skill_block_check in skill.c, just like it already blocks teleport:

	switch (type) {
		case SC_ANKLE:
			if (skill_id == AL_TELEPORT)
				return 1;
			break;

For Statis, Kagehumi and Bite, there are already INF3 values in the skill_db, so you can just edit those there.

 

For anything else you have to take a look at status_check_skilluse in status.c, which also calls skill_block_check:

			if (!flag && ( // Blocked only from using the skill (stuff like autospell may still go through
				sc->cant.cast ||
				(sc->data[SC_BASILICA] && (sc->data[SC_BASILICA]->val4 != src->id || skill_id != HP_BASILICA)) || // Only Basilica caster that can cast, and only Basilica to cancel it
				(sc->data[SC_MARIONETTE] && skill_id != CG_MARIONETTE) || // Only skill you can use is marionette again to cancel it
				(sc->data[SC_MARIONETTE2] && skill_id == CG_MARIONETTE) || // Cannot use marionette if you are being buffed by another
				(sc->data[SC_ANKLE] && skill_block_check(src, SC_ANKLE, skill_id)) ||
				(sc->data[SC_STASIS] && skill_block_check(src, SC_STASIS, skill_id)) ||
				(sc->data[SC_BITE] && skill_block_check(src, SC_BITE, skill_id)) ||
				(sc->data[SC_KAGEHUMI] && skill_block_check(src, SC_KAGEHUMI, skill_id))
			))
				return false;

			// Skill blocking.
			if (
				(sc->data[SC_VOLCANO] && skill_id == WZ_ICEWALL) ||
				(sc->data[SC_ROKISWEIL] && skill_id != BD_ADAPTATION) ||
				(sc->data[SC_HERMODE] && skill_get_inf(skill_id) & INF_SUPPORT_SKILL) ||
				(sc->data[SC_NOCHAT] && sc->data[SC_NOCHAT]->val1&MANNER_NOSKILL)
			)
				return false;

The structure right now is pretty horrible and I really would like to improve in the future so it's easier to expand, but right now you have to add your checks here.

  • Love 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  27
  • Reputation:   0
  • Joined:  04/03/14
  • Last Seen:  

I tried a number of ways by skill_db , status.c and skill.c and could not block = x

Does anyone have any idea to block it?

 

@Edit

 

I got making the following changes




case MO_BODYRELOCATION:
+        if(sd && sd->sc.data[SC_ANKLE] ){
+           clif_skill_fail(sd,skill_id,0,0);
+            return 0;
+        }
if (unit_movepos(src, x, y, 1, 1)) {
#if PACKETVER >= 20111005
clif_snap(src, src->x, src->y);
#else
clif_skill_poseffect(src,skill_id,skill_lv,src->x,src->y,tick);
#endif
if (sd)
skill_blockpc_start (sd, MO_EXTREMITYFIST, 2000);
}
break;


Edited by guhx
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...