Difference between revisions of "NDGIC"

From Legends of Aria Admin and Modding Wiki
Jump to: navigation, search
Line 6: Line 6:
 
{| class="wikitable" | style="width: 60%"
 
{| class="wikitable" | style="width: 60%"
 
|-
 
|-
|style="width: 40%"| <p style="color: #DDDD88;font-size: 18px">CallFunctionDelayed()</p>Params<br>TimeSpan - duration to wait before calling the function<br>function - function to call || Calls a function after the specified amount of time has elapsed Note: This function will not be called if server shuts down or restarts before the delay expires..
+
|style="width: 40%"| <p style="color: #DDDD88;font-size: 18px">CallFunctionDelayed(...)</p>Params<br>TimeSpan - duration to wait before calling the function<br>function - function to call || Calls a function after the specified amount of time has elapsed Note: This function will not be called if server shuts down or restarts before the delay expires..
 
|}
 
|}
 
</center>
 
</center>
Line 28: Line 28:
 
{| class="wikitable" | style="width: 60%"
 
{| class="wikitable" | style="width: 60%"
 
|-
 
|-
|style="width: 40%"| <p style="color: #DDDD88;font-size: 18px">CanPathTo()</p>Params<br>origin - the start location to path from<br>destination - the end location to path to || Checks for a valid path from the origin to the destination using A* algorithm.<br>Returns - true if worked, false if not
+
|style="width: 40%"| <p style="color: #DDDD88;font-size: 18px">CanPathTo(...)</p>Params<br>origin - the start location to path from<br>destination - the end location to path to || Checks for a valid path from the origin to the destination using A* algorithm.<br>Returns - true if worked, false if not
 
|}
 
|}
 
</center>
 
</center>
Line 48: Line 48:
 
{| class="wikitable" | style="width: 60%"
 
{| class="wikitable" | style="width: 60%"
 
|-
 
|-
|style="width: 40%"| <p style="color: #DDDD88;font-size: 18px">ChangeWorld()</p>Params<br>reloadregion - true/false to reload the region<br>regionaddress - region to send players too<br>worldaddress - world adddress that contains the region<br>subregion - subregion to move players too<br>threads - number of object threads to run for the region<br>x - the x location to move the players too<br>z - the z location to move the players too || Changes or reloads the world on a standalone server.
+
|style="width: 40%"| <p style="color: #DDDD88;font-size: 18px">ChangeWorld(...)</p>Params<br>reloadregion - true/false to reload the region<br>regionaddress - region to send players too<br>worldaddress - world adddress that contains the region<br>subregion - subregion to move players too<br>threads - number of object threads to run for the region<br>x - the x location to move the players too<br>z - the z location to move the players too || Changes or reloads the world on a standalone server.
 
|}
 
|}
 
</center>
 
</center>
Line 74: Line 74:
 
{| class="wikitable" | style="width: 60%"
 
{| class="wikitable" | style="width: 60%"
 
|-
 
|-
|style="width: 40%"| <p style="color: #DDDD88;font-size: 18px">CopyObjectToPos() || .
+
|style="width: 40%"| <p style="color: #DDDD88;font-size: 18px">CopyObjectToPos(...)</p> || Copy the specified object in a new position/container.
 
|}
 
|}
 
</center>
 
</center>
Line 85: Line 85:
 
{| class="wikitable" | style="width: 60%"
 
{| class="wikitable" | style="width: 60%"
 
|-
 
|-
|style="width: 40%"| <p style="color: #DDDD88;font-size: 18px">CreateCustomObj() || .
+
|style="width: 40%"| <p style="color: #DDDD88;font-size: 18px">CreateCustomObj()</p> || .
 
|}
 
|}
 
</center>
 
</center>
Line 96: Line 96:
 
{| class="wikitable" | style="width: 60%"
 
{| class="wikitable" | style="width: 60%"
 
|-
 
|-
|style="width: 40%"| <p style="color: #DDDD88;font-size: 18px">CreateCustomObjInContainer() || .
+
|style="width: 40%"| <p style="color: #DDDD88;font-size: 18px">CreateCustomObjInContainer()</p> || .
 
|}
 
|}
 
</center>
 
</center>
Line 107: Line 107:
 
{| class="wikitable" | style="width: 60%"
 
{| class="wikitable" | style="width: 60%"
 
|-
 
|-
|style="width: 40%"| <p style="color: #DDDD88;font-size: 18px">CreateCustomTempObj() || .
+
|style="width: 40%"| <p style="color: #DDDD88;font-size: 18px">CreateCustomTempObj()</p> || .
 
|}
 
|}
 
</center>
 
