i didnt get alot of comments on v1, mostly because the stickmob code was bugged to hell do to my dawldling w the origonal code. I dindt test the code before i posted it and abandoned the public project. I hope this one works out better for you all.
and now to your regulary sceduled program:
yes yes
i know what your gona think, yet another twist macro. there are alot of twist macros out there. Alot of them are good. but they all leave out one or two important things. above all the most important thing is the ability to cast downtime and combat twists. next important,...support for twists ques longer than 4 songs. next stickmob support. next enrage support. i've seen alot of macros out there but none of them have all of the above features. i've seen some combos incuding boastfull bellow. i chose not to include it because the stun portion doesnt work on the mobs i hunt and the dmg output of the skilll is trival. im sure in pvp the stun might be of some value though. when i get some more time ill incude it in.
this is my first script. i dont take credit for it. i just spliced two scripts together and tried to debugg it best i could. please make comments and corrections.
FEATURES
edit stick*.ini's for rampage raid mobs, no need to make these files they will be created automaticaly the firs time.
-group follows when invited
-turns off attack when enraged
-turns off attack when attack turned on with mob more than 150 meters away
-turns off attack when mob gates
-turns off attack when you switch to another target
-turns off attack when you target a player
-human like /face so your feet twist instead of turret like traversing
-turns off attack when mob dies
-combat and non combat twists
future additions/need help/more time, with
-adding xp report -will figure out this soon, just needs testing
-adding toggleable assist - need help, badly
-adding togglable move behind code- should figure this out within the next 2 weeks. move behind code loops on itsself and doesnt give the stick to the other parts, specifily twisting work.
-putting in BB aa skill now that stun will work on higher lvl mobs - soon
Code: Select all
#turbo
#define NPCini "stick-NPC.ini" | file autocreated edit for enrage npcs
#define PCini "stick-PC.ini | file autocreated edit for enrage npcs
#include turn.inc
| Twist4.mac Flexible bard song twister using timers by BrainDozer,
| combat code, and funtionality by m0nk
| Updated by Drax, rzmonk76
|
| Syntax: /macro Twist2.mac [block 1] [block 2]
|
| Parameter block 1 indicates non-combat songs
| Parameter block 2 indicates combat songs
|
| Choose any combination of songs in any sequance to twist for each mode.
|
| Example: /macro Twist2.mac 256 1234234
|
| This would repeat songs 2, 5 and 6 durring non-combat and songs 1, 2, 3
| and 4 in the above sequence while in combat. In this instance, song 1
| is only twisted 1 for 7, which comes in handy for long duration songs
| like amplification.
|
| Other Examples: /macro Twist2.mac 0 123 | Twists on attack only
| /macro Twist2.mac 12345 0 | non-attack twisting only
| /macro Twist2.mac 12345 | same as above
| /macro Twist2.mac 9804 11 | twists 84 and 1
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#event EXP "experience!!"
#event RageON "has become ENRAGED."
#event RageOFF "is no longer enraged"
#event MobGate " Gates."
#event Invited "To join the group, click on the 'FOLLOW' option, or 'DISBAND' to cancel"
#event StunON "You are stunned"
#event StunOFF "You are unstunned"
#event MissedNote "You miss a note, bringing your song to a close!"
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sub main
:setupDeclare
/zapvars
/declare MobID global
/declare MeleeDistance global
/declare CSong global | keeps track of current song number 1-max
/declare CSongf global | break and play song toggle (break=0 play=1)
/declare attack global | debug: @combat glitch work-around
/declare CSongt timer | break and play song timer
/declare attackct timer | debug: @combat glitch work-around check timer
/declare v90 global
/declare v91 global
/declare l0 global
/declare l1 global
/declare l2 global
/declare l3 global
/declare a array2
/declare MeleeDistance global
/declare MobID global
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
/stopsong
/call initVars @Param0 @Param1
:Mainloop
/if $combat==TRUE /call attack
/if @attackct==0 /if $combat==TRUE /if @attack==0 /call AttackOn
/if @attackct==0 /if $combat==FALSE /if @attack==1 /call AttackOff
/if @v9@attack!=-1 /if $char(state)==STAND /call TwistSong @attack
/if @attackct==0 /varset attackct 10
/doevents
/goto :Mainloop
/endmacro
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sub TwistSong
/if @CSong>@v9@Param0 /varset CSong 0 | Restart twist when end of list
/if (@CSongf==0 && @CSongt==0) /call TS2 @Param0 | Start next song in list
/if (@CSongf==1 && @CSongt==0) /call TS3 | Stop song and advance index
/return | Debug: conditionals wern't playing nice with brackets
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sub TS2
/cast @a(@Param0,@CSong)
/varset CSongf 1
/varset CSongt 32 | adjustable play delay
/return
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sub TS3
/stopsong
/varset CSong $int($calc(@CSong+1)) | Debug: Force integer
/varset CSongf 0
/varset CSongt 1 | adjustable break delay
/return
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sub initVars
/if @Param1=="" /varset Param1 "0"
/varset v90 0 | v90,v91 max song index lengths
/varset v91 0 | l0 combat mode index
/for l0 0 to 1 | l1 parameter index
/for l1 0 to $int($calc($strlen(@Param@l0)-1)) | l2 hold
/varset l2 $mid(@l1,1,@Param@l0)
/varset l3 @v9@l0 | Debug: array didn't like the fancy stuff
/if (@l2>=1 && @l2<=8) /varset a(@l0,@l3) @l2 | Debug: Bracket trouble
/if (@l2>=1 && @l2<=8) /varset v9@l0 $int($calc(@v9@l0+1))
/next l1 | Debug: it thinks it's a float-forcing
/next l0
/varset v90 $int($calc(@v90-1)) | over increment fix
/varset v91 $int($calc(@v91-1)) |
/varset CSong 0
/varset CSongt 0
/varset CSongf 0
/if $combat==TRUE /varset attack 1 | debug: inital combat values
/if $combat==FALSE /varset attack 0 |
/return
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sub AttackOn
/stopsong
/varset attack 1
/varset CSong 0 | reset sequence
/varset CSongt 0 | attack mode twist start delay
/varset CSongf 0 | force play mode
/return
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sub AttackOff
/stopsong
/varset attack 0
/varset CSong 0 | reset sequence
/varset CSongt 0 | attack off mode twist start delay
/varset CSongf 0 | force play mode
/return
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sub Event_MissedNote
/varset CSongt 0 | missed note try again delay
/varset CSongf 0 | switch back to play mode
/return
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sub attack
:attackCheck
/varset MobID $target(id)
:attackSetup
/if $target(type)!=NPC {
/attack off
/delay 5
/return
}
/if n $target(distance)>150 {
/attack off
/delay 5
/return
}
:attackPreFight
/call ClearReturn
/varset MeleeDistance $ini("NPCini","$zone","$target(name,clean).DistanceMelee")
/if "@MeleeDistance"=="NOTFOUND" {
/ini "NPCini" "$zone" "$target(name,clean).DistanceMelee" 15
/delay 0
/varset MeleeDistance $ini("NPCini","$zone","$target(name,clean).DistanceMelee")
}
:attackMeleeLoop
/doevents exp
/doevents RageOn
/doevents MobGate
/doevents StunON
/doevents ToggleTaunt
/if n $target(id)!=@MobID /goto :attackend
/if $return==EndATK /goto :attackEnd
/if $combat!=TRUE /goto :attackend
/call turn
/if n $target(distance)>@MeleeDistance /sendkey down up
/if n $target(distance)<=@MeleeDistance /sendkey up up
/if n $target(id)==@MobID /if n $target(distance)<=$calc(@MeleeDistance-5) /press down
/return
:attackend
/doevents exp
/varset MobID NULL
/sendkey up up
/return
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sub ClearReturn
/return NULL
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sub event_exp
/if n $target(hp,pct)>0 /return
/return EndATK
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sub event_RageOn
/if n $target(hp,pct)>15 /return
/if n $target(hp,pct)==0 /return
/if $target(id)==@MobID /sendkey up up
/call ClearReturn
/echo Rage On
/attack off
/call ClearReturn
:waitRage
/doevents
/if $target(id)!=@MobID /return EndATK
/if $return==EndATK /return EndATK
/if $return==RageOFF /return
/goto :waitRage
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sub event_RageOFF
/echo Rage OFF
/attack on
/return RageOFF
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sub event_MobGate
/echo MOB GATED!
/attack off
/return EndATK
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sub event_Invited
/invite
/return
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sub event_StunON
/doevents flush StunOFF
/call ClearReturn
:LoopStunOFF
/doevents StunOFF
/if "$return"=="StunOFF" {
/call ClearReturn
/return
}
/goto :LoopStunOFF
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sub event_StunOFF
/return StunOFF
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Code: Select all
| Turn.inc - Created by GD
|
| Usage: #Include it into your current macro, then call it as follows:
|
| To turn towards Target: /call Turn
| To turn towards Location: /call LocY LocX
| IE: /call Turn -460 500
#turbo
Sub Turn(THeadingY,THeadingX)
/declare PHeading local
/declare THeading local
/declare Bearing local
/declare TurnKey local
/declare IsTurning local
:TurnLoop
/sendkey up up
/delay 0
/if $char(state)=="SIT" /sit off
/varset PHeading $int($char(heading))
/if "$defined(THeadingX)"=="TRUE" {
/varset THeading $int($heading(@THeadingY,@THeadingX))
} else {
/varset THeading $int($target(headingto))
}
/varset Bearing $int($calc($calc(@PHeading-@THeading+540)%360-180))
/if (n @Bearing>=-7 && n @Bearing<=7) {
/if "@TurnKey"!="" /sendkey up @TurnKey
/face heading @THeading nolook
/return
} else /if (n @Bearing>=-180 && n @Bearing>=7) {
/if "@TurnKey"!="RIGHT" /varset TurnKey RIGHT
} else /if (n @Bearing<=180 && n @Bearing<=7) {
/if "@TurnKey"!="LEFT" /varset TurnKey LEFT
}
/if n @IsTurning!=1 {
/sendkey down @TurnKey
/varset IsTurning 1
}
/goto :TurnLoop
/return 

