feat: version 2.0.0

This commit is contained in:
AURUMVORXX
2025-04-15 12:20:31 +03:00
parent dfcf695f24
commit 988f901dc8
44 changed files with 3143 additions and 1378 deletions

View File

@@ -1,155 +0,0 @@
from g2o.functions.event import addEvent
from g2o.functions.event import callEvent
from g2o.functions.event import event
from g2o.functions.event import removeEventHandler
from g2o.functions.event import toggleEvent
from g2o.functions.event import removeEvent
from g2o.classes.packets import Packet
from g2o.classes.damage import DamageDescription
from g2o.classes.items import ItemGround
from g2o.classes.items import ItemsGround
from g2o.classes.daedalus import Daedalus
from g2o.classes.sky import Sky
from g2o.classes.mds import Mds
from g2o.classes.way import Way
from g2o.functions.chat import sendMessageToAll
from g2o.functions.chat import sendMessageToPlayer
from g2o.functions.chat import sendPlayerMessageToAll
from g2o.functions.chat import sendPlayerMessageToPlayer
from g2o.functions.math import getDistance2d
from g2o.functions.math import getDistance3d
from g2o.functions.math import getVectorAngle
from g2o.functions.game import getHostname
from g2o.functions.game import getMaxSlots
from g2o.functions.game import getPlayersCount
from g2o.functions.game import exit
from g2o.functions.game import getDayLength
from g2o.functions.game import getServerDescription
from g2o.functions.game import getServerWorld
from g2o.functions.game import getTime
from g2o.functions.game import serverLog
from g2o.functions.game import setDayLength
from g2o.functions.game import setServerDescription
from g2o.functions.game import setServerWorld
from g2o.functions.game import setTime
from g2o.functions.npc import clearNpcActions
from g2o.functions.npc import createNpc
from g2o.functions.npc import destroyNpc
from g2o.functions.npc import getNpcAction
from g2o.functions.npc import getNpcActions
from g2o.functions.npc import getNpcActionsCount
from g2o.functions.npc import getNpcHostPlayer
from g2o.functions.npc import getNpcLastActionId
from g2o.functions.npc import isNpc
from g2o.functions.npc import isNpcActionFinished
from g2o.functions.npc import npcAttackMelee
from g2o.functions.npc import npcAttackRanged
from g2o.functions.npc import npcSpellCast
from g2o.functions.npc import npcUseClosestMob
from g2o.functions.npc import setNpcHostPlayer
from g2o.functions.player import addBan
from g2o.functions.player import applyPlayerOverlay
from g2o.functions.player import ban
from g2o.functions.player import drawWeapon
from g2o.functions.player import equipItem
from g2o.functions.player import getPlayerAmulet
from g2o.functions.player import getPlayerAngle
from g2o.functions.player import getPlayerAni
from g2o.functions.player import getPlayerArmor
from g2o.functions.player import getPlayerAtVector
from g2o.functions.player import getPlayerBelt
from g2o.functions.player import getPlayerCameraPosition
from g2o.functions.player import getPlayerCollision
from g2o.functions.player import getPlayerColor
from g2o.functions.player import getPlayerContext
from g2o.functions.player import getPlayerDexterity
from g2o.functions.player import getPlayerFaceAnis
from g2o.functions.player import getPlayerFatness
from g2o.functions.player import getPlayerFocus
from g2o.functions.player import getPlayerHealth
from g2o.functions.player import getPlayerHelmet
from g2o.functions.player import getPlayerIP
from g2o.functions.player import getPlayerInstance
from g2o.functions.player import getPlayerInvisible
from g2o.functions.player import getPlayerMacAddr
from g2o.functions.player import getPlayerMana
from g2o.functions.player import getPlayerMaxHealth
from g2o.functions.player import getPlayerMaxMana
from g2o.functions.player import getPlayerMeleeWeapon
from g2o.functions.player import getPlayerName
from g2o.functions.player import getPlayerPing
from g2o.functions.player import getPlayerPosition
from g2o.functions.player import getPlayerRangedWeapon
from g2o.functions.player import getPlayerRespawnTime
from g2o.functions.player import getPlayerRing
from g2o.functions.player import getPlayerScale
from g2o.functions.player import getPlayerSerial
from g2o.functions.player import getPlayerShield
from g2o.functions.player import getPlayerSkillWeapon
from g2o.functions.player import getPlayerSpell
from g2o.functions.player import getPlayerStrength
from g2o.functions.player import getPlayerTalent
from g2o.functions.player import getPlayerVirtualWorld
from g2o.functions.player import getPlayerVisual
from g2o.functions.player import getPlayerWeaponMode
from g2o.functions.player import getPlayerWorld
from g2o.functions.player import giveItem
from g2o.functions.player import hitPlayer
from g2o.functions.player import isPlayerConnected
from g2o.functions.player import isPlayerDead
from g2o.functions.player import isPlayerSpawned
from g2o.functions.player import isPlayerUnconscious
from g2o.functions.player import kick
from g2o.functions.player import playAni
from g2o.functions.player import playFaceAni
from g2o.functions.player import readySpell
from g2o.functions.player import removeItem
from g2o.functions.player import removePlayerOverlay
from g2o.functions.player import removeWeapon
from g2o.functions.player import setPlayerAngle
from g2o.functions.player import setPlayerCollision
from g2o.functions.player import setPlayerColor
from g2o.functions.player import setPlayerContext
from g2o.functions.player import setPlayerDexterity
from g2o.functions.player import setPlayerFatness
from g2o.functions.player import setPlayerHealth
from g2o.functions.player import setPlayerInstance
from g2o.functions.player import setPlayerInvisible
from g2o.functions.player import setPlayerMana
from g2o.functions.player import setPlayerMaxHealth
from g2o.functions.player import setPlayerMaxMana
from g2o.functions.player import setPlayerName
from g2o.functions.player import setPlayerPosition
from g2o.functions.player import setPlayerRespawnTime
from g2o.functions.player import setPlayerScale
from g2o.functions.player import setPlayerSkillWeapon
from g2o.functions.player import setPlayerStrength
from g2o.functions.player import setPlayerTalent
from g2o.functions.player import setPlayerVirtualWorld
from g2o.functions.player import setPlayerVisual
from g2o.functions.player import setPlayerWeaponMode
from g2o.functions.player import setPlayerWorld
from g2o.functions.player import spawnPlayer
from g2o.functions.player import stopAni
from g2o.functions.player import stopFaceAni
from g2o.functions.player import unequipItem
from g2o.functions.player import unreadySpell
from g2o.functions.player import unspawnPlayer
from g2o.functions.player import useItem
from g2o.functions.player import useItemToState
from g2o.functions.streamer import findNearbyPlayers
from g2o.functions.streamer import getStreamedPlayersByPlayer
from g2o.functions.streamer import getSpawnedPlayersForPlayer
from g2o.functions.waypoint import getNearestWaypoint
from g2o.functions.waypoint import getWaypoint
from g2o.constants import *

View File

@@ -1,42 +0,0 @@
import sqg2o
class Daedalus:
"""
This class represents Daedalus scripting interface.
Original: [Daedalus](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-classes/game/Daedalus/)
"""
@staticmethod
def index(value : str) -> int:
"""
This method will get the daedalus symbol index by its name.
**Parameters:**
* `str` **name**: the name of the daedalus symbol.
**Returns `int`:**
the daedalus symbol index number.
"""
return sqg2o.Daedalus.index(value)
@staticmethod
def symbol(value : str) -> dict:
"""
This method will get the daedalus symbol by its name.
**Parameters:**
* `str` **name**: the name of the daedalus symbol.
**Returns `dict`:**
the daedalus symbol (empty if there's no symbol with given name)
"""
return sqg2o.Daedalus.symbol(value)
@staticmethod
def instance(value : str) -> dict:
"""
This method will get the all of the daedalus instance variables.
**Parameters:**
* `str` **instanceName**: the name of the daedalus instance.
**Returns `dict`:**
the object containing all of the daedalus instance variables.
"""
return sqg2o.Daedalus.instance(value)

