Exemple #1
0
    case 9:
        $map = "530";
        $x = "-1863.03";
        $y = "4998.05";
        $z = "-21.1847";
        $place = "Shattrath";
        break;
        //for unknowness -> shattrath
    //for unknowness -> shattrath
    default:
        JLog::add('teleport.php: Invalid location. Location=' . $location, JLog::ERROR);
        echo "<strong>Invalid location.</strong>";
        return;
        break;
}
if (!($char = JTrinityCoreDBHelper::getCharacterInfo($realmid, $guid))) {
    JLog::add('Error getting char info. Realmid=' . $realmid . '  guid=' . $guid, JLog::ERROR);
    die("Error getting char info. Contact administrator or GM.");
}
// Disallows factions to use enemy portals
switch ($char->race) {
    //alliance race
    case 1:
    case 3:
    case 4:
    case 7:
    case 11:
        if ($location >= 5 && $location <= 8 && $location != 9) {
            echo JText::_('COM_JTRINITYCORE_NOTELEPORT_ALLIANCE_HORDE');
            return;
        }
Exemple #2
0
<?php

// No direct access to this file
defined('_JEXEC') or die('Restricted Access');
JRequest::checkToken() or die('Invalid Token');
// Get gold info
$model = $this->getModel();
$gold = $model->getGoldInfo(JRequest::getVar('gold'));
$characterid = JRequest::getVar('characterid');
$realmid = JRequest::getVar('realmid');
// Check if user has enough points
$userpoints = JTrinityCoreUtilities::getPoints();
if ($userpoints < $gold->cost) {
    echo JText::_('COM_JTRINITYCORE_NOT_ENOUGH_POINTS');
    return;
}
$char = JTrinityCoreDBHelper::getCharacterInfo($realmid, $characterid);
if ($model->buyGold($gold, $realmid, $char)) {
    echo JText::sprintf('COM_JTRINITYCORE_BUYGOLD_OK', $char->name, (int) floor($char->money / 10000) + $gold->quantity);
} else {
    echo JText::_('COM_JTRINITYCORE_BUYGOLD_ERROR');
}