;==========================================================
; Alexandria Project, a standard subs library.
; Copyright (C) 2001-2003 The Codename Alexandria Team.
;
; This library is free software; you can redistribute it and/or
; modify it under the terms of the GNU Lesser General Public
; License as published by the Free Software Foundation; either
; version 2.1 of the License, or (at your option) any later version.
;
; This library is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
; Lesser General Public License for more details.
;
; You should have received a copy of the GNU Lesser General Public
; License along with this library; if not, write to the Free Software
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
;
; @packageversion 1.1.0
; $Id: [Link],v 1.13 2003/08/14 07:30:51 wza Exp $
;----------------------------------------------------------
; Editors: [Link] a.k.a. Cheech Wizard
;----------------------------------------------------------
; Original idea & contributor: ScriptFellow
;----------------------------------------------------------
; Contributors: Blast aka Devine, Cheffe, Kal In Ex, Khameleon,
; LordSiD, Lord Helmchen, old_asm_programmer,
; Quintok, Rain Dog, Redpriest, Roadkill, Rolo,
; Smertrios, WarLocke
;==========================================================
;==========================================================
; dispatcher stub for sub calls.
;----------------------------------------------------------
set %_skillNsType #nsType
set %_skillNsName #nsName
nameSpace Local _skill
set !0 %0
if ! %subsInitialized
{
if %_subsPath = N/A
set %_subsPath .\
call %_subsPath , [Link] ; ensure [Link] is loaded
}
if ! %skillInitialized
gosub _init
; nameSpace Local _Lexia
; linesPerCycle %_maxLinesPerCycle
; nameSpace Local _skill
goto !0
0:
goto exit
1:
gosub %1
goto exit
2:
gosub %1 %2
goto exit
3:
gosub %1 %2 %3
goto exit
4:
gosub %1 %2 %3 %4
goto exit
5:
gosub %1 %2 %3 %4 %5
goto exit
6:
gosub %1 %2 %3 %4 %5 %6
goto exit
7:
gosub %1 %2 %3 %4 %5 %6 %7
goto exit
8:
gosub %1 %2 %3 %4 %5 %6 %7 %8
goto exit
9:
gosub %1 %2 %3 %4 %5 %6 %7 %8 %9
goto exit
10:
gosub %1 %2 %3 %4 %5 %6 %7 %8 %9 %10
goto exit
11:
gosub %1 %2 %3 %4 %5 %6 %7 %8 %9 %10 %11
goto exit
12:
gosub %1 %2 %3 %4 %5 %6 %7 %8 %9 %10 %11 %12
goto exit
13:
gosub %1 %2 %3 %4 %5 %6 %7 %8 %9 %10 %11 %12 %13
goto exit
14:
gosub %1 %2 %3 %4 %5 %6 %7 %8 %9 %10 %11 %12 %13 %14
goto exit
15:
gosub %1 %2 %3 %4 %5 %6 %7 %8 %9 %10 %11 %12 %13 %14 %15
goto exit
16:
gosub %1 %2 %3 %4 %5 %6 %7 %8 %9 %10 %11 %12 %13 %14 %15 %16
goto exit
17:
gosub %1 %2 %3 %4 %5 %6 %7 %8 %9 %10 %11 %12 %13 %14 %15 %16 %17
goto exit
18:
gosub %1 %2 %3 %4 %5 %6 %7 %8 %9 %10 %11 %12 %13 %14 %15 %16 %17 %18
goto exit
19:
gosub %1 %2 %3 %4 %5 %6 %7 %8 %9 %10 %11 %12 %13 %14 %15 %16 %17 %18 %19
goto exit
exit:
; nameSpace clearLocal _skill
; nameSpace Local _Lexia
; linesPerCycle %_linesPerCycle
nameSpace %_skillNsType %_skillNsName
exit
;**
;* Initialize constants for this package
;*
;* <p>The following variables are to check the package state at runtime.
;* %skillInitialized equals #true when the library is available.
;*
;* <p>%skillVerMajor, %skillVerMinor and %skillVerRevision:
;* An odd minor version number indicates a development release.
;* An even minor version number indicates a stable release.
;*
;* @internal
;* @purpose Package initialization
sub _init
;---- hide sub init ---------------------------------------
set !_hideCnt #sCnt2
;----------------------------------------------------------
; initEvents
set %skillInitialized #true
set %skillVerMajor 1
set %skillVerMinor 1
set %skillVerRevision 0
return
;**
;* Checks if a skill has been gained within a certain amount of
;* time. Note: If you don't give the 2nd parameter you must choose
;* the skill yourself with chooseSkill.
;*
;* @author Quintok
;* @purpose Check for a skill gain within a certain timeframe.
;* @param %1 timeout req Timeout in 10ths of seconds
;* %2 skill opt Skill to check
;* %3 return opt Name of return value ('return' by default)
;* @return @%3 = #true if there was a gain, #false if not
sub checkGain
if %0 = 2 || %2 <> N/A
chooseSkill %2
if %0 < 3
set %3 return
call %_subsPath , [Link] waitForSysVar skill > #skill %1 %3
return
;**
;* Use the Hiding skill if character isn't hidden.
;*
;* @author [Link]
;* @purpose Use the Hiding skill if character isn't hidden.
;* @see waitAfterHide
sub hide
_hide:
if H notIn #charStatus
{
if !_hideCnt > #sCnt2 ; Fix against sub re-entry
goto _hide
if H notIn #charStatus
{
event Macro 13 21
set !_hideCnt #sCnt2 + 120
}
}
return
;**
;* Wait until the hiding skill timer expires.
;*
;* @author [Link]
;* @purpose Wait until the hiding skill timer expires.
;* @see hide
sub waitAfterHide
_waitAfterHide:
if !_hideCnt > #sCnt2
goto _waitAfterHide
return
;**
;* Meditates if MANA is lower than INT.
;*
;* @author ScriptFellow
;* @purpose Meditates if MANA is lower than INT.
;* @see meditateFull
sub meditate
if #mana <> #int
{
_meditate:
event Macro 13 46
call %_subsPath , [Link] sleep 14000
if concentrate in #sysMsg
goto _meditate
}
return
;**
;* Meditates if MANA is lower than INT and waits for mana
;* to be completely regenerated.
;*
;* @author ScriptFellow
;* @purpose Meditates if MANA is lower than INT and waits for mana to be completely
regenerated.
;* @see meditate
sub meditateFull
if #mana <> #int
{
_meditateFull:
event Macro 13 46
call %_subsPath , [Link] sleep 14000
if focus in #sysMsg
goto _meditateFull
_meditateFullWait:
if #mana < #int
goto _meditateFullWait
}
return