View File

@@ -1,86 +0,0 @@
import sqg2o
class DamageDescription(sqg2o.DamageDescription):
"""
This class represents damage information.
Original: [DamageDescription](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-classes/item/DamageDescription//)
## `int` flags
Represents the damage flags.
## `int` damage
Represents the total damage taken.
## `str` item_instance *(read-only)*
!!! note
Can be empty if there is no weapon.
Represents the weapon instance used to deal damage.
## `int` distance
Represents the total distance, calculated from origin point to target.
## `int` spell_id
Represents the spell id.
## `int` spell_level
Represents the level of chargeable spells.
## `str` node
!!! note
Can be empty if there was no projectile.
Represents the name of the node hit by a point projectile.
"""
def __init__(self):
return super().__init__()
@property
def item_instance(self):
return super().item_instance
@property
def flags(self):
return super().flags
@flags.setter
def flags(self, value):
super().flags = value
@property
def damage(self):
return super().damage
@damage.setter
def damage(self, value):
super().damage = value
@property
def distance(self):
return super().distance
@distance.setter
def distance(self, value):
super().distance = value
@property
def spell_id(self):
return super().spell_id
@spell_id.setter
def spell_id(self, value):
super().spell_id = value
@property
def spell_level(self):
return super().spell_level
@spell_level.setter
def spell_level(self, value):
super().spell_level = value
@property
def node(self):
return super().node
@node.setter
def node(self, value):
super().node = value

View File

@@ -1,110 +0,0 @@
import sqg2o
class ItemsGround:
"""
This class represents item ground manager.
Original: [ItemsGround](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-classes/item/ItemsGround/)
"""
@staticmethod
def getById(id : int):
"""
This method will retrieve the item ground object by its unique id.
**Parameters:**
* `int` **itemGroundId**: the unique item ground id.
**Returns `ItemGround`:**
the item ground object or `throws an exception` if the object cannot be found.
"""
return sqg2o.ItemsGround.getById(id)
@staticmethod
def create(data : dict) -> int:
"""
This method will create the item ground.
**Parameters:**
* `dict {instance, amount=1, physicsEnabled=false position={x=0,y=0,z=0}, rotation={x=0,y=0,z=0}, world=CONFIG_WORLD, virtualWorld=0}`:
* `string` **instance**: the scripting instance of game item.
* `bool` **physicsEnabled**: the physics state of the item ground.
* `dict {x, y, z}` **position**: the position of the item ground in the world.
* `dict {x, y, z}` **rotation**: the rotation of the item ground in the world.
* `string` **world**: the world the item ground is in (.ZEN file path).
* `int` **virtualWorld**: the virtual world id in range <0, 65535>.
**Returns `int`:**
the item ground id.
"""
return sqg2o.ItemsGround.create(data)
@staticmethod
def destroy(id : int):
"""
This method will destroy the item ground by it's unique id.
**Parameters:**
* `int` **itemGroundId**: the item ground unique id.
"""
sqg2o.ItemsGround.destroy(id)
class ItemGround(sqg2o.ItemGround):
"""
This class represents item on the ground.
Original: [ItemGround](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-classes/item/ItemGround//)
## `int` id *(read-only)*
Represents the unique id of the item ground.
## `str` instance *(read-only)*
Represents the item instance of the item ground.
## `int` amount *(read-only)*
Represents the item amount of item ground.
## `str` world *(read-only)*
Represents the item ground world (.ZEN file path).
## `int` virtualWorld
Represents the virtual world of item ground.
"""
def __init__(self):
return super().__init__()
def getPosition() -> tuple:
"""
This method will get the item ground position on the world.
**Returns `tuple(float, float, float)`:**
`X-Y-Z` item ground position on the world.
"""
return super().getPosition()
def getRotation() -> tuple:
"""
This method will get the item ground rotation on the world.
**Returns `tuple(float, float, float)`:**
`X-Y-Z` item ground roration on the world.
"""
return super().getRotation()
@property
def id(self):
return super().id
@property
def instance(self):
return super().instance
@property
def amount(self):
return super().amount
@property
def world(self):
return super().world
@property
def virtualWorld(self):
return super().virtualWorld
@virtualWorld.setter
def virtualWorld(self, value):
super().virtualWorld = value

View File

@@ -1,30 +0,0 @@
import sqg2o
class Mds:
"""
This class represents mds manager for conversion between mds id & mds instance. This manager will work for every registered mds in `mds.xml` file.
Original: [Mds](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/shared-classes/mds/Mds/)
"""
@staticmethod
def id(mdsName : str) -> int:
"""
This method will convert the mds name to mds id.
**Parameters:**
* `str` **mdsName**: the mds name, e.g: `"HumanS_Sprint.mds"`.
**Returns `int`:**
the unique mds id.
"""
return sqg2o.Mds.id(mdsName)
@staticmethod
def name(mdsId : int) -> str:
"""
This method will convert the mds id to mds name.
**Parameters:**
* `int` **mdsId**: the mds id.
**Returns `str`:**
the mds name, e.g: `"HumanS_Sprint.mds"`.
"""
return sqg2o.Mds.name(mdsId)

View File

