View Single Post
Old 04-27-2009, 08:59 PM   #106 (permalink)
argantes
The Visitor
 
Join Date: Apr 2009
Posts: 2
Thanks: 2
argantes is on a distinguished road
Confused

Quote:
Originally Posted by crispus View Post
Thanks alot. How would you go about converting the numeric value into said class?
i use 2 functions i wrote

PHP Code:
function return_class($classid) {
    switch (
$classid) {
        case 
1:
            
$class "Warrior";
            break;
        case 
2:
            
$class "Paladin";
            break;
        case 
3:
            
$class "Hunter";
            break;
        case 
4:
            
$class "Rogue";
            break;
        case 
5:
            
$class "Priest";
            break;
        case 
6:
            
$class "Death Knight";
            break;
        case 
7:
            
$class "Shaman";
            break;
        case 
8:
            
$class "Mage";
            break;
        case 
9:
            
$class "Warlock";
            break;
        case 
11:
            
$class "Druid";
            break;
    }
    return 
$class;

called like

PHP Code:
$toonclass    return_class($char['classId']); 
and for race

PHP Code:
function return_race($raceid$sex) {
    switch (
$raceid) {
        case 
1:
            if (
$sex == "0") {$race "Human Male";}
            if (
$sex == "1") {$race "Human Female";}
            break;
        case 
2:
            if (
$sex == "0") {$race "Orc Male";}
            if (
$sex == "1") {$race "Orc Female";}
            break;
        case 
3:
            if (
$sex == "0") {$race "Dwarf Male";}
            if (
$sex == "1") {$race "Dwarf Female";}
            break;
        case 
4:
            if (
$sex == "0") {$race "Night Elf Male";}
            if (
$sex == "1") {$race "Night Elf Female";}
            break;
        case 
5:
            if (
$sex == "0") {$race "Undead Male";}
            if (
$sex == "1") {$race "Undead Female";}
            break;
        case 
6:
            if (
$sex == "0") {$race "Tauren Male";}
            if (
$sex == "1") {$race "Tauren Female";}
            break;
        case 
7:
            if (
$sex == "0") {$race "Gnome Male";}
            if (
$sex == "1") {$race "Gnome Female";}
            break;
        case 
8:
            if (
$sex == "0") {$race "Troll Male";}
            if (
$sex == "1") {$race "Troll Female";}
            break;
        case 
10:
            if (
$sex == "0") {$race "Blood Elf Male";}
            if (
$sex == "1") {$race "Blood Elf Female";}
            break;
        case 
11:
            if (
$sex == "0") {$race "Draenei Male";}
            if (
$sex == "1") {$race "Draenei Female";}
            break;
    }
    return 
$race;

called with something like

PHP Code:
$toonrace    return_race($char['raceId'], $char['genderId']); 
argantes is offline  
Reply With Quote
The Following User Says Thank You to argantes For This Useful Post:
crispus (04-28-2009)