/* * Author: Dr Nexus * Modified by: Kroy * * Choose the race and set race specific attributes, for character c. * * Parameter c Character to set. * Parameter race of the character. * Return create basic stats. */ public bool OnCharacterChooseRace(Character c, Races race) { //Skill lang = null; if (race == Races.Dwarf) { Dwarf.Start(c); } else if (race == Races.Gnome) { Gnome.Start(c); } else if (race == Races.Human) { Human.Start(c); } else if (race == Races.NightElf) { NightElf.Start(c); } else if (race == Races.Orc) { Orc.Start(c); } else if (race == Races.Tauren) { Tauren.Start(c); } else if (race == Races.Troll) { Troll.Start(c); } else if (race == Races.Undead) { Undead.Start(c); } ChooseClass(c); // Coose class after race. return(true); // execute the caller code }
/* * Author: Dr Nexus * Modified by: Kroy * * Call the level up method for the corresponding class. * * Parameter c Character to level up. * Parameter level Current level. * Parameter gainHP Hit points to gain on level up. * Parameter gainMana Mana to gain on level up. * Parameter gainStrength Strength to gain on level up. * Parameter gainAgility Agility to gain on level up. * Parameter gainStamina Stamina to gain on level up. * Parameter gainInt Intellect to gain on level up. * Parameter gainSpirit Spirit to gain on level up. * Return level up or default code. */ bool OnLevelUp(Character c, int level, ref int gainHp, ref int gainMana, ref float gainStrength, ref float gainAgility, ref float gainStamina, ref float gainInt, ref float gainSpirit) { /* Class specific level up */ switch (c.Classe) { case Classes.Druid: Druid.LevelUp(c, ref gainHp, ref gainMana, ref gainStrength, ref gainAgility, ref gainStamina, ref gainInt, ref gainSpirit); break; case Classes.Hunter: Hunter.LevelUp(c, ref gainHp, ref gainMana, ref gainStrength, ref gainAgility, ref gainStamina, ref gainInt, ref gainSpirit); break; case Classes.Mage: Mage.LevelUp(c, ref gainHp, ref gainMana, ref gainStrength, ref gainAgility, ref gainStamina, ref gainInt, ref gainSpirit); break; case Classes.Priest: Priest.LevelUp(c, ref gainHp, ref gainMana, ref gainStrength, ref gainAgility, ref gainStamina, ref gainInt, ref gainSpirit); break; case Classes.Paladin: Paladin.LevelUp(c, ref gainHp, ref gainMana, ref gainStrength, ref gainAgility, ref gainStamina, ref gainInt, ref gainSpirit); break; case Classes.Rogue: Rogue.LevelUp(c, ref gainHp, ref gainMana, ref gainStrength, ref gainAgility, ref gainStamina, ref gainInt, ref gainSpirit); break; case Classes.Shaman: Shaman.LevelUp(c, ref gainHp, ref gainMana, ref gainStrength, ref gainAgility, ref gainStamina, ref gainInt, ref gainSpirit); break; case Classes.Warrior: Warrior.LevelUp(c, ref gainHp, ref gainMana, ref gainStrength, ref gainAgility, ref gainStamina, ref gainInt, ref gainSpirit); break; case Classes.Warlock: Warlock.LevelUp(c, ref gainHp, ref gainMana, ref gainStrength, ref gainAgility, ref gainStamina, ref gainInt, ref gainSpirit); break; default: Console.WriteLine("LevelUP wrong Classe:" + c.Classe); break; } /* If we have racial bonus */ switch (c.Race) { case Races.Gnome: Gnome.LevelUp(c, ref gainHp, ref gainMana, ref gainStrength, ref gainAgility, ref gainStamina, ref gainInt, ref gainSpirit); break; case Races.Human: Human.LevelUp(c, ref gainHp, ref gainMana, ref gainStrength, ref gainAgility, ref gainStamina, ref gainInt, ref gainSpirit); break; case Races.Tauren: Tauren.LevelUp(c, ref gainHp, ref gainMana, ref gainStrength, ref gainAgility, ref gainStamina, ref gainInt, ref gainSpirit); break; default: break; } /* Penalty for low stat classes */ if (((c.Iq + gainInt) <= 20) && (gainInt > 0)) { // Before 20 int point you not gain that much mana gainMana -= 14; if (gainMana < 0) { gainMana = 0; } } if (((c.Stamina + gainStamina) <= 20) && (gainStamina > 0)) { // Before 20 stamina point you not gain that much hp gainHp -= 9; } return(true); // execute the default code }