@@ -1,196 +0,0 @@
import sqg2o
class Packet(sqg2o.Packet):
"""
This class represents data packet that gets send over the network.
Original: [Packet](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-classes/network/Packet/)
## `int` bitsUsed *(read-only)*
Represents the total number of bits used by the script packet data.
## `int` bytesUsed *(read-only)*
Represents the total number of bytes used by the script packet data.
"""
def __init__(self):
return super().__init__()
def reset(self):
"""
This method will clear the packet data, making it empty.
"""
return super().reset()
def send(self, playerid : int, reliability : int):
"""
This method will send the packet data to the specified player.
**Parameters:**
* `int` **playerid**: the id of the player to whom you want to send the packet.
* `int` **reliability**: the reliability type, for more information see [Reliability](../../constants/reliability.md).
"""
return super().send(playerid, reliability)
def sendToAll(self, reliability : int):
"""
This method will send the packet data to the specified player.
**Parameters:**
* `int` **reliability**: the reliability type, for more information see [Reliability](../../constants/reliability.md).
"""
return super().send(playerid, reliability)
def writeInt8(self, value : int):
"""
This method will append signed int8 value to the packet. (1 byte)
**Parameters:**
* `int` **value**: the number value in range -128 to 127.
"""
return super().writeInt8(value)
def writeUInt8(self, value : int):
"""
This method will append unsigned int8 value to the packet. (1 byte)
**Parameters:**
* `int` **value**: the number value in range 0 to 255.
"""
return super().writeInt8(value)
def writeInt16(self, value : int):
"""
This method will append signed int16 value to the packet. (2 bytes)
**Parameters:**
* `int` **value**: the number value in range -32768 to 32767.
"""
return super().writeInt16(value)
def writeUInt16(self, value : int):
"""
This method will append unsigned int16 value to the packet. (2 bytes)
**Parameters:**
* `int` **value**: the number value in range 0 to 65535.
"""
return super().writeInt16(value)
def writeInt32(self, value : int):
"""
This method will append signed int32 value to the packet. (4 bytes)
**Parameters:**
* `int` **value**: the number value in range -2147483648 to 2147483647.
"""
return super().writeInt32(value)
def writeUInt32(self, value : int):
"""
!!! note
By default squirrel uses int32 values, which means that this method behaves exactly the same as [writeInt32](Packet.md#g2o.classes.packets.Packet.writeInt32) in scripts.
This method will append unsigned int32 value to the packet. (4 bytes)
**Parameters:**
* `int` **value**: the number value in range 0 to 4294967295.
"""
return super().writeInt32(value)
def writeBool(self, value : bool):
"""
This method will append boolean value to the packet. (1 bit)
**Parameters:**
* `bool` **value**: the boolean value.
"""
return super().writeBool(value)
def writeFloat(self, value : float):
"""
This method will append float value to the packet. (4 bytes)
**Parameters:**
* `float` **value**: the number value.
"""
return super().writeFloat(value)
def writeString(self, value : str):
"""
!!! note
The amount of bytes appended to the packet depends on the length of string, 1 byte = 1 char.
This method will append string value to the packet.
**Parameters:**
* `str` **value**: the text value.
"""
return super().writeString(value)
def readInt8(self,) -> int:
"""
This method will get signed int8 value from the packet. (1 byte)
**Returns `int`:**
the number value in range -128 to 127.
"""
return super().readInt8()
def readUInt8(self,) -> int:
"""
This method will get unsigned int8 value from the packet. (1 byte)
**Returns `int`:**
the number value in range 0 to 255.
"""
return super().readInt8()
def readInt16(self) -> int:
"""
This method will get signed int16 value from the packet. (2 bytes)
**Returns `int`:**
the number value in range -32768 to 32767.
"""
return super().readInt16()
def readUInt16(self) -> int:
"""
This method will get unsigned int16 value from the packet. (2 bytes)
**Returns `int`:**
the number value in range 0 to 65535.
"""
return super().readInt16()
def readInt32(self) -> int:
"""
This method will get signed int32 value from the packet. (4 bytes)
**Returns `int`:**
the number value in range -2147483648 to 2147483647.
"""
return super().readInt32()
def readUInt32(self) -> int:
"""
This method will get unsigned int32 value from the packet. (4 bytes)
**Returns `int`:**
the number value in range 0 to 4294967295.
"""
return super().readInt32()
def readBool(self) -> bool:
"""
This method will get signed int8 value from the packet. (1 byte)
**Returns `bool`:**
the boolean value.
"""
return super().readBool()
def readFloat(self) -> float:
"""
This method will get float value from the packet. (4 bytes)
**Returns `float`:**
the number value.
"""
return super().readFloat()
def readString(self) -> str:
"""
!!! note
The amount of bytes appended to the packet depends on the length of string, 1 byte = 1 char.
This method will get string value from the packet.
**Returns `str`:**
the text value.
"""
return super().readString()
@property
def bitsUsed(self):
return super().bitsUsed
@property
def bytesUsed(self):
return super().bytesUsed

View File

@@ -1,106 +0,0 @@
import sqg2o
class SkyMeta(type):
@property
def weather(self):
return sqg2o.Sky.weather
@weather.setter
def weather(self, value):
sqg2o.Sky.weather
@property
def raining(self):
return sqg2o.Sky.raining
@raining.setter
def raining(self, value):
sqg2o.Sky.raining = value
@property
def renderLightning(self):
return sqg2o.Sky.renderLightning
@renderLightning.setter
def renderLightning(self, value):
sqg2o.Sky.renderLightning = value
@property
def windScale(self):
return sqg2o.Sky.windScale
@windScale.setter
def windScale(self, value):
sqg2o.Sky.windScale = value
@property
def dontRain(self):
return sqg2o.Sky.dontRain
@dontRain.setter
def dontRain(self, value):
sqg2o.Sky.dontRain = value
class Sky(metaclass=SkyMeta):
"""
This class represents data packet that gets send over the network.
Original: [Sky](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-classes/game/Sky/)
## `int` weather
Represents the sky weather. For more information see [Weather Constants](../../constants/weather.md)
## `bool` raining
Represents the raining/snowing state.
## `bool` renderLightning
Represents the lightning feature during raining state.
Lightning will only be rendered during raining and when weatherWeight is larger than 0.5
## `float` windScale
Represents the sky wind scale used during raining/snowing.
## `bool` dontRain
Represents the sky dontRain feature.
When it's enabled, the rain/snow won't fall.
"""
@staticmethod
def setRainStartTime(hour : int, minute : int):
"""
This method will set the sky weather time when it starts raining/snowing.
**Parameters:**
* `int` **hour**: the sky weather raining start hour.
* `int` **minute**: the sky weather raining start min.
"""
sqg2o.Sky.setRainStartTime(hour, minute)
@staticmethod
def setRainStopTime(hour : int, minute : int):
"""
This method will set the sky weather time when it stops raining/snowing.
**Parameters:**
* `int` **hour**: the sky weather raining stop hour.
* `int` **minute**: the sky weather raining stop min.
"""
sqg2o.Sky.setRainStopTime(hour, minute)
@staticmethod
def getRainStartTime() -> dict:
"""
This method will get the sky weather time when it starts raining/snowing.
**Returns `dict`:**
* `int` **hour**: the sky weather raining start hour.
* `int` **minute**: the sky weather raining start min.
"""
return sqg2o.Sky.getRainStartTime()
@staticmethod
def getRainStopTime() -> dict:
"""
This method will get the sky weather time when it stops raining/snowing.
**Returns `dict`:**
* `int` **hour**: the sky weather raining stop hour.
* `int` **minute**: the sky weather raining stop min.
"""
return sqg2o.Sky.getRainStopTime()

View File

@@ -1,48 +0,0 @@
import sqg2o
class Way(sqg2o.Way):
"""
This class represents Way constructed from waypoints.
Original: [Way](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-classes/waypoint/Way/)
## `str` start *(read-only)*
Represents the start waypoint for Way.
## `str` end *(read-only)*
Represents the end waypoint for Way.
"""
def __init__(self, world : str, startWp : str, endWp : str):
"""
## Parameters
`str` **world**: the name of the world from config.xml.
`str` **startWp**: the name of the start waypoint.
`str` **endWp**: the name of the end waypoint.
"""
return super().__init__(world, startWp, endWp)
def getWaypoints(self) -> list:
"""
This method will get the all waypoints between startWp & endWp.
## Returns
`list [str]`: the list containing the names of all of the Way waypoints.
"""
return super().getWaypoints()
def getCountWaypoints(self):
"""
This method will get the number of waypoints between start waypoint & end waypoint.
## Returns
`int`: the number of waypoints.
"""
return super().getCountWaypoints()
@property
def start(self):
return super().start
@property
def end(self):
return super().end

View File

@@ -1,13 +0,0 @@
from .anticheat import *
from .context import *
from .damage import *
from .general import *
from .hand import *
from .item import *
from .network import *
from .npc import *
from .reliability import *
from .skillweapon import *
from .talent import *
from .weaponmode import *
from .weather import *

View File

@@ -1,3 +0,0 @@
import sqg2oconst
AC_SPEED_HACK = sqg2oconst.AC_SPEED_HACK

View File

@@ -1,4 +0,0 @@
import sqg2oconst
DAMAGE_CTX = sqg2oconst.DAMAGE_CTX
EQUIPMENT_CTX = sqg2oconst.EQUIPMENT_CTX

View File

@@ -1,11 +0,0 @@
import sqg2oconst
DAMAGE_UNKNOWN = sqg2oconst.DAMAGE_UNKNOWN
DAMAGE_BARRIER = sqg2oconst.DAMAGE_BARRIER
DAMAGE_BLUNT = sqg2oconst.DAMAGE_BLUNT
DAMAGE_EDGE = sqg2oconst.DAMAGE_EDGE
DAMAGE_FIRE = sqg2oconst.DAMAGE_FIRE
DAMAGE_FLY = sqg2oconst.DAMAGE_FLY
DAMAGE_MAGIC = sqg2oconst.DAMAGE_MAGIC
DAMAGE_POINT = sqg2oconst.DAMAGE_POINT
DAMAGE_FALL = sqg2oconst.DAMAGE_FALL

