Jump to content
  • 0

delete spiderweb 1st instance


chowking

Question


  • Group:  Members
  • Topic Count:  32
  • Topics Per Day:  0.01
  • Content Count:  178
  • Reputation:   16
  • Joined:  06/25/12
  • Last Seen:  

so i did this waay back, this code modifies spiderweb to be placed on the ground and trap anyone who walks overit.

===========================================================================
Index: src/map/skill.cpp
===========================================================================
@@ -13642,6 +13642,7 @@ int skill_unit_onplace_timer(struct skill_unit *unit, struct block_list *bl, uns
			case UNT_FIREPILLAR_ACTIVE:
			case UNT_ELECTRICSHOCKER:
			case UNT_MANHOLE:
+			case UNT_SPIDERWEB:
				return 0;
			default:
				ShowError("skill_unit_onplace_timer: interval error (unit id %x)\n", sg->unit_id);
@ -13817,7 +13818,23 @@ int skill_unit_onplace_timer(struct skill_unit *unit, struct block_list *bl, uns
				sc_start(ss,bl,SC_STOP,100,0,skill_get_time2(sg->skill_id,sg->skill_lv));
			}
			break;
-
+		case UNT_SPIDERWEB:
+			if (sg->val2 == 0 && tsc) {
+				int sec = skill_get_time2(sg->skill_id, sg->skill_lv);
+				if (status_change_start(ss, bl, type, 10000, sg->skill_lv, sg->group_id, 0, 0, sec, tick)) {
+					const struct TimerData* td = tsc->data[type] ? get_timer(tsc->data[type]->timer) : NULL;
+					if (td)
+						sec = DIFF_TICK(td->tick, tick);
+					unit_movepos(bl, unit->bl.x, unit->bl.y, 0, 0);
+					clif_fixpos(bl);
+					sg->val2 = bl->id;
+				}
+				else
+					sg->limit = DIFF_TICK(tick, sg->tick) + sec;
+				sg->interval = -1;
+				unit->range = 0;
+			}
+			break;
		case UNT_ANKLESNARE:
		case UNT_MANHOLE:
			if( sg->val2 == 0 && tsc && ((sg->unit_id == UNT_ANKLESNARE && skill_id != SC_ESCAPE) || bl->id != sg->src_id) ) {
@ -17932,6 +17949,7 @@ int skill_delunit(struct skill_unit* unit)
	switch (group->skill_id) {
		case HT_ANKLESNARE:
		case SC_ESCAPE:
+		case PF_SPIDERWEB:
			{
				struct block_list* target = map_id2bl(group->val2);
				enum sc_type type = status_skill2sc(group->skill_id);
@ -18540,6 +18558,12 @@ static int skill_unit_timer_sub(DBKey key, DBData *data, va_list ap)
					}
				}
				break;
+			case UNT_SPIDERWEB:
+				if (unit->val1 <= 0) {
+					if (group->unit_id == UNT_SPIDERWEB && group->val2 > 0)
+						skill_delunit(unit);
+				}
+				break;
			case UNT_REVERBERATION:
			case UNT_NETHERWORLD:
				if (unit->val1 <= 0) {
===========================================================================
Index: db/pre-re/skill_db.txt
===========================================================================
 @@ -603,7 +603,7 @@
402,9,6,1,0,0x1,0,5,1,no,0,0,0,none,0,0x0,		PF_MINDBREAKER,Mind Breaker
403,0,0,4,0,0x1,0,1,1,yes,0,0,0,magic,0,0x0,		PF_MEMORIZE,Foresight
404,9,6,2,2,0x1,0,5,1,yes,0,0x100,2,magic,0,0x10000,	PF_FOGWALL,Blinding Mist
-405,7,6,1,0,0x1,0,1,1,no,0,0,3,magic,0,0x0,		PF_SPIDERWEB,Fiber Lock
+405,7,6,2,0,0x1,0,1,1,no,0,0,4,magic,0,0x0,		PF_SPIDERWEB,Fiber Lock

//****
// Assassin Cross
===========================================================================
Index: db/pre-re/skill_unit_db.txt
===========================================================================
@@ -89,7 +89,7 @@
369,0xb3,    , -1, 0,10000,all,  0x008	//PA_GOSPEL
395,0xb5,    ,  4, 0,  -1,all,   0x200	//CG_MOONLIT
404,0xb6,    , -1, 0,  -1,all,   0x8000	//PF_FOGWALL
-405,0xb7,    ,  0, 0,  -1,enemy, 0x8000	//PF_SPIDERWEB
+405,0xb7,    ,  0, 1,  0,enemy, 0x8000	//PF_SPIDERWEB
409,0xb2,    ,  0,-1,  -1,noone, 0x000	//WE_CALLBABY
410,0xb2,    ,  0,-1,  -1,noone, 0x000	//WE_CALLPARENT
428,0x86,    ,  0, 1, 100,enemy, 0x000	//SG_SUN_WARM
===========================================================================

it does the job yeah but the main problem is the finer points where

intended behavior:

  • when a player is webbed/trapped and prof/sage places another web beside, the web will forcefully move character/mob. (this works already)
  • when there is no one trapped and prof casts spiderweb beyond 4, 1st web cast should be deleted
  • the previous web now gets deleted as the character was removed by another web, allowing to infinitely move the character/mob out of his/her will.

what is happening:

  • when a player is webbed/trapped and prof/sage places another web beside, the web will forcefully move character/mob.
  • the previous web persists but doesn't trap anyone anymore, and after reaching the limit of 4 webs(defined in skill_db.txt) the skill will fail until the 1st web vanishes releasing the trapped character/mob

if you'll notice the code is closely similar to ankle snare,
i built this trying to get reference from already existing skills.

Edited by chowking
added bulletin in intended behavior
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  123
  • Topics Per Day:  0.05
  • Content Count:  478
  • Reputation:   14
  • Joined:  11/30/17
  • Last Seen:  

any update on this mod sir?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.01
  • Content Count:  53
  • Reputation:   0
  • Joined:  12/13/12
  • Last Seen:  

Hi have you had a chance to fix this or maybe just the code for ground target spider web?

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