↓ Skip to main content

Prompt hook for loss/gain of health/mana/move

·199 words·1 min

Prompt code in game:

[code:op41ihii]$n(Hp: $h/$H) (Ma: $m/$M) (Mv: $v/$V)>[/code:op41ihii]

Zmud Code:

[code:op41ihii]#CLASS {Prompt}

#VAR Prompt {hpc0hp31maxhp63mac0ma33maxma84hpmax63mamax92mvc-53mv84mvmax84}

#TRIGGER {(Hp: (%d)/(%d)) (Ma: (%d)/(%d)) (Mv: (%d)/(%d))~>} {

#var prompt.hpc {%eval( @prompt.hp-%1)}

#var prompt.hp %1

#var prompt.hpmax %2

#var prompt.mac {%eval( @prompt.ma-%3)}

#var prompt.ma %3

#var prompt.mamax %4

#var prompt.mvc {%eval( @prompt.hp-%5)}

#var prompt.mv %5

#var prompt.mvmax %6

#PSUB {%2/@prompt.hpc} %x2

#PSUB {%2/@prompt.hpc} %x4

#PSUB {%2/@prompt.hpc} %x6

}

#CLASS 0[/code:op41ihii]

Original Prompt display:

[code:op41ihii](Hp: 100/200) (Ma: 100/200) (Mv: 100/200)>[/code:op41ihii]

New Prompt display:

[code:op41ihii](Hp: 100/200/0) (Ma: 100/200/0) (Mv: 100/200/0)>[/code:op41ihii]

So, when you take 50 damage, your prompt will show:

[code:op41ihii](Hp: 50/200/-50) (Ma: 100/200/0) (Mv: 100/200/0)>[/code:op41ihii]

Works the same with ma and mv. really useful if you like to see exact numbers.

Jake! Is that you? :twisted:

Sorry, no. i’m new to the mud. :)

Double, double toil and trouble;

Fire burn, and cauldron bubble.

only change:

#PSUB {%2/@prompt.hpc} %x2

#PSUB {%2/@prompt.hpc} %x4

#PSUB {%2/@prompt.hpc} %x6

to..

#PSUB {%2/@prompt.hpc} %x2

#PSUB {%2/@prompt.mac} %x4

#PSUB {%2/@prompt.mvc} %x6

A ball of twine, an old birds nest;

And now this brew is ready to test!

A dogs nose, a weasels tail

a pirates hook, a dragons scale

[img:2p7ewf8k]http://www.hauntedmansion.info/Snow%20White/snow_witch_cauldron.jpg[/img:2p7ewf8k]

Muhahahahaha!

a weasel’s tail? :shock: now that’s just wrong.