View File

@@ -1,5 +0,0 @@
import sqg2oconst
DEBUG_MODE = sqg2oconst.DEBUG_MODE
CLIENT_SIDE = sqg2oconst.CLIENT_SIDE
SERVER_SIDE = sqg2oconst.SERVER_SIDE

View File

@@ -1,4 +0,0 @@
import sqg2oconst
HAND_LEFT = sqg2oconst.HAND_LEFT
HAND_RIGHT = sqg2oconst.HAND_RIGHT

View File

@@ -1,38 +0,0 @@
import sqg2oconst
ITEM_CAT_NONE = sqg2oconst.ITEM_CAT_NONE
ITEM_CAT_NF = sqg2oconst.ITEM_CAT_NF
ITEM_CAT_FF = sqg2oconst.ITEM_CAT_FF
ITEM_CAT_MUN = sqg2oconst.ITEM_CAT_MUN
ITEM_CAT_ARMOR = sqg2oconst.ITEM_CAT_ARMOR
ITEM_CAT_FOOD = sqg2oconst.ITEM_CAT_FOOD
ITEM_CAT_DOCS = sqg2oconst.ITEM_CAT_DOCS
ITEM_CAT_POTION = sqg2oconst.ITEM_CAT_POTION
ITEM_CAT_LIGHT = sqg2oconst.ITEM_CAT_LIGHT
ITEM_CAT_RUNE = sqg2oconst.ITEM_CAT_RUNE
ITEM_CAT_MAGIC = sqg2oconst.ITEM_CAT_MAGIC
ITEM_FLAG_DAG = sqg2oconst.ITEM_FLAG_DAG
ITEM_FLAG_SWD = sqg2oconst.ITEM_FLAG_SWD
ITEM_FLAG_AXE = sqg2oconst.ITEM_FLAG_AXE
ITEM_FLAG_2HD_SWD = sqg2oconst.ITEM_FLAG_2HD_SWD
ITEM_FLAG_2HD_AXE = sqg2oconst.ITEM_FLAG_2HD_AXE
ITEM_FLAG_SHIELD = sqg2oconst.ITEM_FLAG_SHIELD
ITEM_FLAG_BOW = sqg2oconst.ITEM_FLAG_BOW
ITEM_FLAG_CROSSBOW = sqg2oconst.ITEM_FLAG_CROSSBOW
ITEM_FLAG_RING = sqg2oconst.ITEM_FLAG_RING
ITEM_FLAG_AMULET = sqg2oconst.ITEM_FLAG_AMULET
ITEM_FLAG_BELT = sqg2oconst.ITEM_FLAG_BELT
ITEM_FLAG_DROPPED = sqg2oconst.ITEM_FLAG_DROPPED
ITEM_FLAG_MI = sqg2oconst.ITEM_FLAG_MI
ITEM_FLAG_MULTI = sqg2oconst.ITEM_FLAG_MULTI
ITEM_FLAG_NFOCUS = sqg2oconst.ITEM_FLAG_NFOCUS
ITEM_FLAG_CREATEAMMO = sqg2oconst.ITEM_FLAG_CREATEAMMO
ITEM_FLAG_NSPLIT = sqg2oconst.ITEM_FLAG_NSPLIT
ITEM_FLAG_DRINK = sqg2oconst.ITEM_FLAG_DRINK
ITEM_FLAG_TORCH = sqg2oconst.ITEM_FLAG_TORCH
ITEM_FLAG_THROW = sqg2oconst.ITEM_FLAG_THROW
ITEM_FLAG_ACTIVE = sqg2oconst.ITEM_FLAG_ACTIVE
ITEM_WEAR_NO = sqg2oconst.ITEM_WEAR_NO
ITEM_WEAR_TORSO = sqg2oconst.ITEM_WEAR_TORSO
ITEM_WEAR_HEAD = sqg2oconst.ITEM_WEAR_HEAD
ITEM_WEAR_LIGHT = sqg2oconst.ITEM_WEAR_LIGHT

View File

@@ -1,5 +0,0 @@
import sqg2oconst
DISCONNECTED = sqg2oconst.DISCONNECTED
LOST_CONNECTION = sqg2oconst.LOST_CONNECTION
HAS_CRASHED = sqg2oconst.HAS_CRASHED

View File

@@ -1,28 +0,0 @@
import sqg2oconst
ATTACK_RUN = sqg2oconst.ATTACK_RUN
ATTACK_FORWARD = sqg2oconst.ATTACK_FORWARD
ATTACK_LEFT = sqg2oconst.ATTACK_LEFT
ATTACK_RIGHT = sqg2oconst.ATTACK_RIGHT
ACTION_CLEAR_QUEUE = sqg2oconst.ACTION_CLEAR_QUEUE
ACTION_APPLY_OVERLAY = sqg2oconst.ACTION_APPLY_OVERLAY
ACTION_REMOVE_OVERLAY = sqg2oconst.ACTION_REMOVE_OVERLAY
ACTION_PLAY_ANI = sqg2oconst.ACTION_PLAY_ANI
ACTION_STOP_ANI = sqg2oconst.ACTION_STOP_ANI
ACTION_EQUIP_ITEM = sqg2oconst.ACTION_EQUIP_ITEM
ACTION_UNEQUIP_ITEM = sqg2oconst.ACTION_UNEQUIP_ITEM
ACTION_WEAPON_MODE = sqg2oconst.ACTION_WEAPON_MODE
ACTION_DRAW_WEAPON = sqg2oconst.ACTION_DRAW_WEAPON
ACTION_REMOVE_WEAPON = sqg2oconst.ACTION_REMOVE_WEAPON
ACTION_USE_ITEM = sqg2oconst.ACTION_USE_ITEM
ACTION_USE_ITEM_TO_STATE = sqg2oconst.ACTION_USE_ITEM_TO_STATE
ACTION_READY_SPELL = sqg2oconst.ACTION_READY_SPELL
ACTION_UNREADY_SPELL = sqg2oconst.ACTION_UNREADY_SPELL
ACTION_ATTACK_MELEE_WEAPON = sqg2oconst.ACTION_ATTACK_MELEE_WEAPON
ACTION_ATTACK_RANGED_WEAPON = sqg2oconst.ACTION_ATTACK_RANGED_WEAPON
ACTION_SPELL_CAST = sqg2oconst.ACTION_SPELL_CAST
ACTION_USE_MOB_SCHEME = sqg2oconst.ACTION_USE_MOB_SCHEME
ACTION_SHOOT_AT = sqg2oconst.ACTION_SHOOT_AT
ACTION_START_AIM_AT = sqg2oconst.ACTION_START_AIM_AT
ACTION_STOP_AIM_AT = sqg2oconst.ACTION_STOP_AIM_AT
ACTION_SCRIPT = sqg2oconst.ACTION_SCRIPT

View File

@@ -1,7 +0,0 @@
import sqg2oconst
UNRELIABLE = sqg2oconst.UNRELIABLE
UNRELIABLE_SEQUENCED = sqg2oconst.UNRELIABLE_SEQUENCED
RELIABLE = sqg2oconst.RELIABLE
RELIABLE_ORDERED = sqg2oconst.RELIABLE_ORDERED
RELIABLE_SEQUENCED = sqg2oconst.RELIABLE_SEQUENCED

View File

