Ejemplo n.º 1
0
    return pow($x + $y, 0.5);
}
function save($i, $j, $R)
{
    global $answer;
    if (!isset($answer[$i]["2R"]) || $answer[$i]["2R"] > $R) {
        $answer[$i]["2R"] = $R;
    }
    if (!isset($answer[$j]["2R"]) || $answer[$j]["2R"] > $R) {
        $answer[$j]["2R"] = $R;
    }
}
$countOfPoints = count($points);
for ($i = 0; $i < $countOfPoints; $i++) {
    for ($j = $i + 1; $j < $countOfPoints; $j++) {
        $R = getRadius($points[$i], $points[$j]);
        save($i, $j, 2 * $R);
        //print_r($i." ".$j." ".$R."\r\n");
        $temp[$i][$j] = $R;
    }
}
foreach ($temp as $i => $each) {
    foreach ($each as $j => $R) {
        if ($answer[$i]["2R"] >= $R) {
            if (!isset($answer[$i]["neigbors"])) {
                $answer[$i]["neigbors"] = 1;
            } else {
                $answer[$i]["neigbors"]++;
            }
        }
        if ($answer[$j]["2R"] >= $R) {
Ejemplo n.º 2
0
function getSpellData($spell)
{
    // Basepoints
    $s1 = abs($spell['EffectBasePoints_1'] + 1);
    $s2 = abs($spell['EffectBasePoints_2'] + 1);
    $s3 = abs($spell['EffectBasePoints_3'] + 1);
    if ($spell['EffectDieSides_1'] > 1) {
        $s1 .= " - " . abs($spell['EffectBasePoints_1'] + $spell['EffectDieSides_1']);
    }
    if ($spell['EffectDieSides_2'] > 1) {
        $s2 .= " - " . abs($spell['EffectBasePoints_2'] + $spell['EffectDieSides_2']);
    }
    if ($spell['EffectDieSides_3'] > 1) {
        $s3 .= " - " . abs($spell['EffectBasePoints_3'] + $spell['EffectDieSides_3']);
    }
    $d = 0;
    if ($spell['DurationIndex']) {
        if ($spell_duration = getSpellDurationData($spell['DurationIndex'])) {
            $d = $spell_duration['duration_1'] / 1000;
        }
    }
    // Tick duration
    $t1 = $spell['EffectAmplitude_1'] ? $spell['EffectAmplitude_1'] / 1000 : 5;
    $t2 = $spell['EffectAmplitude_1'] ? $spell['EffectAmplitude_2'] / 1000 : 5;
    $t3 = $spell['EffectAmplitude_1'] ? $spell['EffectAmplitude_3'] / 1000 : 5;
    // Points per tick
    $o1 = @intval($s1 * $d / $t1);
    $o2 = @intval($s2 * $d / $t2);
    $o3 = @intval($s3 * $d / $t3);
    $spellData['t1'] = $t1;
    $spellData['t2'] = $t2;
    $spellData['t3'] = $t3;
    $spellData['o1'] = $o1;
    $spellData['o2'] = $o2;
    $spellData['o3'] = $o3;
    $spellData['s1'] = $s1;
    $spellData['s2'] = $s2;
    $spellData['s3'] = $s3;
    $spellData['m1'] = $s1;
    $spellData['m2'] = $s2;
    $spellData['m3'] = $s3;
    $spellData['x1'] = $spell['EffectChainTarget_1'];
    $spellData['x2'] = $spell['EffectChainTarget_2'];
    $spellData['x3'] = $spell['EffectChainTarget_3'];
    //  $spellData['i'] = $spell['MaxAffectedTargets'];
    $spellData['d'] = getTimeText($d);
    $spellData['d1'] = getTimeText($d);
    $spellData['d2'] = getTimeText($d);
    $spellData['d3'] = getTimeText($d);
    $spellData['v'] = $spell['AffectedTargetLevel'];
    $spellData['u'] = $spell['StackAmount'];
    $spellData['a1'] = getRadius($spell['EffectRadiusIndex_1']);
    $spellData['a2'] = getRadius($spell['EffectRadiusIndex_2']);
    $spellData['a3'] = getRadius($spell['EffectRadiusIndex_3']);
    $spellData['b1'] = $spell['EffectPointsPerComboPoint_1'];
    $spellData['b2'] = $spell['EffectPointsPerComboPoint_2'];
    $spellData['b3'] = $spell['EffectPointsPerComboPoint_3'];
    $spellData['e'] = $spell['EffectMultipleValue_1'];
    $spellData['e1'] = $spell['EffectMultipleValue_1'];
    $spellData['e2'] = $spell['EffectMultipleValue_2'];
    $spellData['e3'] = $spell['EffectMultipleValue_3'];
    $spellData['f1'] = $spell['DmgMultiplier_1'];
    $spellData['f2'] = $spell['DmgMultiplier_2'];
    $spellData['f3'] = $spell['DmgMultiplier_3'];
    $spellData['q1'] = $spell['EffectMiscValue_1'];
    $spellData['q2'] = $spell['EffectMiscValue_2'];
    $spellData['q3'] = $spell['EffectMiscValue_3'];
    $spellData['h'] = $spell['procChance'];
    $spellData['n'] = $spell['procCharges'];
    $spellData['z'] = "<home>";
    return $spellData;
}
Ejemplo n.º 3
0
<?php

error_reporting(E_ALL);
$errors = array();
require_once 'ImageManipulator.php';
if (isset($_GET['contactId'])) {
    $contactId = $_GET['contactId'];
}
//    if (isset($_SESSION['accessLevel'])) {
//        $accessLevel = $_SESSION['accessLevel'];
//    }
$contact = getSingleContact($dbconn, $contactId);
$trainer = getSingleTrainer($dbconn, $contactId);
$chooseState = getAllState($dbconn);
$radius = getRadius($dbconn);
$woType = getwoSubCat($dbconn);
$trId = $trainer['trId'];
if (!empty($contact['phone'])) {
    $phoneout = preg_replace("/([0-9]{3})([0-9]{3})([0-9]{4})/", "\$1-\$2-\$3", $contact['phone']);
} else {
    $phoneout = "";
}
if (!empty($contact['mobile'])) {
    $mobileout = preg_replace("/([0-9]{3})([0-9]{3})([0-9]{4})/", "\$1-\$2-\$3", $contact['mobile']);
} else {
    $mobileout = "";
}
//format date for output
$bdo = new DateTime($contact['birthDate']);
$birthDateOut = $bdo->format('m/d/Y');
try {