Duration and random socials or Emotes

Posted by Spiegel06 on Tue 04 Mar 2008 05:12 PM — 5 posts, 21,436 views.

#0
I am new to the forum so if there is a post about this already could someone please post the link here so I am be directed to it.

I am new to this, I do not know coding or such, and would like to know how to do a emote or social during the duration of a spell. For example, I have the spell: shield up and at random times it will do something like light shimmers off the shield or something like that. Though I would like that only to happen when that specific affect is up.

Thanks for your time.
Australia Forum Administrator #1
This is a bit similar to a recent post by someone who wanted to cast a spell when in combat but not otherwise.

You say you want to do something "during the duration of a spell" - OK so what you need to "tell" the client is:

  • When the spell starts (presumably a trigger can match the message you get)
  • When the spell ends (another trigger)


Without seeing the messages it is hard to be more specific.

The first trigger could "send to script" and enable a timer that fires at your desired interval, see:

http://www.gammon.com.au/scripts/doc.php?function=EnableTimer

The second trigger disables this timer.

Thus the timer only fires when the spell is active, and the timer itself (when active) can display every few seconds or so a note to yourself that the light is shimmering or whatever.
#2
I am sorry to bother you but I still am not getting it.

The messages I will use to trigger the effect is

"Your body twists and forms into the shape of a tree."

then to end it is this one below.

"Your body returns to its normal form."

but I do not know how to connect the timer to the triggers and been trying and reading it but it does not work. And I thank you for trying to aid me.
Australia Forum Administrator #3
Here are the two triggers:


<triggers>

  <trigger
   enabled="y"
   match="Your body returns to its normal form."
   send_to="12"
   sequence="100"
  >
  <send>
EnableTimer ("treeform", false)
</send>
  </trigger>

  <trigger
   enabled="y"
   match="Your body twists and forms into the shape of a tree."
   send_to="12"
   sequence="100"
  >
  <send>
EnableTimer ("treeform", true)
ResetTimer ("treeform")
</send>
  </trigger>

</triggers>



Here is the timer:


<timers>
  <timer 
    name="treeform"
    second="5.00"    
    send_to="2"
  >
  <send>Branches sprout from your head, making you look strange.</send>

  </timer>
</timers>



The connection is the timer name - the triggers enable / disable the timer "treeform" by name.

See http://www.mushclient.com/pasting for how to copy these examples directly into the client.
Amended on Wed 05 Mar 2008 07:40 PM by Nick Gammon
#4
Thanks so very much, you have helped me alot.