@@ -1,6 +0,0 @@
import sqg2oconst
WEAPON_1H = sqg2oconst.WEAPON_1H
WEAPON_2H = sqg2oconst.WEAPON_2H
WEAPON_BOW = sqg2oconst.WEAPON_BOW
WEAPON_CBOW = sqg2oconst.WEAPON_CBOW

View File

@@ -1,24 +0,0 @@
import sqg2oconst
TALENT_1H = sqg2oconst.TALENT_1H
TALENT_2H = sqg2oconst.TALENT_2H
TALENT_BOW = sqg2oconst.TALENT_BOW
TALENT_CROSSBOW = sqg2oconst.TALENT_CROSSBOW
TALENT_PICK_LOCKS = sqg2oconst.TALENT_PICK_LOCKS
TALENT_PICKPOCKET = sqg2oconst.TALENT_PICKPOCKET
TALENT_MAGE = sqg2oconst.TALENT_MAGE
TALENT_SNEAK = sqg2oconst.TALENT_SNEAK
TALENT_REGENERATE = sqg2oconst.TALENT_REGENERATE
TALENT_FIREMASTER = sqg2oconst.TALENT_FIREMASTER
TALENT_ACROBATIC = sqg2oconst.TALENT_ACROBATIC
TALENT_PICKPOCKET_UNUSED = sqg2oconst.TALENT_PICKPOCKET_UNUSED
TALENT_SMITH = sqg2oconst.TALENT_SMITH
TALENT_RUNES = sqg2oconst.TALENT_RUNES
TALENT_ALCHEMY = sqg2oconst.TALENT_ALCHEMY
TALENT_THROPHY = sqg2oconst.TALENT_THROPHY
TALENT_A = sqg2oconst.TALENT_A
TALENT_B = sqg2oconst.TALENT_B
TALENT_C = sqg2oconst.TALENT_C
TALENT_D = sqg2oconst.TALENT_D
TALENT_E = sqg2oconst.TALENT_E
TALENT_MAX = sqg2oconst.TALENT_MAX

View File

@@ -1,11 +0,0 @@
import sqg2oconst
WEAPONMODE_NONE = sqg2oconst.WEAPONMODE_NONE
WEAPONMODE_FIST = sqg2oconst.WEAPONMODE_FIST
WEAPONMODE_DAG = sqg2oconst.WEAPONMODE_DAG
WEAPONMODE_1HS = sqg2oconst.WEAPONMODE_1HS
WEAPONMODE_2HS = sqg2oconst.WEAPONMODE_2HS
WEAPONMODE_BOW = sqg2oconst.WEAPONMODE_BOW
WEAPONMODE_CBOW = sqg2oconst.WEAPONMODE_CBOW
WEAPONMODE_MAG = sqg2oconst.WEAPONMODE_MAG
WEAPONMODE_MAX = sqg2oconst.WEAPONMODE_MAX

View File

@@ -1,4 +0,0 @@
import sqg2oconst
WEATHER_SNOW = sqg2oconst.WEATHER_SNOW
WEATHER_RAIN = sqg2oconst.WEATHER_RAIN

View File

@@ -1,81 +0,0 @@
import sqg2o
def sendMessageToAll(r : int, g : int, b : int, text : str):
"""
This function will send a chat message to every connected player.
Sending a message triggers client side event [onPlayerMessage](../../defaultEvents/player/onPlayerMessage.md) with playerid set as `-1`.
Original: [sendMessageToAll](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/chat/sendMessageToAll/)
## Declaration
```python
def sendMessageToAll(r : int, g : int, b : int, text : str)
```
## Parameters
* `int` **r**: the red color component in RGB model.
* `int` **g**: the green color component in RGB model.
* `int` **b**: the blue color component in RGB model.
* `str` **text**: that will be send.
"""
return sqg2o.sendMessageToAll(r, g, b, text)
def sendMessageToPlayer(playerid : int, r : int, g : int, b : int, text : str):
"""
This function will send a chat message to specific player.
Sending a message triggers client side event [onPlayerMessage](../../defaultEvents/player/onPlayerMessage.md) with playerid set as `-1`.
Original: [sendMessageToPlayer](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/chat/sendMessageToPlayer/)
## Declaration
```python
def sendMessageToPlayer(playerid : int, r : int, g : int, b : int, text : str)
```
## Parameters
* `int` **playerid**: the id of the player which will receive a message.
* `int` **r**: the red color component in RGB model.
* `int` **g**: the green color component in RGB model.
* `int` **b**: the blue color component in RGB model.
* `str` **text**: that will be send.
"""
return sqg2o.sendMessageToPlayer(playerid, r, g, b, text)
def sendPlayerMessageToAll(senderid : int, r : int, g : int, b : int, text : str):
"""
This function will send a chat message from one player to every player. Sending a message
Sending a message triggers client side event [onPlayerMessage](../../defaultEvents/player/onPlayerMessage.md) with playerid set as **senderid**.
Original: [sendPlayerMessageToAll](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/chat/sendPlayerMessageToAll/)
## Declaration
```python
def sendPlayerMessageToAll(senderid : int, r : int, g : int, b : int, text : str)
```
## Parameters
* `int` **senderid**: the id of the player which will send a message.
* `int` **r**: the red color component in RGB model.
* `int` **g**: the green color component in RGB model.
* `int` **b**: the blue color component in RGB model.
* `str` **text**: that will be send.
"""
return sqg2o.sendPlayerMessageToAll(senderid, r, g, b, text)
def sendPlayerMessageToPlayer(senderid : int, receiverid : int, r : int, g : int, b : int, text : str):
"""
This function will send a chat message from one player to another player.
Sending a message triggers client side event [onPlayerMessage](../../defaultEvents/player/onPlayerMessage.md) with playerid set as **senderid**.
Original: [sendPlayerMessageToPlayer](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/chat/sendPlayerMessageToPlayer/)
## Declaration
```python
sendPlayerMessageToPlayer(senderid : int, receiverid : int, r : int, g : int, b : int, text : str)
```
## Parameters
* `int` **senderid**: the id of the player which will send a message.
* `int` **receiverid**: the id of the player which will receive a message.
* `int` **r**: the red color component in RGB model.
* `int` **g**: the green color component in RGB model.
* `int` **b**: the blue color component in RGB model.
* `str` **text**: that will be send.
"""
return sqg2o.sendPlayerMessageToAll(senderid, receiverid, r, g, b, text)

View File

