User Tools

Site Tools


scripting:reference:events_reference

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
scripting:reference:events_reference [2014/06/23 12:40] mitscripting:reference:events_reference [2025/05/28 16:35] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ===== Events Reference ===== ===== Events Reference =====
- +Here is a list of all the events currently supported by the world server.
-Here is a list of all the events currently supported by the world server+
  
 ===== Player Status Events ===== ===== Player Status Events =====
Line 26: Line 25:
 </code> </code>
 ==== PlayerLoginComplete ====  ==== PlayerLoginComplete ==== 
 +^ Triggered by | A player completing the log-in process to the world |
 +^ Event Parameter | None |
 +^ CancelTransaction | N/A |
 +^ Notes | See above - This event (if present) is triggered after the 'PlayerLogin' event, when the user has completed all the main stages of hte login process
 +//Example//
 +<code>Event( "PlayerLoginComplete", "" )
 +{
 +    *say %PLAYER% has finished entering our world!
 +}
 +</code>
 ==== PlayerLogout ====  ==== PlayerLogout ==== 
 ==== PlayerBirthday ====  ==== PlayerBirthday ==== 
Line 83: Line 92:
 ===== Inventory & Skill Events ===== ===== Inventory & Skill Events =====
 ==== UseItem ==== ==== UseItem ====
 +^ Triggered by | An item being used by the player |
 +^ Event Parameter | Item Name |
 +^ CancelTransaction | Cancels the normal 'Use' behaviour (the normal behaviour usually involves removing the item from the inventory). e.g. If a food item, the world server would normally remove the item from the player's inventory and update their hunger. |
 +^ Notes | Not all items will always have a 'Use' option. You can control which ones do or don't by changing their behaviour using *setitemuse or by setting the *settings -> World Rules -> Inventory Mode. (Inventory Mode 2 makes all items usable irrespective of their behaviour type) |
 +//Example//
 +<code>Event( "UseItem", "Axe" )
 +{
 +    *msg %PLAYER% You used the axe to chop down the nearest tree
 +    *grantitem %PLAYER% 1 Wood
 +    CancelTransaction()    // Calling this means the player keeps the Axe
 +}
 +</code>
 ==== ItemAdded ==== ==== ItemAdded ====
-^ Triggered by | new item being added to the player's inventory |+^ Triggered by | new item being added to the player's inventory |
 ^ Event Parameter | Item Name | ^ Event Parameter | Item Name |
 ^ CancelTransaction | N/A | ^ CancelTransaction | N/A |
Line 104: Line 125:
 ==== SkillRemoved ==== ==== SkillRemoved ====
 ==== BarterRequest ==== ==== BarterRequest ====
 +
 +===== Weapon Events =====
 +==== FireWeapon ====
 +==== WeaponHitGround ====
 +==== WeaponHitPlayer ====
  
 ===== Task System Events ===== ===== Task System Events =====
 ==== BuildingTaskStart ==== ==== BuildingTaskStart ====
 +^ Triggered by | A player building task starting (See *dobuildingtask) |
 +^ Event Parameter | Building Type |
 +^ CancelTransaction | N/A |
 +^ Notes | $gTaskItem1 = 2.  $gTaskItem2 = Building record num.    |
 +//Example//
 +<code>Event( "BuildingTaskStart", "10" )
 +{
 +    *msg %PLAYER% You triggered a building task from a building of type 10
 +}
 +</code>
 ==== CustomTaskStart ==== ==== CustomTaskStart ====
 ==== CombiTaskStart ==== ==== CombiTaskStart ====
