Built-in definitions for Nox Script. More...
Go to the source code of this file.
Enumerations | |
enum | AudioEvent |
Audio events. More... | |
enum | Class |
Class names. More... | |
enum | DamageType |
Damange types. More... | |
enum | Effect |
Effects. More... | |
enum | Enchant |
Enchants. More... | |
enum | Direction |
Facing directions. More... | |
enum | Spell |
Spell names. More... | |
enum | Subclass |
Subclass names. More... | |
Functions | |
object | Wall (int x, int y) |
Get a pointer to a wall by its wall coordinates. More... | |
void | WallOpen (object wall) |
Open a wall. More... | |
void | WallGroupOpen (object wallGroup) |
Open walls in a group. More... | |
void | WallClose (object wall) |
Close a wall. More... | |
void | WallGroupClose (object wallGroup) |
Close walls in a group. More... | |
void | WallToggle (object wall) |
Toggle a wall. More... | |
void | WallGroupToggle (object wallGroup) |
Toggle walls in a group. More... | |
void | WallBreak (object wall) |
Breaks a wall. More... | |
void | WallGroupBreak (object wallGroup) |
Breaks walls in a group. More... | |
int | SecondTimer (int seconds, function callback) |
Create a timer with delay in seconds. More... | |
int | FrameTimer (int frames, function callback) |
Create a timer with delay in frames. More... | |
void | Move (int id, object waypoint) |
Move an object to a waypoint. More... | |
void | GroupMove (object objectGroup, object waypoint) |
Move objects in a group to a waypoint. More... | |
void | LookAtDirection (int id, int direction) |
Cause object to look in a direction. More... | |
void | GroupLookAtDirection (object objectGroup, int direction) |
Cause objects in a group to look in a direction. More... | |
void | ObjectOn (int id) |
Enable an object. More... | |
void | ObjectGroupOn (object objectGroup) |
Enable objects in a group. More... | |
void | WayPointOn (object waypoint) |
Enable a waypoint. More... | |
void | WayPointGroupOn (object waypointGroup) |
Enable waypoints in a group. More... | |
void | ObjectOff (int id) |
Disable an object. More... | |
void | ObjectGroupOff (object objectGroup) |
Disable objects in a group. More... | |
void | WayPointOff (object waypoint) |
Disable a waypoint. More... | |
void | WayPointGroupOff (object waypointGroup) |
Disable waypoints in a group. More... | |
void | ObjectToggle (int id) |
Toggle whether object is disabled. More... | |
void | ObjectGroupToggle (object objectGroup) |
Toggle whether objects in group are disabled. More... | |
void | WayPointToggle (object waypoint) |
Toggle whether waypoint is disabled. More... | |
void | WayPointGroupToggle (object waypointGroup) |
Toggle whether objects in group are disabled. More... | |
void | Delete (int id) |
Delete an object. More... | |
void | GroupDelete (object objectGroup) |
Delete objects in a group. More... | |
void | Wander (int id) |
Cause an object to wander. More... | |
void | GroupWander (object objectGroup) |
Cause objects in a group to wander. More... | |
void | GoBackHome (int id) |
Cause object to move to its starting location. More... | |
void | AudioEvent (string audio, object waypoint) |
Play an audio event at a location. More... | |
void | Print (string message) |
Display a localized string. More... | |
void | PrintToAll (string message) |
Display a localized string to everyone. More... | |
void | Chat (int id, string message) |
Cause an object to say a localized string. More... | |
void | StopScript (any value) |
Exit current script function. More... | |
void | UnlockDoor (int id) |
Unlock a door. More... | |
void | LockDoor (int id) |
Lock a door. More... | |
int | IsObjectOn (int id) |
Get whether object is enabled. More... | |
int | IsWaypointOn (object waypoint) |
Get whether waypoint is enabled. More... | |
int | IsLocked (int id) |
Get whether object is locked. More... | |
float | RandomFloat (float min, float max) |
Random number (float). More... | |
int | Random (int min, int max) |
Random number (int). More... | |
int | SecondTimerWithArg (int seconds, any argument, function callback) |
Create a timer with delay in seconds with an argument. More... | |
int | FrameTimerWithArg (int frames, any argument, function callback) |
Create a timer with delay in frames with an argument. More... | |
string | IntToString (int number) |
Convert an integer to a string. More... | |
string | FloatToString (float number) |
Convert a float to a string. More... | |
int | CreateObject (string type, object waypoint) |
Create an object at a location. More... | |
void | Damage (int target, int source, int amount, int type) |
Damages an object. More... | |
void | GroupDamage (object targetGroup, int source, int amount, int type) |
Damages objects in a group. More... | |
int | CreateMover (int id, object waypoint, float speed) |
Creates a Mover for an object. More... | |
void | GroupCreateMover (object objectGroup, object waypoint, float speed) |
Creates a Mover for every object in a group. More... | |
int | AwardSpell (int id, string spell) |
Award spell level to object. More... | |
void | GroupAwardSpell (object objectGroup, string spell) |
Award spell level to objects in a group. More... | |
void | Enchant (int id, string enchant, float duration) |
Grant object an enchantment. More... | |
void | GroupEnchant (int id, string enchant, float duration) |
Grant objects in a group an enchantment. More... | |
int | GetHost () |
Get host's player object. More... | |
int | Object (string name) |
Lookup an object by name. More... | |
float | GetObjectX (int id) |
Get object X coordinate. More... | |
float | GetWaypointX (object waypoint) |
Get waypoint X coordinate. More... | |
float | GetObjectY (int id) |
Get object Y coordinate. More... | |
float | GetWaypointY (object waypoint) |
Get waypoint Y coordinate. More... | |
float | GetObjectZ (int id) |
Get object Z coordinate. More... | |
int | GetDirection (int id) |
Get object direction. More... | |
void | MoveObject (int id, float x, float y) |
Set an object's location. More... | |
void | MoveWaypoint (object waypoint, float x, float y) |
Set a waypoint's location. More... | |
void | Raise (int id, float z) |
Set an object's Z coordinate. More... | |
void | LookWithAngle (int id, int angle) |
Set an object's direction. More... | |
void | PushObjectTo (int id, float x, float y) |
Push an object to a location. More... | |
void | PushObject (int id, float magnitude, float x, float y) |
Push an object from a vector and magnitude. More... | |
int | GetLastItem (int id) |
Get object's last inventory item. More... | |
int | GetPreviousItem (int id) |
Get previous inventory item. More... | |
int | HasItem (int holder, int item) |
Get whether the item is in the object's inventory. More... | |
int | GetHolder (int item) |
Get the holder of an item. More... | |
int | Pickup (int id, int item) |
Cause object to pickup an item. More... | |
int | Drop (int id, int item) |
Cause object to drop an item. More... | |
int | HasClass (int id, string className) |
Get whether object has a class. More... | |
int | HasEnchant (int id, string enchant) |
Get whether object has an enchant. More... | |
void | EnchantOff (int id, string enchant) |
Remove enchant from an object. More... | |
int | CurrentHealth (int id) |
Get object's health. More... | |
int | MaxHealth (int id) |
Get object's maximum health. More... | |
void | RestoreHealth (int id, int amount) |
Restore object's health. More... | |
float | Distance (float x1, float y1, float x2, float y2) |
Calculate distance between two locations. More... | |
int | IsVisibleTo (int object1, int object2) |
Gets whether an object can see another object. More... | |
int | GetCharacterData (int idx) |
Get character data. More... | |
void | LookAtObject (int id, int target) |
Set direction of object so it is looking at another object. More... | |
void | Walk (int id, float x, float y) |
Causes an object to walk to a location. More... | |
void | GroupWalk (object objectGroup, float x, float y) |
Causes objects in a group to walk to a location. More... | |
int | CancelTimer (int id) |
Cancel a timer. More... | |
void | Effect (string effect, float x1, float y1, float x2, float y2) |
Trigger an effect. More... | |
void | SetOwner (int owner, int target) |
Set the owner of an object. More... | |
void | GroupSetOwner (int owner, object targets) |
Set the owner of objects in a group. More... | |
void | SetOwners (object owners, int target) |
Set the objects in a group as owners of target. More... | |
void | GroupSetOwners (object owners, object targets) |
Set the objects in a group as owners of target. More... | |
int | IsOwnedBy (int id, int target) |
Get whether target is owned by object. More... | |
int | GroupIsOwnedBy (int id, object target) |
Get whether any object in target group is owned by object. More... | |
int | IsOwnedByAny (object objectGroup, int target) |
Get whether target is owned by any object in the group. More... | |
int | GroupIsOwnedByAny (object objectGroup, object target) |
Get whether any object in target is owned by any object in the group. More... | |
void | ClearOwner (int id) |
Clear the owner of an object. More... | |
object | Waypoint (string name) |
Lookup waypoint by name. More... | |
object | WaypointGroup (string name) |
Lookup waypoint group by name. More... | |
object | ObjectGroup (string name) |
Lookup object group by name. More... | |
object | WallGroup (string name) |
Lookup wall group by name. More... | |
void | ChatTimerSeconds (int id, string message, int duration) |
Cause an object to say a localized string for duration in seconds. More... | |
void | ChatTimer (int id, string message, int duration) |
Cause an object to say a localized string for duration in frames. More... | |
void | DestroyChat (int id) |
Destroys object's speech bubble. More... | |
void | DestroyEveryChat () |
Destroys all speech bubbles. More... | |
void | SetQuestStatus (int status, string name) |
Set quest status (int). More... | |
void | SetQuestStatusFloat (float status, string name) |
Set quest status (float). More... | |
int | GetQuestStatus (string name) |
Get quest status (int). More... | |
float | GetQuestStatusFloat (string name) |
Get quest status (int). More... | |
void | ResetQuestStatus (string name) |
Delete quest status. More... | |
int | IsTrigger (int id) |
Get whether object is SELF. More... | |
int | IsCaller (int id) |
Get whether object is OTHER. More... | |
void | SetDialog (int id, string type, function start, function end) |
Setup a conversation with object. More... | |
void | CancelDialog (int id) |
Cancel a conversation with object. More... | |
void | StoryPic (int id, string name) |
Assigns a picture to a conversation. More... | |
void | TellStory (string audio, string story) |
Causes the telling of a story. More... | |
void | StartDialog (int npc, int other) |
Starts a conversation between two objects. More... | |
void | CastSpellObjectObject (string spell, int source, int target) |
Casts a spell from source to target. More... | |
void | CastSpellObjectLocation (string spell, int source, float x, float y) |
Casts a spell from source to target. More... | |
void | CastSpellLocationObject (string spell, float x, float y, int target) |
Casts a spell from source to target. More... | |
void | CastSpellLocationLocation (string spell, float x1, float y1, float x2, float y2) |
Casts a spell from source to target. More... | |
void | UnBlind () |
Unblind the host. More... | |
void | Blind () |
Blind the host. More... | |
void | WideScreen (int value) |
int | GetElevatorStatus (int id) |
Get elevator status. More... | |
void | CreatureGuard (int id, float x1, float y1, float x2, float y2, float distance) |
Cause a creature to guard a location. More... | |
void | CreatureGroupGuard (object objectGroup, float x1, float y1, float x2, float y2, float distance) |
Cause creatures in a group to guard a location. More... | |
void | CreatureHunt (int id) |
Cause creature to hunt. More... | |
void | CreatureGroupHunt (object objectGroup) |
Cause creatures in a group to hunt. More... | |
void | CreatureIdle (int id) |
Cause creature to idle. More... | |
void | CreatureGroupIdle (object objectGroup) |
Cause creatures in a group to idle. More... | |
void | CreatureFollow (int id, int target) |
Cause creature to follow an object. More... | |
void | CreatureGroupFollow (object objectGroup, int target) |
Cause creatures in a group to follow an object. More... | |
void | AggressionLevel (int id, float level) |
Set creature's aggression level. More... | |
void | GroupAggressionLevel (object objectGroup, float level) |
Set group of creature's aggression level. More... | |
void | HitLocation (int id, float x, float y) |
Melee attack a location. More... | |
void | GroupHitLocation (object objectGroup, float x, float y) |
Melee attack a location. More... | |
void | HitFarLocation (int id, float x, float y) |
Ranged attack a location. More... | |
void | GroupHitFarLocation (object objectGroup, float x, float y) |
Ranged attack a location. More... | |
void | SetRoamFlag (int id, int flags) |
Set roaming flags. More... | |
void | GroupSetRoamFlag (object objectGroup, int flags) |
Set roaming flags. More... | |
void | Attack (int id, int target) |
Attack an object. More... | |
void | GroupAttack (object objectGroup, int target) |
Attack an object. More... | |
void | JournalEntry (int id, string message, int type) |
Add entry to player's journal. More... | |
void | JournalDelete (int id, string message) |
Delete entry from player's journal. More... | |
void | JournalEdit (int id, string message, int type) |
Edit entry in player's journal. More... | |
void | RetreatLevel (int id, float percent) |
Set when creature retreats due to low health. More... | |
void | GroupRetreatLevel (object objectGroup, float percent) |
Set when creature retreats due to low health. More... | |
void | ResumeLevel (int id, float percent) |
Set when creature resumes due to health. More... | |
void | GroupResumeLevel (object objectGroup, float percent) |
Set when creature resumes due to health. More... | |
void | RunAway (int id, int target, int duration) |
Cause creature to run away from target. More... | |
void | GroupRunAway (object objectGroup, int target, int duration) |
Cause creatures to run away from target. More... | |
void | PauseObject (int id, int duration) |
Pause an object temporarily. More... | |
void | GroupPauseObject (object objectGroup, int duration) |
Pause objects of a group temporarily. More... | |
int | IsAttackedBy (int id1, int id2) |
Get whether object1 is being attacked by object2. More... | |
int | GetGold (int id) |
Get amount of gold for player object. More... | |
void | ChangeGold (int id, int delta) |
Change amount of gold for player object. More... | |
int | GetAnswer (int id) |
Get answer from conversation. More... | |
void | GiveXp (int id, float xp) |
Grant experience to a player. More... | |
int | HasSubclass (int id, string subclass) |
Get whether object has subclass. More... | |
void | AutoSave () |
Trigger an autosave. Only solo games. More... | |
void | Music (int music, int volume) |
Plays music. More... | |
void | StartupScreen (int arg1) |
Show startup screen to host. More... | |
int | IsTalking () |
Get whether host is talking. More... | |
int | GetTrigger () |
Get SELF if valid. More... | |
int | GetCaller () |
Get OTHER if valid. More... | |
void | MakeFriendly (int id) |
Set object friendly with host. More... | |
void | MakeEnemy (int id) |
Unset object as friendly. More... | |
void | BecomePet (int id) |
Set object as pet of host. More... | |
void | BecomeEnemy (int id) |
Unset object as pet of host. More... | |
int | Unknownb8 (int id) |
int | Unknownb9 (int id) |
void | SetHalberd (int upgrade) |
Upgrade host's oblivion staff. More... | |
void | DeathScreen (int which) |
Show death screen. More... | |
void | Frozen (int id, int frozen) |
Set frozen status of an object. More... | |
void | NoWallSound (int noWallSound) |
Set no wall sound flag. More... | |
void | SetCallback (int id, int idx, function callback) |
Set a callback on an object. More... | |
void | DeleteObjectTimer (int id, int delay) |
Delete object after a delay. More... | |
void | TrapSpells (int id, string spell1, string spell2, string spell3) |
Set spells on a bomber. More... | |
int | IsTrading () |
Get whether the host is currently trading. More... | |
void | ClearMessages (int id) |
Clear messages on player's screen. More... | |
void | SetShopkeeperText (int id, string text) |
Set shopkeeper text. More... | |
void | Unknownc4 () |
int | IsSummoned (int id) |
Gets whether object is a summoned creature. More... | |
void | ZombieStayDown (int id) |
Set zombie to stay down. More... | |
void | ZombieGroupStayDown (object objectGroup) |
Set group of zombies to stay down. More... | |
void | RaiseZombie (int id) |
Raise a zombie. Also clears stay down state. More... | |
void | RaiseZombieGroup (object objectGroup) |
Raise a zombie. Also clears stay down state. More... | |
void | MusicPushEvent () |
void | MusicPopEvent () |
void | MusicEvent () |
int | IsGameBall (int id) |
Get whether object is a GameBall. More... | |
int | IsCrown (int id) |
Get whether object is a Crown. More... | |
void | EndGame (int type) |
End of game. More... | |
void | ImmediateBlind () |
Immediately blind the host. More... | |
void | ChangeScore (int id, int score) |
Change player object's score. More... | |
int | GetScore (int id) |
Get player object's score. More... | |
Variables | |
const int | FALSE = 0 |
FALSE value. More... | |
const int | TRUE = 1 |
TRUE value. More... | |
const int | SELF = -2 |
SELF object id. More... | |
const int | OTHER = -1 |
OTHER object id. More... | |
Built-in definitions for Nox Script.
enum AudioEvent |
Audio events.
enum Class |
Class names.
enum DamageType |
Damange types.
enum Direction |
enum Effect |
Effects.
enum Enchant |
Enchants.
enum Spell |
Spell names.
enum Subclass |
Subclass names.
void AggressionLevel | ( | int | id, |
float | level | ||
) |
Set creature's aggression level.
This will set a creature's aggression level. The most commonly used value is 0.83.
id | an object id |
level | aggression level |
void Attack | ( | int | id, |
int | target | ||
) |
Attack an object.
id | an object id |
target | an object id |
void AudioEvent | ( | string | audio, |
object | waypoint | ||
) |
Play an audio event at a location.
audio | a audio event name AudioEvent |
waypoint | a waypoint object |
void AutoSave | ( | ) |
Trigger an autosave. Only solo games.
int AwardSpell | ( | int | id, |
string | spell | ||
) |
Award spell level to object.
This will raise the spell level of the object. If the object can not cast this spell then it will have no effect.
id | an object id |
spell | a spell name Spell |
void BecomeEnemy | ( | int | id | ) |
Unset object as pet of host.
id | an object id |
void BecomePet | ( | int | id | ) |
Set object as pet of host.
id | an object id |
void Blind | ( | ) |
Blind the host.
void CancelDialog | ( | int | id | ) |
Cancel a conversation with object.
id | an object id |
int CancelTimer | ( | int | id | ) |
Cancel a timer.
id | a timer id |
void CastSpellLocationLocation | ( | string | spell, |
float | x1, | ||
float | y1, | ||
float | x2, | ||
float | y2 | ||
) |
Casts a spell from source to target.
spell | a spell name Spell |
x1 | source x coordinate |
y1 | source y coordinate |
x2 | target x coordinate |
y2 | target y coordinate |
void CastSpellLocationObject | ( | string | spell, |
float | x, | ||
float | y, | ||
int | target | ||
) |
Casts a spell from source to target.
spell | a spell name Spell |
x | source x coordinate |
y | source y coordinate |
target | an object id |
void CastSpellObjectLocation | ( | string | spell, |
int | source, | ||
float | x, | ||
float | y | ||
) |
Casts a spell from source to target.
spell | a spell name Spell |
source | an object id |
x | target x coordinate |
y | target y coordinate |
void CastSpellObjectObject | ( | string | spell, |
int | source, | ||
int | target | ||
) |
void ChangeGold | ( | int | id, |
int | delta | ||
) |
Change amount of gold for player object.
id | an object id |
delta | amount to add (can be negative) |
void ChangeScore | ( | int | id, |
int | score | ||
) |
Change player object's score.
id | an object id |
score | score delta |
void Chat | ( | int | id, |
string | message | ||
) |
Cause an object to say a localized string.
This will display a localized string in a speech bubble. If the string is not in the string database, it will instead print an error message with "MISSING:".
id | an object id |
message | a string |
void ChatTimer | ( | int | id, |
string | message, | ||
int | duration | ||
) |
Cause an object to say a localized string for duration in frames.
This will display a localized string in a speech bubble. If the string is not in the string database, it will instead print an error message with "MISSING:".
id | an object id |
message | a string |
duration | in frames |
void ChatTimerSeconds | ( | int | id, |
string | message, | ||
int | duration | ||
) |
Cause an object to say a localized string for duration in seconds.
This will display a localized string in a speech bubble. If the string is not in the string database, it will instead print an error message with "MISSING:".
id | an object id |
message | a string |
duration | in seconds |
void ClearMessages | ( | int | id | ) |
Clear messages on player's screen.
id | an object id |
void ClearOwner | ( | int | id | ) |
Clear the owner of an object.
id | an object id |
int CreateMover | ( | int | id, |
object | waypoint, | ||
float | speed | ||
) |
Creates a Mover for an object.
id | an object id |
waypoint | destination waypoint |
speed | move speed |
int CreateObject | ( | string | type, |
object | waypoint | ||
) |
Create an object at a location.
This will create an object given a type and a starting location.
Example usage: int spider = CreateObject("SmallAlbinoSpider", Waypoint("SpiderHole"))
type | an object type string |
waypoint | a waypoint object |
void CreatureFollow | ( | int | id, |
int | target | ||
) |
Cause creature to follow an object.
This will cause a creature to follow target, and it won't attack anything unless disrupted or instructed to.
id | an object id |
target | an object id |
void CreatureGroupFollow | ( | object | objectGroup, |
int | target | ||
) |
Cause creatures in a group to follow an object.
This will cause the creatures to follow target, and they won't attack anything unless disrupted or instructed to.
objectGroup | an object group object |
target | an object id |
void CreatureGroupGuard | ( | object | objectGroup, |
float | x1, | ||
float | y1, | ||
float | x2, | ||
float | y2, | ||
float | distance | ||
) |
Cause creatures in a group to guard a location.
This is the same as CreatureGuard but applies to creatures in a group.
objectGroup | an object group object |
x1 | x coordinate to guard from |
y1 | y coordinate to guard from |
x2 | x coordinate to watch |
y2 | y coordinate to watch |
distance | distance from (x2,y2) to attack |
void CreatureGroupHunt | ( | object | objectGroup | ) |
Cause creatures in a group to hunt.
objectGroup | an object group object |
void CreatureGroupIdle | ( | object | objectGroup | ) |
Cause creatures in a group to idle.
objectGroup | an object group object |
void CreatureGuard | ( | int | id, |
float | x1, | ||
float | y1, | ||
float | x2, | ||
float | y2, | ||
float | distance | ||
) |
Cause a creature to guard a location.
This will cause a creature to move to a location, guard a nearby location, and attack any enemies that move within range of the guarded location.
id | an object id |
x1 | x coordinate to guard from |
y1 | y coordinate to guard from |
x2 | x coordinate to watch |
y2 | y coordinate to watch |
distance | distance from (x2,y2) to attack |
void CreatureHunt | ( | int | id | ) |
Cause creature to hunt.
id | an object id |
void CreatureIdle | ( | int | id | ) |
Cause creature to idle.
id | an object id |
int CurrentHealth | ( | int | id | ) |
Get object's health.
id | an object id |
void Damage | ( | int | target, |
int | source, | ||
int | amount, | ||
int | type | ||
) |
Damages an object.
This will damage the target with a given source object, amount, and damage type.
target | an object id that receives damage |
source | an object id as source of damange |
amount | amount of damage |
type | type of damange DamageType |
void DeathScreen | ( | int | which | ) |
Show death screen.
which | the screen to show (1 - 11) |
void Delete | ( | int | id | ) |
Delete an object.
id | an object id |
void DeleteObjectTimer | ( | int | id, |
int | delay | ||
) |
Delete object after a delay.
id | an object id |
delay | number of frames |
void DestroyChat | ( | int | id | ) |
Destroys object's speech bubble.
id | an object id |
void DestroyEveryChat | ( | ) |
Destroys all speech bubbles.
float Distance | ( | float | x1, |
float | y1, | ||
float | x2, | ||
float | y2 | ||
) |
Calculate distance between two locations.
x1 | |
y1 | |
x2 | |
y2 |
int Drop | ( | int | id, |
int | item | ||
) |
Cause object to drop an item.
id | an object id |
item | an object id to drop |
void Effect | ( | string | effect, |
float | x1, | ||
float | y1, | ||
float | x2, | ||
float | y2 | ||
) |
Trigger an effect.
This will trigger an effect from point (x1,y1) to (x2,y2). Some effects only have one point, in which case (x2,y2) is ignored.
effect | an effect name Effect |
x1 | |
y1 | |
x2 | |
y2 |
void Enchant | ( | int | id, |
string | enchant, | ||
float | duration | ||
) |
Grant object an enchantment.
This will grant an object an enchantment of a specified duration. If the enchantment name is incorrect, the game may crash.
id | an object id |
enchant | an enchantment name Enchant |
duration | in seconds |
void EnchantOff | ( | int | id, |
string | enchant | ||
) |
Remove enchant from an object.
id | an object id |
enchant | an enchant name Enchant |
void EndGame | ( | int | type | ) |
End of game.
type | one of 0=Warrior, 1=Wizard, 2=Conjurer |
string FloatToString | ( | float | number | ) |
Convert a float to a string.
This will convert a float to a string, and add the string to the string table temporarily.
number | a float number |
int FrameTimer | ( | int | frames, |
function | callback | ||
) |
Create a timer with delay in frames.
This will create a timer that calls the given script function after a delay given in frames.
frames | delay |
callback | a script function |
int FrameTimerWithArg | ( | int | frames, |
any | argument, | ||
function | callback | ||
) |
Create a timer with delay in frames with an argument.
This will create a timer that calls the given script function after a delay given in frames. The given argument will be passed into the script function.
frames | delay |
argument | function argument |
callback | a script function |
void Frozen | ( | int | id, |
int | frozen | ||
) |
Set frozen status of an object.
id | an object id |
frozen | either TRUE (1) or FALSE (0) |
int GetAnswer | ( | int | id | ) |
Get answer from conversation.
id | an object id |
int GetCaller | ( | ) |
Get OTHER if valid.
int GetCharacterData | ( | int | idx | ) |
Get character data.
FIXME
Get information about the loaded character.
idx | what to return (0-5) |
int GetDirection | ( | int | id | ) |
int GetElevatorStatus | ( | int | id | ) |
Get elevator status.
id | an object id |
int GetGold | ( | int | id | ) |
Get amount of gold for player object.
id | an object id |
int GetHolder | ( | int | item | ) |
Get the holder of an item.
This will return the object id that contains the item in its inventory.
item | an object id |
int GetHost | ( | ) |
Get host's player object.
This will return the host's player object id. The host is the player with a player id of 31.
int GetLastItem | ( | int | id | ) |
Get object's last inventory item.
This will return the object id of the last item in the object's inventory. If the inventory is empty, it will return 0.
This is used with GetPreviousItem to iterate through an object's inventory.
id | an object id |
float GetObjectX | ( | int | id | ) |
Get object X coordinate.
id | an object id |
float GetObjectY | ( | int | id | ) |
Get object Y coordinate.
id | an object id |
float GetObjectZ | ( | int | id | ) |
Get object Z coordinate.
id | a object id |
int GetPreviousItem | ( | int | id | ) |
Get previous inventory item.
This will return the object id of the previous item in the inventory from the given object id. If the specified object id is not in an inventory, or there are no more items in the inventory, it will return 0;
This is used with GetLastItem to iterate through an object's inventory.
id | an object id |
int GetQuestStatus | ( | string | name | ) |
Get quest status (int).
name | quest name |
float GetQuestStatusFloat | ( | string | name | ) |
Get quest status (int).
name | quest name |
int GetScore | ( | int | id | ) |
Get player object's score.
id | an object id |
int GetTrigger | ( | ) |
Get SELF if valid.
float GetWaypointX | ( | object | waypoint | ) |
Get waypoint X coordinate.
waypoint | a waypoint object |
float GetWaypointY | ( | object | waypoint | ) |
Get waypoint Y coordinate.
waypoint | a waypoint object |
void GiveXp | ( | int | id, |
float | xp | ||
) |
Grant experience to a player.
id | an object id |
xp | experience to gain |
void GoBackHome | ( | int | id | ) |
Cause object to move to its starting location.
id | an object id |
void GroupAggressionLevel | ( | object | objectGroup, |
float | level | ||
) |
Set group of creature's aggression level.
This will set a group of creature's aggression level. The most commonly used value is 0.83.
objectGroup | an object group object |
level | aggression level |
void GroupAttack | ( | object | objectGroup, |
int | target | ||
) |
Attack an object.
objectGroup | an object group object |
target | an object id |
void GroupAwardSpell | ( | object | objectGroup, |
string | spell | ||
) |
Award spell level to objects in a group.
This will raise the spell level of the objects in the group. If an object can not cast this spell then it will have no effect on that object.
objectGroup | an object group object |
spell | a spell name Spell |
void GroupCreateMover | ( | object | objectGroup, |
object | waypoint, | ||
float | speed | ||
) |
Creates a Mover for every object in a group.
objectGroup | an object group object |
waypoint | destination waypoint |
speed | move speed |
void GroupDamage | ( | object | targetGroup, |
int | source, | ||
int | amount, | ||
int | type | ||
) |
Damages objects in a group.
This will damage the target objects with a given source object, amount, and damage type.
targetGroup | an object group object that receives damage |
source | an object id as source of damange |
amount | amount of damage |
type | type of damange DamageType |
void GroupDelete | ( | object | objectGroup | ) |
Delete objects in a group.
objectGroup | an object group object |
void GroupEnchant | ( | int | id, |
string | enchant, | ||
float | duration | ||
) |
Grant objects in a group an enchantment.
This will grant the objects in a group an enchantment of a specified duration. If the enchantment name is incorrect, the game may crash.
id | an object id |
enchant | an enchantment name Enchant |
duration | in seconds |
void GroupHitFarLocation | ( | object | objectGroup, |
float | x, | ||
float | y | ||
) |
Ranged attack a location.
objectGroup | an object group object |
x | x coordinate |
y | y coordinate |
void GroupHitLocation | ( | object | objectGroup, |
float | x, | ||
float | y | ||
) |
Melee attack a location.
objectGroup | an object group object |
x | x coordinate |
y | y coordinate |
int GroupIsOwnedBy | ( | int | id, |
object | target | ||
) |
Get whether any object in target group is owned by object.
id | an object id |
target | an object group object |
int GroupIsOwnedByAny | ( | object | objectGroup, |
object | target | ||
) |
Get whether any object in target is owned by any object in the group.
objectGroup | an object group object |
target | an object group object |
void GroupLookAtDirection | ( | object | objectGroup, |
int | direction | ||
) |
Cause objects in a group to look in a direction.
objectGroup | an object group object |
direction | see Direction |
void GroupMove | ( | object | objectGroup, |
object | waypoint | ||
) |
Move objects in a group to a waypoint.
This moves the objects in a group to a waypoint. The objects must be movable or attached to a "Mover". If the waypoint is linked, the objects will continue to move once they reach the first waypoint.
objectGroup | an object group object |
waypoint | a waypoint object |
void GroupPauseObject | ( | object | objectGroup, |
int | duration | ||
) |
Pause objects of a group temporarily.
objectGroup | an object group object |
duration | number of frames |
void GroupResumeLevel | ( | object | objectGroup, |
float | percent | ||
) |
Set when creature resumes due to health.
This will cause the creatures to stop retreating if its health is above the specified percentage.
objectGroup | an object group object |
percent | health ratio (0.0 - 1.0) |
void GroupRetreatLevel | ( | object | objectGroup, |
float | percent | ||
) |
Set when creature retreats due to low health.
This will cause the creatures to retreat if its health falls below the specified percentage.
objectGroup | an object group object |
percent | low health ratio (0.0 - 1.0) |
void GroupRunAway | ( | object | objectGroup, |
int | target, | ||
int | duration | ||
) |
Cause creatures to run away from target.
objectGroup | an object group object |
target | an object id to run away from |
duration | number of frames |
void GroupSetOwner | ( | int | owner, |
object | targets | ||
) |
Set the owner of objects in a group.
This is the same as SetOwner but with a object group as the target.
owner | an object id |
targets | an object group object |
void GroupSetOwners | ( | object | owners, |
object | targets | ||
) |
Set the objects in a group as owners of target.
This is the same as SetOwners but with a object group as the target.
owners | an object group object |
targets | an object group object |
void GroupSetRoamFlag | ( | object | objectGroup, |
int | flags | ||
) |
Set roaming flags.
objectGroup | an object group object |
flags | a 8-bit value (default is 0x80) |
void GroupWalk | ( | object | objectGroup, |
float | x, | ||
float | y | ||
) |
Causes objects in a group to walk to a location.
objectGroup | an object group object |
x | x coordinate |
y | y coordinate |
void GroupWander | ( | object | objectGroup | ) |
Cause objects in a group to wander.
objectGroup | an object group object |
int HasClass | ( | int | id, |
string | className | ||
) |
Get whether object has a class.
id | an object id |
className | a class name Class |
int HasEnchant | ( | int | id, |
string | enchant | ||
) |
Get whether object has an enchant.
id | an object id |
enchant | an enchant name Enchant |
int HasItem | ( | int | holder, |
int | item | ||
) |
Get whether the item is in the object's inventory.
holder | an object id with inventory to check |
item | an object id of item to check for |
int HasSubclass | ( | int | id, |
string | subclass | ||
) |
Get whether object has subclass.
This will test whether an item has a specific subclass. The subclass overlaps, so you should probably test for the class first (HasClass).
id | an object id |
subclass | a subclass name |
void HitFarLocation | ( | int | id, |
float | x, | ||
float | y | ||
) |
Ranged attack a location.
id | an object id |
x | x coordinate |
y | y coordinate |
void HitLocation | ( | int | id, |
float | x, | ||
float | y | ||
) |
Melee attack a location.
id | an object id |
x | x coordinate |
y | y coordinate |
void ImmediateBlind | ( | ) |
Immediately blind the host.
string IntToString | ( | int | number | ) |
Convert an integer to a string.
This will convert an integer to a string, and add the string to the string table temporarily.
number | a integer number |
int IsAttackedBy | ( | int | id1, |
int | id2 | ||
) |
Get whether object1 is being attacked by object2.
id1 | an object id |
id2 | an object id |
int IsCaller | ( | int | id | ) |
Get whether object is OTHER.
id | an object id |
int IsCrown | ( | int | id | ) |
Get whether object is a Crown.
id | an object id |
int IsGameBall | ( | int | id | ) |
Get whether object is a GameBall.
id | an object id |
int IsLocked | ( | int | id | ) |
Get whether object is locked.
This will return whether an object is locked. It works with any kind of lock.
id | an object id |
int IsObjectOn | ( | int | id | ) |
Get whether object is enabled.
id | an object id |
int IsOwnedBy | ( | int | id, |
int | target | ||
) |
Get whether target is owned by object.
id | an object id |
target | an object id |
int IsOwnedByAny | ( | object | objectGroup, |
int | target | ||
) |
Get whether target is owned by any object in the group.
objectGroup | an object group object |
target | an object id |
int IsSummoned | ( | int | id | ) |
Gets whether object is a summoned creature.
id | an object id |
int IsTalking | ( | ) |
Get whether host is talking.
int IsTrading | ( | ) |
Get whether the host is currently trading.
This will return whether the host is currently talking to shopkeeper.
int IsTrigger | ( | int | id | ) |
Get whether object is SELF.
id | an object id |
int IsVisibleTo | ( | int | object1, |
int | object2 | ||
) |
Gets whether an object can see another object.
This will first check if the location of the objects are within 512 of each other coordinate-wise. It not, it returns FALSE.
It then checks whether the first object can see the second object.
object1 | an object id |
object2 | an object id |
int IsWaypointOn | ( | object | waypoint | ) |
Get whether waypoint is enabled.
waypoint | a waypoint object |
void JournalDelete | ( | int | id, |
string | message | ||
) |
Delete entry from player's journal.
This will delete the first entry from a player object's journal whose message matches the specified message. If the player object id is 0, then all players are affected.
id | an object id of player, or 0 for all players |
message | entry to delete |
void JournalEdit | ( | int | id, |
string | message, | ||
int | type | ||
) |
Edit entry in player's journal.
This will modify the first entry in a player object's journal whose message matches the specified message. If the player object id is 0, then all players are affected.
id | an object id of player, or 0 for all players |
message | entry to edit |
type | see description of JournalEntry |
void JournalEntry | ( | int | id, |
string | message, | ||
int | type | ||
) |
Add entry to player's journal.
This will add an entry to a player object's journal. The string can be any string, but should be less than 64 characters. The string is displayed according to the specified type:
0 = Green text, no sound 1 = White text 2 = Red text with quest label 3 = Green text 4 = Grey text with completed label 8 = Yellow text with hint label
If the player object id is 0, then it will add the journal entry to all players.
id | an object id of player, or 0 for all players |
message | string less than 64 characters |
type | see description |
void LockDoor | ( | int | id | ) |
Lock a door.
This will lock a door. It has no effect if the object is not a door.
id | an object id |
void LookAtDirection | ( | int | id, |
int | direction | ||
) |
Cause object to look in a direction.
id | an object id |
direction | see Direction |
void LookAtObject | ( | int | id, |
int | target | ||
) |
Set direction of object so it is looking at another object.
id | an object id |
target | an object id to look at |
void LookWithAngle | ( | int | id, |
int | angle | ||
) |
Set an object's direction.
This will set an object's direction. The direction is an angle represented as an integer between 0 and 255. Due east is 0, and the angle increases as the object turns clock-wise.
id | an object id |
angle | a number between 0 and 255 |
void MakeEnemy | ( | int | id | ) |
Unset object as friendly.
id | an object id |
void MakeFriendly | ( | int | id | ) |
Set object friendly with host.
id | an object id |
int MaxHealth | ( | int | id | ) |
Get object's maximum health.
id | an object id |
void Move | ( | int | id, |
object | waypoint | ||
) |
Move an object to a waypoint.
This moves an object to a waypoint. The object must be movable or attached to a "Mover". If the waypoint is linked, the object will continue to move once it reaches the first waypoint.
id | an object id |
waypoint | a waypoint object |
void MoveObject | ( | int | id, |
float | x, | ||
float | y | ||
) |
Set an object's location.
id | an object id |
x | x coordinate |
y | y coordinate |
void MoveWaypoint | ( | object | waypoint, |
float | x, | ||
float | y | ||
) |
Set a waypoint's location.
waypoint | a waypoint object |
x | x coordinate |
y | y coordinate |
void Music | ( | int | music, |
int | volume | ||
) |
Plays music.
music | music id |
volume | number from 0 - 100 |
void MusicEvent | ( | ) |
TODO
void MusicPopEvent | ( | ) |
TODO
void MusicPushEvent | ( | ) |
TODO
void NoWallSound | ( | int | noWallSound | ) |
Set no wall sound flag.
noWallSound | either TRUE (1) or FALSE (0) |
int Object | ( | string | name | ) |
Lookup an object by name.
This will lookup an object by its script name and return the object id.
name | object name |
object ObjectGroup | ( | string | name | ) |
Lookup object group by name.
name | a object group name |
void ObjectGroupOff | ( | object | objectGroup | ) |
Disable objects in a group.
objectGroup | an object group object |
void ObjectGroupOn | ( | object | objectGroup | ) |
Enable objects in a group.
objectGroup | an object group object |
void ObjectGroupToggle | ( | object | objectGroup | ) |
Toggle whether objects in group are disabled.
objectGroup | an object group object |
void ObjectOff | ( | int | id | ) |
Disable an object.
id | an object id |
void ObjectOn | ( | int | id | ) |
Enable an object.
id | an object id |
void ObjectToggle | ( | int | id | ) |
Toggle whether object is disabled.
id | an object id |
void PauseObject | ( | int | id, |
int | duration | ||
) |
Pause an object temporarily.
id | an object id |
duration | number of frames |
int Pickup | ( | int | id, |
int | item | ||
) |
Cause object to pickup an item.
id | an object id |
item | an object id to pickup |
void Print | ( | string | message | ) |
Display a localized string.
This will display on a localized string on the screen of OTHER. If the string is not in the string database, it will instead print an error message with "MISSING:".
message | a string |
void PrintToAll | ( | string | message | ) |
Display a localized string to everyone.
This will display on a localized string on everyone's screen. If the string is not in the string database, it will instead print an error message with "MISSING:".
message | a string |
void PushObject | ( | int | id, |
float | magnitude, | ||
float | x, | ||
float | y | ||
) |
Push an object from a vector and magnitude.
This will calculate a unit vector from the object's location to the specified location, and multiply it by the specified magnitude. This vector will be added to the object's location.
id | an object id |
magnitude | force magnitude |
x | force x coordinate |
y | force y coordinate |
void PushObjectTo | ( | int | id, |
float | x, | ||
float | y | ||
) |
Push an object to a location.
id | an object id |
x | x coordinate |
y | y coordinate |
void Raise | ( | int | id, |
float | z | ||
) |
Set an object's Z coordinate.
This will set an object's Z coordinate and then let the object fall down.
id | an object id |
z | z coordinate |
void RaiseZombie | ( | int | id | ) |
Raise a zombie. Also clears stay down state.
id | an object id |
void RaiseZombieGroup | ( | object | objectGroup | ) |
Raise a zombie. Also clears stay down state.
objectGroup | an object group object |
int Random | ( | int | min, |
int | max | ||
) |
Random number (int).
min | minimum value |
max | maximum value |
float RandomFloat | ( | float | min, |
float | max | ||
) |
Random number (float).
min | minimum value |
max | maximum value |
void ResetQuestStatus | ( | string | name | ) |
Delete quest status.
This will delete a quest status. The name can be a wildcard with an asterisk or with a map name.
TODO what is the wildcard syntax?
name | quest name |
void RestoreHealth | ( | int | id, |
int | amount | ||
) |
Restore object's health.
id | an object id |
amount | amount of health to restore |
void ResumeLevel | ( | int | id, |
float | percent | ||
) |
Set when creature resumes due to health.
This will cause the creature to stop retreating if its health is above the specified percentage.
id | an object id |
percent | health ratio (0.0 - 1.0) |
void RetreatLevel | ( | int | id, |
float | percent | ||
) |
Set when creature retreats due to low health.
This will cause the creature to retreat if its health falls below the specified percentage.
id | an object id |
percent | low health ratio (0.0 - 1.0) |
void RunAway | ( | int | id, |
int | target, | ||
int | duration | ||
) |
Cause creature to run away from target.
id | creature's object id |
target | an object id to run away from |
duration | number of frames |
int SecondTimer | ( | int | seconds, |
function | callback | ||
) |
Create a timer with delay in seconds.
This will create a timer that calls the given script function after a delay given in seconds.
seconds | delay |
callback | a script function |
int SecondTimerWithArg | ( | int | seconds, |
any | argument, | ||
function | callback | ||
) |
Create a timer with delay in seconds with an argument.
This will create a timer that calls the given script function after a delay given in seconds. The given argument will be passed into the script function.
seconds | delay |
argument | function argument |
callback | a script function |
void SetCallback | ( | int | id, |
int | idx, | ||
function | callback | ||
) |
Set a callback on an object.
This will set a function script to call for an event. The callback index is one of the following:
3 = Enemy sighted 4 = Looking for enemy 5 = Deatch 6 = Change focus 7 = Is hit 8 = Retreat 9 = Collision 10 = Enemy heard 11 = End of waypoint 13 = Lost sight of enemy
No other indexes are defined.
id | an object id |
idx | callback index |
callback | a script function |
void SetDialog | ( | int | id, |
string | type, | ||
function | start, | ||
function | end | ||
) |
Setup a conversation with object.
This will cause a conversation with the object. The type of conversation is one of: NORMAL, NEXT, YESNO, YESNONEXT. The start and end are script functions that are called at the start and end of the conversation.
If using a YESNO conversation, the end script function should use GetAnswer to retrieve the result.
id | an object id |
type | a conversation type string (NORMAL, NEXT, YESNO, YESNONEXT) |
start | a script function |
end | a script function |
void SetHalberd | ( | int | upgrade | ) |
Upgrade host's oblivion staff.
This will upgrade the oblivion staff. The upgrades are:
0 = OblivionHalberd 1 = OblivionHeart 2 = OblivionWierdling 3 = OblivionOrb
upgrade | see description |
void SetOwner | ( | int | owner, |
int | target | ||
) |
Set the owner of an object.
This will make an object the owner of the target. This will make the target friendly to the owner, and it will accredit the target's kills to the owner.
For example, in a multiplayer map, you might have a switch that activates a hazard. You can use this so that if the hazard kills anyone, the player who activated the hazard gets the credit.
owner | an object id |
target | an object id |
void SetOwners | ( | object | owners, |
int | target | ||
) |
Set the objects in a group as owners of target.
This is the same as SetOwner but with a object group as the owner.
owners | an object group object |
target | an object id |
void SetQuestStatus | ( | int | status, |
string | name | ||
) |
Set quest status (int).
status | value to save |
name | quest name |
void SetQuestStatusFloat | ( | float | status, |
string | name | ||
) |
Set quest status (float).
status | value to save |
name | quest name |
void SetRoamFlag | ( | int | id, |
int | flags | ||
) |
Set roaming flags.
id | an object id |
flags | a 8-bit value (default is 0x80) |
void SetShopkeeperText | ( | int | id, |
string | text | ||
) |
Set shopkeeper text.
id | an object id |
text | a string less than 32 characters |
void StartDialog | ( | int | npc, |
int | other | ||
) |
Starts a conversation between two objects.
This requires that SetDialog has already been used to setup the conversation on the NPC object.
npc | an object id |
other | an object id |
void StartupScreen | ( | int | arg1 | ) |
Show startup screen to host.
arg1 |
void StopScript | ( | any | value | ) |
Exit current script function.
value | the function return value, if it is non-void |
void StoryPic | ( | int | id, |
string | name | ||
) |
Assigns a picture to a conversation.
id | an object id |
name | a picture name |
void TellStory | ( | string | audio, |
string | story | ||
) |
Causes the telling of a story.
This will cause a story to be told. It relies on SELF and OTHER to be particular values, which limits this to being used in the SetDialog callbacks.
Example usage: TellStory("SwordsmanHurt", "Con05:OgreTalk07")
audio | an audio event name that is usually "SwordsmanHurt" |
story | a story name |
void TrapSpells | ( | int | id, |
string | spell1, | ||
string | spell2, | ||
string | spell3 | ||
) |
void UnBlind | ( | ) |
Unblind the host.
int Unknownb8 | ( | int | id | ) |
TODO
id | an object id |
int Unknownb9 | ( | int | id | ) |
TODO
id | an object id |
void Unknownc4 | ( | ) |
TODO
void UnlockDoor | ( | int | id | ) |
Unlock a door.
This will unlock a door. It has no effect if the object is not a door.
id | an object id |
void Walk | ( | int | id, |
float | x, | ||
float | y | ||
) |
Causes an object to walk to a location.
id | an object id |
x | x coordinate |
y | y coordinate |
object Wall | ( | int | x, |
int | y | ||
) |
Get a pointer to a wall by its wall coordinates.
x | wall coordinate X |
y | wall coordinate Y |
void WallBreak | ( | object | wall | ) |
Breaks a wall.
This will break a wall. The wall must be breakable.
wall | a wall object |
void WallClose | ( | object | wall | ) |
Close a wall.
wall | a wall object |
object WallGroup | ( | string | name | ) |
Lookup wall group by name.
name | a wall group name |
void WallGroupBreak | ( | object | wallGroup | ) |
Breaks walls in a group.
This will break walls in a group. The walls must be breakable.
wallGroup | a wall group object |
void WallGroupClose | ( | object | wallGroup | ) |
Close walls in a group.
wallGroup | a wall group object |
void WallGroupOpen | ( | object | wallGroup | ) |
Open walls in a group.
wallGroup | a wall group object |
void WallGroupToggle | ( | object | wallGroup | ) |
Toggle walls in a group.
This will toggle a wall group between opened and closed.
wallGroup | a wall group object |
void WallOpen | ( | object | wall | ) |
Open a wall.
wall | a wall object |
void WallToggle | ( | object | wall | ) |
Toggle a wall.
This will toggle wall between opened and closed.
wall | a wall object |
void Wander | ( | int | id | ) |
Cause an object to wander.
This will cause a NPC or monster to wander.
id | an object id |
object Waypoint | ( | string | name | ) |
Lookup waypoint by name.
name | a waypoint name |
object WaypointGroup | ( | string | name | ) |
Lookup waypoint group by name.
name | a waypoint group name |
void WayPointGroupOff | ( | object | waypointGroup | ) |
Disable waypoints in a group.
waypointGroup | a waypoint group object |
void WayPointGroupOn | ( | object | waypointGroup | ) |
Enable waypoints in a group.
waypointGroup | a waypoint group object |
void WayPointGroupToggle | ( | object | waypointGroup | ) |
Toggle whether objects in group are disabled.
waypointGroup | a waypoint group object |
void WayPointOff | ( | object | waypoint | ) |
Disable a waypoint.
waypoint | a waypoint object |
void WayPointOn | ( | object | waypoint | ) |
Enable a waypoint.
waypoint | a waypoint object |
void WayPointToggle | ( | object | waypoint | ) |
Toggle whether waypoint is disabled.
waypoint | a waypoint object |
void WideScreen | ( | int | value | ) |
value | TRUE or FALSE |
void ZombieGroupStayDown | ( | object | objectGroup | ) |
Set group of zombies to stay down.
objectGroup | an object group object |
void ZombieStayDown | ( | int | id | ) |
Set zombie to stay down.
id | an object id |
const int FALSE = 0 |
FALSE value.
const int OTHER = -1 |
OTHER object id.
This constant can be used any place where an object id is used.
const int SELF = -2 |
SELF object id.
This constant can be used any place where an object id is used.
const int TRUE = 1 |
TRUE value.