Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Sagern
Newbie


Joined: 07 Jun 2011
Posts: 8

PostPosted: Tue Jun 07, 2011 9:29 pm   

a "bleed" trigger
 
I havent played many muds, been loyal to only 2-3 all based on same code. In this code, if you drop below half HP your character will leave a blood trail if you run. I used to have a trigger package that had a lot of useful triggers but lost it over the years cause i quit mudding. I have now gotten back into playing again and want to rebuild some. I have forgotten how to make my own triggers etc though.

below is a custom prompt i made for my priest

Health/Movement/Mana/Earth-Water Mana/Experience/etc

(current/max)Hp (current/max)Mv (current/max)Ma (water mana)W (earth mana)E [xp]

I need a trigger set that will take the health values and do 2 things.
i see a new feature Gauges, my first request could make use of this feature perhaps.

i need a "bleeder" trig that will report that i have reached half health (through group message and/or an echo)
and i need one that will report the number value of my health upon the death of a mob ( through group message and/or echo)

i don't want to steal anyone's "coding" expertize but i could use some help, its all Greek to me now.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4672
Location: Pensacola, FL, USA

PostPosted: Tue Jun 07, 2011 9:37 pm   
 
well, if you could show us an actually example of the text you want to capture it would help alot
_________________
Discord: Shalimarwildcat
Reply with quote
Sagern
Newbie


Joined: 07 Jun 2011
Posts: 8

PostPosted: Tue Jun 07, 2011 9:47 pm   
 
my prompt ( just noticed somehow it wasnt in first post)

(886/886)Hp (299/299)Mv (339/339)Ma (137)W (137)E [3023688]

(886/886)Hp <-- My health/hitpoints first number is my current health and second is my max health

if half of my max is reached i "bleed" so 443 or less with current numbers..but these numbers are subject to change.

I'm sure i need a couple variables set with some #math but its been so long since i manipulated with zmud, and never with cmud i just do not know where to start
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4672
Location: Pensacola, FL, USA

PostPosted: Tue Jun 07, 2011 10:02 pm   
 
This -should- work.
Paste it onto the XML tab of a new trigger.
It also populates all the variables you will need to make your gauges, those are best made through the GUI however.

Code:
<trigger priority="12860" newline="false" prompt="true" id="1286">
  <pattern>~((%d)/(%d)~)Hp ~((%d)/(%d)~)Mv ~((%d)/(%d)~)Ma ~((%d)~)W ~((%d)~)E ~[(%d)~]</pattern>
  <value><![CDATA[hp=%1
hpMax=%2
move=%3
moveMax=%4
mana=%5
manaMax=%6
WaterMana=%7
EarthMana=%8
exp=%9
#IF (@hp<(@hpMax/2)) {
  group message here
  #ECHO {Yo, yer <color crimson>bleedin</color>!}
  }]]></value>
</trigger>


P.S. #MATH is outdated, most expressions work just fine by enclosing it in parenthesis (a=((@b+@c)*@d)
_________________
Discord: Shalimarwildcat

Last edited by shalimar on Tue Jun 07, 2011 10:06 pm; edited 1 time in total
Reply with quote
Sagern
Newbie


Joined: 07 Jun 2011
Posts: 8

PostPosted: Tue Jun 07, 2011 10:05 pm   
 
thanks! maybe from this i can relearn how stuff works too :)
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4672
Location: Pensacola, FL, USA

PostPosted: Tue Jun 07, 2011 10:17 pm   
 
No problem, feel free to start a new thread if you have any other questions
_________________
Discord: Shalimarwildcat
Reply with quote
Sagern
Newbie


Joined: 07 Jun 2011
Posts: 8

PostPosted: Wed Jun 08, 2011 1:14 am   
 
It works, :) too well

the echo and group message works but it spams like crazy
any way to make it just say it once? or every now and again?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4672
Location: Pensacola, FL, USA

PostPosted: Wed Jun 08, 2011 2:59 am   
 
there is, how often would you like it to fire is the real question?
Just required more variables and checks.

Code:
#IF (@hp<(@hpMax/2)) {bleeding=(@bleeding+1)} {bleeding=0}
#SWITCH (@bleeding)
  (0) {#NOOP}
  (1) {group stuff}
  (5) {bleeding=0}


That should spam the message only every 5th time it gets the message after the 1st
_________________
Discord: Shalimarwildcat
Reply with quote
Sagern
Newbie


Joined: 07 Jun 2011
Posts: 8

PostPosted: Thu Jun 09, 2011 3:51 am   
 
something like every 3 seconds or so, is what im looking for.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4672
Location: Pensacola, FL, USA

PostPosted: Thu Jun 09, 2011 8:35 am   
 
in that case... I would make use of an alias to do the announcments

Code:
#EVENT onBleeding {
group message here
#ECHO {Yo, yer <color crimson>bleedin</color>!}
#T- onBleeding
#ALARM "stillBleeding" +3 {#T+ onBleeding}
}


This event turns itself off for three seconds with each use.

Then change the check in the original trigger to be:

Code:
#IF (@hp<(@hpMax/2)) {#RAISE onBleeding}


edit: it was an alias at first, but just turning of the alias would not stop cmud from sending the alias command.. which would then get sent to the MUD when the alias is turned of, the event gets around this issue.
_________________
Discord: Shalimarwildcat
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
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

© 2009 Zugg Software. Hosted by Wolfpaw.net