Jump to content

Aero2.0

Members
  • Posts

    6
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Posts posted by Aero2.0

  1. The race count stuff can all be done in 1 query afaik

    Yea I think so too, and that one is really bothering me because it's not pretty so I wrote this...

    <?
    require_once('config.php');
    
    mysql_connect("$ip", "$user", "$pass");
    mysql_select_db ("$mangoscharacters");
    $race = array();
    $class = array();
    $query = "select race, class from characters";
    $result = mysql_query($query);
    while ($row = mysql_fetch_assoc($result)) {
       $race[$row['race']]++;
       $class[$row['class']]++;
    }
    
    echo "Humans: $race[1]
    ";
    echo "Dwarves: $race[3]
    ";
    echo "Night Elf: $race[4]
    ";
    echo "Gnome: $race[7]
    ";
    echo "Draenei: $race[11]
    ";
    echo "Orc: $race[2]
    ";
    echo "Undead: $race[5]
    ";
    echo "Tauren: $race[6]
    ";
    echo "Troll: $race[8]
    ";
    echo "Blood Elf: $race[10]
    
    ";
    echo "Druid: $class[11]
    ";
    echo "Hunter: $class[3]
    ";
    echo "Mage: $class[8]
    ";
    echo "Paladin: $class[2]
    ";
    echo "Priest: $class[5]
    ";
    echo "Rogue: $class[4]
    ";
    echo "Shaman: $class[7]
    ";
    echo "Warlock: $class[9]
    ";
    echo "Warrior: $class[1]
    ";
    echo "Death Knight: $class[6]
    ";
    ?>

    I haven't tested it yet but it should be much more efficient.. please correct me if I'm wrong though

  2. I don't have a clean enough copy of MaNGOS downloaded atm, so I can't post a patch file, but I would open Unit.cpp and find the isHostileTo function.. and underneath..

            // Duel
           if(pTester->duel && pTester->duel->opponent == pTarget && pTester->duel->startTime != 0)
               return true;

    add..

            // Race
           if(pTester->getRace() != pTarget->getRace())
               return true;

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use