Line 113: Line 149:
 ==== CombiTaskComplete ==== ==== CombiTaskComplete ====
 ==== TaskComplete ==== ==== TaskComplete ====
 +^ Triggered by | A player task completing |
 +^ Event Parameter | Task Type |
 +^ | 0 = Combination task (Triggered through the 'Combination Item' interface or via *docombitask command) |
 +^ | 1 = Custom task (Triggered through the *dotask command) |
 +^ | 2 = Building task (Triggered through the *dobuildingtask command) |
 +^ CancelTransaction | N/A |
 +^ Notes | TBD - $gTaskItem1 etc |
 +//Example//
 +<code>Event( "TaskComplete", "1" )
 +{
 +    if ( $gTaskItem1 == 100 )
 +    {
 +        *msg %PLAYER% You completed task 100 
 +    }
 +}
 +</code>
 ==== TaskStart ==== ==== TaskStart ====
  
 ===== Building Events ===== ===== Building Events =====
-''NewBuilding \\ +==== NewBuilding ====  
-PreAccessBuilding \\ +==== PreAccessBuilding ====  
-AccessBuilding \\ +==== AccessBuilding ====  
-AccessConstruction \\ +==== AccessConstruction ====  
-BuildingPurchase \\ +==== BuildingPurchase ====  
-BuildingDestroyed \\ +==== BuildingDestroyed ====  
-BuildingTriggered \\ +==== BuildingTriggered ====  
-BuildingTriggerSequenceComplete \\ +==== BuildingTriggerSequenceComplete ====  
-BuildingProductionRun \\ +==== BuildingProductionRun ====  
-BuildingDemolished \\ +==== BuildingDemolished ====  
-BuildingOwnerDied \\ +==== BuildingOwnerDied ====  
-PlaceBuilding \\ +==== PlaceBuilding ====  
-PlaceAnyBuilding \\ +==== PlaceAnyBuilding ====  
-BuildingCapture \\ +==== BuildingCapture ====  
-BuildingIDProxEnter \\ +==== BuildingIDProxEnter ====  
-BuildingIDProxLeave \\ +==== BuildingIDProxLeave ====  
-BuildingProxEnter \\ +==== BuildingProxEnter ====  
-BuildingProxLeave \\ +==== BuildingProxLeave ====  
-''+==== PickupBuilding ==== 
 +==== BuildingDamaged ==== 
 + 
 +===== Special Server Events ===== 
 +==== Custom ==== 
 +==== ProductionRunStart ==== 
 +==== ProductionRunEnd ==== 
 +==== EndSequence ==== 
 +==== &command ==== 
 +==== Timer ==== 
 +==== ScriptReload ==== 
 +==== RangeLeave ==== 
 +==== SeaDepth ==== 
 +==== KillWildlife ==== 
 +==== WorldUpdate ==== 
 + 
 +===== Entity Events ===== 
 +==== EntityDestroyed ==== 
 +==== EntityDamaged ==== 
 +==== EntityUpdate ====
  
 ===== Town Events ===== ===== Town Events =====
-''TownButton \\ +==== TownButton ==== 
-TownDeclareWar \\ +==== TownDeclareWar ==== 
-TownEndWar \\ +==== TownEndWar ====
-''+
  
 ===== Battle Events ===== ===== Battle Events =====
-''InitChallenge \\ +==== InitChallenge ==== 
-AcceptChallenge \\ +==== AcceptChallenge ==== 
-BattleStart \\ +==== BattleStart ==== 
-BattleUpdate \\ +==== BattleUpdate ==== 
-BattleEnd \\ +==== BattleEnd ==== 
-BattleSurrender \\ +==== BattleSurrender ==== 
-BattleLeave \\ +==== BattleLeave ==== 
-BattleJoin \\ +==== BattleJoin ==== 
-BattleAcceptSurrender \\ +==== BattleAcceptSurrender ==== 
-BattleComplete \\ +==== BattleComplete ====
-''+
  
-===== Special Server Events ===== 
-''Custom \\ 
-EndSequence \\ 
-&command \\ 
-Timer \\ 
-ScriptReload \\ 
-RangeLeave \\ 
-SeaDepth \\ 
-'' 
  
scripting/reference/events_reference.1403527223.txt.gz · Last modified: (external edit)