# Event-System Event

# Game Event managementEvents

Simply add events that need to be monitored without creating event object, example as below:

--Game Event---
ScriptSupportEvent:registerEvent([=[Game.Start]=], Game_StartGame)
ScriptSupportEvent:registerEvent([=[Game.Run]=], Game_Update)
ScriptSupportEvent:registerEvent([=[Game.End]=], Game_GameOver)
--Player Event---
ScriptSupportEvent:registerEvent([=[Player.Die]=], Player_Dead)
ScriptSupportEvent:registerEvent([=[Player.Revive]=], Player_Revive)
ScriptSupportEvent:registerEvent([=[Player.AddItem]=], BackPack_AddItem)
--Block Event---
ScriptSupportEvent:registerEvent([=[Block.Add]=], Block_Add)
ScriptSupportEvent:registerEvent([=[Block.DestroyBy]=], Block_Destroy)
ScriptSupportEvent:registerEvent([=[Block.Trigger]=], Block_Trigger)

# Game Event Type and Description

No. Event Type Description
1 World Event Relevant events in map
2 Logic Event Game logic related events
3 Player Event Player related events
4 Creature Event Creature related events
5 Block Event Block related events
6 Item Event Item related events
7 Particle Event Particle related events

# World Event (World)

Name Description Params
Weather.Changed Change of weather None
Backpack.ItemTakeOut Container has item output {blockid, x, y, z, itemid, itemnum}1.1+
Backpack.ItemPutIn Container has item input {blockid, x, y, z, itemid, itemnum}1.1+
Backpack.ItemChange Change of backpack bar {blockid, x, y, z, itemid, itemnum}
  • World Event相关示例:

--Write a function, just named when the Change of weather will perform this function
local function Weather_Changed()
	Chat:sendSystemMsg("Incident: Change of weather")
end
--Registered listeners, Change the function of the Executive Weather_Changed when weather
--The first parameter is listening event, the second parameter Weather_Changed function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Weather.Changed]=],Weather_Changed)
--Write a function, just named when the Change of backpack bar will perform this function
local function Backpack_ItemChange(event)
	Chat:sendSystemMsg("Incident: Change of backpack bar")
	Chat:sendSystemMsg("Parameter blockid as:" .. event.blockid)
	Chat:sendSystemMsg("Parameter x is:" .. event.x)
	Chat:sendSystemMsg("Parameter y is:" .. event.y)
	Chat:sendSystemMsg("The parameter z as:" .. event.z)
	Chat:sendSystemMsg("Parameter itemid as:" .. event.itemid)
	Chat:sendSystemMsg("Parameter itemnum as:" .. event.itemnum)
end
--Registered listeners, Change of backpack bar when a function execution Backpack_ItemChange
--The first parameter is listening event, the second parameter Backpack_ItemChange function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Backpack.ItemChange]=],Backpack_ItemChange)

# Logic Event (Game)

Name Description Params
Game.AnyPlayer.Defeat Any player is defeated {eventobjid, toobjid}
Game.AnyPlayer.EnterGame Any player enters game {eventobjid, toobjid}
Game.AnyPlayer.LeaveGame Any player leaves game {eventobjid, toobjid}
Game.AnyPlayer.ReadStage Any player loads game None
Game.AnyPlayer.Victory Any player wins {eventobjid, toobjid}
Game.End Game over None
Game.Hour World time is [n] {hour}
Game.Load Start game None
Game.Run Game is running None
Game.RunTime World time is [n] second {second}
Game.Start Game start None
Game.TimeOver Game timeout None
minitimer.change Any change of Timer {timerid, timername}1.1+
  • Logic Event相关示例:
--Write a function, just named, when Any player is defeated will perform this function
local function Game_AnyPlayer_Defeat(event)
	Chat:sendSystemMsg("Incident: Any player is defeated")
	Chat:sendSystemMsg("Parameter eventobjid as:" .. event.eventobjid)
	Chat:sendSystemMsg("Parameter toobjid as:" .. event.toobjid)
