TinTin++ Mud Client The TinTin++ message board

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
TinTin++ Mud Client

Arctic Group Combat Subs

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Finished Scripts
View previous topic :: View next topic  
Author Message
Roady



Joined: 28 Mar 2006
Posts: 25

PostPosted: Mon Apr 28, 2008 11:52 pm    Post subject: Arctic Group Combat Subs Reply with quote

Sharing is caring: I find myself struggling to keep up with big group battles so we (our clan) came up with the following to try and reduce the spam fest with big groups.

We originally created a different sub for each damage type, but when implemented that was close to 250 subs per group member. With 5+ group members it gets pretty laggy (1000+ subs, not including any other subs you might have). So we revised it to what you see now. Its not as detailed as the previous implementation (ie you cant tell what class of weapon being used by looking at combat actions) but as theres only 20-odd subs per group member its much much faster.

Usage
to add a member to the group: StartGroup <name>
to remove a member from the group: StopGroup <name>
to list the members of the current group: ListGroup <name>

* note that this doesn't create a group on the mud - it just creates a local list so we can manage the subs a little easier.

* also note that the commands and player name are case sensitive.

and on with the show...

Code:

#NOP damage subs for group members

#ALIAS {StartGroup} {#VAR {members} {%0}; #FORALL {$members} {HighlightDamageFor &0; AddGroupMember &0}}
#ALIAS {StopGroup} {#VAR {members} {%0}; #FORALL {$members} {UnHighlightDamageFor &0; DelGroupMember &0}}

#ALIAS {AddGroupMember %0} {#LIST {GroupMembers} {INS} {-1} {%0}}
#ALIAS {DelGroupMember %0} {#LIST {GroupMembers} {FND} {%0} {MemberIndex}; #LIST {GroupMembers} {DEL} {$MemberIndex}}

#ALIAS {ListGroup} {
  #LIST {GroupMembers} {LEN} {GroupMemberCount};
  #SHOWME {-> Group Members};
  #LOOP {1 $GroupMemberCount} {#SHOWME {-> [&0] $GroupMembers[&0]}}
}