@@ -1,248 +0,0 @@
eventList = {}
disabledEventList = []
def callEvent(evtName : str, **kwargs : dict):
"""
This function will notify (call) every handler bound to specified event.
Original: [callEvent](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/shared-functions/event/callEvent/)
## Declaration
```python
def callEvent(evtName : str, **kwargs : dict)
```
## Parameters
* `str` **name**: the name of the event
* `**dict` **kwargs**: the variable number of arguments.
## Usage
```python
import g2o
g2o.addEvent('testEvt')
@g2o.event('testEvt')
def onTestEvent(**kwargs):
print(f'{kwargs['name']} called my beautiful test event')
g2o.callEvent('testEvt', name = 'Diego')
```
"""
isEventCancelled = False
if evtName in eventList and evtName not in disabledEventList:
for event in eventList[evtName]:
event['function'].eventName = evtName
event['function'].cancelled = isEventCancelled
result = event['function'](**kwargs)
if result != None:
isEventCancelled = not result
return isEventCancelled
def addEvent(name : str):
"""
This function will register a new event with specified name.
Events can be used to notify function(s) when something will happen, like player joins the server, etc.
Original: [addEvent](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/shared-functions/event/addEvent/)
## Declaration
```python
def addEvent(name)
```
## Parameters
* `str` **name**: the name of the event
## Usage
```python
import g2o
g2o.addEvent('testEvt')
```
"""
if not name in eventList:
eventList[name] = []
def event(name : str, priority : int = 9999):
"""
This function will bind function to specified event.
Original: [addEventHandler](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/shared-functions/event/addEventHandler/)
## Declaration
```python
def event(name : str, priority : int = 9999)
```
## Parameters
* `str` **name**: the name of the event
* `int` **priority**: the function priority. The lower the value, the sooner the function/handler will be called.
## Usage
```python
import g2o
@g2o.event('onInit')
def onInitEventHandler(**kwargs):
print('Called onInit event')
```
"""
def inlineEvt(func):
if name not in eventList:
return None
eventList[name].append({'function': func, 'priority': priority})
eventList[name].sort(key = lambda x: x['priority'])
return func
return inlineEvt
def removeEventHandler(name : str, func : object):
"""
This function will unbind function from specified event.
Original: [removeEventHandler](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/shared-functions/event/removeEventHandler/)
## Declaration
```python
def removeEventHandler(name : str, func : object)
```
## Parameters
* `str` **name**: the name of the event
* `object` **func**: the reference to a function which is currently bound to specified event.
## Usage
```python
import g2o
@g2o.event('onTime')
def onTimeEvt(**kwargs):
print('Calling only once')
g2o.removeEventHandler('onTime', onTimeEvt)
```
"""
if not name in eventList:
pass
for index, item in enumerate(eventList[name]):
if item['function'] == func:
del eventList[name][index]
def toggleEvent(name : str, toggle : bool):
'''
!!! note
By default every event is toggled `on` (enabled).
This function will toggle event (enable or disable it globally). By toggling event off, you can completely disable certain event from calling it's handlers.
Original: [toggleEvent](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/shared-functions/event/toggleEvent/)
## Declaration
```python
def toggleEvent(name : str, toggle : bool)
```
## Parameters
* `str` **name**: the name of the event
* `bool` **toggle**: `false` if you want to disable the event, otherwise true.
## Usage
```python
import g2o
@g2o.event('onTime')
def onTimeEvt(**kwargs):
print('Calling only once')
g2o.toggleEvent('onTime', false)
```
'''
if not toggle and name not in disabledEventList:
disabledEventList.append(name)
elif toggle and name in disabledEventList:
disabledEventList.remove(name)
def removeEvent(name : str):
'''
!!! warning
Removing an event also cause all event handlers to unregister.
This function will unregister an event with specified name.
Original: [removeEvent](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/shared-functions/event/removeEvent/)
## Declaration
```python
def removeEvent(name : str)
```
## Parameters
* `str` **name**: the name of the event
## Usage
```python
import g2o
@g2o.event('onTime')
def onTimeEvt(**kwargs):
print('Calling only once')
g2o.removeEvent('onTime')
```
'''
if name in eventList:
eventList.pop(name)
## registering default events
addEvent('onInit')
addEvent('onExit')
addEvent('onTick')
addEvent('onTime')
addEvent('onBan')
addEvent('onUnban')
addEvent('onPlayerChangeColor')
addEvent('onPlayerChangeFocus')
addEvent('onPlayerChangeHealth')
addEvent('onPlayerChangeMana')
addEvent('onPlayerChangeMaxHealth')
addEvent('onPlayerChangeMaxMana')
addEvent('onPlayerChangeWeaponMode')
addEvent('onPlayerChangeWorld')
addEvent('onPlayerCommand')
addEvent('onPlayerDamage')
addEvent('onPlayerDead')
addEvent('onPlayerDisconnect')
addEvent('onPlayerDropItem')
addEvent('onPlayerEnterWorld')
addEvent('onPlayerJoin')
addEvent('onPlayerMessage')
addEvent('onPlayerMobInteract')
addEvent('onPlayerRespawn')
addEvent('onPlayerShoot')
addEvent('onPlayerSpellCast')
addEvent('onPlayerSpellSetup')
addEvent('onPlayerTakeItem')
addEvent('onPlayerTeleport')
addEvent('onPlayerToggleFaceAni')
addEvent('onPlayerEquipAmulet')
addEvent('onPlayerEquipArmor')
addEvent('onPlayerEquipBelt')
addEvent('onPlayerEquipHandItem')
addEvent('onPlayerEquipHelmet')
addEvent('onPlayerEquipMeleeWeapon')
addEvent('onPlayerEquipRangedWeapon')
addEvent('onPlayerEquipRing')
addEvent('onPlayerEquipShield')
addEvent('onPlayerEquipSpell')
addEvent('onPacket')
addEvent('onPlayerUseCheat')
addEvent('onNpcActionFinished')
addEvent('onNpcActionSent')
addEvent('onNpcChangeHostPlayer')
addEvent('onNpcCreated')
addEvent('onNpcDestroyed')

View File

@@ -1,223 +0,0 @@
import sqg2o
def getHostname() -> str:
"""
This function will get the hostname of the server.
Original: [getHostname](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/shared-functions/game/getHostname/)
## Declaration
```python
def getHostname() -> str
```
## Returns
`str`: Server hostname.
## Usage
```python
import g2o
@g2o.event('onInit')
def evtInit(**kwargs):
print('Server hostname:', g2o.getHostname())
```
"""
return sqg2o.getHostname()
def getMaxSlots() -> int:
"""
This function will get the max number of slots available on the server.
Original: [getMaxSlots](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/shared-functions/game/getMaxSlots/)
## Declaration
```python
def getMaxSlots() -> int
```
## Returns
`int`: Max slots number on the server.
## Usage
```python
import g2o
@g2o.event('onInit')
def evtInit(**kwargs):
print('Server max slots:', g2o.getMaxSlots())
```
"""
return sqg2o.getMaxSlots()
def getPlayersCount() -> int:
"""
This function will get the max number of slots available on the server.
Original: [getPlayersCount](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/shared-functions/game/getPlayersCount/)
## Declaration
```python
def getPlayersCount() -> int
```
## Returns
`int`: Number of players on the server.
## Usage
```python
import g2o
@g2o.event('onInit')
def evtInit(**kwargs):
print('Players online:', g2o.getPlayersCount())
```
"""
return sqg2o.getPlayersCount()
def exit(exitCode : int = 0):
"""
This function will close the server with specified exit code.
Original: [exit](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/game/exit/)
## Declaration
```python
def exit(exitCode : int = 0)
```
## Parameters
* `int` **exitCode**: exit status for g2o server.
"""
return sqg2o.exit(exitCode)
def getDayLength() -> float:
"""
The function is used to get the day length in miliseconds.
Original: [getDayLength](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/game/getDayLength/)
## Declaration
```python
def getDayLength() -> float
```
## Returns
`float`: the current day length in miliseconds.
"""
return sqg2o.getDayLength()
def getServerDescription() -> str:
"""
This function will get the description of the server.
Original: [getServerDescription](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/game/getServerDescription/)
## Declaration
```python
def getServerDescription() -> str
```
## Returns
`str`: Server description.
"""
return sqg2o.getServerDescription()
def getServerWorld() -> str:
"""
The function is used to get the path of the default world on the server.
Original: [getServerWorld](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/game/getServerWorld/)
## Declaration
```python
def getServerWorld() -> str
```
## Returns
`str`: The world path name.
"""
return sqg2o.getServerWorld()
def getTime() -> dict:
"""
The function is used to get the path of the default world on the server.
Original: [getTime](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/game/getTime/)
## Declaration
```python
def getTime() -> dict
```
## Returns
`dict {day, hour, min}`: The current time in the game.
"""
return sqg2o.getTime()
def serverLog(text : str):
"""
This function will log the text into server.log file.
Original: [serverLog](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/game/serverLog/)
## Declaration
```python
def serverLog(text : str)
```
## Parameters
`str` **text**: the text message that you want to append to server.log file.
"""
return sqg2o.serverLog(text)
def setDayLength(miliseconds : float):
"""
!!! note
Day length can't be smaller than 10 000 miliseconds.
This function will set the day length in miliseconds.
Original: [setDayLength](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/game/setDayLength/)
## Declaration
```python
def setDayLength(miliseconds : float)
```
## Parameters
`float` **miliseconds**: day length in miliseconds.
"""
return sqg2o.setDayLength(miliseconds)
def setServerDescription(description : str):
"""
This function will set the description of the server.
Original: [setServerDescription](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/game/setServerDescription/)
## Declaration
```python
def setServerDescription(description : str)
```
## Parameters
`str` **description**: the server description.
## Returns
`bool`: `true` if server description was set successfully, otherwise `false`.
"""
return sqg2o.setServerDescription(description)
def setServerWorld(world : str):
"""
!!! note
The server world limit is set to 32 characters.
!!! note
If the target world path is written with backslashes instead of normal slashes, you need to escape it with another backslashes e.g. "NEWWORLD\\NEWWORLD.ZEN".
This function will change the default world to which players will enter after joining.
Original: [setServerWorld](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/game/setServerWorld/)
## Declaration
```python
def setServerWorld(world : str)
```
## Parameters
`str` **world**: the path to the target world.
"""
return sqg2o.setServerWorld(world)
def setTime(hour : int, min : int, day : int = 0):
"""
This function will set the current time in the game to the given time, for all the players.
Original: [setTime](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/game/setTime/)
## Declaration
```python
def setTime(hour : int, min : int, day : int = 0)
```
## Parameters
`int` **hour**: the hour of new time (in the range between 0-23).
`int` **min**: the minute of new time (in the range between 0-59).
`int` **day**: the day of new time.
"""
return sqg2o.setTime(hour, min, day)

