WLD - world manipulation functions
Functions related to the world.
Functions
Wld_AssignRoomToGuild
Wld_AssignRoomToGuild
Assigns a room to a guild
Parameters
var string room
- name of the room as defined in the portalvar int guild
- guild ID
Wld_AssignRoomToNpc
Wld_AssignRoomToNpc
Assigns a room to a specific NPC
Parameters
var string room
- name of the room as defined in the portalvar C_NPC owner
- instance of the room owner
Wld_DetectItem
Wld_DetectItem
Detects an item with the specified flags
Parameters
var C_NPC npc
- instance of the NPCvar int flags
- item flags
Globals
item
- set to the item if detected
Return value
The function returns TRUE if the item is found, FALSE otherwise
Wld_DetectNpc
Wld_DetectNpc
Detects an NPC based on instance name, guild and AI state
Parameters
var C_NPC npc
- instance of the detector NPCvar int instancename
- instance name of the detected NPC (-1
for any)var func state
- ZS state function of the detected NPCvar int guild
- guild ID of the detected NPC (-1
for any)
Globals
other
- set to the detected NPC
Return value
The function returns TRUE if the NPC is detected, FALSE otherwise
Wld_DetectNpcEx
Wld_DetectNpcEx
Detects an NPC based on instance name, guild and AI state with oprion to ignore player
Parameters
var C_NPC npc
- instance of the detector NPCvar int instancename
- instance name of the detected NPC (-1 for any)var func state
- ZS state function of the detected NPCvar int guild
- guild ID of the detected NPC (-1 for any)var int detectplayer
-1
to detect player,0
to ignore player
Globals
other
- set to the detected NPC
Return value
The function returns TRUE if the NPC is detected, FALSE otherwise
Wld_DetectNpcExAtt
Wld_DetectNpcExAtt
Detects an NPC based on instance name, guild, AI state and attitude with oprion to ignore player
Parameters
var C_NPC npc
- instance of the detector NPCvar int instancename
- instance name of the detected NPC (-1 for any)var func state
- ZS state function of the detected NPCvar int guild
- guild ID of the detected NPC (-1 for any)var int detectplayer
-1
to detect player,0
to ignore playervar int attitude
- attitude of the detected NPC (ATT_
constants)
Globals
other
- set to the detected NPC
Return value
The function returns TRUE if the NPC is detected, FALSE otherwise
Warning
This function is only available in Gothic 2
Wld_DetectPlayer
Wld_DetectPlayer
Checks if the player is detected by the NPC
Parameters
var C_NPC npc
- instance of the NPC
Globals
other
- set to the detected player
Return value
The function returns TRUE if the player is detected, FALSE otherwise
Wld_ExchangeGuildAttitudes
Wld_ExchangeGuildAttitudes
Exchanges the guild attitude table
Parameters
var string tablename
- name of the new attitude table
Wld_GetDay
Wld_GetDay
Gets the current day, start day is 0
Return value
The function returns current day
Wld_GetFormerPlayerPortalGuild
Wld_GetFormerPlayerPortalGuild
Gets the guild of the room (portal) the player was in before the last room change
Return value
The function returns owner guild ID of the previous room the player was in
Wld_GetFormerPlayerPortalOwner
Wld_GetFormerPlayerPortalOwner
Gets the owner of the room (portal) the player was in before the last room change
Return value
The function returns instance of the room owner of the previous room the player was in, NULL if no owner
Wld_GetPlayerPortalGuild
Wld_GetPlayerPortalGuild
Gets the owner guild of the room (portal) the player is currently in
Return value
The function returns owner guild ID of the current room the player is in
Wld_GetPlayerPortalOwner
Wld_GetPlayerPortalOwner
Gets the owner of the active room (portal) the player is currently in
Return value
The function returns instance of the room owner of the current room the player is in, NULL if no owner
Wld_InsertItem
Wld_InsertItem
Inserts an item into the world at the specified spawn point
Parameters
var int iteminstance
- instance ID of the itemvar string spawnpoint
- name of the spawn point (waypoint or object)
Wld_InsertNpc
Wld_InsertNpc
Inserts an NPC into the world at the specified spawn point
Parameters
var int npcinstance
- instance ID of the NPCvar string spawnpoint
- name of the spawn point (waypoint or object)
Globals
self
- set to the inserted NPC
Wld_InsertNpcAndRespawn
Wld_InsertNpcAndRespawn
Inserts an NPC into the world and sets a respawn delay, if the NPC dies it will respawn after the specified delay
Parameters
var int instancename
- instance name of the NPCvar string spawnpoint
- name of the spawn point (waypoint or object)var int spawndelay
- spawn delay in game hours
Wld_InsertObject
Wld_InsertObject
Inserts an oCMob
with specified visual into the world at the specified spawn point
Parameters
var string visual
- name of the visual (with the extension)var string spawnpoint
- name of the spawn point (waypoint or object)
Wld_IsFPAvailable
Wld_IsFPAvailable
Checks if a free point near the NPC is available
Parameters
var C_NPC npc
- instance of the NPCvar string fpname
- name of the freepoint (could be only the middle part of the name:FP_
+fpname
+_01
)
Return value
The function returns TRUE if the freepoint is available, FALSE otherwise
Wld_IsMobAvailable
Wld_IsMobAvailable
Checks if a MOB is available near the NPC and is unoccupied
Parameters
var C_NPC npc
- instance of the NPCvar string schemename
- name of the MOB schema (e.g.BENCH
)
Return value
The function returns TRUE if the MOB is available, FALSE otherwise
Wld_IsNextFPAvailable
Wld_IsNextFPAvailable
Checks if the next free point is available
Parameters
var C_NPC npc
- instance of the NPCvar string fpname
- name of the freepoint (could be only the middle part of the name:FP_
+fpname
+_01
)
Return value
The function returns TRUE if the next freepoint is available, FALSE otherwise
Wld_IsRaining
Wld_IsRaining
Checks if it is raining
Return value
The function returns TRUE if it is raining, FALSE otherwise
Warning
This function is only available in Gothic 2
Wld_IsTime
Wld_IsTime
Checks if the current world time is between the specified times
Parameters
var int hour1
- start hourvar int min1
- start minutevar int hour2
- end hourvar int min2
- end minute
Return value
The function returns TRUE if the current time is between the specified times, FALSE otherwise
Wld_PlayEffect
Wld_PlayEffect
Plays a visual effect (VFX)
Parameters
var string effect
- name of the visual effectvar instance origin
- instance of the effect origin objectvar instance target
- instance of the effect target objectvar int effectlevel
- level of the effectvar int damage
- damage valuevar int damagetype
- type of damagevar int isprojectile
- if TRUE, the effect passes through static objects
Wld_StopEffect
Wld_StopEffect
Stops a visual effect (VFX)
Parameters
var string effect
- name of the visual effect
Warning
This function is only available in Gothic 2
Wld_RemoveItem
Wld_RemoveItem
Removes a specific item object from the world
Parameters
var C_ITEM itm
- C_ITEM instance of the item
Return value
The function returns TRUE if the item was removed, FALSE otherwise
Wld_RemoveNpc
Wld_RemoveNpc
Removes an NPC from the game world
Parameters
var int instancename
- instance name of the NPC to remove
Wld_SendTrigger
Wld_SendTrigger
Sends a trigger message to the specified VOB
Parameters
var string vobname
- name of the VOB
Wld_SendUntrigger
Wld_SendUntrigger
Sends an untrigger message to the specified VOB
Parameters
var string vobname
- name of the VOB
Wld_SetGuildAttitude
Wld_SetGuildAttitude
Sets the guild attitude value between two guilds. Used for monster guilds as human guilds use attitude table
Parameters
var int guild1
- ID of the first guildvar int attitude
- attitude value (ATT_
constants)var int guild2
- ID of the second guild
Wld_GetGuildAttitude
Wld_GetGuildAttitude
Gets the guild attitude value between two guilds.
Parameters
var int guild1
- ID of the first guildvar int guild2
- ID of the second guild
Return value
The function returns attitude value as ATT_
constant
Wld_SetMobRoutine
Wld_SetMobRoutine
Sets a daily routine for the object, the Trigger/Untrigger message is sent if it is later than the specified time
Parameters
var int hour1
- start hourvar int min1
- start minutevar string objname
- name of the objectvar int state
- 1 for Trigger, 0 for Untrigger
Wld_SetObjectRoutine
Wld_SetObjectRoutine
Sets a daily routine for the object, the Trigger/Untrigger message is sent if it is later than the specified time
Parameters
var int hour1
- start hourvar int min1
- start minutevar string objname
- name of the objectvar int state
- 1 for Trigger, 0 for Untrigger
Wld_SetTime
Wld_SetTime
Sets the world time to the specified hour and minute
Parameters
var int hour
- int hour to setvar int min
- int minute to set
Wld_SpawnNpcRange
Wld_SpawnNpcRange
Spawns an NPC within a specified range around npc
Parameters
var C_NPC npc
- instance of the NPC to spawn aroundvar int instancename
- instance name of the spawned NPCvar int num
- number of NPCs to spawnvar float range
- spawn range in cm
Wld_GetMobState
Wld_GetMobState
Gets the state of the MOB used by the NPC
Parameters
var C_NPC npc
- instance of the NPCvar string schemename
- name of the schema (e.g.BENCH
)
zParserExtender
zParserExtender implements quite a few new WLD external functions.