Moderator: MacroQuest Developers
Code: Select all
DWORD parmCombat(PCHAR szVar, PCHAR szOutput, PSPAWNINFO pChar)
{
DWORD i=0;
// $combat
if (!EQADDR_ATTACK) return PMP_ERROR_BADPARM;
BYTE bAttack = *EQADDR_ATTACK;
i+=5;
if (bAttack == 0) {
strcat(szOutput,"TRUE");
} else {
strcat(szOutput,"FALSE");
}
return i;
}Code: Select all
| - twist.mac -
|
| Modified from Colonel's Macro
|
| Modified to current form 12/11/2003
|
| Combat Twist Order ------------+
| NonCombat Twist Order -----+ |
| | |
| Usage: v v
| /macro twist.mac ### ###
| # represents the spell gem number you'd like to sing
|
| Example:
| /macro twist.mac 4567 123456
|
#turbo 30
| INIFILENAME is the name of the INI file that has the song shortbuff information
#define INIFILENAME songinfo.ini
Sub Main(Param0)
/if $defined(Param0)==FALSE /endmacro
|
| Variable Declarations
|
/declare CombatCurSong global
/declare NonCombatCurSong global
/declare NNonCombatSongs global
/declare NCombatSongs global
/declare NonCombatSongList global
/declare CombatSongList global
/declare TwistI global
/declare TwistJ global
/declare DynamicBuffer global
/declare NonCombatSongArray array
/declare CombatSongArray array
/declare ArrSong array
|
| Timer Declarations
|
/declare SingTime timer
/varset CombatCurSong 1
/varset NonCombatCurSong 1
/varset NNonCombatSongs $strlen(@Param0)
/varset NCombatSongs $strlen(@Param1)
/varset NonCombatSongList @Param0
/varset CombatSongList @Param1
/varset DynamicBuffer 5
/for TwistI 1 to @NNonCombatSongs
/varcalc TwistJ $int(@TwistI-1)
/varset NonCombatSongArray(@TwistI) $mid(@TwistJ,1,@NonCombatSongList)
/next TwistI
/for TwistI 1 to @NCombatSongs
/varcalc TwistJ $int(@TwistI-1)
/varset CombatSongArray(@TwistI) $mid(@TwistJ,1,@CombatSongList)
/next TwistI
/call INICompare
:Loop
/if "$char(state)"!="SIT" {
/if "$combat"=="TRUE" /call CombatSing @CombatSongArray(@CombatCurSong)
/if "$combat"!="TRUE" /call NonCombatSing @NonCombatSongArray(@NonCombatCurSong)
}
/if $char(state)=="DUCK" /press d
/if $char(state)=="SIT" /stand
/goto :Loop
/return
Sub CombatSing
/declare Buffer local
:CombatSing1
/varset SingTime 3s
/varset Buffer 0
| /echo Song: @Param0 Type: @ArrSong(@Param0)
/cast @Param0
:CombatSing2
/delay 1
/if "$char(casting)"=="TRUE" /goto :CombatSing2
/if n @SingTime>0 /goto :CombatSing1
/if n @ArrSong(@Param0)!=1 {
/delay @DynamicBuffer
/stopsong
} else {
:CombatSing3
/varadd Buffer 1
/delay 1
/if n @Buffer>8 {
/stopsong
/goto :CombatSing1
}
/if n $char(song,$char(song,"$char(gem,@Param0)"),duration)<2 /goto :CombatSing3
/varset DynamicBuffer @Buffer
/stopsong
}
| /echo Dynamic Buffer: @DynamicBuffer
/varadd CombatCurSong 1
/if n @CombatCurSong>@NCombatSongs /varset CombatCurSong 1
/return
Sub NonCombatSing
/declare Buffer local
:NonCombatSing1
/varset SingTime 3s
/varset Buffer 0
| /echo Song: @Param0 Type: @ArrSong(@Param0)
/cast @Param0
:NonCombatSing2
/delay 1
/if "$char(casting)"=="TRUE" /goto :NonCombatSing2
/if n @SingTime>0 /goto :NonCombatSing1
/if n @ArrSong(@Param0)!=1 {
/delay @DynamicBuffer
/stopsong
} else {
:NonCombatSing3
/varadd Buffer 1
/delay 1
/if n @Buffer>8 {
/stopsong
/goto :NonCombatSing1
}
/if n $char(song,$char(song,"$char(gem,@Param0)"),duration)<2 /goto :NonCombatSing3
/varset DynamicBuffer @Buffer
/stopsong
}
| /echo Dynamic Buffer: @DynamicBuffer
/varadd NonCombatCurSong 1
/if n @NonCombatCurSong>@NNonCombatSongs /varset NonCombatCurSong 1
/return
Sub INICompare
/declare A local
/for A 1 to 8
/varset ArrSong(@A) "$ini(INIFILENAME,"Songs",$Spell("$char(gem,@A)",id))"
/if n @ArrSong(@A)<0 /if n @ArrSong(@A)>2 /varset ArrSong(@A) 0
/next A
/return
Code: Select all
[Songs]
718=0
727=1
2603=1
1196=1
1197=0
706=0
1748=0
701=1
3682=0
3681=0
2606=1
704=0
1747=0
3371=0
4112=1
1759=1
1448=1
1287=1
723=1
745=1
1761=0
700=1
703=0
3372=1
2609=1
708=1
1452=1
741=0
1764=0
742=0
730=0
736=0
1100=0
3369=0
3030=0
3364=0
2607=1
710=1
2936=0
4085=1
4086=1
4087=1
707=0
4210=0
709=1
3375=0
7=1
722=1
1762=1
749=1
734=1
2604=1
1749=0
724=0
728=1
1751=0
705=0
3376=0
737=1
720=1
721=1
735=1
2601=1
702=1
1760=1
739=1
1449=1
3365=0
1752=1
1763=1
748=1
1451=0
713=1
714=1
716=1
3368=1
715=1
712=1
2608=1
711=1
3066=0
3362=1
4083=1
4084=1
3366=0
717=0
2605=2
1758=0
746=0
738=0
4395=0
1750=0
719=0
1450=1
3361=0
868=0
750=0
1765=1
725=0
1754=0
1755=0
1756=0
2602=1
1753=0
726=0
729=0
3567=0
3367=0
743=0
744=0
3373=0
3566=0
3363=0
3370=0
747=1
1757=1
740=1
2610=1
3374=1
3651=1