// MQ2Twist.cpp - Bard song twisting plugin for MacroQuest2
//
// koad 03-24-04 Original plugin (http://macroquest.sourceforge.net/phpBB2/viewtopic.php?t=5962&start=2)
// CyberTech 03-31-04 w/ code/ideas from Falco72 & Space-boy
// Cr4zyb4rd 08-19-04 taking over janitorial duties
// Pheph 08-24-04 cleaning up use of MQ2Data
/*
MQ2Twist Version 1.3
Usage:
/twist # # # # # - Twists in the order given.
Valid options are 1 thru 9 for song gems, and 10 thru 19 for item clicks.
These may be mixed in any order, and repeats are allowable. Up to 10 may be
specified.
If a song is specified with a duration longer than standard (ie, selos)
that song will be twisted based on it's duration. For example, riz+mana+selos
would be a 2 song twist with selos pulsed every 2.5 min.
/twist once # # # # # - Twists in the order given, then reverts to original twist
/twist hold <gem #> - Pause twisting and sing only the specified song
/sing <gem#> - alias for /twist hold
/twist stop/end/off - stop twisting, does not clear the twist queue
/stoptwist - alias for above
/twist or /twist start - Resume the twist after using /twist hold or /twist stop
/twist reset - Reset timers for item clicks and long duration songs
/twist delay # - 10ths of a second, minimum of 30, default 33
/twist adjust # - in ticks, how early to recast long duration songs
/twist reload - reload the INI file to update item clicks
/twist slots - List the slots/items defined in the INI and their #'s
/twist quiet - Toggles songs listing and start/stop messages for one-shot twists
----------------------------
Item Click Method:
MQ2Twist uses /itemnotify slotname rightmouseup to perform item clicks.
The INI file allows you to specify items by name (with name=itemname), or by
inventory slot (with slot=slotname). If both a name and slot are defined for an
item, the plugin will attempt to swap the item into that slot (via the /exchange
command) and replace the original item when casting is complete.
The example INI file below contains examples of the types of usage.
----------------------------
Examples:
/twist 1
Sing gem 1 forever
/twist 1 2 3
Twist gems 1,2, and 3 forever
/twist 1 2 3 10
Twist gems 1,2,3, and clicky 10, forever
/twist hold 4 or /sing 4
Sing gem 4 until another singing-related /twist command is given
----------------------------
MQ2Data Variables:
bool Twist Currently Twisting: true/false, if NULL plugin is not loaded
Members:
bool Twisting Currently twisting: true/false.
int Current Returns the curent gem number being sung, -1 for item, or 0 if not twisting
int Next Returns the next gem number to be sung, -1 for item, or 0 if not twistsing
string List Returns the twist sequence in a format suitable for /twist
----------------------------
The ini file has the format:
[MQ2Twist]
Delay=32 Delay between twists. Lag & System dependant.
Adjust=1 This defines how many ticks before the 'normal' recast time to cast a long song.
Long songs are defined as songs greater than 3 ticks in length. If set to 1 tick,
and a song lasts 10 ticks, the song will be recast at the 8 tick mark, instead of
at the 9 tick mark as it normally would.
[Click_10] thru [Click_19]
CastTime=30 Casting Time, -1 to use the normal song delay
ReCastTime=0 How often to recast, 0 to twist normally.
Name="Fife of Battle" Item name for /itemnotify
Slot=neck Slot name for /itemnotify
Delay, CastTime and ReCastTime are specified in 10ths of a
second, so 10 = 1 second, and so on.
INI File Example:
[MQ2Twist]
Delay=31
Quiet=0
;Shadowsong cloak
[Click_10]
CastTime=30
ReCastTime=350
Name=Shadowsong Cloak
Slot=DISABLED
;girdle of living thorns (current belt will be swapped out)
[Click_11]
CastTime=0
ReCastTime=11600
Name=Girdle of Living Thorns
Slot=waist
;nature's melody
[Click_12]
CastTime=-1
ReCastTime=135
Name=DISABLED
Slot=mainhand
;lute of the flowing waters
[Click_13]
CastTime=0
ReCastTime=0
Name=Lute of the Flowing Waters
Slot=DISABLED
[Click_14] ... [Click_19]
CastTime=33
ReCastTime=0
Name=DISABLED
Slot=DISABLED
----------------------------