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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
towel
Beginner


Joined: 27 May 2002
Posts: 13

PostPosted: Tue Jan 06, 2009 10:25 am   

help with complicated trigger
 
Hello there all you triggerhappy mudders.
I'm in dire need of help!

Hp:252(252) Sp:340(340) T:0/0 C:0(70) B:0 P:0 Xp:5694268 Tactics: 25
[L-Hp: 0] [L-Sp: 0] [SpecDmg: 0 ] [Damage: 0 ]

See the top line there is the original reportline...
And I need help to create the lower one.

Hmm the Specdmg is calculated exactly after how many xp points that comes in..
for example if I make a eeh fireball that gives me 120 xp then it should say that in SpecDMG line.. (the whole lower line has to be created for that matter) and then in the Damage one it has to say 50% of the gained exp.. so if the fireball does 120 specdmg then it does 60 Damage..

and ofcourse the L-Hp and L-Sp is how many sp and hp I lose during a spell or an attack.

is there anyone here who can explain and help me how to do this?

If someone wanna talk more alive please add my msn:

anderssonfredrik@live.se

Best regards. Fredrik
_________________
towel
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Tue Jan 06, 2009 10:39 am   
 
So the MUD doesn't send that second line, you want the script to print it for you? And the numbers should be the change in hitpoints, sp and xp since the last prompt, with the fourth being half the xp value?
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Rorso
Wizard


Joined: 14 Oct 2000
Posts: 1368

PostPosted: Tue Jan 06, 2009 11:12 am   
 
Try:
Code:

#CLASS {extraPrompt}
#TRIGGER {Hp:&{stats.hp}~(&{stats.maxhp}~) Sp:&{stats.sp}~(&{stats.maxsp}~) T:%d/%d C:%d~(%d~) B:%d P:%d Xp:&{stats.xp} Tactics: %d} {
  #if (%null( @oldstats)=0) {
    specdmg = %eval( @stats.xp - @oldstats.xp)
    damage = %eval( @specdmg/2)
    lhp = %eval( @stats.hp - @oldstats.hp)
    lsp = %eval( @stats.hp - @oldstats.hp)
    #show ~[L-Hp: @lhp~] ~[L-Sp: @lsp~] ~[SpecDmg: @specdmg~] ~[Damage: @damage~]
    } {#show No data yet.}
  oldstats = @stats
  } "" {prompt}
#CLASS 0
Reply with quote
towel
Beginner


Joined: 27 May 2002
Posts: 13

PostPosted: Tue Jan 06, 2009 11:27 am   
 
exactly Fang..it doesn't send that second line..want it created
_________________
towel
Reply with quote
towel
Beginner


Joined: 27 May 2002
Posts: 13

PostPosted: Tue Jan 06, 2009 11:29 am   
 
oh thanks alot mr Rorso.. it works fine!

You rock!
_________________
towel
Reply with quote
Rappy
Wanderer


Joined: 15 Jul 2005
Posts: 96

PostPosted: Wed Jan 07, 2009 6:24 am   
 
lsp = %eval( @stats.hp - @oldstats.hp)

Should be...

lsp = %eval( @stats.sp - @oldstats.sp)

He mistakenly put hp for both lines....

-Rappy
_________________
Windows 11 Pro,
cMUD 3.34
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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