Ollvaror Caves

SCRIPTING

Introduction

You can add response to events during play with the scripting languaje of Ollvaror Caves. First of all you must assign a tag to an actor who is going to be the trigger of the event.

Then you have to create a text file with the same name of the map with the extension "olsc". For example, if your map's name is "Example map", the file must be named "Example map.olsc".

The following script is an simple "hello world" example triggered on the death of the creature tagged as "miner".

actor:miner;
event:ondie;
message:hello world;

All the scripts go in this ".olsc" file, like in this example:

actor:miner;
event:ondie;
message:hello world;
event:onplayertalk;
message:hello you;
actor:minertwo;
event:ondie;
bye world;

The list of the events are the following:

event:ondie;
event:onturnon
event:onturnoff;
event:onenter;
event:onexit;
event:onplayertalk;
event:onload;
event:onglobalchange;
event:onplayerentermodule;
event:onplayerchoose;
event:onbesummoned;
event:onplayertrueexits;
event:ondeadplayerdie;
event:onservermessage;
event:onwebmessage;
event:ondbpower;
event:oncreatemark;
event:onloseattention;
event:onpersistantplayerenters;

The onload event is different because does't need neither admit an actor in declaration.

The onplayerentermodule doesn't admit an actor in declaration, but has a player. It triggers everytime a player enter o reenter the game. Is intended only for mechanical purposes, like sending big textures.

Switches have onturnon and onturnoff events.

Areas have onenter, onexit and onturnonevents.

Actors have ondie and onplayertak events.

Conditionals

You can include conditionals that evaluates the truth of it's assignment each time, for example:

actor:miner;
event:onplayertalk;
messagecontains:hello;
message:hello you;
end;

The conditionals must end with an "end;" command.

messagecontains

Checks if a message contains an specific portion of text. Only uses a parameter, the text to check, for example:

messagecontains:die;

Checks the player (or npc) has sent "die" in the message. Will be true if the player says "die bastard" or "do diet".

messageexact

Checks if a message matchs a text. Only uses a parameter, the text to check, for example:

messagecontains:die;

Checks the player (or npc) has sent "die" as an exact message.

conditionalequal

Checks if a local variable has an specific value. Local variables are assigned by the abstract command "assign". Have two parameters, as seen in the example.

conditionalequal:nameofthevariable,valuechecked;

conditionaldifferent

Exactly the opossed to conditionalequal.

conditionalplayer

Checks if the actor is a player. Have no parameters.

conditionalplayer:;

conditionalfaction

Checks if the actor is in a faction.

conditionalfaction:chaos;

The faction can be chaos, players and no.

conditionalfaction:players; and conditionaplayer:; are not the same, as npc have players faction.

conditionaltagequals

Checks if the actor have an especific tag. Never true for players.

conditionaltagequals:nameofthetag;

conditionalcounterequal, conditionalcounterdifferent, conditionalcountermorethan, conditionalcounterlessthan

Similar to conditionalequal, but with entire numbers. Have a name and a entire value.

conditionalcounterequal:nameofthecounter,10;

conditionalactorequal,conditionalactordifferent

Similar to conditionalequal, but variables are assigned to a specific actor.

conditionalactorequal:nameofthevariable,value;

conditionalglobalchangeto

Only to be used with "onglobalchange" event.

conditionalglobalchangeto:nameofthevariable,value;

conditionalsometagalive, conditionalalltagalive, conditionalsometagdead, conditionalalltagdead

Checks the status of tagged actor and furnitures.

conditionalalltagalive:tag;

conditionalbeinarea

Check if a character is within the area

conditionalbeinarea:area;

conditionalglobalactorequal,conditionalglobalactordifferent

Similar to conditionalactorequal, but stored on a file on the server. The values are read from the program memory, so can be abused.

conditionalglobalactorequal:nameofthevariable,value;

conditionalglobalequal,conditionalglobaldifferent

