RPGWO Guide
Complete documentation for RPGWO commands and features
Part 6: Event Scripting
Event Scripts - Use
/eventcompile to compile your script. Scripts need to be located in your server folder. A good understanding of VB or programming helps when making these scripts.
Script Commands
;;; Implemented commands...
Hidden ; does not show up in /event command
Log TRUE | FALSE ; each line is logged as it is executed
Begin ; starting point of execution
End ; stop script
Goto <label>
Sub <label> ; start of a subroutine
Gosub <label>
Return ; returns from a sub
EndSub ; same as Return but more explicit
:<text> ; label
EventStart <filename>
Dim <variable>
Let <variable> = <number> | <expression> | <built-in-function>
GetFreeTag() ; returns an unused tag
GetChatUUID() ; returns the player uuid that met the last IfPlayerChat criteria
RND() ; returns a random number from min to max
MaxRnd <number> ; sets the max for RND()
MinRnd <number> ; sets the min for RND()
Title <text> ; shows up when player types /event
Global <text> ; sent out to all players
LocalChat <xpos>, <ypos>, <zpos>, <range>, <message>
SendMessage <uuid>, <message>
MailSend <playername>, <message>
Wait <20 second intervals>
MonsterAdd <name>, <xpos>, <ypos>, <zpos>, <qty>, <tag>
MonsterGoto <tag>, <xpos>, <ypos>
MonsterRemove <tag>
MonsterChat <tag>, <message>
MonsterIgnoreAll <tag>, TRUE | FALSE
MonsterAttackable <tag>, TRUE | FALSE
ItemAdd <name>, <xpos>, <ypos>, <zpos>, <qty>, <tag>
ItemRemove <tag>
ItemData <tag>, <data1-8>
ItemLock <tag>, TRUE | FALSE
ItemGive <itemtag>, <playeruuid>
WarpPlayer <UUID>, <Xpos>, <ypos>, <zpos>
Animation <xpos>, <ypos>, <zpos>, <animation>
IfEquals <num1>, <num2>, <label>
IfGreater <num1>, <num2>, <label>
IfLess <num1>, <num2>, <label>
IfMonsterAt <tag>, <xpos>, <ypos>, <range>, <label>
IfNotMonsterExist <tag>, <label>
IfPlayerNear <xpos>, <ypos>, <zpos>, <range>, <label>
IfPlayerChat <tag>, <chat phrase>, <label>
GiveXp <uuid>, <xp>
Distance <X1>, <Y1>, <X2>, <Y2>, <varDist>
Push <expression>
Pop <variable>
Example Script: Bandit Raid on Haven
;; bandit rob haven
;; send in a scout to locate the bank
;; if scout comes back, send in small force
;; if scout dies send in larger force
BEGIN
Dim StartX
Dim StartY
Dim ShopX
Dim ShopY
Dim BanditTag
Dim ScoutTag
Dim BaronTag
Let StartX = 1455
Let StartY = 1645
Let ShopX = 1465
Let ShopY = 1680
Let BanditTag = GetFreeTag()
Let ScoutTag = GetFreeTag()
Let BaronTag = GetFreeTag()
Title Bandits Raid Haven
Global The town of Haven is a peaceful, safe place... also the perfect place for bandits to raid!!!
MonsterAdd Bandit Scout, startx, starty, 0, 1, ScoutTag
MonsterGoto ScoutTag, ShopX, ShopY-5
MonsterIgnoreAll ScoutTag, True
:WaitForScout1
Wait 1
IfMonsterAt ScoutTag, ShopX, ShopY-5, 2, ScoutAtBank
IfNotMonsterExist ScoutTag, ScoutKilled
Goto WaitForScout1
:ScoutAtBank
Wait 2
MonsterGoto ScoutTag, StartX, StartY
:ScoutKilled
Global A Bandit Scout has been spotted and killed near Haven!
Wait 4
MonsterAdd Bandit Baron, startx, starty, 0, 1, BaronTag
MonsterAdd Bandit Mage, startx, starty, 0, 4, BanditTag
MonsterChat BaronTag, Let's go.
MonsterGoto BanditTag, Shopx, ShopY
Goto AttackHaven
:AttackHaven
MonsterChat BaronTag, To the bank! Kill all who stand in the way!
Wait 4
IfNotMonsterExist BanditTag, Victory1
Goto AttackHaven
:Victory1
Global The bandit raid has been thwarted!
MonsterRemove BaronTag
MonsterRemove BanditTag
End
Quick Links
About RPGWO
RPG World Online is a free multiplayer online RPG featuring real trade skills, player-created worlds, and an active community since 2000.