Berserker Mac - Modified stick.mac with range upgrade

A forum for you to dump all the macros you create, allowing users to use, modify, and comment on your work.

Moderator: MacroQuest Developers

apollo5145
orc pawn
orc pawn
Posts: 26
Joined: Wed Feb 25, 2004 8:14 pm

Berserker Mac - Modified stick.mac with range upgrade

Post by apollo5145 » Mon Mar 29, 2004 4:46 pm

I just modified the stick.mac a little. The only real change is the option to change your melee range while engaged. I didn't see any option for that, so I added it in. Just do /dist or /distance and the range you'd like to be away from the mob you're killing. It will update it in the INI too. It also auto detects giants/dragons and sets a higher melee range. I'm sure this could be improved on vastly, but I figured I'd post it up and let people see what I did anyway. It also does not conform to the new standard. I did this mac a few days ago and haven't gotten around to changing over to the new format yet.

Code: Select all

#turbo 
#define NPCini "stick-NPC.ini" 
#define PCini "stick-PC.ini 
|#include spellcast.inc 
|===========| 
| 02.14.04a | 
|___________| 
|           | 
| stick.mac | 
|  by m0nk  | 
|___________| 
| 
| -Syntax = /mac stick "NinjaLoot (0 or 1)" "MeleeAbility_1" "MeleeAbility_2" "MeleeAbility_3" 
| example = /mac stick 0 "bash" (will not loot and only bash) 
| example = /mac stick 1 "bash" (will not loot and only bash) 
| example = /mac stick 1 "Flying Kick" "Disarm" (will loot, Flying Kick ,disarm) 
| example = /mac stick (will do what the defaults are set to in the :editDefaults section) 
| 
#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 TauntThisRound "to ignore others and attack you!" 
#event ToggleTaunt "[MQ2] tt" 

Sub main 
   :setupDeclare 
      /zapvars 
      /declare MA_1 global 
      /declare MA_2 global 
      /declare MA_3 global 
      /declare MA_SB global 
      /declare TauntToggle global 
      /declare MA_Timer_SB global 
      /declare MobID global 
      /declare NinjaLewt global 
      /declare MeleeDistance global 
      /declare ChangeDistance global
      /declare Time_MA_SB timer 
      /alias /distance /varset ChangeDistance
      /alias /dist /varset ChangeDistance

   :setupVarset 
      /varset MA_1 "@Param1" 
      /varset MA_2 "@Param2" 
      /varset MA_3 "@Param3" 
      /varset MA_SB "NULL" 
      /varset NinjaLewt @Param0 
      /varset TauntToggle NULL 

   :editDefaults 
      /varset MA_Timer_SB 60 
      /if $defined(Param0)!=TRUE /varset NinjaLewt 0 

      /if $defined(Param1)!=TRUE /varset MA_1 "Frenzy" 
      /if $defined(Param2)!=TRUE /varset MA_2 "NULL" 
      /if $defined(Param3)!=TRUE /varset MA_3 "NULL" 

   :setupCheck 
      /if ("@MA_1"=="bash" || "@MA_1"=="slam") { 
         /echo Auto @MA_1 every @MA_Timer_SB. 
         /varset MA_SB "@MA_1" 
         /varset MA_1 "NULL" 
         } 
      /if ("@MA_2"=="bash" || "@MA_2"=="slam") { 
         /echo Auto @MA_2 every @MA_Timer_SB 
         /varset MA_SB "@MA_2" 
         /varset MA_2 "NULL" 
         } 
      /if ("@MA_3"=="bash" || "@MA_3"=="slam") { 
         /echo Auto @MA_3 every @MA_Timer_SB 
         /varset MA_SB "@MA_1" 
         /varset MA_3 "NULL" 
         } 

   :start 
      /if "@MA_1"!="NULL" /echo Auto @MA_1 when availiable. 
      /if "@MA_2"!="NULL" /echo Auto @MA_2 when availiable. 
      /if "@MA_3"!="NULL" /echo Auto @MA_3 when availiable. 
      /if n @NinjaLewt==1 /echo Auto Ninja Loot 
      /echo @TauntToggle 
   :mainloop 
      /if $combat==TRUE /call Attack 
      /doevents 
   /goto :mainloop 