Similar to conditionalequal, but stored on a file on the server. The values are read from the program memory, so can be abused.

conditionalglobalequal:nameofthevariable,value;

conditionalcheckattribute

Cheks if a character has an attribute.

conditionalchekattribute:str>=3;

You can use basic logic operators (==, >=, <=, < and >) and some attributes:

  • str: strength
  • agi: agility
  • end: endurance
  • wil: will
  • int: intelligence
  • lea: leadership
  • pot: otence
  • def: defense
  • ext: extension
  • mut: number of chaos mutations

conditionalswitchon

Checks if tagged swith is on.

conditionalswitchon:tagoftheswitch;

If multiple switch are tagged, checks if all are on.

conditionalswitchoff

Same as conditionalswitchon.

conditionalrandom

Checks random circunstances.

conditionalrandom:1,2;
  1. Favorable cases.
  2. Possible cases.

conditionalswitchon, conditionalswitchon

Cheks if a switch is on a position.

conditionalswitchon:chanswitcha;
  1. Tag of the switch.

playeroptionequal

Cheks if a player choose a particular option on an election. Only in "onplayerchoose" event.

playeroptionequal:chaoscoin,take two;
  1. Election
  2. Option

conditionalaccomplished

Checks the status of an accomplished task.

Look for "accomplish" command.

conditionalaccomplished:stones,4;

conditionalif

A "more open" conditional

conditionalif:sentence;

The sentence is written as a SQL command.

Stupid example (always true, as 3 is always differente from 4):

conditionalif:3<>4;

Check "Coding structures" for not so stupid usages.

Abstract commands

Have no perceptible effect, but are necesary for advanced effects.

assign

Assigns a value on a variable.

assing:nameofthevariable,value;

actorassign

The same, for an actor.

actorassign:nameofthevariable,value;

setlocalactor

Creates an alias for an actor, allowing access to its internal variables.

The parameters are (in order):

  1. objetive:
    • self
    • indirect
  2. Name of the alias
setlocalactor:self,nameofthealias;

removelocalactor

Removes the alias created by the setlocalactor

The parameters are (in order):

  1. Name of the alias
removelocalactor:nameofthealias;

setcounter

Assign an entire value to a counter

setcounter:nameofthecounter,10;

actorglobalsetcounter

Assign an entire value to an actor. The value is stored on the server for further reading.

Global variables are saved on the hard drive when assigned, and read when the player joins game in the server in an individual file for each character.

Shall not be abused.

actorglobalsetcounter:nameofthecounter,number;

claimotherserverplayerglobal

Read a global variable from a server.

The parameters are (in order):

  1. Server name
  2. Variable name
claimotherserverplayerglobal:afkermat cave,leerrunas;

increasecounter, decreasecounter

Increases or decreases the value of a counter, by one or a value

increasecounter:nameofthecounter,1;

makelocalactorcurrentvictim

Makes the "selected" actor the one passed by parameter.

makelocalactorcurrentvictim:nameofthealias;

makeactorpeaceful

Turns the target actor into a peaceful one.

makeactorpeaceful:;

makemegacreature

Turns the target actor into their enhanced version.

Takes a single argument. This can be selected in different ways.

  1. Objetive:
    • self
    • indirect
    • Tag
makemegacreature:miner;

makeattack

The target actor makes a strong attack with the strength passed by parameter.

  1. Strength
makeattack:3;

sendtexture

Send a texture skipping the normal flux. Created to be used with "onplayerentersmodule".

Deprecated now: all textures are sent on entering map.

sendtexture:./tiles/decoration/personal/clouds.png;

addbackground

Add a background. Only in onload.

The parameters are (in order):

  1. Image (It has to be in the map editor)
  2. Start X coordinate
  3. Start Y coordinate
  4. End X coordinate
  5. End Y coordinate
  6. Extra X coordinate
  7. Extra Y coordinate
  8. parallax X coordinate
  9. parallax Y coordinate