</center>
Line 118: Line 118:
 
{| class="wikitable" | style="width: 60%"
 
{| class="wikitable" | style="width: 60%"
 
|-
 
|-
|style="width: 40%"| <p style="color: #DDDD88;font-size: 18px">CreateEquippedObj() || .
+
|style="width: 40%"| <p style="color: #DDDD88;font-size: 18px">CreateEquippedObj()</p> || .
 
|}
 
|}
 
</center>
 
</center>
Line 129: Line 129:
 
{| class="wikitable" | style="width: 60%"
 
{| class="wikitable" | style="width: 60%"
 
|-
 
|-
|style="width: 40%"| <p style="color: #DDDD88;font-size: 18px">CreateObjExtended() || .
+
|style="width: 40%"| <p style="color: #DDDD88;font-size: 18px">CreateObjExtended()</p> || .
 
|}
 
|}
 
</center>
 
</center>
Line 151: Line 151:
 
{| class="wikitable" | style="width: 60%"
 
{| class="wikitable" | style="width: 60%"
 
|-
 
|-
|style="width: 40%"| <p style="color: #DDDD88;font-size: 18px">CreatePrefab() || .
+
|style="width: 40%"| <p style="color: #DDDD88;font-size: 18px">CreatePrefab()</p> || .
 
|}
 
|}
 
</center>
 
</center>
Line 162: Line 162:
 
{| class="wikitable" | style="width: 60%"
 
{| class="wikitable" | style="width: 60%"
 
|-
 
|-
|style="width: 40%"| <p style="color: #DDDD88;font-size: 18px">CreateTempObj() || .
+
|style="width: 40%"| <p style="color: #DDDD88;font-size: 18px">CreateTempObj()</p> || .
 
|}
 
|}
 
</center>
 
</center>

Revision as of 19:44, 13 November 2019

[Main] [Lua Examples]

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Global Functions & Examples

CallFunctionDelayed(...)

Params
TimeSpan - duration to wait before calling the function
function - function to call
Calls a function after the specified amount of time has elapsed Note: This function will not be called if server shuts down or restarts before the delay expires..

Example

-- call the TrapTriggered function after 2 seconds has elapsed
CallFunctionDelayed(TimeSpan.FromSeconds(2),TrapTriggered())
 
-- handle the target who triggered the trap by dealing 25 points of magic damage to the target
function TrapTriggered()
    -- get the target trigger object stored by the trap
    local target = this:GetObjVar("TrapTriggeredBy")
    -- if the target is valid apply the damage
    if(target) then
        damageInfo.Victim:SendMessage("DamageInflicted",target,25,"MAGIC",false,false,false,target)         
    end
end

CanPathTo(...)

Params
origin - the start location to path from
destination - the end location to path to
Checks for a valid path from the origin to the destination using A* algorithm.
Returns - true if worked, false if not

Example

-- attempt to move the target object to a new location
function MoveTargetToLoc(target,location)
    if(CanPathTo(this:GetLocation(),location) then
        -- move the target to the location specified
        target:PathTo(location,1,"ArrivedEventHandler",true,true,4)
        return true
    end
    -- if pathing failed return false
    return false
end 

ChangeWorld(...)

Params
reloadregion - true/false to reload the region
regionaddress - region to send players too
worldaddress - world adddress that contains the region
subregion - subregion to move players too
threads - number of object threads to run for the region
x - the x location to move the players too
z - the z location to move the players too
Changes or reloads the world on a standalone server.

Example

-- change the current region, will reset and reload
ChangeWorld(true)
-- change the current region to the black forest at location 550,375 with 8 threads and no reloading of the area
ChangeWorld(false,"AzureSky.NewCelador.BlackForest","NewCelador","BlackForest",8,550,375)

ClearBans()

Clears all active bans on the server..

Example

-- WARNING: THIS REMOVES ALL BANS ON THE SERVER
ClearBans()

CopyObjectToPos(...)

Copy the specified object in a new position/container.

Example

 CODE EXAMPLE BLOCK

CreateCustomObj()

.

Example

 CODE EXAMPLE BLOCK

CreateCustomObjInContainer()

.

Example

 CODE EXAMPLE BLOCK

CreateCustomTempObj()

.

Example

 CODE EXAMPLE BLOCK

CreateEquippedObj()

.

Example

 CODE EXAMPLE BLOCK

CreateObjExtended()

.

Example

 CODE EXAMPLE BLOCK

CreateObjInContainer()

.

Example

 CODE EXAMPLE BLOCK

CreatePrefab()

.

Example

 CODE EXAMPLE BLOCK

CreateTempObj()

.

Example

 CODE EXAMPLE BLOCK