View File

@@ -1,63 +0,0 @@
import sqg2o
def getDistance2d(x1 : float, y1: float, x2 : float, y2 : float) -> float:
"""
This function will get the 2d distance between two points.
Original: [getDistance2d](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/shared-functions/math/getDistance2d/)
## Declaration
```python
def getDistance2d(x1 : float, y1: float, x2 : float, y2 : float) -> float
```
## Parameters
* `float` **x1**: the position on X axis of the first point.
* `float` **y1**: the position on Y axis of the first point.
* `float` **x2**: the position on X axis of the second point.
* `float` **y2**: the position on Y axis of the second point.
## Returns
`float`: Returns the calculated 2d distance between two points as floating point number.
"""
return sqg2o.getDistance2d(x1, y1, x2, y2)
def getDistance3d(x1 : float, y1: float, z1 : float, x2 : float, y2 : float, z2 : float) -> float:
"""
This function will get the 3d distance between two points.
Original: [getDistance3d](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/shared-functions/math/getDistance3d/)
## Declaration
```python
def getDistance3d(x1 : float, y1: float, z1 : float, x2 : float, y2 : float, z2 : float) -> float
```
## Parameters
* `float` **x1**: the position on X axis of the first point.
* `float` **y1**: the position on Y axis of the first point.
* `float` **z1**: the position on Z axis of the first point.
* `float` **x2**: the position on X axis of the second point.
* `float` **y2**: the position on Y axis of the second point.
* `float` **z2**: the position on Z axis of the second point.
## Returns
`float`: Returns the calculated 3d distance between two points as floating point number.
"""
return sqg2o.getDistance3d(x1, y1, z1, x2, y2, z2)
def getVectorAngle(x1 : float, y1: float, x2 : float, y2 : float) -> float:
"""
This function will get angle on Y axis directed towards the second point.
Original: [getVectorAngle](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/shared-functions/math/getVectorAngle/)
## Declaration
```python
def getVectorAngle(x1 : float, y1: float, x2 : float, y2 : float) -> float
```
## Parameters
* `float` **x1**: the position on X axis of the first point.
* `float` **y1**: the position on Y axis of the first point.
* `float` **x2**: the position on X axis of the second point.
* `float` **y2**: the position on Y axis of the second point.
## Returns
`float`: Returns the angle on Y axis directed towards the second point.
"""
return sqg2o.getVectorAngle(x1, y1, x2, y2)

View File