addbackground:./tiles/background/background5.png,0,0,9800,1920,0,-80,100,5;

SetSight

Stablish the sight range in pixels. The server sends the players objects in their sight range. However only works in 400-pixels cells, so it will round other values.

By default the value is 800, and cannot be reduced.

Actually only makes sense to view moving visuals which begins far away, but would enter de sight range in their moves.

setsight:1600;

Don't use if you don't need. It overloads the data transmission.

loadrelic

Load each relic individually so the screen knows of its existence.

The loadrelic goes inside the event:onload;

Example:

event:onload;
loadrelic:relic1;
loadrelic:relic2;

loaddbpower

Load each divine bond power individually so the screen knows of its existence.

The loaddbpower goes inside the event:onload;

Example:

event:onload;
loaddbpower:power1;
loaddbpower:power2;

addtolistcustom

If it doesn't exist, create a list and add the target.

If it already exists, just add the target.

addtolistcustom:nameofthelist;

removefromlistcustom

Remove the target from the list.

removefromlistcustom:nameofthelist;

listcustom

Used to traverse lists. Useful for doing something to all targets in a list.

To iterate through lists you must use "while" together with "conditionalnextobjectvalid".

listcustom:nameofthelist;

listactorsinarea

Same as listcustom but with all actors within an area.

To iterate through lists you must use "while" together with "conditionalnextobjectvalid".

listactorsinarea:list,area;

listactorsatdistance

Same as listcustom but with all actors within a distance.

To iterate through lists you must use "while" together with "conditionalnextobjectvalid".

The parameters are (in order):

  1. Objetive:
    • self
    • indirect
  2. Name of the list
  3. Distance
  4. Tag (optional)
listactorsatdistance:self,list,800;
listactorsatdistance:self,list,800,statue;

listactorstag

Same as listcustom but with all actors with the same tag.

To iterate through lists you must use "while" together with "conditionalnextobjectvalid".

listactorstag:list,tag;

listswitchestag

Same as listcustom but with all switches with the same tag.

To iterate through lists you must use "while" together with "conditionalnextobjectvalid".

listswitchestag:list,tag;

listfurnituretag

Same as listcustom but with all furnitures with the same tag.

To iterate through lists you must use "while" together with "conditionalnextobjectvalid".

listfurnituretag:list,tag;

customlistsize

Returns the number of items in the list.

Useful to use together with a conditional for example.

conditionalif:customlistsize(examplelist)=6;
        console:There are 6 items in the list;
end;

copylist

Copies a list with all its elements to another list.

copylist:originlist,destinationlist;

movelist

Moves a list with all its elements to another list. The origin list is deleted.

movelist:originlist,destinationlist;

eraselist

Delete the list.

eraselist:examplelist;

conditionalnextobjectvalid

Used to traverse lists.

To iterate through lists you must use "while" together with a list.

In the following example all targets in the list are healed:

listcustom:examplelist;
while;
conditionalnextobjectvalid:examplelist;
        heal:10;
end;

Perceptible commands

Do a perceptible effect.

accomplish

Finish an objetive of the game. Have a parameter.

accomplish:nameoftheobjetive;

It's posible to repeate the name if they're equal.

accomplishsingle

The same, but only for one target. Only for persistant maps.

accomplishsingle:nameoftheobjetive;

pause

Pauses de game for a time

pause:300;

message

Sends a message to all player in the chatbox

message:text of the message;

messageto

Sends a message to a player in the chat.

messageto:message;

bigmessage, bigmessageto

Sends a message in a position of the screen. Bigmessage send to all player, and bigmessageto send to the player that triggers the event.

bigmessage:this is a big message,50,10,10,20,200,200,200;

The parameters are (in order):

  1. Text
  2. Duration
  3. X coord
  4. Y coord
  5. Size
  6. Red component
  7. Green component
  8. Blue component

talkoptions

A reasonable option for dialoging with non-player characters.