#ALIAS {HighlightDamageFor %0} {
  #SUB {^%0 misses %%91 with %%92 [hit|bite|smite|pierce|slash|cleave|claw|crush|drain|bludgeon|whip|stab|sting|shoot|plunk].^}      {%0 ---> <040>misses<099> ---> %%91}      {3};
  #SUB {^%0 bruises %%91 with %%92 [hit|bite|smite|pierce|slash|cleave|claw|crush|drain|bludgeon|whip|stab|sting|shoot|plunk].^}     {%0 ---> <040>bruises<099> ---> %%91}     {3};
  #SUB {^%0 massacres %%91 with %%92 [hit|bite|smite|pierce|slash|cleave|claw|crush|drain|bludgeon|whip|stab|sting|shoot|plunk].^}   {%0 ---> <040>MASSACRES<099> ---> %%91}   {3};
  #SUB {^%0 annihilates %%91 with %%92 [hit|bite|smite|pierce|slash|cleave|claw|crush|drain|bludgeon|whip|stab|sting|shoot|plunk].^} {%0 ---> <040>ANNIHILATES<099> ---> %%91} {3};
  #SUB {^%0 obliterates %%91 with %%92 [hit|bite|smite|pierce|slash|cleave|claw|crush|drain|bludgeon|whip|stab|sting|shoot|plunk].^} {%0 ---> <040>OBLITERATES<099> ---> %%91} {3};

  #SUB {^%%91 misses %0 with %%92 [hit|bite|smite|pierce|slash|cleave|claw|crush|drain|bludgeon|whip|stab|sting|shoot|plunk].^}      {%%91 ===> <090>misses<099> ===> <170>%0<099>}      {3};
  #SUB {^%%91 bruises %0 with %%92 [hit|bite|smite|pierce|slash|cleave|claw|crush|drain|bludgeon|whip|stab|sting|shoot|plunk].^}     {%%91 ===> <030>bruises<099> ===> <170>%0<099>}     {3};
  #SUB {^%%91 massacres %0 with %%92 [hit|bite|smite|pierce|slash|cleave|claw|crush|drain|bludgeon|whip|stab|sting|shoot|plunk].^}   {%%91 ===> <030>MASSACRES<099> ===> <170>%0<099>}   {3};
  #SUB {^%%91 annihilates %0 with %%92 [hit|bite|smite|pierce|slash|cleave|claw|crush|drain|bludgeon|whip|stab|sting|shoot|plunk].^} {%%91 ===> <030>ANNIHILATES<099> ===> <170>%0<099>} {3};
  #SUB {^%%91 obliterates %0 with %%92 [hit|bite|smite|pierce|slash|cleave|claw|crush|drain|bludgeon|whip|stab|sting|shoot|plunk].^} {%%91 ===> <030>OBLITERATES<099> ===> <170>%0<099>} {3};
      
  #SUB {^%0 barely [hits|bites|smites|pierces|slashes|cleaves|claws|crushes|drains|bludgeons|whips|stabs|stings|shoots|plunks] %%91.^}         {%0 ---> <040>barely<099> ---> %%91}         {3};
  #SUB {^%0 [hits|bites|smites|pierces|slashes|cleaves|claws|crushes|drains|bludgeons|whips|stabs|stings|shoots|plunks] %%91 extremely hard.^} {%0 ---> <040>extremely hard<099> ---> %%91} {1};
  #SUB {^%0 [hits|bites|smites|pierces|slashes|cleaves|claws|crushes|drains|bludgeons|whips|stabs|stings|shoots|plunks] %%91 very hard.^}      {%0 ---> <040>very hard<099> ---> %%91}      {2};
  #SUB {^%0 [hits|bites|smites|pierces|slashes|cleaves|claws|crushes|drains|bludgeons|whips|stabs|stings|shoots|plunks] %%91 hard.^}           {%0 ---> <040>hard<099> ---> %%91}           {3};
  #SUB {^%0 [hits|bites|smites|pierces|slashes|cleaves|claws|crushes|drains|bludgeons|whips|stabs|stings|shoots|plunks] %%91.^}                {%0 ---> <040>hit<099> ---> %%91}            {4};

  #SUB {^%%91 barely [hits|bites|smites|pierces|slashes|cleaves|claws|crushes|drains|bludgeons|whips|stabs|stings|shoots|plunks] %0.^}         {%%91 ===> <030>barely<099> ===> <170>%0<099>}         {3};
  #SUB {^%%91 [hits|bites|smites|pierces|slashes|cleaves|claws|crushes|drains|bludgeons|whips|stabs|stings|shoots|plunks] %0.^}                {%%91 ===> <030>hits<099> ===> <170>%0<099>}             {3};
  #SUB {^%%91 [hits|bites|smites|pierces|slashes|cleaves|claws|crushes|drains|bludgeons|whips|stabs|stings|shoots|plunks] %0 hard.^}           {%%91 ===> <030>hard<099> ===> <170>%0<099>}           {3};
  #SUB {^%%91 [hits|bites|smites|pierces|slashes|cleaves|claws|crushes|drains|bludgeons|whips|stabs|stings|shoots|plunks] %0 very hard.^}      {%%91 ===> <030>very hard<099> ===> <170>%0<099>}      {3};
  #SUB {^%%91 [hits|bites|smites|pierces|slashes|cleaves|claws|crushes|drains|bludgeons|whips|stabs|stings|shoots|plunks] %0 extremely hard.^} {%%91 ===> <030>extremely hard<099> ===> <170>%0<099>} {3};
}

