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/06 11:17] – [ItemDetails] 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 40: Line 49:
 ===== Menus & UI Events ===== ===== Menus & UI Events =====
 ==== OSDSelect ==== ==== OSDSelect ====
 +^ Triggered by | Player clicking a scripted OSD item |
 +^ Event Parameter | OSDName:OSDButtonName |
 +^ CancelTransaction | N/A |
 +^ Notes | For details on created scripted UI, see the [[scripting:scriptedosd|Scripted OSD Overview]] |
 +\\
 ==== MenuOption ==== ==== MenuOption ====
 ^ Triggered by | A player selecting a customisable menu or button in the main game UI | ^ Triggered by | A player selecting a customisable menu or button in the main game UI |
Line 77: Line 91:
 </code> </code>
 ===== Inventory & Skill Events ===== ===== Inventory & Skill Events =====
-''UseItem \\ +==== UseItem ==== 
-ItemAdded \\ +^ Triggered by | An item being used by the player | 
-ItemRemoved \\ +^ Event Parameter | Item Name | 
-TaskComplete \\ +^ CancelTransaction | Cancels the normal 'Usebehaviour (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. | 
-TaskStart \\ +^ 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) | 
-UseSkill \\ +//Example// 
-SkillAdded \\ +<code>Event( "UseItem", "Axe" ) 
-SkillRemoved \\ +
-BarterRequest \\ +    *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 ==== 
 +^ Triggered by | A new item being added to the player's inventory | 
 +^ Event Parameter | Item Name | 
 +^ CancelTransaction | N/A | 
 +^ Notes | | 
 +//Example// 
 +<code>Event( "ItemAdded", "Bronze Sword" ) 
 +
 +    // Level up when the player first gets a bronze sword 
 +    if ( $gPlayerLevel < 1 ) 
 +    { 
 +        *setlevel %PLAYER% 1 
 +        *notifylarge %PLAYER% Level up! 
 +    } 
 +
 +</code> 
 +==== ItemRemoved ==== 
 +==== UseSkill ==== 
 +==== SkillAdded ==== 
 +==== SkillRemoved ==== 
 +==== BarterRequest ==== 
 + 
 +===== Weapon Events ===== 
 +==== FireWeapon ==== 
 +==== WeaponHitGround ==== 
 +==== WeaponHitPlayer ==== 
 + 
 +===== Task System Events ===== 
 +==== 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 ==== 
 +==== CombiTaskStart ==== 
 +==== BuildingTaskComplete ====  
 +==== CustomTaskComplete ==== 
 +==== CombiTaskComplete ==== 
 +==== TaskComplete ==== 
 +^ Triggered by | A player task completing | 
 +^ Event Parameter | Task Type | 
 +^ | 0 = Combination task (Triggered through the 'Combination Iteminterface 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 ====
  
 ===== 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.1402053462.txt.gz · Last modified: (external edit)