Goto page Previous  1, 2 Character Browser need help with new magelo
Reply
for some reason it finally clicked in my head that there is no way that the HP value saved in the blob is your actual base HP. It doesnt make sence. I think the one saved in the database is the current HP, the ????/2352. So I poked around in the emu sourcecode and grabed the BASE hp calculation function, and converted it.

More +
$WARRIOR = 1;   
$CLERIC = 2;
$PALADIN = 3;
$RANGER = 4;
$SHADOWKNIGHT = 5;
$DRUID = 6;
$MONK = 7;
$BARD = 8;
$ROGUE = 9;
$SHAMAN = 10;
$NECROMANCER = 11;
$WIZARD = 12;
$MAGICIAN = 13;
$ENCHANTER = 14;
$BEASTLORD = 15;
$BERSERKER = 16;

//function copied/converted from EQEMU sourcecode may 2, 2009
function GetClassLevelFactor($mlevel,$class) {
   $multiplier = 0;

   switch($class)
   {
      case $WARRIOR:{
         if ($mlevel < 20)
            $multiplier = 220;
         else if ($mlevel < 30)
            $multiplier = 230;
         else if ($mlevel < 40)
            $multiplier = 250;
         else if ($mlevel < 53)
            $multiplier = 270;
         else if ($mlevel < 57)
            $multiplier = 280;
         else if ($mlevel < 60)
            $multiplier = 290;
         else if ($mlevel < 70)
            $multiplier = 300;
         else
            $multiplier = 311;
         break;
      }
      case $DRUID:
      case $CLERIC:
      case $SHAMAN:{
         if ($mlevel < 70)
            $multiplier = 150;
         else
            $multiplier = 157;
         break;
      }
      case $BERSERKER:
      case $PALADIN:
      case $SHADOWKNIGHT:{
         if ($mlevel < 35)
            $multiplier = 210;
         else if ($mlevel < 45)
            $multiplier = 220;
         else if ($mlevel < 51)
            $multiplier = 230;
         else if ($mlevel < 56)
            $multiplier = 240;
         else if ($mlevel < 60)
            $multiplier = 250;
         else if ($mlevel < 68)
            $multiplier = 260;
         else
            $multiplier = 270;
         break;
      }
      case $MONK:
      case $BARD:
      case $ROGUE:
      case $BEASTLORD:{
         if ($mlevel < 51)
            $multiplier = 180;
         else if ($mlevel < 58)
            $multiplier = 190;
         else if ($mlevel < 70)
            $multiplier = 200;
         else
            $multiplier = 210;
         break;
      }
      case $RANGER:{
         if ($mlevel < 58)
            $multiplier = 200;
         else if ($mlevel < 70)
            $multiplier = 210;
         else
            $multiplier = 220;
         break;
      }
      case $MAGICIAN:
      case $WIZARD:
      case $NECROMANCER:
      case $ENCHANTER:{
         if ($mlevel < 70)
            $multiplier = 120;
         else
            $multiplier = 127;
         break;
      }
      default:{
         if ($mlevel < 35)
            $multiplier = 210;
         else if ($mlevel < 45)
            $multiplier = 220;
         else if ($mlevel < 51)
            $multiplier = 230;
         else if ($mlevel < 56)
            $multiplier = 240;
         else if ($mlevel < 60)
            $multiplier = 250;
         else
            $multiplier = 260;
         break;
      }
   }
   return $multiplier;
}
//function copied/converted from EQEMU sourcecode may 2, 2009
function GetBaseHP($mlevel,$class,$sta)
{
   $lm = GetClassLevelFactor($mlevel,$class);
   $Post255 = 0;
   if(($sta-255)/2 > 0)
      $Post255 = ($sta-255)/2;
   else
      $Post255 = 0;
      
   $base_hp = (5)+($mlevel*$lm/10) + ((($sta-$Post255)*$mlevel*$lm/3000));
   return $base_hp;
}
Sat May 02, 2009 6:11 pm
Project Lead
Fixed mana using the same method as above... been posting all these new functions in the global.php..... don't think that is a very good spot for them, but I think I'm not going to mess with organizing this stuff till I'm done. I'll fix some/most of it when im writing the documentation and verifying the consistency of the code/comments/html output.
Sat May 02, 2009 8:28 pm
Project Lead
Simpley Kickass man.
Genius useing the actual HP Calc Tables too.
Sat May 02, 2009 8:31 pm
Project Member (Retired)
I realise now that to move forward I need to radically rethink my method and reformat the way i'm handling the items, so I gotta do some shuffling around and create 2 new classes, but it should end up being more easily maintainable and make more sence. It will delay what I thought was going to be getting close to a beta release.
Sun May 03, 2009 8:45 pm
Project Lead
Didn't get much done today. I got my hands on two character sources from cavedude so I can work with "live" data to verify everything. I've already found some inconsistencies in the inventory that need to be corrected. As far as HP/Mana the in game character had 890hp, the magelo said 891hp. 1742mana in game, 1745mana in the magelo. These are stats of a toon with NO AA abilities. I won't be implementing any AA crunching until next release. All the stats and resists were dead on.

The weight was off, im not adding in weight from the 8 inventory slots, weight from bags will need to be dynamic because of weight reducing bags.

Slots for bags need to be corrected from 22,33,44,55,66,77,88,99 to 22-30.

Add a bagstart[] array to global.php listing what slot# each bag starts in, i.e. bagstart[22] starts in slot 31.

Inventory is in columns, bags are in rows(good).

Still have a TON of work to do converting inventory management to the new class.
Mon May 04, 2009 8:26 pm
Project Lead
Goto page Previous  1, 2 Character Browser need help with new magelo
Reply