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
Hron
Beginner


Joined: 16 Jan 2015
Posts: 11

PostPosted: Sun Jan 25, 2015 9:16 pm   

Help with Kill/XP track database
 
Hi, im struggling with creation of database for kills and xp gained.

this is output from mud i play:

Your kick DISMEMBERS bodyguard!
Bodyguard IS DEAD!!
You receive 2 experience points.


I serched this forum, and found one or two kill counters but after some changes i cant force them to at least add +1 for kill count, not to mention catching XP gained being displayed in second line.

What i would like to have is database that gathers killcount and total xp gained from diferent mobs,
and an alias: 'showxp bodyguard' and it would display:
bodyguard [killed: 101] [average xp: 2]
and ofcourse other mobs with diferent names

ofcourse average xp is 2 becouse there was a math: 202/101 = 2 (202 as total is stored in database)

I know it would take some time to write such script, so maybe some tips on where to look for? or how to create 3 column database instead of 2? and how to increment kill count? How to read from both lines, while trigger starts at {* IS DEAD!!}
Reply with quote
shalimar
GURU


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

PostPosted: Mon Jan 26, 2015 1:17 am   
 
Something like this should work.... its untested though


#TR {(*) IS DEAD!!} {}
#COND {You receive (%d) experience points. } {
$killed=%t1
$xp=(%db(%db(@killChart, $killed), TotalXP)+%t2)
$kills=(%db(%db(@killChart, $killed), Killed)+1)
#ADDKEY killChart.${killed} TotalXP $xp
#ADDKEY killCHart.${killed} Killed $kills
#ADDKEY killChart.${killed} Average ($xp/$kills)
}

#ALIAS showxp($mob) {#SHOWDB %db(@killChart, $mob)}
_________________
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