end
--Registered listeners when the function execution Game_AnyPlayer_Defeat Any player is defeated
--The first parameter is listening event, the second parameter Game_AnyPlayer_Defeat function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Game.AnyPlayer.Defeat]=],Game_AnyPlayer_Defeat)
--Write a function, just named, when Any player enters game when this function is executed
local function Game_AnyPlayer_EnterGame(event)
	Chat:sendSystemMsg("Incident: Any player enters game")
	Chat:sendSystemMsg("Parameter eventobjid as:" .. event.eventobjid)
	Chat:sendSystemMsg("Parameter toobjid as:" .. event.toobjid)
end
--Registered listeners, do Game_AnyPlayer_EnterGame function Any player enters game when
--The first parameter is listening event, the second parameter Game_AnyPlayer_EnterGame function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Game.AnyPlayer.EnterGame]=],Game_AnyPlayer_EnterGame)
--Write a function, just named, when Any player leaves game will perform this function
local function Game_AnyPlayer_LeaveGame(event)
	Chat:sendSystemMsg("Incident: Any player leaves game")
	Chat:sendSystemMsg("Parameter eventobjid as:" .. event.eventobjid)
	Chat:sendSystemMsg("Parameter toobjid as:" .. event.toobjid)
end
--Registered listeners, do Game_AnyPlayer_LeaveGame function Any player leaves game time
--The first parameter is listening event, the second parameter Game_AnyPlayer_LeaveGame function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Game.AnyPlayer.LeaveGame]=],Game_AnyPlayer_LeaveGame)
--Write a function, just named, when Any player loads game will perform this function
local function Game_AnyPlayer_ReadStage()
	Chat:sendSystemMsg("Incident: Any player loads game")
end
--Registered listeners, do Game_AnyPlayer_ReadStage function Any player loads game time
--The first parameter is listening event, the second parameter Game_AnyPlayer_ReadStage function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Game.AnyPlayer.ReadStage]=],Game_AnyPlayer_ReadStage)
--Write a function, just named, when Any player wins when this function is executed
local function Game_AnyPlayer_Victory(event)
	Chat:sendSystemMsg("Incident: Any player wins")
	Chat:sendSystemMsg("Parameter eventobjid as:" .. event.eventobjid)
	Chat:sendSystemMsg("Parameter toobjid as:" .. event.toobjid)
end
--Registered listeners when the function execution Game_AnyPlayer_Victory Any player wins
--The first parameter is listening event, the second parameter Game_AnyPlayer_Victory function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Game.AnyPlayer.Victory]=],Game_AnyPlayer_Victory)
--Write a function, just named, when Game over will perform this function
local function Game_End()
	Chat:sendSystemMsg("Incident: Game over")
end
--Registered listeners, do Game_End function when Game over
--The first parameter is listening event, the second parameter Game_End function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Game.End]=],Game_End)
--Write a function, just named, when the World time is when will perform this function [n]
local function Game_Hour(event)
	Chat:sendSystemMsg("Incident: World time is [n]")
	Chat:sendSystemMsg("Parameter hour as:" .. event.hour)
end
--Registered listeners, World time is executed Game_Hour function when [n]
--The first parameter is listening event, the second parameter Game_Hour function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Game.Hour]=],Game_Hour)
--Write a function, just named, when Start game will perform this function
local function Game_Load()
	Chat:sendSystemMsg("Incident: Start game")
end
--Registered listeners, do Game_Load function when Start game
--The first parameter is listening event, the second parameter Game_Load function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Game.Load]=],Game_Load)
--Write a function, just named, when the Game is running will perform this function
--This event will be triggered once every 50ms, the internal function call interface should not be sending messages, or chat box will be scraper
local function Game_Run()
	--Chat:sendSystemMsg("Incident: Game is running")
	--Every 50ms to homeowner output increased 1 until the blood is not less than 100
	local result,hp=Player:getAttr(0,2) - Get current health Homeowners
	if hp<100 then-- if the blood is less than 100
		Player:setAttr(0,2, hp + 1) - adding to the blood a homeowner
	end