#ALIAS {UnHighlightDamageFor %0} {
  #UNSUB {^%0 misses %%91 with %%92 [hit|bite|smite|pierce|slash|cleave|claw|crush|drain|bludgeon|whip|stab|sting|shoot|plunk].^}      {%0 ---> <040>misses<099> ---> %%91}      {3};
  #UNSUB {^%0 bruises %%91 with %%92 [hit|bite|smite|pierce|slash|cleave|claw|crush|drain|bludgeon|whip|stab|sting|shoot|plunk].^}     {%0 ---> <040>bruises<099> ---> %%91}     {3};
  #UNSUB {^%0 massacres %%91 with %%92 [hit|bite|smite|pierce|slash|cleave|claw|crush|drain|bludgeon|whip|stab|sting|shoot|plunk].^}   {%0 ---> <040>MASSACRES<099> ---> %%91}   {3};
  #UNSUB {^%0 annihilates %%91 with %%92 [hit|bite|smite|pierce|slash|cleave|claw|crush|drain|bludgeon|whip|stab|sting|shoot|plunk].^} {%0 ---> <040>ANNIHILATES<099> ---> %%91} {3};
  #UNSUB {^%0 obliterates %%91 with %%92 [hit|bite|smite|pierce|slash|cleave|claw|crush|drain|bludgeon|whip|stab|sting|shoot|plunk].^} {%0 ---> <040>OBLITERATES<099> ---> %%91} {3};

  #UNSUB {^%%91 misses %0 with %%92 [hit|bite|smite|pierce|slash|cleave|claw|crush|drain|bludgeon|whip|stab|sting|shoot|plunk].^}      {%%91 ===> <090>misses<099> ===> <170>%0<099>}      {3};
  #UNSUB {^%%91 bruises %0 with %%92 [hit|bite|smite|pierce|slash|cleave|claw|crush|drain|bludgeon|whip|stab|sting|shoot|plunk].^}     {%%91 ===> <030>bruises<099> ===> <170>%0<099>}     {3};
  #UNSUB {^%%91 massacres %0 with %%92 [hit|bite|smite|pierce|slash|cleave|claw|crush|drain|bludgeon|whip|stab|sting|shoot|plunk].^}   {%%91 ===> <030>MASSACRES<099> ===> <170>%0<099>}   {3};
  #UNSUB {^%%91 annihilates %0 with %%92 [hit|bite|smite|pierce|slash|cleave|claw|crush|drain|bludgeon|whip|stab|sting|shoot|plunk].^} {%%91 ===> <030>ANNIHILATES<099> ===> <170>%0<099>} {3};
  #UNSUB {^%%91 obliterates %0 with %%92 [hit|bite|smite|pierce|slash|cleave|claw|crush|drain|bludgeon|whip|stab|sting|shoot|plunk].^} {%%91 ===> <030>OBLITERATES<099> ===> <170>%0<099>} {3};
      
  #UNSUB {^%0 barely [hits|bites|smites|pierces|slashes|cleaves|claws|crushes|drains|bludgeons|whips|stabs|stings|shoots|plunks] %%91.^}         {%0 ---> <040>barely<099> ---> %%91}         {3};
  #UNSUB {^%0 [hits|bites|smites|pierces|slashes|cleaves|claws|crushes|drains|bludgeons|whips|stabs|stings|shoots|plunks] %%91 extremely hard.^} {%0 ---> <040>extremely hard<099> ---> %%91} {1};
  #UNSUB {^%0 [hits|bites|smites|pierces|slashes|cleaves|claws|crushes|drains|bludgeons|whips|stabs|stings|shoots|plunks] %%91 very hard.^}      {%0 ---> <040>very hard<099> ---> %%91}      {2};
  #UNSUB {^%0 [hits|bites|smites|pierces|slashes|cleaves|claws|crushes|drains|bludgeons|whips|stabs|stings|shoots|plunks] %%91 hard.^}           {%0 ---> <040>hard<099> ---> %%91}           {3};
  #UNSUB {^%0 [hits|bites|smites|pierces|slashes|cleaves|claws|crushes|drains|bludgeons|whips|stabs|stings|shoots|plunks] %%91.^}                {%0 ---> <040>hit<099> ---> %%91}            {4};

  #UNSUB {^%%91 barely [hits|bites|smites|pierces|slashes|cleaves|claws|crushes|drains|bludgeons|whips|stabs|stings|shoots|plunks] %0.^}         {%%91 ===> <030>barely<099> ===> <170>%0<099>}         {3};
  #UNSUB {^%%91 [hits|bites|smites|pierces|slashes|cleaves|claws|crushes|drains|bludgeons|whips|stabs|stings|shoots|plunks] %0.^}                {%%91 ===> <030>hit<099> ===> <170>%0<099>}             {3};
  #UNSUB {^%%91 [hits|bites|smites|pierces|slashes|cleaves|claws|crushes|drains|bludgeons|whips|stabs|stings|shoots|plunks] %0 hard.^}           {%%91 ===> <030>hard<099> ===> <170>%0<099>}           {3};
  #UNSUB {^%%91 [hits|bites|smites|pierces|slashes|cleaves|claws|crushes|drains|bludgeons|whips|stabs|stings|shoots|plunks] %0 very hard.^}      {%%91 ===> <030>very hard<099> ===> <170>%0<099>}      {3};
  #UNSUB {^%%91 [hits|bites|smites|pierces|slashes|cleaves|claws|crushes|drains|bludgeons|whips|stabs|stings|shoots|plunks] %0 extremely hard.^} {%%91 ===> <030>extremely hard<099> ===> <170>%0<099>} {3};
}


