Lineage 2 Tower Forum

Full Version: l2divine functions ported to l2tower
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

As a former l2divine user that migrated to l2tower, I wanted to re-use existing scripts on l2tower. That is why I ported some functions for people who would like to migrate to l2tower.

Instruction for porting an existing l2divine script to l2tower script:
- replace every comments "//" by "--"
- replace every "label:" and Jump() call by "::label::" and goto (lua label convention)
- replace every "If" by "if"
- replace every "Else" by "else"
- replace every "{" by "then"
- replace every "}" by "end"
- put l2divine.lua on your script folder
- include this line on the beginning of your script :
dofile (GetDir() .. "\\scripts\\l2divine.lua")


l2divine.lua
Code:
l2tower_MoveTo = MoveTo
Console = 0

function Msg(Console, message)
    ShowToClient("L2Tower", message)
end

function Include(fileName)
    dofile (GetDir() .. "\\scripts\\" .. fileName)
end

function MoveTo(x, y, z)
    local moveDistance = 30
    l2tower_MoveTo(x, y, z, moveDistance)
end

function Delay(ms)
    Sleep(ms)
end

function NpcDialog(npc_id)
    ClearTargets()
    TargetNpc("", npc_id);
    Talk();
end

function LocInRange(x, y, z, radius)
    return math.floor(GetMe():GetRangeTo(x,y,z)) <= radius
end

function BattleStart()
    SetPause(false)
end

function BattleStop()
    SetPause(true)
end

There are still some function to recode...

Todo :
- ClearHuntingArea with TargettingSettings
- AddRectHuntingArea with TargettingSettings
- SetBattleArea with TargettingSettings
- SelectDialog with html parsing : DONE, look at here http://forum.l2tower.eu/thread-select-np...lay-string
- CloseDialog
- CountItem
The best fuction from Divine is, OOG mode. Big Grin
And radar map !
CountItem, TargetInRange, NoMobInHuntingArea done, will publish them later
Reference URL's