#face=./tiles/avatar/avatar45.png;
#text=Hello slave;
#options=Any mission for me?;
#options.=_Hello you;
talkoptions:450,10,360,360,,#face,#text,#options;

First, the necessary variables are declared with #. The .= is used to concatenate the variable.

The parameters are (in order):

  1. X coord
  2. Y coord
  3. X size
  4. Y size
  5. Background image (optional)
  6. Image of the npc's face
  7. Text
  8. Answers

playeroptions

A reasonable option for responding non-player characters.

It's even possible to make payments to get [x item/thing]. In this case, the payment method is secure. A server cannot cheat players out of their money, as confirmation is always requested from the player, indicating the amount to be paid.

The playeroptions must be inside the messagecontains.

messagecontains:I will pay for that sword;
playeroptions:390,10,200,300,,,pay 100 coins,itempaidsword,yes-100_no;
end;

The parameters are (in order):

  1. X coord
  2. Y coord
  3. X size
  4. Y size
  5. Background image (optional)
  6. Image of the npc's face
  7. Answer
  8. Variable (The normal thing is to use it in the playeroptionequal to do something with it)
  9. Confirmation (The hyphen is used to indicate the actual value that the player will have to pay.)

showimage, showimageto

Shows an image to all players, or to a player.

showimageto:./tiles/decoration/personal/kristlam_map.png,250,20,40,253,350;

The effect of this line is best seen on this image:

The parameters are (in order):

  1. Image. Need to be included in the map.
  2. Duration
  3. X coord
  4. Y coord
  5. (optional) X size
  6. (optional) Y size
  7. (optional) X displacement
  8. (optional) Y displacement

visual

Creates a movile (or not) visual effect. It can be animated.

The parameters are (in order):

  1. X coord
  2. Y coord
  3. Duration
  4. Direction (left means flip the texture)
  5. Disappearing time
  6. Angle (for moving)
  7. Velocity
  8. Texture

We can create a snow falling effect repeting the following line:

visual:rand(2626-3926),10,500,0,0,rand(220-230),rand(20-30),./tiles/decoration/personal/snow.png;

changeimage

Changes the texture of an static tagged object.

changeimage:tag,image;

setalpha

Change the alpha channel. Perfect if you want to hide a solid color by changing the alpha channel to zero.

setalpha:tag,alpha;
setalpha:tag,0;

setplayertilevisibility

Changes the alpha channel of a tile for a single player. Perfect if you want to hide a tile from a single player.

setplayertilevisibility:tag,0;
setplayertilevisibility:tag,1;

setlight

Change the light radious.

setlight:tag,radious;

playcustomsound

Starts a custom sound.

playcustomsound:sound,volume;
playcustomsound:sound,volume,x,y;

console

Sends a message to the console

Perhaps useful for debugging.

console:message;

sendtextsecuence

Allows button sequences to be made to achieve some behavior.

You probably need to use it in the onplayerentermodule event. This event is without an actor.

The parameters are (in order):

  1. Secuence:
    • b (back)
    • d (down)
    • f (forward)
    • u (up)
    • [ (block)
    • ] (release block)
  2. Message in chat
sendtextsecuence:[du],hidden-message;

You can combine keys to create multiple combinations. Example: dbu or [ddd]

The message is sent via chat, so if you want to give it any function you need to use the onplayertalk event without an actor. The hidde- makes the message not visible in the chat.

setfaction

Sets the target character's faction. Factions can be chaos, players and no. You can also use whole numbers to create more factions, perfect for PVP.

setfaction:chaos;
setfaction:101;
setfaction:102;

addtrap

The parameters are (in order):

  1. Tag of the trap
  2. Tag
  3. Step duration
  4. Animation steps
  5. Starting damage step
  6. End damage step
  7. Damage
  8. Damage tipe (dark,flesh,cont,perf,cort)
  9. Cycles (-1 for infinite)
  10. Waiting between cycles
  11. Faction (opcional) (chaos,players,no)
