After testing for some time the bard kitting macros available on the site, I decided to write my own.
It's far from complete, I have lots of improvement ideas, but I already provide this tested version to you guys.
Portions of code were copied / inspired by others bard kitting macros from Siddin.
Your comments are welcome.
It's far from complete, I have lots of improvement ideas, but I already provide this tested version to you guys.
Portions of code were copied / inspired by others bard kitting macros from Siddin.
Your comments are welcome.
Rich (BB code):
| === Bard Kitting Macro ===
|
| Version: 0.5
| Date: 10 June 2005
|
| Based on different versions of the Bard Kitting macros from Siddin posted on www.Redguides.com
|
| Usage: /macro bardkite.mac
|
| Plugins Requirements:
| - MQ2MoveUtils
| - MQ2DoCrack (not mandatory)
|
| Macros libraries Requirements:
| - move.inc
| - gen_routines.inc
|
| Description:
| ------------
| This bard kitting macro do the following:
| - When bard health go below 95%, twist heal song
| - When mob health go below 25%, twist snare song
| - Loots corpses if no mob in a radius of 50
| - If selo wears off, re-sing it immediately
| - When starting the macro, will memorize the location and circle around the loc.
| After looting, the bard will go back and circle the same loc
| - If a druid or wiz is available, it can be used for emergency evac.
| Just make a short macro with:
| #Event evac "#1# tells you#*#EVAC#*#
|
| sub Event_evac(String Line, String MyBard)
| /target ${MyBard}
| /notify GroupWindow GW_FollowButton leftmouseup
| | Cast Evac on Gem 8
| /cast 8
| /return
|
|
| Changes:
| - 0.1: Initial version
| - 0.2: Added heal
| - 0.3: Added player check
| - 0.4: Added evac if some bot can evac
| - 0.5: Added looting any corpse nearby
|
#include gen_routines.inc
#include move.inc
#turbo
#event zoned "#*#You have entered#*#"
#Event exp "#*#You gain#*#experience#*#"
#Event tell "#1# tells you#*#"
Sub Main
/call GeneralDeclares
/call DeclareIniVar healsong int Settings 1
/call DeclareIniVar snaresong int Settings 7
/call DeclareIniVar selosong int Settings 8
/call DeclareIniVar evacBot string Settings MyDruidBot
/call DeclareIniVar snarepct int Settings 25
/call DeclareIniVar health int Settings 95
/call DeclareIniVar lowLifePct int Settings 25
/call DeclareIniVar evacOnLowLife int Settings 0
/call DeclareIniVar safetyRadius int Settings 50
/call DeclareIniVar lootRadius int Settings 200
/call DeclareIniVar circleRadius int Settings 35
/declare xcoords float outer ${Me.X}
/declare ycoords float outer ${Me.Y}
/echo Start pos: ${xcoords}, ${ycoords}
| ------------------------------------------------
| EDIT THE FOLLOWING LINES WITH NORMAL TWIST SONGS
/declare song1 int outer 8
/declare song2 int outer 5
/declare song3 int outer 4
/declare song4 int outer 8
/declare song5 int outer 6
/declare song6 int outer 3
| END OF USER MODIFICATION
| ------------------------------------------------
/declare c_song1 int outer ${song1}
/declare c_song2 int outer ${song2}
/declare c_song3 int outer ${song3}
/declare c_song4 int outer ${song4}
/declare c_song5 int outer ${song5}
/declare c_song6 int outer ${song6}
/declare healflag int outer 0
/declare snareflag int outer 0
/call init
/call normaltwist
/circle on ${circleRadius} ${ycoords} ${xcoords}
/docrack NoStun on
/keypress Num_Lock
:loopstart
/doevents
/call GMcheck
/call playercheck
/call checkhealsong
/call checkselosong
/call checksnaresong
/if (${Target.Level}>${Math.Calc[${Me.Level} + 1]}) /tar npc next
/if (${Target.Distance}>220) /keypress esc
/if (${Target.ID}==FALSE) /tar NPC radius 220
/delay 10
/goto :loopstart
/return
Sub GMcheck
/if (${Spawn[gm].ID}) {
/mqlog GM entered the zone!
/mqlog For safety reasons ending the macro
/echo GM entered the zone!
/echo For safety reasons ending the macro
/endmac
/keypress instant_camp
}
/return
Sub checkhealsong
/if (${Me.PctHPs}<25) {
/call emergency_evac
}
/if (${healflag}==0) /if (${Me.PctHPs}<${health}) {
/varset healflag 1
/varset c_song2 ${healsong}
/squelch /twist ${c_song1} ${c_song2} ${c_song3} ${c_song4} ${c_song5} ${c_song6}
/delay 25
/echo Enabling heal
}
/if (${healflag}==1) /if (${Me.PctHPs}>=${health}) {
/varset healflag 0
/varset c_song2 ${song2}
/squelch /twist ${c_song1} ${c_song2} ${c_song3} ${c_song4} ${c_song5} ${c_song6}
/delay 25
/echo Disabling heal
}
/return
sub checkselosong
/if (${Me.Buff[${Me.Gem[${selosong}].Name}].Duration}==NULL) {
/stopsong
/squelch /twist ${c_song1} ${c_song2} ${c_song3} ${c_song4} ${c_song5} ${c_song6}
/echo Selos is dead - refreshing
/delay 25
}
/return
sub checksnaresong
/if (${Target.PctHPs}<=${snarepct}) /if (${snareflag}==0) {
/varset snareflag 1
/varset c_song3 ${snaresong}
/varset c_song6 ${snaresong}
/squelch /twist ${c_song1} ${c_song2} ${c_song3} ${c_song4} ${c_song5} ${c_song6}
/echo enabling snare
/delay 25
}
/if (${Target.PctHPs}>${snarepct}) /if (${snareflag}==1) {
/varset snareflag 0
/varset c_song3 ${song3}
/varset c_song6 ${song6}
/squelch /twist ${c_song1} ${c_song2} ${c_song3} ${c_song4} ${c_song5} ${c_song6}
/echo disabling snare
/delay 25
}
/return
sub normaltwist
/varset healflag 0
/varset snareflag 0
/twist ${song1} ${song2} ${song3} ${song4} ${song5} ${song6}
/return
Sub playercheck
/if (${Spawn[pc noalert 2 radius 500].ID}) {
/mqlog Player nearby: ${Spawn[pc noalert 2 radius 500].Name}
/echo Player nearby: ${Spawn[pc noalert 2 radius 500].Name}
/call emergency_evac
}
/return
Sub init
/alert clear 2
/alert add 2 pc ${Me.Name}
| Insert here the player than will not trigger the alert
/alert add 2 pc Siddin
/alert add 2 pc RedBot
/return
Sub emergency_evac
/echo Entering emergency evac
/circle off
/twist ${selosong} ${healsong}
/target ${evacBot}
/echo Target is: ${Target.ID}
/if (${Target.ID}) {
/call MoveToSpawn ${Target.ID} 40
/notify GroupWindow GW_InviteButton leftmouseup
/tell ${evacBot} "EVAC"
}
/if (!${Target.ID}) {
/echo nobody to help, camping
/keypress forward
/keypress back
/camp desktop
/q
/endmacro
}
/return
sub event_zoned
/mqlog Zoning
/delay 5s
/sit
/camp desktop
/endmacro
/return
Sub Event_tell(String chatText)
/mqlog ${chatText}
/return
|-----------------------------------------------------------------------------
| Loot part
|-----------------------------------------------------------------------------
| add check when inventory full
| add check with item value
| refresh sow potion
Sub Event_exp
/twist ${selosong}
/squelch /target npc radius ${safetyRadius}
/keypress forward
/keypress back
| Check first if there are some mobs in the neighbourhood to prevent looting
/if (${Target.ID}) {
/mqlog Not safe for looting
/echo Not safe for looting
/goto :endxp
/return
}
| No mobs nearby, move to the corpse
/echo No mobs nearby, move to the corpse
/circle off
/keypress forward
/keypress back
:movetocorpse
/squelch /target clear
/squelch /target npc radius ${safetyRadius}
/if (${Target.ID}) {
/echo Not safe for looting
/goto :endxp
}
/squelch /target npc corpse radius 200
/squelch /face nolook
/if (!${Target.ID}) /goto :endxp
/if (${Target.ID}) {
/call MoveTowardsTarget
}
/if (${Target.Distance}>11) {
/goto :movetocorpse
}
/call LootMob
| Look for other corpses
/goto :movetocorpse
:endxp
/echo starting to run again at ${circleRadius} ${ycoords} ${xcoords}
/circle on ${circleRadius} ${ycoords} ${xcoords}
/delay 5
/keypress Num_Lock
/return
Sub LootMob
/declare LootChance int inner 0
/declare LootSlot int inner 0
/declare LootCheck int inner 0
/declare LootTotal int inner 0
/loot
/delay 1s
/if (!${Corpse.Items}) {
/echo NO LOOT! Cheap Bastard!
/call DestroyCoppers
/return
}
/varset LootTotal ${Corpse.Items}
/for LootSlot 1 to ${LootTotal}
/itemnotify loot${LootSlot} leftmouseup
/delay 5
/if ( ${Window[ConfirmationDialogBox].Open} ) {
/notify ConfirmationDialogBox Yes_Button leftmouseup
}
/autoinventory
/delay 5
/next LootSlot
/call DestroyCoppers
/return
Sub MoveTowardsTarget
/if (${Target.Distance}>11) {
/keypress forward hold
}
/if (${Target.Distance}<=11 && ${Target.Distance}>8) {
/keypress forward
}
/if (${Target.Distance}<8) {
/keypress back
}
/return
Sub DestroyCoppers
/shift /notify InventoryWindow IW_Money1 leftmouseup
/destroy
/shift /notify InventoryWindow IW_Money2 leftmouseup
/destroy
/shift /notify InventoryWindow IW_Money3 leftmouseup
/destroy
/notify LootWnd DoneButton leftmouseup
/cleanup
/return
|-----------------------------------------------------------------------------
| End of Loot part
|-----------------------------------------------------------------------------
Last edited:

