Help with this particular chant macro

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

morpheous531
orc pawn
orc pawn
Posts: 18
Joined: Sun Oct 06, 2002 10:52 pm

Help with this particular chant macro

Post by morpheous531 » Mon Jan 19, 2004 6:24 am

First let me start by saying that Raebis' chant macro is amazing and I use it regularly, but I'm looking for help on this particular macro for one reason - Raebis' macro is used to hunt the whole zone.

This macro sticks to one spot and, for the area that I'm hunting in right now, is much safer.



I need to add 2 more different chants before the cycle repeats itself:


This is DKAA's chant macro.

Code: Select all

| 
| - chantkite.mac - 
| this is orignally from twist.mac or twist1.mac -- sorry, I 
| didn't keep that attribution 
| 
| chantkite <selo's gem> [<dot1 gem> <dot2 gem> [<loc x> <loc y> <radius>]] 
| run around in a cirle while twisting selos and two DOT chants.  If x, 
| y, and radius are not supplied, use the current position and a radius 
| of 80.  This uses the short-lasting selos. 
| 
#event MissedNote "You miss a note, bringing your song to a close!" 
#event Recovered  "You haven't recovered yet..." 
#event NeedTarget "You must first select a target for this spell!" 
#event Slow       "You slow down" 
#event Exp        "You gain " 
#event Outof      "out of range" 

| this needs to be on now -- parameter parsing takes too long 
#turbo 

Sub Main(p0,p1,p2,p3,p4,p5) 

/declare cirx global 
/declare ciry global 
/declare cirr global 
| array of songs 
/declare a array                    
| number of songs 
/declare nsongs global              
| current song 1-3 
/declare cursong global              
/declare exper global 
| selo's coming for slow down processing 
/declare selocoming global          
/declare t0 timer 
/declare mytarg global 
/declare v6 local 

  /if $defined(p0)==false { 
    /echo usage: zero string 
    /return 
  } 

  | check if the location was passed in... 
  /if $defined(p3)==false { 
        /varset cirx $char(y) 
        /varset ciry $char(x) 
        /varset cirr 80 
  } else { 
        /varset cirx @p3 
        /varset ciry @p4 
        /varset cirr @p5 
  } 

  /varset nsongs 1 

  /varset a(1) @p0   | First song 
  /echo Song 1: $char(gem,@p0) 

  /if $defined(p1)!=false { 
            /varadd nsongs 1 
            /varset a(2) @p1 
            /echo Song 2: $char(gem,@p1) 
      } 

  /if $defined(p2)!=false { 
            /varadd nsongs 1 
            /varset a(3) @p2 
            /echo Song 3: $char(gem,@p2) 
  } 

| always incremented before starting a new 
| song.  songs start at 1 so we can make 
| cursong = 0 to restart the list 
  /varset cursong 0              
  /varset exper $char(exp) 
  /varset selocoming 0 
  /varset t0 0 

:Loop 
  /if n @t0<=0 { 
    | inline /call sing $int(@a(@cursong)) 
    /stopsong 
    /if n @cursong==1 { 
      /varset selocoming 1 
    } else { 
      /varset selocoming 0 
    } 
    /delay 1 
    /varset t0 32 
    /varadd cursong 1 
    /if n @cursong>@nsongs /varset cursong 1 
    /echo starting song @a(@cursong) 
    /cast @a(@cursong) 
    /if "$target()"=="true" /varset mytarg $target(name,clean) 
  } 
  /delay 2 

  | inline /call circ @cirx @ciry @cirr 
  | do the circle calculations.... 
  /varset v6 $calc(@cirr-$distance(@cirx,@ciry)) 
  /if n @v6>10 { 
        | head out 
        /face fast heading $calc($heading(@cirx,@ciry)+180)          
    } else /if n @v6<-10 { 
        /if n @v6<-180 /varset v6 -180 
        | head in 
        /face fast heading $calc($heading(@cirx,@ciry)+90+@v6/2)    
    } else { 
        | head tang 
        /face fast heading $calc($heading(@cirx,@ciry)+90)      
    } 

  /delay 4 
  /doevents 
  /delay 1 
/goto :Loop 

/return 


Sub Event_MissedNote 
  | restart song 
  /varcalc cursong @cursong-1        
  /varset t0 0 
/return 

Sub Event_Slow 
  /if n @selocoming!=1 { 
    | restart list 
    /varset cursong 0                
    /varset t0 0 
  } 
/return 

Sub Event_Outof 
  /varset t0 0 
/return 

Sub Event_Recovered 
  | restart song 
  /varcalc cursong @cursong-1        
  /varset t0 0 
/return 

Sub Event_NeedTarget 
  | get target 
  /tar npc @mytarg                  
/return 

Sub Event_Exp 
  /varcalc exper $char(exp)-@exper 
  /echo @exper% 
  /varset exper $char(exp) 
  /tar npc @mytarg 
/return

Thank you in advance.

morpheous531
orc pawn
orc pawn
Posts: 18
Joined: Sun Oct 06, 2002 10:52 pm

