Overview
This is really a 3 step process of mine in revamping the combat system in MoM. Luckily for me they did an excellent job of not spreading it all over the place so it should be a fairly straight forward piece of work (with I am sure some hangup I missed). I am going to write up a few parts of this for people who are interested in doing something similiar or who are just interested in how it all works :-). We should really have another wiki for documenting how it works by itself :-).
The first part is setting manual values for spawn. If you are not too much familiar with this, the stats (health, mana, stamina, str, etc) are all controlled by the level, difficultyMod, some scalers that can be added for health, stamina, mana, offense, and defense, difficulty of the game, objects and spells, and the class. The best way to figure out how these are all applied and where is to use the IDE or some other kind of grep function and explore the entries throughout the project.
If you want to manually control some of these values (in particular the stats which really are flat and controlled by level) you can make a very simple hack job to implement some pieces of code that are already in place. For health/mana/stamina you will need to make a new entry into the Spawn class/DB and that will be shown (it is stupid easy). I left out Offense and Defense because I am taking these values out of my code and replacing them with other values, but the same general process can be done since they are also controlled by the same factors.
As a final note be aware that other factors happen after these settings that will still affect these stats. They get rid of the "automatic" stat generation, but will not affect code such as checking for lower levels/higher levels to modify a stat, scalers, etc.
--Xerves
Changes
Only 2 files will be modified to get this to work.
mud/world/mob.py mud/world/spawn.py
In mob.py find the following code in the mob Class
self.str = spawn.plevel*10+100
self.dex = spawn.plevel*10+100
self.ref = spawn.plevel*10+100
self.agi = spawn.plevel*10+100
self.wis = spawn.plevel*10+100
self.bdy = spawn.plevel*10+100
self.mnd = spawn.plevel*10+100
self.mys = spawn.plevel*10+100
self.pre = presence
self.armor = spawn.plevel*10
Immediately after it add the following code
#PROJSTATMOD
if (spawn.strBase):
self.str = spawn.strBase
self.strBase = spawn.strBase
if (spawn.dexBase):
self.dex = spawn.dexBase
self.dexBase = spawn.dexBase
if (spawn.refBase):
self.ref = spawn.refBase
self.refBase = spawn.refBase
if (spawn.agiBase):
self.agi = spawn.agiBase
self.agiBase = spawn.agiBase
if (spawn.wisBase):
self.wis = spawn.wisBase
self.wisBase = spawn.wisBase
if (spawn.bdyBase):
self.bdy = spawn.bdyBase
self.bdyBase = spawn.bdyBase
if (spawn.mndBase):
self.mnd = spawn.mndBase
self.mndBase = spawn.mndBase
if (spawn.mysBase):
self.mys = spawn.mysBase
self.mysBase = spawn.mysBase
if (spawn.preBase):
self.pre = spawn.preBase
self.preBase = spawn.preBase
if (self.preBase > RPG_MAX_PRESENCE):
self.preBase = RPG_MAX_PRESENCE
spawn.preBase = RPG_MAX_PRESENCE
#PROJSTATMOD
This will force the mob to be created with only the the Base values you specify on the spawn instead of the randomly generated values just above. You will notice that armor is a value that could possibly be replaced also. See the information in the spawn file to see how this could be done. This part takes care of the str, dex stats but not Health. That is coming up next. Find the following code in updateDrivedStats
#tertiary class
if self.tclass:
tstats = self.tclass.getClassStats(self,self.tlevel)
for st,value in tstats.iteritems():
if value > stats[st]:
stats[st]=value
for st,value in stats.iteritems():
setattr(self,st,value)
Immediately afterwards add the following values
#PROJSTATMOD
if (self.spawn.hitBase):
self.maxHealth = self.spawn.hitBase
if (self.spawn.manaBase):
self.maxMana = self.spawn.manaBase
if (self.spawn.staminaBase):
self.maxStamina = self.spawn.staminaBase
#PROJSTATMOD
This will add in the values for hp/mana/stamina. What is going on is that it is looping through some code in /mud/world/archetype.py which is the class code. The class code controls hp/mana/stamina/offense/defense/primaryAttackRate/secondarAttackRate/critical initial values (check getClassStats in archetype.py for how this works). Immediately after this code is called we check the spawn for manual values to replace those automatically generated ones. If you wanted to replace Offense/Defense you will need to add a new value to the Spawn class....which we are going to do now. In spawn.py file the following values in the Spawn class
wisBase = IntCol(default=0)
bdyBase = IntCol(default=0)
mndBase = IntCol(default=0)
mysBase = IntCol(default=0)
Immediately afterwards add the following
#PROJSTATMOD
hitBase = IntCol(default=0)
manaBase = IntCol(default=0)
staminaBase = IntCol(default=0)
#PROJSTATMOD
This will create an integer value into the database and add it to the class (the Spawn class actually controls the database too). Once this is done compile and make sure there are no errors. You should be able to manually set the values on a spawn now. Below is what you would need to do.
spawn.strBase = 14 spawn.dexBase = 14 spawn.refBase = 14 spawn.agiBase = 14 spawn.wisBase = 14 spawn.bdyBase = 14 spawn.mndBase = 14 spawn.mysBase = 14 spawn.manaBase = 200 spawn.staminaBase = 200 spawn.hitBase = 200
Now, this will create a VERY easy mob, but you can see these are the values you now can add to your spawns. If you want to leave everything auto generated but you want your Titan to have a BUCKET LOAD of strength you can just set the strBase way above the normal generated value (LEVEL*10)+100 to whatever you want.
Well I hope this helps someone.
--Xerves

