Universal Invisibility

A forum for macro code snippets to be used in writing other macros. Post routines or .inc files here only, completed macros go to the Macro Depot. MQ2Data format only!

Moderator: MacroQuest Developers

Shadows91
a lesser mummy
a lesser mummy
Posts: 31
Joined: Mon Feb 09, 2009 11:21 pm

Universal Invisibility

Post by Shadows91 » Wed Apr 01, 2009 6:39 pm

Required Plugins:
- MQ2Cast
- MQ2Bandolier
- MQ2MoveUtils

Usage:
- Enter this alias command once: /alias /invis /docommand ${If[${EQBC.Connected},/bc,/echo]} -= Invisibility Up (${Zone.ID})
- Use /invis after inputing that

In the events section add:

Code: Select all

#event Invis				"#*#Invisibility Up (#1#)#*#"
At the bottom add:


Code: Select all

| -=-=-=-=-=-=-=-=-=-=-=-=-
| -=     Invis   Event   =-
| -=-=-=-=-=-=-=-=-=-=-=-=-
| * Attempts to cast Invisibility
| * Priority: Hide+Sneak > AA invis > Spell Invis > Item Invis
| -=-=-=-=-=-=-=-=-=-=-=-=-
Sub Event_Invis(sender,zoneID)
	/If (${zoneID.Equal[${Zone.ID}]}) {
	
		/declare counter1 int local
		/declare counter2 int local
		/declare counter3 int local
		/declare counter4 int local
		
		/declare SpellInvisArray[5] string local
		/varset SpellInvisArray[1] You vanish.
		/varset SpellInvisArray[2] A veil of elements hides you from sight.
		/varset SpellInvisArray[3] You gather shadows about you.
		/varset SpellInvisArray[4] Your skin becomes shadow.
		/varset SpellInvisArray[5] A black shadow drifts over you.
		
		/declare AAInvisArray[7] int local
		/varset AAInvisArray[1] 420	 | _Fading Memories
		/varset AAInvisArray[2] 212 	| _Imitate Death
		/varset AAInvisArray[3] 518 	| _Shared Camouflage
		/varset AAInvisArray[4] 1210   | _Group Perfected Invisibility
		/varset AAInvisArray[5] 3812   | _Perfected Invisibility 
		/varset AAInvisArray[6] 80 	 | _Innate Camouflage
		/varset AAInvisArray[7] 531 	| _Cloak of Shadows
		/If (${Stick.Active} && ${Target.ID}) {
			/declare wasSticking bool local ${Stick.Active}
			/declare stickID int local ${Target.ID}
		}
		/If (${Me.Invis}) /return
		/If (${Me.Casting.ID}) /stopcast
		/If (${Twist.Twisting}) /twist stop
		/If (${Me.Combat}) /attack off
		
		| Hide+Sneak Method
		/If (!${Me.Invis} && ${Me.Class.ShortName.Equal[ROG]} && ${Me.AltTimerReady[Sneak]} && ${Me.AltTimerReady[Hide]}) {
			/doability sneak
			/doability hide
			/return
		} else /If (${Select[${Me.Class.ShortName},BST,DRU,ENC,MAG,MNK,NEC,RNG,SHD,SHM,WIZ]}) {
		
		| AA Method
			/for counter1 1 to ${AAInvisArray.Size}
				/If (${Me.AltAbilityReady[${AAInvisArray[${counter1}]}]}) {
					/If (${Me.AltAbility[${counter1}].Spell.MyCastTime}) {
						/squelch /stick off
						/delay !${Me.Moving}
					}
					/Alt Activate ${AAInvisArray[${counter1}]}
					/If (${counter1}==1) {
						/delay 5
						/stand
					} else {
						/goto :ReStick
					}
					/return
				}
			/next counter1
			/If (!${Me.Class.ShortName.Equal[MNK]}) {
			
			| Spell Method
				/for counter1 1 to 960
					/for counter2 1 to ${SpellInvisArray.Size}
						/If (${Me.Book[${counter1}].CastOnYou.Equal[${SpellInvisArray[${counter2}]}]}) {
							/If (${Me.Book[${counter1}].TargetType.Equal[Self]} || ${Me.Book[${counter1}].TargetType.Equal[Group v2]}) {
								/If (${Me.Book[${counter1}].TargetType.Equal[Single]}) /target id ${Me.ID}
								/squelch /stick off
								/delay !${Me.Moving}
								/casting "${Me.Book[${counter1}].Name}" 1
								/goto :ReStick
								/return
							}
						}
					/next counter2
				/next counter1
			}
		}
		
		| Item Method
		/for counter1 22 to 30
			/If (${Me.Inventory[${counter1}].Container}) {
				/for counter2 1 to ${Me.Inventory[${counter1}].Container}
					/If (!${Me.Inventory[${counter1}].Item[${counter2}].TimerReady} && ${Me.Inventory[${counter1}].Item[${counter2}].Spell.CastOnYou.Equal[Your form is covered in a shroud of air.]} || ${Me.Inventory[${counter1}].Item[${counter2}].Spell.CastOnYou.Equal[You vanish.]}) {
						/squelch /stick off
						/delay !${Me.Moving}
						/casting "${Me.Inventory[${counter1}].Item[${counter2}].Name}" ${Me.Inventory[${counter1}].Item[${counter2}].WornSlot[1]} Item 
						/goto :ReStick
					}			
				/next counter2
			} else /If (!${Me.Inventory[${counter1}].TimerReady} && ${Me.Inventory[${counter1}].Spell.CastOnYou.Equal[Your form is covered in a shroud of air.]} || ${Me.Inventory[${counter1}].Spell.CastOnYou.Find[You vanish.]}) {
				/squelch /stick off
				/delay !${Me.Moving}
				/casting "${Me.Inventory[${counter1}].Name}" ${Me.Inventory[${counter1}].WornSlot[1]} Item 
				/goto :ReStick
			}
		/next counter1
		/If (!${Me.Invis}) /docommand ${If[${EQBC.Connected},/bc,/echo]} -= Failure to execute command
	}
	:ReStick
	/If (!${Stick.Active} && ${wasSticking}) {
		/declare castDelay int local
		/delay ${Cast.Timing}
		/varset castDelay ${Math.Calc[${Cast.Timing} / 100]}
		/delay ${castDelay} 
		/squelch /stick id ${stickID}
	}