Post by morpheous531 » Wed Jan 21, 2004 5:22 pm

OK so I decided to try this myself and yada, yada, yada...it works perfectly.

Don't use this particular chant macro if:

1. you want a macro that is better at getting targets and are in a safe zone where most of it is chantable - use Raebis' mac for that.

2. are under 49 - this uses 4 chants and then sings the 49 selo - the lvl 6 selo wouldnt work with this


Thanks to DKAA for the original

Code: Select all

| 
| - chantkite.mac - 
| this is orignally from twist.mac or twist1.mac -- sorry, I 
| didn't keep that attribution 
| 
| chantkite <selo's gem> [<dot1 gem> <dot2 gem> [<loc x> <loc y> <radius>]] 
| run around in a cirle while twisting selos and two DOT chants.  If x, 
| y, and radius are not supplied, use the current position and a radius 
| of 80.  This uses the short-lasting selos. 
| 
#event MissedNote "You miss a note, bringing your song to a close!" 
#event Recovered  "You haven't recovered yet..." 
#event NeedTarget "You must first select a target for this spell!" 
#event Slow       "You slow down" 
#event Exp        "You gain " 
#event Outof      "out of range" 

| this needs to be on now -- parameter parsing takes too long 
#turbo 

Sub Main(p0,p1,p2,p3,p4,p5,p6,p7) 

/declare cirx global 
/declare ciry global 
/declare cirr global 
| array of songs 
/declare a array                    
| number of songs 
/declare nsongs global              
| current song 1-5
/declare cursong global              
/declare exper global 
| selo's coming for slow down processing 
/declare selocoming global          
/declare t0 timer 
/declare mytarg global 
/declare v6 local 

  /if $defined(p0)==false { 
    /echo usage: zero string 
    /return 
  } 

  | check if the location was passed in... 
  /if $defined(p5)==false { 
        /varset cirx $char(y) 
        /varset ciry $char(x) 
        /varset cirr 80 
  } else { 
        /varset cirx @p5
        /varset ciry @p6
        /varset cirr @p7
  } 

  /varset nsongs 1 

  /varset a(1) @p0   | First song 
  /echo Song 1: $char(gem,@p0) 

  /if $defined(p1)!=false { 
            /varadd nsongs 1 
            /varset a(2) @p1 
            /echo Song 2: $char(gem,@p1) 
  } 

  /if $defined(p2)!=false { 
            /varadd nsongs 1 
            /varset a(3) @p2 
            /echo Song 3: $char(gem,@p2) 
  } 

/if $defined(p3)!=false { 
            /varadd nsongs 1 
            /varset a(4) @p3 
            /echo Song 4: $char(gem,@p3) 
  } 

/if $defined(p4)!=false { 
            /varadd nsongs 1 
            /varset a(5) @p4
            /echo Song 5: $char(gem,@p4) 
  } 

| always incremented before starting a new 
| song.  songs start at 1 so we can make 
| cursong = 0 to restart the list 
  /varset cursong 0              
  /varset exper $char(exp) 
  /varset selocoming 0 
  /varset t0 0 

:Loop 
  /if n @t0<=0 { 
    | inline /call sing $int(@a(@cursong)) 
    /stopsong 
    /if n @cursong==1 { 
      /varset selocoming 1 
    } else { 
      /varset selocoming 0 
    } 
    /delay 1 
    /varset t0 32 
    /varadd cursong 1 
    /if n @cursong>@nsongs /varset cursong 1 
    /echo starting song @a(@cursong) 
    /cast @a(@cursong) 
    /if "$target()"=="true" /varset mytarg $target(name,clean) 
  } 
  /delay 2 

  | inline /call circ @cirx @ciry @cirr 
  | do the circle calculations.... 
  /varset v6 $calc(@cirr-$distance(@cirx,@ciry)) 
  /if n @v6>10 { 
        | head out 
        /face fast heading $calc($heading(@cirx,@ciry)+180)          
    } else /if n @v6<-10 { 
        /if n @v6<-180 /varset v6 -180 
        | head in 
        /face fast heading $calc($heading(@cirx,@ciry)+90+@v6/2)    
    } else { 
        | head tang 
        /face fast heading $calc($heading(@cirx,@ciry)+90)      
    } 

  /delay 4 
  /doevents 
  /delay 1 
/goto :Loop 

/return 


Sub Event_MissedNote 
  | restart song 
  /varcalc cursong @cursong-1        
  /varset t0 0 
/return 

Sub Event_Slow 
  /if n @selocoming!=1 { 
    | restart list 
    /varset cursong 0                
    /varset t0 0 
  } 
/return 

Sub Event_Outof 
  /varset t0 0 
/return 

Sub Event_Recovered 
  | restart song 
  /varcalc cursong @cursong-1        
  /varset t0 0 
/return 

Sub Event_NeedTarget 
  | get target 
  /tar npc @mytarg                  
/return 

Sub Event_Exp 
  /varcalc exper $char(exp)-@exper 
  /echo @exper% 
  /varset exper $char(exp) 
  /tar npc @mytarg 
/return