end
--Registered listeners, do Game_Run function when Game is running
--The first parameter is listening event, the second parameter Game_Run function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Game.Run]=],Game_Run)
--Write a function, just named, when the World time is [n] will perform this function when the second
--This event will be triggered once per second, so the internal function call interface should not be sending messages, or chat box will be scraper
local function Game_RunTime(event)
	--Chat:sendSystemMsg("Incident: World time is [n] second")
	--Chat:sendSystemMsg("Second parameter as:" .. event.second)
	--Per second to homeowners hungry increased by one, until the value of not less than 100 hunger
	local result,hunger=Player:getAttr(0,6) - Get the current value of a homeowner hunger
	if hunger<100 then-- If the value is less than 100 hunger
		Player:setAttr(0,6, hunger + 1) - a plus value to a homeowner hunger
	end
end
--Registered listeners, World time is [n] function when the second execution Game_RunTime
--The first parameter is listening event, the second parameter Game_RunTime function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Game.RunTime]=],Game_RunTime)
--Write a function, just named, when Game start will perform this function
local function Game_Start()
	Chat:sendSystemMsg("Incident: Game start")
end
--Registered listeners, do Game_Start function when Game start
--The first parameter is listening event, the second parameter Game_Start function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Game.Start]=],Game_Start)
--Write a function, just named, when Game timeout will perform this function
local function Game_TimeOver()
	Chat:sendSystemMsg("Incident: Game timeout")
end
--Registered listeners when Game timeout function execution Game_TimeOver
--The first parameter is listening event, the second parameter Game_TimeOver function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Game.TimeOver]=],Game_TimeOver)
--Write a function, just named, when Any change will do this time of Timer function
local function minitimer_change(event)
	Chat:sendSystemMsg("Incident: Any change of Timer")
	Chat:sendSystemMsg("Parameter timerid as:" .. event.timerid)
	Chat:sendSystemMsg("Parameter timername as:" .. event.timername)
end
--Registered listeners, Any change execution minitimer_change time of Timer function
--The first parameter is listening event, the second parameter minitimer_change function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[minitimer.change]=],minitimer_change)

# Player Event (Player)

Name Description Params
Player.AddBuff When players get status effect {eventobjid, buffid, bufflvl}
Player.AddItem Add new item {eventobjid, toobjid, itemid, itemnum}
Player.AreaIn Player enters area {eventobjid, areaid}
Player.AreaOut Player leaves area {eventobjid, areaid}
Player.Attack Player attacking {eventobjid, toobjid}
Player.AttackHit Player attack hits {eventobjid, toobjid}
Player.BackPackChange Change of backpack bar {eventobjid, toobjid, itemid, itemnum}
Player.BeHurt Player take damage {eventobjid, toobjid, hurtlv}
Player.ChangeAttr Change of attribute {eventobjid, playerattr}
Player.ClickActor Click on creation {eventobjid, toobjid}
Player.ClickBlock Click on block {eventobjid, blockid, x, y, z}
Player.Collide Collide with other player {eventobjid, toobjid}
Player.ConsumeItem Consume item {eventobjid, toobjid, itemid, itemnum}
Player.DamageActor Deals damage to other player {eventobjid, toobjid, hurtlv}
Player.DefeatActor Defeat object {eventobjid, toobjid}
Player.Die Player die {eventobjid, toobjid}
Player.DiscardItem Discard item {eventobjid, toobjid, itemid, itemnum}1.1+
Player.DismountActor Cancel riding mount {eventobjid, toobjid}
Player.EquipChange Change of armor bar {eventobjid, toobjid, itemid, itemnum}
Player.EquipOff Unequip armor {eventobjid, toobjid, itemid, itemnum}1.1+
Player.EquipOn Equip armor {eventobjid, toobjid, itemid, itemnum}1.1+
Player.Init Player is restored {eventobjid, toobjid}
Player.InputContent Events triggered by changes in chat box {eventobjid, content}1.1+
Player.InputKeyDown Button pressed {eventobjid, vkey}1.5+
Player.InputKeyOnPress Button being pressed {eventobjid, vkey}1.5+
Player.InputKeyUp Button released {eventobjid, vkey}1.5+
Player.JoinTeam Join team {eventobjid, toobjid}
Player.LevelModelUpgrade When player’s level changes {eventobjid, toobjid}
Player.MotionStateChange Change motion state {eventobjid, playermotion}
Player.MountActor Ride mount/vehicles {eventobjid, toobjid}
Player.MoveOneBlockSize Move one block {eventobjid, toobjid}
Player.NewInputContent Enter text string {eventobjid, content}1.4+
Player.PickUpItem Pick up drop item {eventobjid, toobjid, itemid, itemnum}
Player.PlayAction Change of expression {eventobjid, act}
Player.RemoveBuff When players lose status effect {eventobjid, buffid, bufflvl}
Player.Revive Player respawn {eventobjid, toobjid}
Player.SelectShortcut Make selection on shortcut bar {eventobjid, toobjid, itemid, itemnum}
Player.ShortcutChange Change of shortcut bar {eventobjid, toobjid, itemid, itemnum}
Player.UseItem Use item {eventobjid, toobjid, itemid, itemnum}
  • Player Event相关示例:
