집을 짓는 공간 미리 확인하는 매크로 > 클래식어시스트 매크로

본문 바로가기
사이트 내 전체검색

클래식어시스트 매크로

 

집을 짓는 공간 미리 확인하는 매크로

페이지 정보

profile_image
작성자 fisherH
댓글 4건 조회 171회 작성일 24-03-06 05:32

본문

저 같이 집을 짓는 컨텐츠가 어려운 분들에게 추천하는 매크로입니다.


이 공간에 집을 지을수있는지 확인하는 매크로이며, 스크립트 중간 square_size = 15   로 집크기를 조절해서 확인해볼수있습니다

마고서버 가장 큰 집기준 15 였기에 기본값으로 저장해놨습니다.



 


 









# Name: Test Tiles for House Placement
# Description: Displays valid tiles for house placement.
# Usage: Stand where you want to place a house and hit play.
# Author: github.com/UltimaScripts/PublicScriptLibrary
# Version: 1.0.0
# Credits: Reetus made the Defs Impassable & SAWorldItem
# Notes:
# WARNING, This Script will Increase Client Memory Usage once ran.
# I recommened restarting the client after you're done using it.
from ClassicAssist.UO.Data import PacketWriter, Statics, TileFlags, MapInfo
from ClassicAssist.UO.Commands import RemoveObject
from Assistant import Engine
from System import *

#Keep in mind Housing Rules
#the east side needs 1 more valid tile
#the south side needs 5 valid tiles

# ===== Options Start =====
# ___remove_display___
## Set remove_display to True to remove the display.
## You can also just run off screen and they should be gone.
## Case / Capitalization matters. (True or False)
remove_display = False
#
# ___square_size___
## Never set square_size higher than 24.
## If you run it with a higher number and,
## want to run it again with a lower number,
## you will need to remove_display first.
## Can run it repeatedly with the same value.
square_size = 15
#
# ___height_tolerance___
## height_tolerance is usually 0.
height_tolerance = 0
# ===== Options End =====

# DO NOT EDIT BELOW THIS
# unless you know what you're doing.

def Impassable(x, y, map = int(Engine.Player.Map)):
    staticTiles = Statics.GetStatics( map, x, y )
    
    if staticTiles == None or staticTiles.Length == 0:
        return MapInfo.GetLandTile(map, x, y).Flags.HasFlag(TileFlags.Impassable)
    
    for x in staticTiles:
        if x.Flags.HasFlag(TileFlags.Impassable):
            return True

    return False

def SAWorldItem(serial, itemId, amount, x, y, z, hue):
      length = 26 if Engine.ClientVersion >= Version( 7, 0, 9, 0 ) else 24
      writer = PacketWriter(length)
      writer.Write(Byte( 0xF3 ))
      writer.Write(Int16( 1 ))
      writer.Write(Byte( 0 ))
      writer.Write(Int32(serial))
      writer.Write(Int16( itemId ))
      writer.Write(Byte( 0 ))
      writer.Write(Int16( amount ))
      writer.Write(Int16( amount ))
      writer.Write(Int16( x ))
      writer.Write(Int16( y ))
      writer.Write(SByte( z ))
      writer.Write(Byte( 0 ))
      writer.Write(Int16( hue ))
      writer.Write(Byte( 0x20 ))
      writer.Fill()
      return writer

# Removes the objects from the gameworld
if remove_display == True:
    remove_size = (((square_size + 1) * 2) * ((square_size + 1) * 2))
    for x in range(remove_size):
        value = (1073741824 + x)
        RemoveObject(value)
    Stop()

