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
Can cast spells under map
Author Message
escribano
Journeyman
*

Posts: 170
Likes Given: 16
Likes Received: 32 in 23 posts
Joined: Nov 2012
Reputation: 2

Dragon Shard

Post: #12
RE: Can cast spells under map
I've posted this some time ago:

Code:
[FUNCTION f_fix_z]
local.z = <z>
local.tz = <serv.map(<p.x>,<p.y>).terrain.z>

if (<abs <eval (<local.z> - <local.tz>)>> < 10)
    z <local.tz>
else
    local.z <local.tz>
    for x 1 <serv.map(<p.x>,<p.y>).statics>
        if (<abs <eval (<local.z> - <serv.map(<p.x>,<p.y>).statics.<local.x>.z>)>> < 10)
            local.z <serv.map(<p.x>,<p.y>).statics.<local.x>.z>
        endif
    endfor

    z <local.z>
endif

I don't really know if it's the best and accurate code to do this... loot it's simple, but you can have an idea Smile

Adding a tiny explanation:

This code checks the TERRAIN of the "actual item position" (ignoring its own Z), it the item is too "closer" to the terrain the fixed Z will be set as the TERRAIN Z point.

If the actual position is distant to the terrain the code will seek the closet STATIC item at the position to define the Z point...

There are a lot of code needed to make this work properly, need to check the item "height", floors and so...

And think now of the initial problem.... u can check if the spell is called "under" the TERRAIN...

Triggering it you can cancel the casting, or... use the code to fix the spell position Smile

UltimaPHP - OpenSource Ultima Online Server v0.1-pre-alpha under development, we need help!
(This post was last modified: 10-14-2017 08:53 AM by escribano.)
10-14-2017 08:45 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
Can cast spells under map - Russian - 10-13-2017, 04:47 AM
RE: Can cast spells under map - darksun84 - 10-13-2017, 05:34 AM
RE: Can cast spells under map - Russian - 10-13-2017, 10:07 PM
RE: Can cast spells under map - Russian - 10-13-2017, 05:39 AM
RE: Can cast spells under map - darksun84 - 10-13-2017, 10:21 PM
RE: Can cast spells under map - Russian - 10-13-2017, 10:36 PM
RE: Can cast spells under map - darksun84 - 10-13-2017, 11:44 PM
RE: Can cast spells under map - Russian - 10-14-2017, 01:05 AM
RE: Can cast spells under map - darksun84 - 10-14-2017, 01:37 AM
RE: Can cast spells under map - Russian - 10-14-2017, 03:26 AM
RE: Can cast spells under map - Coruja - 10-14-2017, 08:20 AM
RE: Can cast spells under map - escribano - 10-14-2017 08:45 AM
RE: Can cast spells under map - Russian - 10-14-2017, 05:23 PM
RE: Can cast spells under map - escribano - 10-16-2017, 11:01 PM

Forum Jump:


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