#SUB {^You miss %1 with your [hit|bite|smite|pierce|slash|cleave|claw|crush|drain|bludgeon|whip|stab|sting|shoot|plunk].^}       {You ---> <040>miss<099> ---> %1}         {3}
#SUB {^You barely [hit|bite|smite|pierce|slash|cleave|claw|crush|drain|bludgeon|whip|stab|sting|shoot|plunk] %1.^}               {You ---> <040>barely<099> ---> %1}         {3}
#SUB {^You bruise %1 with your [hit|bite|smite|pierce|slash|cleave|claw|crush|drain|bludgeon|whip|stab|sting|shoot|plunk].^}     {You ---> <040>bruise<099> ---> %1}         {3}
#SUB {^You [hit|bite|smite|pierce|slash|cleave|claw|crush|drain|bludgeon|whip|stab|sting|shoot|plunk] %1 extremely hard.^}       {You ---> <040>extremely hard<099> ---> %1} {1}
#SUB {^You [hit|bite|smite|pierce|slash|cleave|claw|crush|drain|bludgeon|whip|stab|sting|shoot|plunk] %1 very hard.^}            {You ---> <040>very hard<099> ---> %1}      {2}
#SUB {^You [hit|bite|smite|pierce|slash|cleave|claw|crush|drain|bludgeon|whip|stab|sting|shoot|plunk] %1 hard.^}                 {You ---> <040>hard<099> ---> %1}           {3}
#SUB {^You [hit|bite|smite|pierce|slash|cleave|claw|crush|drain|bludgeon|whip|stab|sting|shoot|plunk] %1.^}                      {You ---> <040>hit<099> ---> %1}            {4}
#SUB {^You massacre %1 with your [hit|bite|smite|pierce|slash|cleave|claw|crush|drain|bludgeon|whip|stab|sting|shoot|plunk].^}   {You ---> <040>MASSACRE<099> ---> %1}       {2}
#SUB {^You annihilate %1 with your [hit|bite|smite|pierce|slash|cleave|claw|crush|drain|bludgeon|whip|stab|sting|shoot|plunk].^} {You ---> <040>ANNIHILATE<099> ---> %1}     {2}
#SUB {^You obliterate %1 with your [hit|bite|smite|pierce|slash|cleave|claw|crush|drain|bludgeon|whip|stab|sting|shoot|plunk].^} {You ---> <040>OBLITERATE<099> ---> %1}     {2}

#SUB {^%1 misses you with %2 [hit|bite|smite|pierce|slash|cleave|claw|crush|drain|bludgeon|whip|stab|sting|shoot|plunk].^}      {<039>**<099>%1 ===> <050>misses<099> ===> <170>YOU<099>}      {3}
#SUB {^%1 bruises YOU with %2 [hit|bite|smite|pierce|slash|cleave|claw|crush|drain|bludgeon|whip|stab|sting|shoot|plunk].^}     {<039>**<099>%1 ===> <050>bruises<099> ===> <170>YOU<099>}     {3}
#SUB {^%1 massacres YOU with %2 [hit|bite|smite|pierce|slash|cleave|claw|crush|drain|bludgeon|whip|stab|sting|shoot|plunk].^}   {<039>**<099>%1 ===> <010>MASSACRES<099> ===> <170>YOU<099>}   {3}
#SUB {^%1 annihilates YOU with %2 [hit|bite|smite|pierce|slash|cleave|claw|crush|drain|bludgeon|whip|stab|sting|shoot|plunk].^} {<039>**<099>%1 ===> <010>ANNIHILATES<099> ===> <170>YOU<099>} {3}
#SUB {^%1 obliterates YOU with %2 [hit|bite|smite|pierce|slash|cleave|claw|crush|drain|bludgeon|whip|stab|sting|shoot|plunk].^} {<039>**<099>%1 ===> <010>OBLITERATES<099> ===> <170>YOU<099>} {3}