--Write a function, just named when the Add new item will perform this function
local function Player_AddItem(event)
	Chat:sendSystemMsg("Incident: Add new item")
	Chat:sendSystemMsg("Parameter eventobjid as:" .. event.eventobjid)
	Chat:sendSystemMsg("Parameter toobjid as:" .. event.toobjid)
	Chat:sendSystemMsg("Parameter itemid as:" .. event.itemid)
	Chat:sendSystemMsg("Parameter itemnum as:" .. event.itemnum)
end
--Registered listeners when the function execution Player_AddItem Add new item
--The first parameter is listening event, the second parameter Player_AddItem function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Player.AddItem]=],Player_AddItem)
--Write a function, just named when the Player enters area will perform this function
local function Player_AreaIn(event)
	Chat:sendSystemMsg("Incident: Player enters area")
	Chat:sendSystemMsg("Parameter eventobjid as:" .. event.eventobjid)
	Chat:sendSystemMsg("Parameter areaid as:" .. event.areaid)
end
--Registered listeners, do Player_AreaIn function when Player enters area
--The first parameter is listening event, the second parameter Player_AreaIn function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Player.AreaIn]=],Player_AreaIn)
--Write a function, just named when the Player leaves area will perform this function
local function Player_AreaOut(event)
	Chat:sendSystemMsg("Incident: Player leaves area")
	Chat:sendSystemMsg("Parameter eventobjid as:" .. event.eventobjid)
	Chat:sendSystemMsg("Parameter areaid as:" .. event.areaid)
end
--Registered listeners, do Player_AreaOut function when Player leaves area
--The first parameter is listening event, the second parameter Player_AreaOut function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Player.AreaOut]=],Player_AreaOut)

# Creature Event (Actor)

Name Description Params
Actor.AddBuff the status effect on the creature {eventobjid, buffid, bufflvl}
Actor.AreaIn Creature enters area {eventobjid, areaid}
Actor.AreaOut Creature leaves area {eventobjid, areaid}
Actor.Attack Creature attacking {eventobjid, toobjid}
Actor.AttackHit Creature attack hits {eventobjid, toobjid}
Actor.BeGreetedBy And the players greeted {eventobjid, toobjid, act}
Actor.BeHurt Creature take damage {eventobjid, toobjid, hurtlv}
Actor.Beat Creature defeat other player/creature {eventobjid, toobjid}
Actor.ChangeAttr Change of attribute {eventobjid, actorattr}
Actor.ChangeMotion Creature change motion state {eventobjid, actormotion}
Actor.Collide Collide with other player or creature {eventobjid, toobjid}
Actor.Create Creature is created {eventobjid, toobjid}
Actor.Damage Deals damage to others {eventobjid, toobjid, hurtlv}
Actor.Die Creature die {eventobjid, toobjid}
Actor.InteractEvent Interact with the players {eventobjid, toobjid, itemid, itemnum}
Actor.NewBeHurt Creature take damage (different parameters) {eventobjid, toobjid, x, y, z}
Actor.Projectile.Hit Smashed by projectile {eventobjid, toobjid(opt), blockid(opt), x, y, z}
Actor.RemoveBuff when creature lose status effect {eventobjid, buffid, bufflvl}
Actor.ReqHelp Send a distress message {eventobjid, helperobjid, toobjid, x, y, z}
Actor.VillageBindPosChange Village Totem binding point change {eventobjid, toobjid}
Actor.VillagerFlagChange Villages Work binding point change {eventobjid, toobjid}
  • Creature Event相关示例:
--Write a function, just named, when the Creature enters area will perform this function
local function Actor_AreaIn(event)
	Chat:sendSystemMsg("Incident: Creature enters area")
	Chat:sendSystemMsg("Parameter eventobjid as:" .. event.eventobjid)
	Chat:sendSystemMsg("Parameter areaid as:" .. event.areaid)
end
--Registered listeners, do Actor_AreaIn function when Creature enters area
--The first parameter is listening event, the second parameter Actor_AreaIn function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Actor.AreaIn]=],Actor_AreaIn)
---Actor.AreaOut---49
--Write a function, just named, when the Creature leaves area will perform this function
local function Actor_AreaOut(event)
	Chat:sendSystemMsg("Incident: Creature leaves area")
	Chat:sendSystemMsg("Parameter eventobjid as:" .. event.eventobjid)
	Chat:sendSystemMsg("Parameter areaid as:" .. event.areaid)
end
--Registered listeners, do Actor_AreaOut function when Creature leaves area
--The first parameter is listening event, the second parameter Actor_AreaOut function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Actor.AreaOut]=],Actor_AreaOut)
---Actor.Attack---50
--Write a function, just named, when the Creature attacking will perform this function
local function Actor_Attack(event)
	Chat:sendSystemMsg("Incident: Creature attacking")
	Chat:sendSystemMsg("Parameter eventobjid as:" .. event.eventobjid)
	Chat:sendSystemMsg("Parameter toobjid as:" .. event.toobjid)
end
--Registered listeners, execute function when Creature attacking Actor_Attack
--The first parameter is listening event, the second parameter Actor_Attack function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Actor.Attack]=],Actor_Attack)
---Actor.AttackHit---51
--Write a function, just named, when the Creature attack hits will perform this function
local function Actor_AttackHit(event)
	Chat:sendSystemMsg("Incident: Creature attack hits")
	Chat:sendSystemMsg("Parameter eventobjid as:" .. event.eventobjid)
	Chat:sendSystemMsg("Parameter toobjid as:" .. event.toobjid)
end
--Registered listeners, Creature attack hits execution function when Actor_AttackHit
--The first parameter is listening event, the second parameter Actor_AttackHit function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Actor.AttackHit]=],Actor_AttackHit)

# Block Event (Block)

Name Description Params
Block.Add Block is created {blockid, x, y, z}
Block.DestroyBy Block is destoryed {eventobjid(opt), blockid, x, y, z}
Block.Dig.Begin Start mining block {eventobjid, blockid, x, y, z}
Block.Dig.Cancel Cancel mining block {eventobjid, blockid, x, y, z}
Block.Dig.End Complete mining block {eventobjid, blockid, x, y, z}
Block.Fertilize Block being fertilized {eventobjid, blockid, x, y, z}
Block.PlaceBy Block being placed {eventobjid, blockid, x, y, z}
Block.Remove Block being removed {blockid, x, y, z}
Block.Trigger Block being triggered {eventobjid, blockid, x, y, z}
  • Block Event相关示例:
--Write a function, just named, when Block is created will perform this function
local function Block_Add(event)
	Chat:sendSystemMsg("Incident: Block is created")
	Chat:sendSystemMsg("Parameter blockid as:" .. event.blockid)
	Chat:sendSystemMsg("Parameter x is:" .. event.x)
	Chat:sendSystemMsg("Parameter y is:" .. event.y)
	Chat:sendSystemMsg("The parameter z as:" .. event.z)