@@ -1,247 +0,0 @@
import sqg2o
def clearNpcActions(npc_id : int):
"""
This function clears remote NPC actions queue. Remote NPCs uses actions queue to execute thier tasks.
Original: [clearNpcActions](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/npc/clearNpcActions/)
## Declaration
```python
clearNpcActions(npc_id : int)
```
## Parameters
`int` **npc_id**: the npc identifier.
"""
return sqg2o.clearNpcActions(npc_id)
def createNpc(name : str, instance : str = 'PC_HERO') -> int:
"""
!!! note
By default npcs won't be added to world. In order to do that, you have to call [spawnPlayer](../player/spawnPlayer.md).
!!! note
Remote NPC id will always begins from max slots value.
This function creates remote NPC.
Original: [createNpc](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/npc/createNpc/)
## Declaration
```python
def createNpc(name : str, instance : str = 'PC_HERO') -> int
```
## Parameters
`str` **name**: the displayed name of the npc.
`str` **instance**: the instance name of for the npc.
"""
return sqg2o.createNpc(name, instance)
def destroyNpc(npc_id : int) -> bool:
"""
This function destroys remote NPC.
Original: [destroyNpc](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/npc/destroyNpc/)
## Declaration
```python
def destroyNpc(npc_id : int) -> bool
```
## Parameters
`int` **npc_id**: the identifier of npc.
## Returns
`bool`: `true` when npc was successfully destroyed, otherwise false`.
"""
return sqg2o.destroyNpc(npc_id)
def getNpcAction(npc_id : int, index : int) -> dict:
"""
This function gets information about element on specified index in NPC action queue.
Original: [getNpcAction](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/npc/getNpcAction/)
## Declaration
```python
getNpcAction(npc_id : int, index : int) -> dict
```
## Parameters
`int` **npc_id**: the identifier of npc.
`int` **index**: the index of element in the queue.
## Returns
`dict {type, id, status}`: The table containing information about selected element.
"""
return sqg2o.getNpcAction(npc_id, index)
def getNpcActions(npc_id : int) -> list:
"""
This function gets informations about elements in NPC action queue.
Original: [getNpcActions](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/npc/getNpcActions/)
## Declaration
```python
def getNpcActions(npc_id : int) -> list
```
## Parameters
`int` **npc_id**: the identifier of npc.
## Returns
`list [{type, id}]`: The array containing information about queue elements.
"""
return sqg2o.getNpcActions(npc_id)
def getNpcActionsCount(npc_id : int) -> int:
"""
This function gets elements count in NPC action queue.
Original: [getNpcActionsCount](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/npc/getNpcActionsCount/)
## Declaration
```python
def getNpcActionsCount(npc_id : int) -> int
```
## Parameters
`int` **npc_id**: the identifier of npc.
## Returns
`int`: The count of elements inside queue, otherwise `-1`.
"""
return sqg2o.getNpcActionsCount(npc_id)
def getNpcHostPlayer(npc_id : int) -> int:
"""
This function gets NPC host player id.
Original: [getNpcHostPlayer](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/npc/getNpcHostPlayer/)
## Declaration
```python
getNpcHostPlayer(npc_id : int) -> int
```
## Parameters
`int` **npc_id**: the identifier of npc.
## Returns
`int`: the host player identifier. If there is no host player `-1` is returned instead.
"""
return sqg2o.getNpcHostPlayer(npc_id)
def getNpcLastActionId(npc_id : int) -> int:
"""
This function gets last action identifier, that was enqued to the NPC action queue. Every action in queue has associated unique id, by which can be identified.
Original: [getNpcLastActionId](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/npc/getNpcLastActionId/)
## Declaration
```python
getNpcLastActionId(npc_id : int) -> int
```
## Parameters
`int` **npc_id**: the identifier of npc.
## Returns
`int`: The last finished action identifier, otherwise `-1`.
"""
return sqg2o.getNpcLastActionId(npc_id)
def isNpc(npc_id : int) -> bool:
"""
This function checks whether id related to given object is remote NPC.
Original: [isNpc](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/npc/isNpc/)
## Declaration
```python
def isNpc(npc_id : int) -> bool
```
## Parameters
`int` **npc_id**: the identifier of npc.
## Returns
`bool`: `true` when object is NPC, otherwise `false`.
"""
return sqg2o.isNpc(npc_id)
def isNpcActionFinished(npc_id : int, action_id : int) -> bool:
"""
This function checks whether specified NPC action was finished.
Original: [isNpcActionFinished](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/npc/isNpcActionFinished/)
## Declaration
```python
def isNpcActionFinished(npc_id : int, action_id : int) -> bool
```
## Parameters
`int` **npc_id**: the identifier of npc.
`int` **action_id**: the unique action identifier.
## Returns
`bool`: `true` if specified action identifier was already finished, otherwise `false`.
"""
return sqg2o.isNpcActionFinished(npc_id, action_id)
def npcAttackMelee(attacker_id : int, enemy_id : int, attack_type : int, combo : int):
"""
!!! note
Combo is internal Gothic value. Its behaviour can be sometimes undefined. For example -1 value doesn't work for not humanoid NPCs.
This function enqueues attack melee action to the remote NPC action queue.
Original: [npcAttackMelee](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/npc/npcAttackMelee/)
## Declaration
```python
def npcAttackMelee(attacker_id : int, enemy_id : int, attack_type : int, combo : int)
```
## Parameters
`int` **attacker_id**: the remote npc id.
`int` **enemy_id**: the remote npc or player id.
`int` **attack_type**: the type of attack.
`int` **combol**: the combo sequence. For `-1` execute next command immediately.
"""
return sqg2o.npcAttackMelee(attacker_id, enemy_id, attack_type, combo)
def npcAttackRanged(attacker_id : int, enemy_id : int):
"""
This function enqueues attack ranged action to the remote NPC action queue.
Original: [npcAttackRanged](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/npc/npcAttackRanged/)
## Declaration
```python
def npcAttackRanged(attacker_id : int, enemy_id : int)
```
## Parameters
`int` **attacker_id**: the remote npc id.
`int` **enemy_id**: the remote npc or player id.
"""
return sqg2o.npcAttackRanged(attacker_id, enemy_id)
def npcSpellCast(attacker_id : int, enemy_id : int):
"""
This function enqueues spell cast action to the remote NPC action queue.
Original: [npcSpellCast](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/npc/npcSpellCast/)
## Declaration
```python
def npcSpellCast(attacker_id : int, enemy_id : int)
```
## Parameters
`int` **attacker_id**: the remote npc id.
`int` **enemy_id**: the remote npc or player id.
"""
return sqg2o.npcSpellCast(attacker_id, enemy_id)
def npcUseClosestMob(npc_id : int, sceme : str, target_state : int):
"""
This function enqueues use closest mob action to the remote NPC action queue.
Original: [npcUseClosestMob](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/npc/npcUseClosestMob/)
## Declaration
```python
def npcUseClosestMob(npc_id : int, sceme : str, target_state : int)
```
## Parameters
`int` **npc_id**: the npc identifier.
`str` **sceme**: the animation sceme name, e.g: `"BENCH"` when you want to interact with bench.
`int` **target_state**: the target state, use `1` if you want to start interaction and `-1` to end it.
"""
return sqg2o.npcUseClosestMob(npc_id, sceme, target_state)
def setNpcHostPlayer(npc_id : int, host_id : int) -> bool:
"""
This function sets new NPC host player.
Original: [setNpcHostPlayer](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/npc/setNpcHostPlayer/)
## Declaration
```python
def setNpcHostPlayer(npc_id : int, host_id : int) -> bool
```
## Parameters
`int` **npc_id**: the npc identifier.
`int` **host_id**: the player host identifier.
## Returns
`bool`: `true` if host was successfully changed, otherwise `false`.
"""
return sqg2o.setNpcHostPlayer(npc_id, host_id)

File diff suppressed because it is too large Load Diff

View File

@@ -1,52 +0,0 @@
import sqg2o
def findNearbyPlayers(position : dict, radius : int, world : str, virtual_world : int = 0) -> list:
"""
This function will search for nearest players, that matches given query arguments.
Original: [findNearbyPlayers](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/streamer/findNearbyPlayers/)
## Declaration
```python
def findNearbyPlayers(position : dict, radius : int, world : str, virtual_world : int = 0) -> list
```
## Parameters
`dict {x, y, z}` **position**: the centroid position.
`int` **radius**: the maximum radius to search from centroid.
`str` **world**: the world used to find players.
`int` **virtual_world**: the virtual world used to find players.
## Returns
`list [int]`: ids of nearby players.
"""
return sqg2o.findNearbyPlayers(position, radius, world, virtual_world)
def getSpawnedPlayersForPlayer(id : int) -> list:
"""
This function is used to retrieve currently spawned players for given player.
Original: [getSpawnedPlayersForPlayer](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/streamer/getSpawnedPlayersForPlayer/)
## Declaration
```python
def getSpawnedPlayersForPlayer(id : int) -> list
```
## Parameters
`int` **id**: the player id.
## Returns
`list [int]`: ids of spawned players.
"""
return sqg2o.getSpawnedPlayersForPlayer(id)
def getStreamedPlayersByPlayer(id : int) -> list:
"""
This function is used to retrieve currently streamed players by given player. More details: Streamed players are basically clients, that has spawned given player in their game. Please notice, that player can be spawned only one way. Which means that there are situation were player 1 is spawned for player 2, but not the other way arount. Simple examples: - Invisible players cannot be seen, but they can see everyone nearby. - Flying around world using camera.
Original: [getStreamedPlayersByPlayer](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/streamer/getStreamedPlayersByPlayer/)
## Declaration
```python
def getStreamedPlayersByPlayer(id : int) -> list
```
## Parameters
`int` **id**: the player id.
## Returns
`list [int]`: ids of streamed players.
"""
return sqg2o.getStreamedPlayersByPlayer(id)

View File

@@ -1,37 +0,0 @@
import sqg2o
def getNearestWaypoint(world : str, x : int, y : int, z : int) -> dict:
"""
This function is used to retrieve the information about nearest waypoint from the specified position.
Original: [getNearestWaypoint](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/waypoint/getNearestWaypoint/)
## Declaration
```python
def getNearestWaypoint(world : str, x : int, y : int, z : int) -> dict
```
## Parameters
`str` **world**: the world name in which the waypoint exists.
`int` **x**: the position in the world on the x axis.
`int` **y**: the position in the world on the y axis.
`int` **z**: the position in the world on the z axis.
## Returns
`dict {name, x, y, z}`: Waypoint information.
"""
return sqg2o.getNearestWaypoint(world, x, y, z)
def getWaypoint(world : str, name : str) -> dict:
"""
This function is used to retrieve the position of specified waypoint.
Original: [getWaypoint](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/waypoint/getWaypoint/)
## Declaration
```python
def getWaypoint(world : str, name : str) -> dict
```
## Parameters
`str` **world**: the world name in which the waypoint exists.
`str` **name**: the name of the waypoint.
## Returns
`dict {x, y, z}`: The position of waypoint.
"""
return sqg2o.getWaypoint(world, name)