#SUB {^%1 barely [hits|bites|smites|pierces|slashes|cleaves|claws|crushes|drains|bludgeons|whips|stabs|stings|shoots|plunks] YOU.^}         {<039>**<099>%1 ===> <050>barely<099> ===> <170>YOU<099>}         {3}
#SUB {^%1 [hits|bites|smites|pierces|slashes|cleaves|claws|crushes|drains|bludgeons|whips|stabs|stings|shoots|plunks] YOU.^}                {<039>**<099>%1 ===> <050>hits<099> ===> <170>YOU<099>}           {3}
#SUB {^%1 [hits|bites|smites|pierces|slashes|cleaves|claws|crushes|drains|bludgeons|whips|stabs|stings|shoots|plunks] YOU hard.^}           {<039>**<099>%1 ===> <050>hard<099> ===> <170>YOU<099>}           {3}
#SUB {^%1 [hits|bites|smites|pierces|slashes|cleaves|claws|crushes|drains|bludgeons|whips|stabs|stings|shoots|plunks] YOU very hard.^}      {<039>**<099>%1 ===> <050>very hard<099> ===> <170>YOU<099>}      {3}
#SUB {^%1 [hits|bites|smites|pierces|slashes|cleaves|claws|crushes|drains|bludgeons|whips|stabs|stings|shoots|plunks] YOU extremely hard.^} {<039>**<099>%1 ===> <050>extremely hard<099> ===> <170>YOU<099>} {3}

#SUB {^%0 dodges your attack!^} {<039>**<099>%0 ===> <050>dodges<099> ---> <170>YOU<099>} {3}

#showme {damage2.tin loaded...}


Enjoy, and of course, any suggestions welcomed.
Back to top
View user's profile Send private message
magiko



Joined: 11 May 2006
Posts: 33

PostPosted: Thu May 08, 2008 10:33 am    Post subject: Reply with quote

Hey, Thanks for sharing Smile. I don't know how I feel about combat subs in general (and I'll get to that), but then, I solo, and I'm really used to the output. That said, I'm pretty glad you posted this - I believe I'm going to incorporate a derivative (in a way I can turn it on/off at will) into my own scripts. I was playing with it last night, and I have several comments.

1) Word lists
You can improve upon the design of your code by not repeating the list each time you need it - store that in a variable without the brackets:

Code:
#variable {hitTypes} = {hit|bite|smite|pierce|slash|cleave|claw|crush|drain|bludgeon|whip|stab|sting|shoot|plunk};
#variable {hitTypesPlural} = {hits|bites|smites|pierces|slashes|cleaves|claws|crushes|drains|bludgeons|whips|stabs|stings|shoots|plunks};

And then call it like this (note the brackets here):

Code:

  #SUB {^%0 misses %%91 with %%92 [$hitTypes].^}      {%0 ---> <040>misses<099> ---> %%91}      {3};


So now you have 1 place to store the singular and plural lists.

Note that you could do exactly the same thing with "misses/bruises" etc (it does store which it uses from the list - I'll show you that in a moment below) You could get the script whittled down really far this way. The match would be closer to: [$hitStregth] [$hitTypesPlural]. Since you're substituting the same thing each time, in each set of matches, the match just needs to be better. Though, there may be a reason to not go through this effort (furher below)


2) Turn it on/off
Now that there's 1 variable, it's easy to turn the feature on/off. So I'll really define the variable like this (this replaces the code above).