# Roads list is technically incomplete.
# May lead to false results, outside of roads.
Roads = [0x0071, 0x0078, 0x00E8, 0x00EB
         0x07AE, 0x07B1, 0x3FF4, 0x3FF4
         0x3FF8, 0x3FFB, 0x0442, 0x0479
         0x0501, 0x0510, 0x0009, 0x0015
         0x0150, 0x015C
         0x170, 0x72, 0x73, 0x74, 0x75
         0x76, 0x77, 0x79, 0x7A, 0x7C,
         0x7D, 0x7E, 0x82, 0x83, 0x85,
         0x86, 0x87, 0x88, 0x89, 0x8A,
         0x8B, 0x8C, 0x16f]

# Don't change count, it's hex value is 0x40000000
count = 1073741824
for xx in range(-abs(square_size),(square_size + 1)):
    for yy in range(-abs(square_size),(square_size + 1)):
        x = (X() + xx)
        y = (Y() + yy)
        z0 = Z()
        map = int(Engine.Player.Map)
        z = MapInfo.GetLandTile(map, x, y).Z
        idd = MapInfo.GetLandTile(map, x, y).ID
        count += 1
        # Impassable Check
        impass1 = Impassable(x, y)
        for xxx in range(-1,2):
            for yyy in range(-1,2):
                x1 = (x + xxx)
                y1 = (y + yyy)
                z1 = MapInfo.GetLandTile(map, x1, y1).Z
                impass2 = Impassable(x1, y1)
                if impass2 == True:
                    break
            if impass2 == True:
                    break
        # Height Check - Basic
        if not z == z0 and not impass1 == True and not impass2 == True:
            if not (z0 - height_tolerance) <= z <= (z0 + height_tolerance):
                impass2 = True
        
        # Items sent to world
        if impass1 == True or idd in Roads:
            Engine.SendPacketToClient(SAWorldItem(count, 0x1CDA, 1, x, y, z, 0))
        elif impass2 == True:
            Engine.SendPacketToClient(SAWorldItem(count, 0x1CDA, 1, x, y, z, 1259)) 
        else:
            Engine.SendPacketToClient(SAWorldItem(count, 0x1CDA, 1, x, y, z, 1271))

🔒 로그인 후 내용을 확인하세요

첨부파일

댓글목록

profile_image

마스터골드님의 댓글

마스터골드 작성일

와우!!! 대박!!! 감사합니다

profile_image

노다쿤님의 댓글

노다쿤 작성일

이런 유용한것을.. 감사감사합니당
집 많이 짓는 사람들한테도 필요한거네요

profile_image

빡군님의 댓글

빡군 작성일

이거 너무 좋아요...
집이 왜 안지어졌는지도 알 수 있었고
어느 타일에 지으면 되는지 바로 알 수 있어서 너무 좋음...
감사합니다!

profile_image

노다쿤님의 댓글

노다쿤 작성일

Square size 참고 :
18x18 = 8
23x23 = 11
32x32 = 15

Total 134건 3 페이지
클래식어시스트 매크로 목록
번호 제목 글쓴이 조회 날짜
94 흑양파 83 06-07
93 흑양파 82 06-07
92 바보울온 244 06-05
91
[클어씨#35] 부시도 훈련매클 인기글 첨부파일 댓글2
바보울온 250 06-02
90 바보울온 221 05-30
89 바보울온 71 05-18
88 바보울온 241 05-17
87 바보울온 180 05-13
86 바보울온 303 05-04
85 동글이♬ 51 04-28
84 동글이♬ 93 04-27
83 동글이♬ 41 04-27
82 동글이♬ 28 04-27
81 동글이♬ 64 04-27
80 동글이♬ 40 04-27
79 동글이♬ 33 04-27
78 동글이♬ 23 04-27
77 동글이♬ 29 04-27
76 동글이♬ 51 04-27
75 바보울온 106 04-27

검색

 


회사소개 개인정보취급방침 서비스이용약관 모바일 버전으로 보기 상단으로

TEL. 00-000-0000 FAX. 00-000-0000 서울 강남구 강남대로 1
대표:홍길동 사업자등록번호:000-00-00000 개인정보관리책임자:홍길동

Copyright © 소유하신 도메인. All rights reserved.