end
--Registered listeners, do Block_Add function when Block is created
--The first parameter is listening event, function that executes when the second argument Block_Add That incident
ScriptSupportEvent:registerEvent([=[Block.Add]=],Block_Add)
--Write a function, just named, when Block is destoryed will perform this function
local function Block_DestroyBy(event)
	Chat:sendSystemMsg("Incident: Block is destroyed")
	Chat:sendSystemMsg("Parameter eventobjid (opt) as:" .. event.eventobjid (opt))
	Chat:sendSystemMsg("Parameter blockid as:" .. event.blockid)
	Chat:sendSystemMsg("Parameter x is:" .. event.x)
	Chat:sendSystemMsg("Parameter y is:" .. event.y)
	Chat:sendSystemMsg("The parameter z as:" .. event.z)
end
--Registered listeners, do Block_DestroyBy function when Block is destoryed
--The first parameter is listening event, the second parameter Block_DestroyBy function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Block.DestroyBy]=],Block_DestroyBy)
--Write a function, just named when the Start mining block will perform this function
local function Block_Dig_Begin(event)
	Chat:sendSystemMsg("Incident: Start mining block")
	Chat:sendSystemMsg("Parameter eventobjid as:" .. event.eventobjid)
	Chat:sendSystemMsg("Parameter blockid as:" .. event.blockid)
	Chat:sendSystemMsg("Parameter x is:" .. event.x)
	Chat:sendSystemMsg("Parameter y is:" .. event.y)
	Chat:sendSystemMsg("The parameter z as:" .. event.z)
end
--Registered listeners, do Block_Dig_Begin function when Start mining block
--The first parameter is listening event, the second parameter Block_Dig_Begin function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Block.Dig.Begin]=],Block_Dig_Begin)

# Item Event (Item)

Name Description Params
DropItem.AreaIn Drop item enters area {eventobjid, areaid, itemid(opt), itemnum(opt)}
DropItem.AreaOut Drop item leaves area {eventobjid, areaid, itemid(opt), itemnum(opt)}
Item.Disappear Item disappear {eventobjid, toobjid, itemid, itemnum}
Item.Pickup Item is picked up {eventobjid, toobjid, itemid, itemnum}
Missile.AreaIn Projectile enters area {eventobjid, areaid, itemid(opt), itemnum(opt)}
Missile.AreaOut Projectile leaves area {eventobjid, areaid, itemid(opt), itemnum(opt)}
Missile.Create Projectile is created {eventobjid, toobjid, itemid, x, y, z}1.2+
  • Item Event相关示例:
--Write a function, just named, when Drop item enters area will perform this function
local function DropItem_AreaIn(event)
	Chat:sendSystemMsg("Incident: Drop item enters area")
	Chat:sendSystemMsg("Parameter eventobjid as:" .. event.eventobjid)
	Chat:sendSystemMsg("Parameter areaid as:" .. event.areaid)
	Chat:sendSystemMsg("Parameter itemid (opt) as:" .. event.itemid (opt))
	Chat:sendSystemMsg("Parameter itemnum (opt) as:" .. event.itemnum (opt))
end
--Registered listeners, do DropItem_AreaIn function when Drop item enters area
--The first parameter is listening event, the second parameter DropItem_AreaIn function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[DropItem.AreaIn]=],DropItem_AreaIn)
--Write a function, just named, when Drop item leaves area will perform this function
local function DropItem_AreaOut(event)
	Chat:sendSystemMsg("Event: Drop item leaves area")
	Chat:sendSystemMsg("Parameter eventobjid as:" .. event.eventobjid)
	Chat:sendSystemMsg("Parameter areaid as:" .. event.areaid)
	Chat:sendSystemMsg("Parameter itemid (opt) as:" .. event.itemid (opt))
	Chat:sendSystemMsg("Parameter itemnum (opt) as:" .. event.itemnum (opt))