/return
Cheers

xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: Universal Invisibility

Post by xyilla » Mon Sep 08, 2025 1:12 am


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: Universal Invisibility

Post by xyilla » Mon Sep 08, 2025 1:49 am


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: Universal Invisibility

Post by xyilla » Mon Sep 08, 2025 2:26 am


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: Universal Invisibility

Post by xyilla » Mon Sep 08, 2025 3:03 am


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: Universal Invisibility

Post by xyilla » Mon Sep 08, 2025 3:05 am


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: Universal Invisibility

Post by xyilla » Mon Sep 08, 2025 3:06 am


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: Universal Invisibility

Post by xyilla » Mon Sep 08, 2025 3:07 am


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: Universal Invisibility

Post by xyilla » Mon Sep 08, 2025 3:08 am


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: Universal Invisibility

Post by xyilla » Mon Sep 08, 2025 3:09 am


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: Universal Invisibility

Post by xyilla » Mon Sep 08, 2025 3:10 am


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: Universal Invisibility

Post by xyilla » Mon Sep 08, 2025 3:11 am


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: Universal Invisibility

Post by xyilla » Mon Sep 08, 2025 3:13 am


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: Universal Invisibility

Post by xyilla » Mon Sep 08, 2025 3:14 am


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: Universal Invisibility

Post by xyilla » Mon Sep 08, 2025 3:15 am