addtrap:trapinc,2,10,3,6,1,no,-1,rand(20-50);

starttrap

Start a stopped trap (0 cycles left). Must be prepared previously with "addtrap", but it is not required to start until stopped.

The parameters are (in order):

  1. Tag of the trap
  2. Cycles

stoptrap

Stops a trap. It will conclude it cycle.

The parameter is:

  1. Tag of the trap

fade

Fades to black or other color.

fade:75,15;
fade:75,15,20,20,20;

The parameters are (in order):

  1. Duration
  2. Speed
  3. (optional) Red component
  4. (optional) Green component
  5. (optional) Blue component

fadeto

Same as "fade" but aimed at the target player.

hideinterface

Hides all interface elements, such as the health bar or chat.

hideinterface:;

showinterface

Shows all interface elements, such as the health bar or chat.

showinterface:;

move

Moves a tagged tile to a direction.

The parameters are (in order):

  1. Tag
  2. Direction (up,down,left,right)
  3. Distance
  4. Speed
  5. Type of movement (optional)
    • once (default)
    • simple (same)
    • return
    • cyclic
  6. Stop time (optional)
  7. Character displacement on collision (optional)
    • left
    • right
    • sides (the closest)
move:tag,down,100,10;

forcemove

The same, but doesnt care about actors trapped.

alert

Alert an actor. In the game each character has stealth. If an actor is alerted, the character loses stealth.

The parameters are (in order):

  1. Tag
alert:tag;

setswitchoption

Set a parameter on a switch.

setswitchoption:swaa,autoreturn,1760;

The parameters are (in order):

  1. Tag of the switch
  2. Parameter
    • autoreturn
    • return
    • reuse
  3. Value

setreturn

Stablish the return status of an used switch. Only for "onturnon" event of a switch.

setreturn:status;

Status can be "true" or "false".

actormove

Sends an actor an order to change its home in the X axis.

actormove:tag,200;
actormove:tag,-200;

actormoveto

Sends an actor an order to go to the X coordinate.

actormoveto:tag,1500;

caoscontagion

Assing a contagion to a tagged object (actor, furniture...)

The parameters are (in order):

  1. Tag
  2. Contagion
  3. Distance
caoscontagion:tag,400,100;

assignpenalty

Create penalty for actors. Intended for "onenter".

assignpenalty:damage,1;
assignpenalty:resblud,2;

The parameters are (in order):

  1. type of penalty:
    • damage
    • resblud (resistance to bludgeoning damage)
    • resshar (resistance to shear damage)
    • respier (resistance to piercing damage)
    • resdark (resistance to darkness damage)
  2. Value
  3. Mitigation (optional):
    • mitagation_def
    • mitagation_potdef

assignbonus

Create bonus for actors.


assignbonus:damage,1,0;
assignbonus:resblud,2,0;

The parameters are (in order):

  1. type of penalty:
    • damage
    • speed (attack speed)
    • life
    • chaos (chaos bar)
    • endurance
    • resblud (resistance to bludgeoning damage)
    • resshar (resistance to shear damage)
    • respier (resistance to piercing damage)
    • resdark (resistance to darkness damage)
  2. Value
  3. Duration (0 is permanent)

assignlimit

Create limits for actors. Intended for "onenter".


assignlimit:move,30;
assignlimit:jump,125;

The parameters are (in order):

  1. Variable
    • Move
    • Jump
  2. Value

removelimits, removeeffects

Remove all limits and effects.

removelimits:tag;
removelimits:;

Intended for areas. Tag must be empty when used on "onexit" event.

createarea

Create an area around objets with a tag.

createarea:tag,width/2,height/2;

summon

Summon a creature at a position.

summon:10,100,500;

The parameters are (in order):

  1. ID of the creature
  2. X cord
  3. Y cord
  4. Tag (optional)
