The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Knockback - wall check
Author Message
tleilax
Journeyman
*

Posts: 56
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Jun 2012
Reputation: 0



Post: #1
Knockback - wall check
Hello,

I hope I can get some ideas how to script knockback.

Knockback itself isn't such a problem, but checking players not to fall through walls/impassable tiles is something that I currently cannot think of any solution.

Is there any hardcoded check for this or can anyone point me in right direction?
09-09-2012 11:01 PM
Find all posts by this user Like Post Quote this message in a reply
Shaklaban
Master
**

Posts: 378
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Mar 2012
Reputation: 8

DOT

Post: #2
RE: Knockback - wall check
you can try canmove function:

if <canmove n>
say i can move to north
endif
(This post was last modified: 09-09-2012 11:36 PM by Shaklaban.)
09-09-2012 11:36 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Rayvolution
Journeyman
*

Posts: 135
Likes Given: 0
Likes Received: 2 in 2 posts
Joined: Jul 2012
Reputation: 1

Aetharia

Post: #3
RE: Knockback - wall check
This is my server's "Knockback" enchantment, written by EXTREME. It works pretty well. Wink

There's 3 levels, Minor, Moderate and Major. All it really does is raise the chance to knockback.

It's designed to be applied to a weapon, so if you just want to apply it to a monster/NPC directly, simplypull the ON=@DAMAGE portion out of the TYPEDEF and stick it on the monster/NPC or it's EVENTS script. Smile

Code:
[TYPEDEF E_WEAPON_ENCHANT_KNOCKBACK_MINOR]
ON=@DAMAGE
IF <R1,10> == 1
SRC.KNOCKBACK <TOPOBJ.DIR>
SRC.EFFECT 3,i_fx_glow_spike,1,17,0
SRC.SOUND 314
ENDIF

[TYPEDEF E_WEAPON_ENCHANT_KNOCKBACK_MODERATE]
ON=@DAMAGE
IF <R1,5> == 1
SRC.KNOCKBACK <TOPOBJ.DIR>
SRC.EFFECT 3,i_fx_glow_spike,1,17,0
SRC.SOUND 314
ENDIF

[TYPEDEF E_WEAPON_ENCHANT_KNOCKBACK_MAJOR]
ON=@DAMAGE
IF <R1,2> == 1
SRC.KNOCKBACK <TOPOBJ.DIR>
SRC.EFFECT 3,i_fx_glow_spike,1,17,0
SRC.SOUND 314
ENDIF

[FUNCTION KNOCKBACK]
IF <ARGS>
LOCAL.DIR <EVAL <ARGS>+4>
IF <dLOCAL.DIR> > 7
  LOCAL.DIR -= 8
ENDIF
ELSE
LOCAL.DIR <DIR>
ENDIF
DOSWITCH <dLOCAL.DIR>
BEGIN
  IF (<CANMOVE S>)
   MOVE S
  ENDIF
END
BEGIN
  IF (<CANMOVE SW>)
   MOVE SW
  ENDIF
END
BEGIN
  IF (<CANMOVE W>)
   MOVE W
  ENDIF
END
BEGIN
  IF (<CANMOVE NW>)
   MOVE NW
  ENDIF
END
BEGIN
  IF (<CANMOVE N>)
   MOVE N
  ENDIF
END
BEGIN
  IF (<CANMOVE NE>)
   MOVE NE
  ENDIF
END
BEGIN
  IF (<CANMOVE E>)
   MOVE E
  ENDIF
END
BEGIN
  IF (<CANMOVE SE>)
   MOVE SE
  ENDIF
END
BEGIN
  IF (<CANMOVE S>)
   MOVE S
  ENDIF
END
ENDDO

[Image: 4_Logo.png]
An MMORPG based on the Ultima Online engine.
Completely Custom Map, GUI, AI, Combat, Skills, Crafts, Art, Music and so much more.
http://aetharia.com - Home of Ambition!
(This post was last modified: 09-10-2012 01:24 PM by Rayvolution.)
09-10-2012 01:23 PM
Find all posts by this user Like Post Quote this message in a reply
tleilax
Journeyman
*

Posts: 56
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Jun 2012
Reputation: 0



Post: #4
RE: Knockback - wall check
Thanks, rayvolution. Knockback works. But my character can be knocked through doors, walls and other impassable stuff.

Is anything set wrong in my sphere.ini or something?

Edit: My bad, for players with plevel 0 it works like a charm. Thanks a lot!
(This post was last modified: 09-11-2012 11:37 PM by tleilax.)
09-11-2012 11:36 PM
Find all posts by this user Like Post Quote this message in a reply
Rayvolution
Journeyman
*

Posts: 135
Likes Given: 0
Likes Received: 2 in 2 posts
Joined: Jul 2012
Reputation: 1

Aetharia

Post: #5
RE: Knockback - wall check
hehe, yeah, GMs totally ignore walls/non-passable objects. The only reason GMs even "stop" when they hit a wall is because the client says no, not the server. Tongue

So, in the case of GMs, they always pass the "Canmove" check no matter what. Wink

[Image: 4_Logo.png]
An MMORPG based on the Ultima Online engine.
Completely Custom Map, GUI, AI, Combat, Skills, Crafts, Art, Music and so much more.
http://aetharia.com - Home of Ambition!
09-12-2012 07:38 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)