end
--Registered listeners, do DropItem_AreaOut function when Drop item leaves area
--The first parameter is listening event, the second parameter DropItem_AreaOut function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[DropItem.AreaOut]=],DropItem_AreaOut)
--Write a function, just named when the Item disappear will perform this function
local function Item_Disappear(event)
	Chat:sendSystemMsg("Incident: Item disappear")
	Chat:sendSystemMsg("Parameter eventobjid as:" .. event.eventobjid)
	Chat:sendSystemMsg("Parameter toobjid as:" .. event.toobjid)
	Chat:sendSystemMsg("Parameter itemid as:" .. event.itemid)
	Chat:sendSystemMsg("Parameter itemnum as:" .. event.itemnum)
end
--Registered listeners, Item disappear when the function execution Item_Disappear
--The first parameter is listening event, the second parameter Item_Disappear function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Item.Disappear]=],Item_Disappear)

# Particle Event (Particle)

Name Description Params
Particle.Mob.OnCreate Special effects have been created on any creatures {eventobjid, effectid}1.2+
Particle.Player.OnCreate Special effects have been created on any players {eventobjid, effectid}1.2+
Particle.Pos.OnCreate Special effects have been created on any location {x, y, z, effectid}1.2+
Particle.Projectile.OnCreate Special effects have been created for any projectile {eventobjid, effectid}1.2+
  • Particle Event相关示例:
--Write a function, just named when Special effects have been created will perform this function when on any creatures
local function Particle_Mob_OnCreate(event)
	Chat:sendSystemMsg("发生事件:Special effects have been created on any creatures")
	Chat:sendSystemMsg("Parameter eventobjid as:" .. event.eventobjid)
	Chat:sendSystemMsg("Parameter effectid as:" .. event.effectid)
end
--Registered listeners, Special effects have been created on the implementation of Particle_Mob_OnCreate function when any creatures
--The first parameter is listening event, the second parameter Particle_Mob_OnCreate function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Particle.Mob.OnCreate]=],Particle_Mob_OnCreate)
--Write a function, just named when Special effects have been created will perform this function when on any players
local function Particle_Player_OnCreate(event)
	Chat:sendSystemMsg("发生事件:Special effects have been created on any players")
	Chat:sendSystemMsg("Parameter eventobjid as:" .. event.eventobjid)
	Chat:sendSystemMsg("Parameter effectid as:" .. event.effectid)
end
--Registered listeners, Special effects have been created on any players when executed Particle_Player_OnCreate function
--The first parameter is listening event, the second parameter Particle_Player_OnCreate function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Particle.Player.OnCreate]=],Particle_Player_OnCreate)
--Write a function, just named when Special effects have been created on any location can perform this function
local function Particle_Pos_OnCreate(event)
	Chat:sendSystemMsg("发生事件:Special effects have been created on any location")
	Chat:sendSystemMsg("Parameter x is:" .. event.x)
	Chat:sendSystemMsg("Parameter y is:" .. event.y)
	Chat:sendSystemMsg("The parameter z as:" .. event.z)
	Chat:sendSystemMsg("Parameter effectid as:" .. event.effectid)
end
--Registered listeners, Special effects have been created on any location when perform functions Particle_Pos_OnCreate
--The first parameter is listening event, the second parameter Particle_Pos_OnCreate function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Particle.Pos.OnCreate]=],Particle_Pos_OnCreate)
--Write a function, just named when Special effects have been created for any projectile when this function is executed
local function Particle_Projectile_OnCreate(event)
	Chat:sendSystemMsg("发生事件:Special effects have been created for any projectile")
	Chat:sendSystemMsg("Parameter eventobjid as:" .. event.eventobjid)
	Chat:sendSystemMsg("Parameter effectid as:" .. event.effectid)
end
--Registered listeners, when executed Particle_Projectile_OnCreate function Special effects have been created for any projectile
--The first parameter is listening event, the second parameter Particle_Projectile_OnCreate function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Particle.Projectile.OnCreate]=],Particle_Projectile_OnCreate)
Last Update: 9/7/2020, 10:19:13 PM