示例#1
0
$characterData = array();
//Get the refundables
$res = ItemRefundSystem::GetRefundables();
?>
            	
                <div class="container_3 account-wide" align="center">
                    <div class="items">
                    
                    <?php 
if ($res) {
    while ($arr = $res->fetch()) {
        $GUID = $arr['character'];
        //Get the character data for this refund
        if (!isset($characterData[$GUID])) {
            $columns = array('name', 'class', 'level', 'race', 'gender');
            $characterData[$GUID] = $chars->getCharacterData($GUID, false, $columns);
            unset($columns);
        }
        echo '
							<ul class="item-row">
								<li class="item-icon">
									<a href="', $config['WoWDB_URL'], '/?item=', $arr['entry'], '" target="_newtab" rel="item=', $arr['entry'], '">
										<img style="background-image:url(http://wow.zamimg.com/images/wow/icons/large/inv_misc_questionmark.jpg)"/>
									</a>
								</li>
								<li class="item-info"><h2>Loading</h2><h5>', $arr['price'], ' ', $arr['currency'] == CA_COIN_TYPE_SILVER ? 'Silver' : 'Gold', ' Coins</h5></li>
								<li class="refund-btn"><a href="#" class="refund-btn" onclick="return RefundItem(', $arr['id'], ');">Refund</a></li>';
        if ($characterData[$GUID]) {
            $ClassSimple = str_replace(' ', '', strtolower($chars->getClassString($characterData[$GUID]['class'])));
            echo '
									<li class="character">
示例#2
0
//prepare the commands class
$command = new server_Commands();
//prepare the character handler
$chars = new server_Character();
//setup the maps data class
$MD = new MapsData();
//setup the map points data class
$MP = new MapPoints();
//start logging
$logs->add('TELEPORTER', 'Starting log session. Teleporting player: ' . $charName . ', to point: ' . $pointId . ', selected realm: ' . $RealmId . '.', 'pending');
//connect to the database
if ($chars->setRealm($RealmId)) {
    ################################################
    ####   check if the character is valid    ######
    //get some character data
    $charData = $chars->getCharacterData(false, $charName, array('guid', 'level'));
    //find the map key by pointId
    $mapKey = $MD->ResolveMapByPoint($pointId);
    //get the map data
    $mapData = $MD->get($mapKey);
    if (!$chars->isMyCharacter(false, $charName)) {
        $ERRORS->Add('The selected character does not belong to this account.');
        //update the log
        $logs->update(false, 'The selected character belongs to another account.', 'error');
    } else {
        if ($mapData['reqLevel'] > $charData['level']) {
            $ERRORS->Add('The selected character does not meet the level requirement. The location requires a minimum of atleast ' . $charData['level'] . ' level.');
            //update the log
            $logs->update(false, 'The selected character does not meet the level requirement. The location requires a minimum of atleast ' . $charData['level'] . ' level.', 'error');
        } else {
            //get the coords
示例#3
0
$perPage = isset($_GET['perPage']) ? (int) $_GET['perPage'] : 6;
$category = isset($_GET['category']) ? (int) $_GET['category'] : 0;
$character = isset($_GET['character']) ? $_GET['character'] : false;
$realm = isset($_GET['realm']) ? (int) $_GET['realm'] : 1;
//set the realm
$chars->setRealm($realm);
//define some defaults
$where = "";
$isFiltered = false;
if ($category and $category > 0) {
    $where = "AND `category` = :filter";
    $isFiltered = true;
}
//get the character info
if ($character and $character != '') {
    $charClass = $chars->getCharacterData(false, $character, 'class');
    //append the conditions to the where variable
    $where .= " AND `class` IN('0', :class)";
}
//count the items
$count_res = $DB->prepare("SELECT COUNT(*) FROM `armorsets` WHERE `realm` = '-1' " . $where . " or `realm` = :realm " . $where);
$count_res->bindParam(':realm', $realm, PDO::PARAM_INT);
if (isset($charClass)) {
    $count_res->bindParam(':class', $charClass['class'], PDO::PARAM_INT);
}
if ($isFiltered) {
    $count_res->bindParam(':filter', $category, PDO::PARAM_INT);
}
$count_res->execute();
$count_row = $count_res->fetch(PDO::FETCH_NUM);
$count = $count_row[0];
示例#4
0
if (!$pointId) {
    echo '<error>Invalid point id.</error>';
}
if (!$charName) {
    echo '<error>Invalid character.</error>';
}
//setup the maps data class
$MD = new MapsData();
//find the map key by pointId
$mapKey = $MD->ResolveMapByPoint($pointId);
//get the map data
$mapData = $MD->get($mapKey);
//free memory
unset($MD);
//setup the characters class
$chars = new server_Character();
//set the realm
$chars->setRealm($RealmId);
//get the character level
$level = $chars->getCharacterData(false, $charName, 'level');
unset($chars);
//return the collected data
echo '
<info>
	<reqLevel>', $mapData['reqLevel'], '</reqLevel>
	<charLevel>', $level['level'], '</charLevel>
</info>';
//set the XML header
if (!headers_sent()) {
    header("content-type: text/xml");
}
示例#5
0
//construct the characters handler
$chars = new server_Character();
//get the account gold and silver
$accountGold = (int) $CURUSER->get('gold');
$accountSilver = (int) $CURUSER->get('silver');
//start logging
$logs->add('STORE', 'Starting log session, initial values: ' . $accountSilver . ' silver, ' . $accountGold . ' gold. To character: ' . $charName . ' in realm: ' . $RealmId . '.', 'pending');
//set the realm
if ($chars->setRealm($RealmId)) {
    //check if the character belongs to this account
    if ($chars->isMyCharacter(false, $charName)) {
        //create error array
        $itemErrors = array();
        //create negative items string
        $itemsString = false;
        $charData = $chars->getCharacterData(false, $charName, 'guid');
        //Get the character GUID
        $characterGUID = $charData['guid'];
        unset($charData);
        //loop the item list
        foreach ($items as $index => $data) {
            //set the default hasMoney to false
            $hasMoney = false;
            list($id, $currency, $icon) = explode(',', $data);
            //save the currency of this item in case of error
            $itemErrors[$index]['id'] = $id;
            $itemErrors[$index]['currency'] = $currency;
            $itemErrors[$index]['icon'] = $icon;
            $itemErrors[$index]['error'] = '';
            //get the store items records
            $res = $DB->prepare("SELECT id, entry, silver, gold FROM `store_items` WHERE `id` = :item AND `realm` LIKE CONCAT('%', :realm, '%') LIMIT 1;");
示例#6
0
    }
}
unset($BalanceError);
$ERRORS->Check('/index.php?page=levels');
####################################################################
## The actual script begins here
//construct the characters handler
$chars = new server_Character();
//start logging
$logs->add('PSTORE_LEVEL', 'Starting log session. Leveling character: ' . $character . ' to level ' . $level['level'] . '. Using currency: ' . $level['priceCurrency'] . ', price value: ' . $level['price'] . ', selected realm: ' . $RealmId . '.', 'pending');
//set the realm
if ($chars->setRealm($RealmId)) {
    //check if the character belongs to this account
    if ($chars->isMyCharacter(false, $character)) {
        //get the character name
        $charData = $chars->getCharacterData(false, $character, 'level');
        //check if the character is already higher level
        if ($charData['level'] < $level['level']) {
            //level the character
            $levelUp = $command->levelTo($character, $level['level'], $RealmId);
            //send the gold
            $sentGold = $command->sendMoney($character, $level['money'], 'Premium Store Delivery', $RealmId);
            //make the bags string
            $bagsString = "";
            for ($i = 0; $i < $level['bags']; $i++) {
                $bagsString .= $level['bagsId'] . " ";
            }
            //send the bags
            $sentBags = $command->sendItems($character, $bagsString, 'Premium Store Delivery', $RealmId);
            //check if any of the actions have failed and log it
            if ($levelUp !== true) {