ID Name
1 Dormenian soldier
2 Eridian soldier
3 Harrassian soldier
4 Tirtic soldier
5 Chaos eyes
6 Unarmed
7 Oso del caos
8 Perro del caos
9 Caracol del caos
10 Cabra del caos
11 Rapaz del caos
12 Blando menor
13 Falta de personalidad menor
14 Codicia menor
15 Simpleza menor
16 Mezquindad menor
17 NPC
18 Minero corrupto corto
19 Minero corrupto largo
20 Minero corrupto pesado
21 Minero corrupto aura
22 Masa de carne
23 Guardián corrupto guerrero hacha
24 Guardia esclavista
25 Guardia corrupta cadenas
26 Masa de carne voladora
27 Maza de carne mini
28 Masa de carne torreta
29 Crow
30 Temeridad menor
31 Agente corrección
32 Guerrero ollvaror
33 Cobardía menor
34 Falsedad menor
35 Crueldad menor
36 Desidia menor
37 Indecisión menor
38 Desenfreno menor
39 Insistencia menor
40 Individualismo menor
41 Ostentosidad menor
42 Guerrero rebelde ollvaror
43 alma_l
44 alma_c
45 alma_v
46 Inconstancia menor
47 Brusquedad menor
48 Belicosidad menor
49 Agente correción boss
50 Inconstancia menor true
51 Masa de carne voladora enorme

encounter

Brings up all actors with the encounter name.

In the map editor, a box appears for each actor to enter the name of the encounter.

encounter:nameoftheencounter;

superencounter

Same as the encounter but the actors appear enhanced.

In the map editor, a box appears for each actor to enter the name of the encounter.

superencounter:nameoftheencounter;

disableencounter

Makes all actors with the name encounter disappear.

In the map editor, a box appears for each actor to enter the name of the encounter.

disableencounter:nameoftheencounter;

eliminateactor

Eliminate an actor, if this is not a player.

The parameters are (in order):

  1. Objetive:
    • self
    • indirect
eliminateactor:self;

actortalk

An actor sends a message

actortalk:tag,hello world;

heal

Create a healing effect. If not tag wil heal the trigger of the event.

heal:10;
heal:tag,10;

respite

The target gains as much stamina as the amount passed by parameter.

The parameters are (in order):

  1. Amount
respite:5;

clean

Clean up the consumed chaos. If not tag, will clean up the chaos of the trigger of the event.

clean:10;
clean:tag,10;

cleanneversurrender

The character recovers an amount of 'never surrender'.

cleanneversurrender:1;

In the following example it recovers as many as its power

#pot=character(pow);
cleanneversurrender:evaluate[1*#pot];

damage

It does as much damage as the past parameter to an actor

damage:5;
damage:tag,5;

teleport

Teleports the event trigger to a position.

teleport:8000,22800;

The parameters are (in order):

  1. X coord
  2. Y coord

setexit

It establishes that you cannot exit in an area.

Example:

actor:areanoescape;
event:onenter;
setexit:0;
event:onexit;
setexit:1;

equip

Replaces the inventory of the trigger.

equip:103,103,1;

The parameters are (in order):

  1. ID of the weapon in right hand
  2. ID of the weapon in left hand
  3. ID of armor

Any parameter can be 0.

ID Name Weight (kg)
1 Leather armor 3
2 Mail armor 7
3 Eridian armor 12
4 Carsij armor 13
5 Ollvaror armor 18
101 Dagger 0.5
102 Short sword 1
103 Long sword 1.5
104 Greatsword 2.5
105 Hand axe 2
106 War axe 3
107 Gunear axe 4
108 Dormenian halberd 2
109 Eridian halberd 3
110 Hammer (not implemented) 3
111 Maul 5
112 Flail 1
113 Mace 1.5
116 Club 0.6
201 Light shield 1
202 Round shield 1.5
203 Heavy shield 2

music

Sends the player the order to preload music.

music:1;

musicmode

Sends the player the order to load a section of the preload music.

musicmode:3;

delay, enddelay

Delays the execution of a portion of script.

delay:300;
...
endelay;

Delays can't be delayed.

actorassignglobal

As actorassign, but the value is stored on the server for further reading.

Global variables are saved on the hard drive when assigned, and read when the player joins game in the server in an individual file for each character.

Shall not be abused.

actorassignglobal:nameofthevariable,value;

assignglobal

As assign, but the value is stored on the server for further reading.

Global variables are saved on the hard drive when assigned, and read when the server launches.

Triggers onglobalchange in all games in the server.

Shall not be abused.

assignglobal:nameofthevariable,value;

proyectile

Creates a proyectile.

proyectile:players,1534,451,5,dark,20,20,2,10,180,left,dark;
proyectile:chaos,352,2209,3,dark,40,40,5,20,180,right,pers,./tiles/pers/ball1.png;
  1. Faction
  2. X coord
  3. Y coord
  4. Damage
  5. Damage type
  6. Width
  7. Height
  8. Speed
  9. Lifetime
  10. Angle in degrees
  11. Direction (left means flip the texture)
  12. Texture
  13. Personaliced texture (only if Texture is "pers")


createswitch

Creates a switch.

The parameters are (in order):

  1. Texture
  2. X coord
  3. Y coord
  4. Reuse time
  5. Return time
  6. Autoreturn time
  7. Tag (optional)

The switch has to be somewhere on the map in the map editor. You can put it hidden outside of accessible areas.

createswitch:./switches/statue_nadruneb.png,character(posx),character(posy),1,0,0,estatuapoder;

Note: with character(posx) and character(posy) you access the character's coordinates.

createfurniture

Creates a furniture.

The parameters are (in order):

  1. Texture
  2. X coord
  3. Y coord
  4. Life
  5. Tag (optional)

The furniture has to be somewhere on the map in the map editor. You can put it hidden outside of accessible areas.

createfurniture:./furniture/spark-nadruneb.png,200,210,20,chispaverde;


animate

Set the animation of a map surface.

animate:anobject,4;
  1. Tag
  2. Speed of the movement.

useswitch

Turn a tagged switch, if posible.

useswitch:swtra;
  1. Tag

userelic

It is used to hand over the relic to a character.

Does not work without loadrelic command.

It has no parameters

Example:

actor:relic1;
event:onturnon;
userelic:;

actor:relic2;
event:onturnon;
userelic:;

adddbpower

It is used for the character to learn the power.

Does not work without loaddbpower command.

It has no parameters

Example:

actor:power1;
event:onturnon;
adddbpower:;

actor:power2;
event:onturnon;
adddbpower:;

reservedbenergy

It is used to give the screen a certain amount of energy. If the screen has no energy, the characters will not be able to obtain it.

For this to work, the server needs to have energy.

The parameters are (in order):

  1. Amount

In the following example, only five energy points are reserved. If the characters obtain less than this amount, the remaining energy is returned to the server.

reservedbenergy:5;

transferdbenergy

It is used to give a single energy to the character.

It has no parameters. You are always given one energy.

transferdbenergy:;

setbehaviour

Change the target's behavior.

The parameters are (in order):

  1. Objetive
  2. Behaviour (They range from 1 to 8)
    1. Patrol
    2. Fly
    3. Still
    4. Jump down
    5. Limp
    6. Never attack air
    7. Never strong attack
    8. Very limited vision
  3. True or false

In the following example it is used so that chaos creatures have a more limited vision.

actor:areadeffects;
event:onenter;
conditionalfaction:chaos;
setbehaviour:self,8,true;
end;

addcustomitem

Add a custom item to inventory.

The parameters are (in order):

  1. Objetive
  2. Name (will appear in inventory)
  3. Image (will appear in inventory)
  4. Weight in grams (will appear in inventory)
  5. Description (will appear in inventory)

Example:

actor:key;
event:onturnon;
addcustomitem:self,key,./tiles/personal/decoration/golden-key.png,0,a golden key made by Iderion;

If you want to know if a character has the key you can use ncustomitem(key) to get the number of items named 'key' in the inventory

Example:

actor:door;
event:onturnon;
conditionalif:ncustomitem(key) > 0;
bigmessage:You have the key,100,100,100,20,200,200,200;
end;

removecustomitem

Remove an item from the target's inventory.

The parameters are (in order):

  1. Objetive:
    • self
    • indirect
  2. Name of the item
removecustomitem:self,key;

turnto

Turn the NPC in the direction of the character. Useful in interactions with them.

Example:

actor:miner;
event:onplayertalk;
turnto:;
messagecontains:hello;
message:hello my friend;
end;

createlightzone

With this command, which goes in the event:onload; we can modify the lights. It's great for adding darkness in caves for example.

The parameters are (in order):

  1. Percentage of light
  2. X coord start
  3. Y coord start
  4. Width
  5. Height
event:onload;
createlightzone:20,0,0,100000,100000;

actorsetcameraposition

Changes the player's camera to the desired position, or returns the camera to the player.

The parameters are (in order):

  1. Position
    • position
    • return
  2. Coord X (only with position)
  3. Coord Y (only with position)

Example:

actorsetcameraposition:position,150,200;
actorsetcameraposition:return;

actorstun

Stuns the actor

The parameters are (in order):

  1. Stun force
  2. Type of stun (optional):
    • cast
    • nothing

Example:

actorstun:6;
actorstun:6,cast;
actorstun:30,nothing;

Note: If you put nothing, or put "cast", the value counts as if it were damage. If you put "nothing" the stune force counts as game turns (30 is a second)

actorcleanstun

removes the actor's stun

Example:

actorcleanstun:;

setzoom

zoom in on a target.

A 50 zoom brings the camera very close to the target.

A 200 zoom takes the camera very far from the target.

A zoom of 100 is the default for characters.

You can change this value to suit your needs.

The parameters are (in order):

  1. Objetive
    • self
    • indirect
  2. Zoom

Example:

setzoom:self,50;

setascend

The target character ascends.

If the value is equal to one the character is ascended to fighter.

For this command to work, your server must have ascend permissions. Contact us to get them.

The parameters are (in order):

  1. Value

Example:

setascend:1;

setattribute

Changes a character attribute

The parameters are (in order):

  1. Attribute:
    • 0 (Strength)
    • 1 (Agility)
    • 2 (Endurance)
    • 3 (Willpower)
    • 4 (Inteligence)
    • 5 (Lidership)
    • 6 (Potence)
    • 7 (Defense)
    • 8 (Extension)
  2. Value

Example:

setattribute:6,4;

Pending commands

makesourcecurrentvictim

makeindirectcurrentvictim

liberatevictim

summonrelative

autouseswitch

useswitchon

cleantemporal

musicloadpart

servermessage

setserveracces

sendplayer

additem

setitemquality

splittext

randomencounterposition

webmessage

setbodytype

Coding structures

Variable parameters

Most of the commands admits variables ad parameters.

Example


conditionalif:character(atr6)>=2;
heal:evaluate[character(atr6)*3];
end;

We spanish people say "To the good understander few words are enough".

Not all commands have implemented variable parameters.

Variables itselfs

Declared an checked with #. Works as text, so expect some problems.

The following example makes the same as the previous one.


#cpower=character(atr6);
conditionalif:#cpower>=2;
heal:evaluate[#cpower*3];
end;

Variables are lost at the end of the event.

Something similar to functions

Declared in the top of the code.

Funtions works as a text replacement, call a function only insert its contents on the calling code.

So the following example is exactly the same as the previous one.


function:healsomeone();
#cpower=character(atr6);
conditionalif:#cpower>=2;
heal:evaluate[#cpower*3];
end;
endfunction;

(other place of the code)

call:healsomeone();

Functions have no parameters (perhaps some day), but as they are code insertions yo can use variables (#) in and out and you have to TAKE CARE not using the same variable names.