/endmacro 

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 
      /if n $char(pet)!=0 /pet attack 
      /varset MeleeDistance $ini("NPCini","$zone","$target(name,clean).DistanceMelee") 
      /if "@MeleeDistance"=="NOTFOUND" { 
        /if n $target(race)=="Black and White Dragons"  /echo Target is a dragon, Meleeing at max distance.
	/if n $target(race)=="Dragon" {
	         /echo Target is a dragon, Meleeing at max distance.
	         /ini "NPCini" "$zone" "$target(name,clean).DistanceMelee" 45
	 }
	 /if n $target(race)=="Giant" {
	         /echo Target is a giant, Meleeing at max distance.
	         /ini "NPCini" "$zone" "$target(name,clean).DistanceMelee" 45
	 }
         /if n $target(race)!="Dragon" {
		 /echo Normal Sized mob, edit range if it's bad.
		 /ini "NPCini" "$zone" "$target(name,clean).DistanceMelee" 17 
  	 }
    /delay 0 
    /varset MeleeDistance $ini("NPCini","$zone","$target(name,clean).DistanceMelee") 
    } 
    /varset ChangeDistance @MeleeDistance 

   :attackMeleeLoop 
      /doevents exp 
      /doevents RageOn 
      /doevents MobGate 
      /doevents StunON 
      /doevents ToggleTaunt 
      /doevents TauntThisRound 
      /keypress hot1
      /if @MeleeDistance=="NULL" /echo MeleeDistance NULL
      /if "@ChangeDistance"!="@MeleeDistance" {
	/varset MeleeDistance @ChangeDistance
        /echo Changed Melee Distance to @ChangeDistance
        /ini "NPCini" "$zone" "$target(name,clean).DistanceMelee" @MeleeDistance
      }	
      /if $char(class)=="Berserker" /doability disarm
      /if n $target(id)!=@MobID /goto :attackend 
      /if $return==EndATK /goto :attackEnd 
      /if $combat!=TRUE /goto :attackend 
      /if $char(casting)!=TRUE /if n $char(feetwet)!=0 /face fast 
      /if $char(casting)!=TRUE /if n $char(feetwet)==0 /face fast nolook 
      /if n $target(id)==@MobID /if $char(casting)!=TRUE /if n $target(distance)>@MeleeDistance /sendkey down up 
      /if n $target(id)==@MobID /if $char(casting)!=TRUE /if n $target(distance)<=@MeleeDistance /sendkey up up 
      /if n $target(id)==@MobID /if $char(casting)!=TRUE /if n $target(distance)<=$calc(@MeleeDistance-5) /press down 
         /if "@MA_SB"!="No" /if n "@Time_MA_SB"=="0" /if $char(casting)!=TRUE /if n $target(distance)<=@MeleeDistance { 
          /varset Time_MA_SB @MA_Timer_SB 
         } 
      /if "$char(class)"=="Shadow Knight" /if $target(id)==@MobID /if $char(casting)!=TRUE /if n $target(distance)<=@MeleeDistance /goto :attackSpellsSK 
   /goto :attackMeleeLoop 

   :attackSpellsSK 
      /if n $char(gem,"Zevfeer's Bite")>0 /if n $char(mana,pct)>20 /if n $target(hp,pct)<90 /call cast "Zevfeer's Bite" 
      /if n $char(gem,"Aura of Hate")>0 /if n $char(mana,pct)>20 /if n $target(hp,pct)<90 /call cast "Aura of Hate" 
      /if n $char(gem,"Spear of Decay")>0 /if n $char(mana,pct)>50 /if n $target(hp,pct)<90 /call cast "Spear of Decay" 
      /if n $char(gem,"Spear of Plague")>0 /if n $char(mana,pct)>50 /if n $target(hp,pct)<90 /call cast "Spear of Plague" 
   /goto :attackMeleeLoop 

   :attackend 
      /if n @NinjaLewt!=0 /doevents exp 
      /varset MobID NULL 
      /if @TauntToggle!=NULL /varset TauntToggle NULL 
      /attack off 
      /pet backoff 
      /pet hold 
      /sendkey up up 
/return 

Sub ClearReturn 
/return NULL 

Sub event_TauntThisRound 
   /if "@TauntToggle"!="Yes" { 
      /echo Taunting this round against %t 
      /varset TauntToggle Yes 
      } 
/return 

Sub event_exp 
   /if n $target(hp,pct)>0 /return 
   /if n @NinjaLewt==0 /return EndATK 
   /if $target(type)!=CORPSE /target id @MobID 
   /loot 
   /sendkey up up 
   /loot 
   /loot 
   /loot 
/return EndATK 

Sub event_RageOn 
   /if n $target(hp,pct)>15 /return 
   /if n $target(hp,pct)==0 /return 
   /if $target(id)==@MobID /if $char(casting)!=TRUE /sendkey up up 
   /call ClearReturn 
   /echo Rage On 
   /attack off 
   /pet back off 
   /pet hold 
   /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 

Sub event_ToggleTaunt 
      /if "@MA_1"=="taunt" { 
         /varset MA_1 "NULL" 
         /echo Will no longer taunt. 
         /return 
         } 
      /if "@MA_2"=="taunt" { 
         /varset MA_2 "NULL" 
         /echo Will no longer taunt. 
         /return 
         } 
      /if "@MA_3"=="taunt" { 
         /varset MA_3 "NULL" 
         /echo Will no longer taunt. 
         /return 
         } 
      /if "@MA_1"=="NULL" { 
         /varset MA_1 "taunt" 
         /echo Auto @MA_1 when availiable. 
         /return 
         } 
      /if "@MA_2"=="NULL" { 
         /varset MA_2 "taunt" 
         /echo Auto @MA_2 when availiable. 
         /return 
         } 
      /if "@MA_3"=="NULL" { 
         /varset MA_3 "taunt" 
         /echo Auto @MA_3 when availiable. 
         /return 
         } 
/return 

kkmonte
orc pawn
orc pawn
Posts: 23
Joined: Sat Dec 14, 2002 2:52 pm

Post by kkmonte » Mon Mar 29, 2004 5:03 pm

Once you run it do you manually have to target and click mobs to attack? or do you send a tell or gruop say saying attack???