Denizen Health

by Malarious

Back to Mechanic's Corner.

Malarious2012-05-14 08:42:34
So I had this idea to track denizen health but trying to work out the specifics. The main issue is I have never really looked into lua tables, so could use some help getting the table and serializing and such set up. As well as some thoughts on how best to handle it.


What I will need:
- Trigger for kick hitting
* Sets hit type to kick
- Trigger for nekai hitting
* Sets hit type to nekai
- Triggers for critical hits
* Does hit type damage * crit level.
- Triggers for damageshift
* If a kill causes damageshift flag the next test as wrong unless damageshift wears off.
- Trigger for denizen slain
* This is just to total. If totaldam < priordam store it as the new health level.


Triggers will have to track the denizens FULL name, to prevent things like kephera worker and kephera monk from being considered the same.

How do I get Lua to compare things for the table though? Example Nekai trigger:
Slashing viciously at a giant snapping turtle, you rend him with a twin scythe nekai.
You have scored a CRITICAL hit!

How do I make a comparison against the table though?

Its almost 5am, I am hitting the hey will check on this thread later.

Thanks!

PS. My results will be made available later. Though info could be skewed because of mob resistances/weaknesses.
Daganev2012-05-14 09:09:34
I think all you have to do is:

priordam = mobHealthTable or totaldam
If totaldam <= priordam then
mobHealthTable = totaldam
end
Malarious2012-05-14 09:30:59
That would be oddly simple... I may have to try that... <.<
Unknown2012-05-14 14:36:13

damage_tracking = {
= {
= {
= "",
= 0,
= 0,
= 0
}
},
= {
= 0,
= 0,
= 0,
= 0,
= 0,
= 0
}
}


Could do something like that if you wanted to get fancy, too.
Malarious2012-05-14 17:59:57
That one scares me....

mobHealth

I will use Pestilence to get a base damage line. Will report back if nothing breaks and return with some information.