Usage:
To toggle on/off, type "battlesubs"

Code:


#variable {battlesubs} {1}
#ALIAS            {battlesubs}           {#math {battlesubs}{!$battlesubs};#if {$battlesubs}{battleSubsOn;#showme Battle substitions is on}{battleSubsOff;#showme Battle substitutions is off}}

#alias {battleSubsOn} {
   #variable {hitTypes} = {hit|bite|smite|pierce|slash|cleave|claw|crush|drain|bludgeon|whip|stab|sting|shoot|plunk};
   #variable {hitTypesPlural} = {hits|bites|smites|pierces|slashes|cleaves|claws|crushes|drains|bludgeons|whips|stabs|stings|shoots|plunks};
}
#alias {battleSubsOff} {
   #variable {hitTypes} = {nothing};
   #variable {hitTypesPlural} = {nothing};
}
battleSubsOn


3) Class of weapon.
You mention this implementation is less detailed than a previous implementation, because you can't see class of weapon. Do you want to? If so, that data is available. It stores what matched in the list in (I believe) the first available slot. I leave it up to you to decide if it clutters the output (curious what you think).

To put it back in the output:

Code:

#SUB {^You barely [$hitTypes] %1.^}               {You ---> <040>barely %0<099> ---> %1}         {3}

And you can decide better output (very hard pierce sounds weird)
Code:

#SUB {^You [$hitTypes] %1.^}                      {You ---> <040>%0<099> ---> %1}            {4}
#SUB {^You [$hitTypes] %1 hard.^}                 {You ---> <040>%0 hard<099> ---> %1}           {3}
#SUB {^You [$hitTypes] %1 very hard.^}            {You ---> <040>%0 very hard<099> ---> %1}      {2}


4) UI thoughts
I'm tempted to remove all the highlights and strange colors on mine, but I have not yet. I will ask - do you get used to them? They're very strange to me Smile.

User interface wise, I'm considering something like this:

You ---> miss ---> a feisty puppy
You ----> bruise ---> a feisty puppy
You -----> barely ---> a feisty puppy
You ------> hit ---> a feisty puppy
You -------> hard---> a feisty puppy
You --------> very hard ---> a feisty puppy
You ---------> extremely hard ---> a feisty puppy
You ----------> massacre ---> a feisty puppy
You -----------> ANNIHILATE ---> a feisty puppy
You ------------> OBLITERATE ---> a feisty puppy

And when I'm getting hit:

<--- miss <---- a feisty puppy
<---- bruise <---- a feisty puppy
<----- barely <---- a feisty puppy
<------ hit <---- a feisty puppy
<------- hard <---- a feisty puppy
<-------- very hard <---- a feisty puppy
<--------- extremely hard <---- a feisty puppy
<---------- massacre <---- a feisty puppy
<------------ ANNIHILATE <---- a feisty puppy
<------------- OBLITERATE <---- a feisty puppy

(this defeats what I said about whittling it down with a single sub and two variable lists - but now we really do have unique subs for each match)

I'm not sure massacre deserves all caps. It's neat when you're low lvl and you mass, but pretty common later on. Then again, I don't group - let me know if I'm off here.

Same thing for the group subs. The color doesn't really help me glance and see the severity of the battle (since the color doesn't change from small hits to big hits, which it could), and so I think I need a way see how big the hits are just by visual separation. If the text is going to the right a lot, then I know the hits are big. Because of this, I might even do this for group members, for align reasons, though I'm not a fan yet:

------------> OBLITERATE ---> groupie --> a feisty puppy

5) Groups Necessary?
Can I ask why you went through extra effort to sub only for group members? Why not use battle subs for any fight you stumble across? The overhead is less and you don't have the tedium to turn it on for each member (the global on/off would suffice). If there are some clan battling implications, then I'm curious to hear it. If you need to know if it's a clannie or not a clannie, I assume you have highlights that kick in on friends/enemies anyway.

Thanks much for sharing - I'll share something of my own soon.

Justin
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Finished Scripts All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads
TinTin++ Homepage

Powered by phpBB © 2001, 2002 phpBB Group