Ejemplo n.º 1
0
        gNews(0, 7, "creature stay extended", $text, $row["target"]);
    }
}
if ($action == "submitremoveallieddefense") {
    $no = 0;
    if (!$sid) {
        $output .= 'Invalid data.<br>';
        $no = 1;
    } else {
        $sql = "SELECT s.target, c.name FROM summons AS s, creatures AS c WHERE s.account = '{$acc['id']}' AND s.id = '{$sid}' AND s.type = '6' AND s.creature = c.id";
        $result = $db->query($sql);
        $numrows = $db->num_rows($result);
        if ($numrows != 1) {
            $output .= 'Invalid sid.<br>';
            $no = 1;
        } else {
            $row = $db->fetch_array($result);
        }
    }
    if ($acc["attacked"]) {
        $output .= 'You can\'t remove a creature from allied defense when you are under attack.<br>';
        $no = 1;
    }
    if ($no == 0) {
        $sql = "UPDATE summons SET type = '0' WHERE id = '{$sid}'";
        $result = $db->query($sql);
        $output .= 'You remove that creature from allied defense.<br>';
        $text .= "\r\n\t\t\t<a href=\"index.php?page=playerinfo&action=viewinfo&aid={$acc['id']}\">{$acc['name']}</a> withdrew " . strtolower($acc["gender"]["a"]) . " {$row['name']} from allied defense.<br>\r\n\t\t\t";
        gNews(0, 7, "creature removed", $text, $row["target"]);
    }
}
Ejemplo n.º 2
0
function gTutorial($id, $tid)
{
    global $db;
    $sql = "SELECT topic, text FROM tutorial WHERE id = '{$tid}'";
    $result = $db->query($sql);
    $numrows = $db->num_rows($result);
    if ($numrows == 1) {
        $row = $db->fetch_array($result);
        $text = addslashes($row["text"]);
        $sql = "SELECT id FROM tutorial WHERE parent = '{$tid}'";
        $result = $db->query($sql);
        $numrows = $db->num_rows($result);
        if ($numrows == 1) {
            $newtid = $db->result($result, 0);
            $text .= "\r\n\t\t\t\t<br><br>\r\n\t\t\t\t<a href=\"index.php?page=news&action=nexttutorial&tid={$newtid}\">Next tutorial.</a>\r\n\t\t\t\t";
        }
        return gNews(0, 4, $row["topic"], $text, $id);
    }
}
Ejemplo n.º 3
0
        if ($gdCurses[$curse["curse"]]["target"] == "creature") {
            $sql = "SELECT account FROM summons WHERE castcurse = '{$cuid}'";
            $result = $db->query($sql);
            $account = $db->result($result, 0);
            $sql = "UPDATE summons SET curse = '0', castcurse = '0' WHERE castcurse = '{$cuid}'";
            $result = $db->query($sql);
            $text = "<a href=\"index.php?page=playerinfo&action=viewinfo&aid={$acc['id']}\">{$acc['name']}</a> removed the " . addslashes($gdCurses[$curse["curse"]]["name"]) . " curse placed on one of your creatures.";
        } else {
            $sql = "SELECT id FROM accounts WHERE castcurse = '{$cuid}'";
            $result = $db->query($sql);
            $account = $db->result($result, 0);
            $sql = "UPDATE accounts SET curse = '0', castcurse = '0' WHERE castcurse = '{$cuid}'";
            $result = $db->query($sql);
            $text = "<a href=\"index.php?page=playerinfo&action=viewinfo&aid={$acc['id']}\">{$acc['name']}</a> removed the " . addslashes($gdCurses[$curse["curse"]]["name"]) . " curse placed on you.";
        }
        gNews(0, 6, "curse removed", $text, $account);
        echo 'You remove that curse.<br>';
        $action = "activecurses";
    }
}
if ($action == "viewshards") {
    $no = 0;
    $sql = "SELECT curse FROM accounts WHERE castcurse = '{$cuid}' AND id = '{$acc['id']}'";
    $result = $db->query($sql);
    $numrows = $db->num_rows($result);
    if ($numrows != 1) {
        $sql = "SELECT curse FROM summons WHERE castcurse = '{$cuid}' AND account = '{$acc['id']}'";
        $result = $db->query($sql);
        $numrows = $db->num_rows($result);
        if ($numrows != 1) {
            echo 'Invalid curse.<br>';
Ejemplo n.º 4
0
if ($action == "changeemail") {
    $no = 0;
    if ($newemail != $newemail2) {
        $output .= 'You haven\'t entered the same new e-mail address 2 times.<br>';
        $no = 1;
    }
    if (!ereg("[A-Za-z0-9_-]+([\\.]{1}[A-Za-z0-9_-]+)*@[A-Za-z0-9-]+([\\.]{1}[A-Za-z0-9-]+)+", $newemail)) {
        echo 'Your e-mail adress isn\'t valid.<br>';
        $no = 1;
    }
    $sql = "SELECT name FROM {$db_register_accounts} WHERE email = '{$newemail}'";
    $result = $db->query($sql);
    $numrows = $db->num_rows($result);
    if ($numrows != 0) {
        echo 'There is already an account with that e-mail adress. You can only have one account registered on the same account.<br>';
        $no = 1;
    }
    if ($acc["newemailtime"] != 0) {
        $date = date("Y-m-d H:i:s", $acc["newemailtime"] + gdPasswordChangeTimeOffset);
        $output .= 'Your account is already scheduled for an e-mail change on ' . $date . '.<br>';
        $no = 1;
    }
    if ($no == 0) {
        $sql = "UPDATE accounts SET newemail = '{$newemail}', newemailtime = '" . time() . "' WHERE id = '{$acc['id']}'";
        $result = $db->query($sql);
        $date = date("Y-m-d H:i:s", time() + gdPasswordChangeTimeOffset);
        $text = "Your e-mail address is scheduled to be changed to " . $newemail . " on " . $date . ". If you don't want this to happen, click <a href=\"index.php?page=options&action=cancelemailchange\">here</a>.";
        gNews(0, 9, "e-mail change scheduled", addslashes($text), $acc["id"], time() + gdPasswordChangeTimeOffset);
        $output .= 'You have succesfully requested an e-mail address change. If your request isn\'t cancelled before ' . $date . ' by clicking on the link in the news message, the e-mail address will be changed.<br>';
    }
}
Ejemplo n.º 5
0
    }
    if ($no != 1) {
        $cntcur = count($questions);
        if ($current < $cntcur) {
            echo $questions[$current][0];
            echo '<br>';
            fTitle("index.php?page=Surathil&action=quest");
            fText("Answer:", "answer");
            fEnd("Give the answer");
        } else {
            echo '
					<p>"You have proven yourself worthy mortal. Take these magical scrolls and use them well."
					<p>The light starts to fade until there is nothing but darkness around you.
				';
            $text = "It was {$acc['name']} that recovered the scrolls from New Surathil. As he enters Stonehenge, he is welcomed as a hero. The scrolls are handed over to the Stonehenge council. While everyone is still rejoicing, they retreat to the library to study the scrolls.";
            gNews(2, 10, "Scrolls recovered", $text);
        }
    }
}
/*
if (!$action) {
    tBegin("City Hall");

    echo '
    The New Surathil City Hall was constructed by the Nethers after the destruction of Surathil during the Itherian age. It\'s an architectural marvel. All administrative and commercial activity is concentrated in this building. The library containing the scrolls which were recovered from the ruins of Surathli\'s tower is situated west of the plaza. There are a bunch of shops and state enterprises set up near the east wall, some of which are run by Nethers. Carved in the north wall is a beautiful sculpture depicting Surathli, Aetar and Tular in honor of their sacrifices. There\'s a beautiful plaza and a small fountain in the middle of the great hall. It was built on the ruins of the old Surathil pool and appears to have inherited some of its magical properties.<br><br>
    ';

    if ($acc["level"] >= gdArcaneLevelMin) {
        echo '
        <a href="index.php?page=Surathil&action=builder">Visit the Nether Builder.</a><br>
        <a href="index.php?page=Surathil&action=creator">Visit the Nether Creator.</a><br>
Ejemplo n.º 6
0
                                        // KILLED
                                        $bosskilled = TRUE;
                                    } else {
                                        // move on to next wave
                                        $kdb["waves"]++;
                                        $sql = "UPDATE kdbattles SET waves = '{$kdb['waves']}' WHERE id = '{$kdb['id']}'";
                                        $result = $db->query($sql);
                                    }
                                }
                            }
                        }
                    }
                    // boss killed
                    if ($bosskilled) {
                        $text = "\r\n\t\t\t\t\t\t\tAs the whole Surathil community stands united in this battle, <a href=\"index.php?page=playerinfo&action=viewinfo&aid={$acc['id']}\">{$acc['name']}</a> is the one to give the fatal blow to the Easter Pigeon. With a huge flash of light, blinding everyone, the creature falls down. Everyone in Rodia can feel the earth trembling from the immense blow and a huge dust cloud covers the scene. When the dust is cleared, everyone on the battlefield can see <a href=\"index.php?page=playerinfo&action=viewinfo&aid={$acc['id']}\">{$acc['name']}</a> standing victoriously on the lifeless body of the pigeon, shouting that the reign of pigeon terror is now over.<br><br>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tTonight a party in honor of this hero shall be thrown. We shall feast on barbecued pigeon meat and beer!<br>\r\n\t\t\t\t\t\t\t";
                        gNews(2, 0, "the fall of the Easter Pigeon", addslashes($text));
                        echo '
							As the whole Surathil community stands united in this battle, you are the one to give the fatal blow to the Easter Pigeon. With a huge flash of light, blinding everyone, the creature falls down. Everyone in Rodia can feel the earth trembling from the immense blow and a huge dust cloud covers the scene. When the dust is cleared, everyone on the battlefield can see you standing victoriously on the lifeless body of the pigeon, shouting that the reign of pigeon terror is now over.<br><br>
							
							Tonight a party in honor of you shall be thrown. We shall feast on barbecued pigeon meat and beer!<br>
							';
                    } else {
                        echo 'You send your creature to attack the pigeon.<br><br>';
                        echo gParseReport($longreport);
                        if ($left > 0) {
                            echo '<br>The pigeon survived the battle, but is severely weakened: it only has ', $left, ' health left.<br>';
                        } else {
                            echo '<br>You managed to slay the mighty pigeon! This brings us one step closer to the Easter Pigeon.<br>';
                        }
                    }
                }
Ejemplo n.º 7
0
            // log query
            $sql = "INSERT INTO battlelogs (battleid, attackerid, defenderid, date) VALUES ('{$bid}', '{$accountid}', '{$targetid}', '" . date("Y-m-d H:i:s") . "')";
            $result = $db->query($sql);
            // battle query
            $time = time();
            $sql = "UPDATE battles SET status = '3', accountreport = '" . addslashes($attreport) . "', targetreport = '" . addslashes($defreport) . "', time = '{$time}' WHERE id = '{$bid}'";
            $result = $db->query($sql);
            if (!$result) {
                $bla = addslashes($sql);
                mail($PhantomMail, "EMERGENCY BUG", $bla);
            }
            // update summon status
            $sql = "UPDATE summons SET type = NULL WHERE type = '4' AND target = '{$bid}'";
            $result = $db->query($sql);
            // delete battle limits
            $sql = "DELETE FROM battlelimits WHERE battle = '{$battle['id']}' AND type = '0'";
            $result = $db->query($sql);
            if ($action == "submitdefend") {
                echo 'Battle fought! (<a href="index.php?page=battles&action=attack&target=', $accountid, '">counter attack</a>)<br><br>';
                echo gParseReport(stripslashes($defreport));
                $text = "\r\n\t\t\t\t\t<a href=\"index.php?page=playerinfo&action=viewinfo&aid={$target['id']}\">{$target['name']}</a> defended our attacking creatures.<br>\r\n\t\t\t\t\t<a href=\"index.php?page=battles&action=battlereport&bid={$battle['id']}\">Read the report.</a><br>\r\n\t\t\t\t\t";
                gNews(0, 2, "battle report vs {$target['name']}", $text, $accountid);
            } else {
                echo 'Raid successful!<br><br>';
                echo gParseReport(stripslashes($attreport));
                $text = "\r\n\t\t\t\t\t<a href=\"index.php?page=playerinfo&action=viewinfo&aid={$account['id']}\">{$account['name']}</a> attacked us but we didn\\'t defend in time so " . strtolower($gdGenders[$account["gender"]]["s"]) . " raided our castle.<br>\r\n\t\t\t\t\t<a href=\"index.php?page=battles&action=battlereport&bid={$battle['id']}\">Read the report.</a><br>\r\n\t\t\t\t\t";
                gNews(0, 2, "battle report vs {$account['name']}", $text, $targetid);
            }
        }
    }
}
Ejemplo n.º 8
0
    if ($acc["leadertype"] < 1) {
        echo 'You are not a leader.<br>';
        $no = 1;
    }
    if ($no == 0) {
        $sql = "UPDATE eggs SET kingdom = '{$id}' WHERE id = '{$eid}'";
        $result = $db->query($sql);
        // egglogs
        $sql = "INSERT INTO egglogs (type, date, egg, kingdom, account, target) VALUES ('donate', '" . date("Y-m-d H:i:s") . "', '{$eid}', '{$acc['kingdom']}', '{$acc['id']}', '{$id}')";
        $result = $db->query($sql);
        $sql = "SELECT name FROM kingdoms WHERE id = '{$acc['kingdom']}'";
        $result = $db->query($sql);
        $acckdname = $db->result($result, 0);
        $text = "<a href=\"index.php?page=playerinfo&action=viewinfo&aid={$acc['id']}\">{$acc['name']}</a> of kingdom <a href=\"index.php?page=kingdominfo&action=viewinfo&kid={$acc['kingdom']}\">{$acckdname}</a> donated a " . $gdEggDescriptors[$descriptor] . " " . addslashes($creaturename) . " Egg (id {$eid}) to kingdom <a href=\"index.php?page=kingdominfo&action=viewinfo&kid={$id}\">{$kdname}</a>.";
        gNews(1, 1, "egg donation", $text, $acc["kingdom"]);
        gNews(1, 1, "egg donation", $text, $id);
        echo 'Egg successfully donated!<br>';
        $action = "hatcheries";
    }
}
if ($action == "shards") {
    $no = 0;
    // kingdom check
    if (is_null($acc[x]) && is_null($acc[y])) {
        $kingdom = $acc["kingdom"];
    } elseif ($acc["tkdrelation"] == 2) {
        $kingdom = $acc["tkd"];
    } else {
        echo 'You shouldn\'t be here.<br>';
        $no = 1;
    }
Ejemplo n.º 9
0
            echo 'Invalid kdbid.<br>';
            $no = 1;
        } else {
            $row = $db->fetch_array($result);
        }
    }
    if ($acc["leadertype"] < 1) {
        echo 'You are no leader.<br>';
        $no = 1;
    }
    if ($no == 0) {
        $sql = "SELECT id, name FROM kingdoms WHERE id = '{$row['target']}'";
        $result = $db->query($sql);
        $target = $db->fetch_array($result);
        $text = "\r\n\t\t\t<a href=\"index.php?page=playerinfo&action=viewinfo&aid={$acc['id']}\">{$acc['name']}</a> cancelled the kingdom battle vs <a href=\"index.php?page=kingdominfo&action=viewinfo&kid={$target['id']}\">{$target['name']}</a>.<br>\r\n\t\t\t";
        gNews(1, 3, "battle vs {$target['name']}", $text, $acc["kingdom"]);
        $sql = "UPDATE summons SET type = '0' WHERE type = '2' AND target = '{$kdbid}'";
        $result = $db->query($sql);
        $sql = "DELETE FROM kdbattles WHERE id = '{$kdbid}'";
        $result = $db->query($sql);
        echo 'Battle successfully cancelled.<br>';
    }
}
if ($action == "castenchantment") {
    $no = 0;
    if ($no == 0) {
        $sql = "SELECT SUM(xp) AS xp FROM accounts WHERE kingdom = '{$acc['kingdom']}' AND status != '2'";
        $result = $db->query($sql);
        $xp = $db->result($result, 0);
        $kingdomlevel = gCalcLvl($xp, $gdKingdomXpVar, $gdKingdomStartXp);
        $found = FALSE;
Ejemplo n.º 10
0
<?php

topic("Admin Area");
if (!$acc["admin"]) {
    die("What the f**k are you doing here?");
}
if ($action == "submiteditnotes") {
    $sql = "UPDATE misctext SET text = '" . $notes . "' WHERE name = 'adminnotes'";
    $result = $db->query($sql);
    echo 'Notes updated.<br><br>';
    unset($action);
}
if ($action == "submiteventmes") {
    gNews(2, 10, $eventtit, $eventmes);
    echo 'Event posted.<br><br>';
    unset($action);
}
if (!$action) {
    $sql = "SELECT name, value FROM misc ORDER BY name";
    $result = $db->query($sql);
    tBegin("Reports");
    echo '<a href="index.php?page=admin&action=reports">Check reports.</a>';
    tEnd();
    tBegin("Notes (<a href=\"index.php?page=admin&action=editnotes\">edit</a>)");
    $sql = "SELECT text FROM misctext WHERE name = 'adminnotes'";
    $result = $db->query($sql);
    $notes = $db->result($result, 0);
    echo gTags($notes);
    tEnd();
    tBegin("Misc Stats");
    $sql = "SELECT count(*) FROM accounts WHERE status != '2'";
Ejemplo n.º 11
0
                 $text = "\r\n\t\t\t\t\t\t\tYou notice a bright blue flash at the horizon and for a moment, you feel a tremendous amount of power in the air. <a href=\"index.php?page=playerinfo&action=viewinfo&aid=" . $attacker->data["accid"] . "\">" . $attacker->data["accname"] . "</a> defeated the last Guardian.<br><br>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tAs the armies of {$name} march towards the pulsating center of the Core, aware of their certain death, the battle seems already won. The new Core, still developing its powers, is completely defenseless. After a short but fierce battle, the new Core loses its balance and prepares to launch a final wave of deadly power at the world.<br><br>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tBut then, the air behind the Core starts to twist. Stunned by this sudden event, the creatures drop their weapons and look in awe to the rapidly growing space rift. Even the scholars in the Stonehenge library hear the demonic laughter when Lord Dremorth appears and deals the final blow to the Core himself.<br><br><br>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\"<i>Fear and despair, for my time has come at last!</i>\"<br><br>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tLord Dremorth, standing right next to the Core, completely absorbs all it all the power released by the destruction of the new Core. Everyone in the vincity teleports out.\r\n\t\t\t\t\t\t\t";
                 $sql = "UPDATE accounts SET x = NULL, y = NULL WHERE x > '2300' AND x < '2400' AND y > '6800' AND y < '7000'";
                 $result = $db->query($sql);
                 $sql = "SELECT target, type FROM summons WHERE id = '109578'";
                 $result = $db->query($sql);
                 $dremorth = $db->fetch_array($result);
                 if ($dremorth["type"] != 0) {
                     $sql = "DELETE FROM battles WHERE id = '{$dremorth['target']}'";
                     $result = $db->query($sql);
                 }
                 $sql = "UPDATE summons SET type = '1' WHERE id = '109578'";
                 $result = $db->query($sql);
             } else {
                 $text = "You notice a bright blue flash at the horizon and for a moment, you feel an incredible amount of power in the air. <a href=\"index.php?page=playerinfo&action=viewinfo&aid=" . $attacker->data["accid"] . "\">" . $attacker->data["accname"] . "</a> defeated a Guardian. A heavy blow for the Core, but the battle is not over yet.";
             }
             gNews(2, 0, "Guardian defeated", $text);
         } else {
             $id = $attacker->data["id"];
             $sql = "DELETE FROM summons WHERE id = '{$id}'";
             $result = $db->query($sql);
             if ($attacker->data["castcurse"] != 0) {
                 $cid = $attacker->data["castcurse"];
                 $sql = "DELETE FROM castcurses WHERE id = '{$cid}'";
                 $result = $db->query($sql);
                 $sql = "DELETE FROM accshards WHERE castcurse != '0' AND castcurse = '{$cid}'";
                 $result = $db->query($sql);
             }
         }
     }
 }
 echo 'You send all the creatures of your faction to the Guardian.<br><br>';
Ejemplo n.º 12
0
                echo 'That mage is not a member of your kingdom!<br>';
                $no = 1;
            }
        }
    }
    if ($no == 0) {
        $sql = "UPDATE accounts SET leadertype = '0' WHERE id = '{$acc['id']}'";
        $result = $db->query($sql);
        $sql = "UPDATE accounts SET leadertype = '2' WHERE id = '{$aid}'";
        $result = $db->query($sql);
        $sql = "SELECT id, name, gender FROM accounts WHERE id = '{$aid}'";
        $result = $db->query($sql);
        $king = $db->fetch_array($result);
        $topic = "new " . $gdLeaderTypes[2]["name"][$king["gender"]];
        $text = "<a href=\"index.php?page=playerinfo&action=viewinfo&aid={$acc['id']}\">{$acc['name']}</a> appointed <a href=\"index.php?page=playerinfo&action=viewinfo&aid={$king['id']}\">{$king['name']}</a> to be the new " . $gdLeaderTypes[2]["name"][$king["gender"]] . " of your kingdom!";
        gNews(1, 1, $topic, $text, $acc["kingdom"]);
        echo 'You have passed the throne to someone else. Let\'s hope he uses his power well!<br>';
        $action = "townhall";
    }
}
if ($action == "resourcelog") {
    if (!$offset) {
        $offset = 0;
    }
    $display = gdMaxTreasuryLogLines + 1;
    $sql = "SELECT a.id, a.name, l.amount, l.time, l.target FROM (kdresourcelog AS l) LEFT JOIN accounts AS a ON l.account = a.id WHERE l.kingdom = '{$acc['kingdom']}' ORDER BY l.time DESC LIMIT {$offset},{$display}";
    $result = $db->query($sql);
    tBegin("Kingdom Resource Log");
    tBegin();
    echo '
		<tr>
Ejemplo n.º 13
0
         // update creature
         if ($gdCurses[$curse["curse"]]["target"] == "creature") {
             $sql = "UPDATE summons SET curse = NULL, castcurse = '0' WHERE id = '{$tid}'";
             $result = $db->query($sql);
             $castertext = "<a href=\"index.php?page=playerinfo&action=viewinfo&aid={$acc['id']}\">{$acc['name']}</a> dispelled a curse you placed on one of the creatures of <a href=\"index.php?page=playerinfo&action=viewinfo&aid={$targetmage['id']}\">{$targetmage['name']}</a>.<br>";
             $targettext = "<a href=\"index.php?page=playerinfo&action=viewinfo&aid={$acc['id']}\">{$acc['name']}</a> dispelled a curse placed on one of your creatures by <a href=\"index.php?page=playerinfo&action=viewinfo&aid={$caster['id']}\">{$caster['name']}</a>.<br>";
         } else {
             $sql = "UPDATE accounts SET curse = NULL, castcurse = '0' WHERE id = '{$tid}'";
             $result = $db->query($sql);
             $castertext = "<a href=\"index.php?page=playerinfo&action=viewinfo&aid={$acc['id']}\">{$acc['name']}</a> dispelled the curse you placed on <a href=\"index.php?page=playerinfo&action=viewinfo&aid={$targetmage['id']}\">{$targetmage['name']}</a>.<br>";
             $targettext = "<a href=\"index.php?page=playerinfo&action=viewinfo&aid={$acc['id']}\">{$acc['name']}</a> dispelled the curse placed on you by <a href=\"index.php?page=playerinfo&action=viewinfo&aid={$caster['id']}\">{$caster['name']}</a>.<br>";
         }
         if ($targetmage["id"] != $caster["id"]) {
             gNews(0, 6, "curse dispelled", $castertext, $caster[id]);
         }
         gNews(0, 6, "curse dispelled", $targettext, $targetmage[id]);
         $output .= 'You successfully cast a dispell on that ' . $gdCurses[$curse["curse"]]["target"] . '. The curse is removed, the shards destroyed.';
     }
 } else {
     $shardloss = rand(1, $total);
     reset($shards);
     unset($array);
     $where = "";
     // put shards in array
     while (list($id, $value) = each($shards)) {
         if ($value == "on") {
             $array[count($array)] = $id;
         }
     }
     // shuffle
     for ($j = count($array) - 1; $j > 0; $j--) {
Ejemplo n.º 14
0
        $sql = "DELETE FROM itemconfigset WHERE creature = '{$sid}'";
        $result = $db->query($sql);
        $sql = "DELETE FROM slotconfigset WHERE creature = '{$sid}'";
        $result = $db->query($sql);
        //Update pool data
        $lr = ceil($creature->data["baselevel"] / 6);
        $sql = "UPDATE misc SET value = value + {$lr} WHERE name = 'pool'";
        $result = $db->query($sql);
        $sql = "UPDATE accounts SET critssacced = critssacced + 1 WHERE id = '{$acc['id']}'";
        $result = $db->query($sql);
        $sql = "SELECT value FROM misc WHERE name = 'pool'";
        $result = $db->query($sql);
        $totallvl = $db->result($result, 0);
        if ($totallvl >= $gdPoolRequiredLevel) {
            $text = "As {$acc['name']} sacrifices the last creature in the pool, the water emits an intense glow. As the pool settles down again, you can feel the same feeling coming from the water as the water from Surathil. During the process of sacrificing creatures, some strange shards were created as a side effect, these shards were divided amongst the mages of rodia.";
            gNews(2, 10, "Shard Pool completed", $text);
        }
        echo 'You sacrifice the creature and send his energy to the shard pool.<br><br>';
        unset($action);
    }
}
if ($action == "sacrifice2") {
    $no == 0;
    $sql = "SELECT s.type AS status, s.item, c.damage, c.health, s.castcurse, c.type, s.creature AS cid, s.mods FROM summons AS s, creatures AS c WHERE s.id = '{$sid}' AND s.creature = c.id AND s.account = '{$acc['id']}'";
    $result = $db->query($sql);
    $numrows = $db->num_rows($result);
    if ($numrows != 1) {
        echo 'Invalid sid.<br>';
        $no = 1;
    } else {
        $row = $db->fetch_array($result);
Ejemplo n.º 15
0
                } else {
                    $kingdomtopic = "We declined peace treaty offer of {$target['name']}";
                    $kingdomtext = "\r\n\t\t\t\t\t\tToday, our " . $gdLeaderTypes[$acc["leadertype"]]["name"][$acc["gender"]["short"]] . " <a href=\"index.php?page=playerinfo&action=viewinfo&aid={$acc['id']}\">{$acc['name']}</a> declined the peace treaty offer kingdom <a href=\"index.php?page=kingdominfo&action=viewinfo&kid={$kid}\">{$target['name']}</a> made towards us.<br>\r\n\t\t\t\t\t\tWe are still hostile towards them.<br>\r\n\t\t\t\t\t\tThis means that you cannot visit the pub.<br>\r\n\t\t\t\t\t\tYou can attack mages in this kingdom, and the warlords of your kingdom can organize kingdom battles.<br>\r\n\t\t\t\t\t\t";
                    $targettopic = "{$kingdom['name']} declined our peace treaty offer";
                    $targettext = "\r\n\t\t\t\t\t\tToday, " . $gdLeaderTypes[$acc["leadertype"]]["name"][$acc["gender"]["short"]] . " <a href=\"index.php?page=playerinfo&action=viewinfo&aid={$acc['id']}\">{$acc['name']}</a> of kingdom <a href=\"index.php?page=kingdominfo&action=viewinfo&kid={$acc['kingdom']}\">{$kingdom['name']}</a> declined our peace treaty offer.<br>\r\n\t\t\t\t\t\tWe are still hostile towards them.<br>\r\n\t\t\t\t\t\tThis means that you cannot visit the pub.<br>\r\n\t\t\t\t\t\tYou can attack mages in this kingdom, and the warlords of your kingdom can organize kingdom battles.<br>\r\n\t\t\t\t\t\t";
                }
            }
            if ($reltype == 0) {
                $sql = "DELETE FROM relations WHERE (kingdom = '{$acc['kingdom']}' AND target = '{$kid}') OR (kingdom = '{$kid}' AND target = '{$acc['kingdom']}')";
                $result = $db->query($sql);
                // remove kingdom battles
                $sql = "SELECT id FROM kdbattles WHERE ((kingdom = '{$kingdom['id']}' AND target = '{$target['id']}') OR (target = '{$kingdom['id']}' AND kingdom = '{$target['id']}')) AND status = '0'";
                $result = $db->query($sql);
                while ($row = $db->fetch_array($result)) {
                    $nsql = "UPDATE summons SET type = '0' WHERE type = '2' AND  target = '{$row['id']}'";
                    $nresult = $db->query($nsql);
                    $nsql = "DELETE FROM kdbattles WHERE id = '{$row['id']}'";
                    $nresult = $db->query($nsql);
                }
                $kingdomtopic = "We accepted peace treaty offer of {$target['name']}";
                $kingdomtext = "\r\n\t\t\t\t\tToday, our " . $gdLeaderTypes[$acc["leadertype"]]["name"][$acc["gender"]["short"]] . " <a href=\"index.php?page=playerinfo&action=viewinfo&aid={$acc['id']}\">{$acc['name']}</a> accepted the peace treaty offer kingdom <a href=\"index.php?page=kingdominfo&action=viewinfo&kid={$kid}\">{$target['name']}</a> made towards us.<br>\r\n\t\t\t\t\tWe are neutral towards them from now on.<br>\r\n\t\t\t\t\tAll the active kingdom battles against them are cancelled.<br>\r\n\t\t\t\t\tThis means that you can visit their pub.<br>\r\n\t\t\t\t\t";
                $targettopic = "{$kingdom['name']} accepted our peace treaty offer";
                $targettext = "\r\n\t\t\t\t\tToday, " . $gdLeaderTypes[$acc["leadertype"]]["name"][$acc["gender"]["short"]] . " <a href=\"index.php?page=playerinfo&action=viewinfo&aid={$acc['id']}\">{$acc['name']}</a> of kingdom <a href=\"index.php?page=kingdominfo&action=viewinfo&kid={$acc['kingdom']}\">{$kingdom['name']}</a> accepted our peace treaty offer.<br>\r\n\t\t\t\t\tWe are neutral towards them from now on.<br>\r\n\t\t\t\t\tAll the active kingdom battles against them are cancelled.<br>\r\n\t\t\t\t\tThis means that you can visit their pub.<br>\r\n\t\t\t\t\t";
            }
        }
        gNews(1, 1, $kingdomtopic, $kingdomtext, $acc[kingdom]);
        gNews(1, 1, $targettopic, $targettext, $kid);
        $output .= 'Diplomacy change successful!<br><br>';
        $action = "viewinfo";
    }
}
Ejemplo n.º 16
0
        } else {
            $account = $db->fetch_array($result);
            if ($account["id"] == $acc["id"] || $gdSpecialKingdoms[$acc["kingdom"]]) {
                $output .= 'Invalid account.<br>';
                $no = 1;
            }
            $sql = "SELECT count(*) FROM battles WHERE target = '{$aid}' AND status = '1'";
            $result = $db->query($sql);
            $numrows = $db->result($result, 0);
            if ($numrows > 0) {
                $output .= 'That player is under attack at the moment.<br>';
                $no = 1;
            }
        }
    }
    if ($acc["attacked"]) {
        $output .= 'You can\'t send creatures away while you are under attack.<br>';
        $no = 1;
    }
    if ($no == 0) {
        $time = time() + $gdAlliedDefenseTime;
        $sql = "UPDATE summons SET type = '6', target = '{$aid}', hidden = '{$time}' WHERE id = '{$sid}'";
        $result = $db->query($sql);
        $sql = "UPDATE accounts SET power = power - '{$cost}' WHERE id = '{$acc['id']}'";
        $result = $db->query($sql);
        $acc["power"] -= $cost;
        $output .= "You send that creature to <a href=\"index.php?page=playerinfo&action=viewinfo&aid={$aid}\">{$account['name']}</a>.<br>";
        $text .= "\r\n\t\t\t<a href=\"index.php?page=playerinfo&action=viewinfo&aid={$acc['id']}\">{$acc['name']}</a> sent " . strtolower($acc["gender"]["a"]) . " " . $creature->data["creaturename"] . " to aid you in battle.<br>\r\n\t\t\t";
        gNews(0, 7, "creature sent", $text, $aid);
    }
}
Ejemplo n.º 17
0
     $no = 1;
 }
 if ($no == 0) {
     if ($inhabitants == 1 && !$gdSpecialKingdoms[$acc["kingdom"]]) {
         gDeleteKingdom($acc["kingdom"]);
     }
     $inhabitants--;
     $curses = gRemoveCurses($acc["id"]);
     $sql = "INSERT INTO kingdoms (name, type, x, y, resources) VALUES ('{$name}', '0', '{$coords['x']}', '{$coords['y']}', '2000')";
     $result = $db->query($sql);
     $id = $db->insert_id($conn);
     $sql = "UPDATE accounts SET leadertype = '2' WHERE id = '{$acc['id']}'";
     $result = $db->query($sql);
     if (!$gdSpecialKingdoms[$acc["kingdom"]]) {
         $text = "\r\n\t\t\t\t<a href=\"index.php?page=playerinfo&action=viewinfo&aid={$acc['id']}\">{$acc['name']}</a> left our kingdom.<br>\r\n\t\t\t\t";
         gNews(1, 1, "{$acc['name']} leaves kingdom", $text, $acc["kingdom"]);
     }
     $acc["brimstone"] -= $cost;
     $acc["crystal"] -= $cost;
     $acc["essence"] -= $cost;
     $acc["granite"] -= $cost;
     $acc["kingdom"] = $id;
     $sql = "UPDATE accounts SET kingdom = '{$id}', brimstone = {$acc['brimstone']}, essence = {$acc['essence']}, crystal = {$acc['crystal']}, granite = {$acc['granite']}, gems_in = '0', gems_out = '0' WHERE id = '{$acc['id']}'";
     $result = $db->query($sql);
     $time = time();
     $sql = "INSERT INTO kingdomhistory (account, type, leaves, joins, time) VALUES ('{$acc['id']}', 'create', '{$leaves}', '{$name}', '{$time}')";
     $result = $db->query($sql);
     $sql = "UPDATE summons SET type = '0' WhERE type = '6' AND account = '{$acc['id']}'";
     $result = $db->query($sql);
     $output .= 'Kingdom successfully created!<br>' . $curses;
 }
Ejemplo n.º 18
0
		<br /><a href="index.php?page=Aether&action=builder">Nether Builder.</a>
		';
    if ($reward == 1) {
        echo '<br /><a href="index.php?page=Aether&action=mystic">Mystic Shop.</a>';
    }
    if ($numrows2 == 0) {
        echo '
			<p>As you enter Aether you feel the beacon power inside you. Do you want to <a href="?page=Aether&action=beacon">place a beacon</a> here?
			';
    }
}
if ($action == "beacon" && $numrows2 == 0) {
    $sql = "INSERT INTO teleport (x, y, name, pb) VALUES (58, -22, 'Aether', 10)";
    $result = $db->query($sql);
    $text = "A messenger from the High Council runs to your castle to hand you a letter:\r\n\t\t\t\t<p>\"{$acc['name']} has placed a beacon in Aether. You may now use the teleportation shrine to teleport there.\"";
    gNews(2, 10, "A beacon has been placed", $text);
    echo '
			You place the beacon in Aether.
		';
}
if ($action == "mystic" && $reward == 1) {
    echo 'You enter the shop. It was erected in a hurry to compensate the Stonehenge magi.<br />The shop is filled with strange looking items.<p>You can buy one of the following items:';
    $sql = "SELECT ROUND((resinvested - resused)/100000) AS credits FROM accounts WHERE id='{$acc['id']}'";
    $result = $db->query($sql);
    $credit = $db->result($result, 0);
    echo '<p>You have ' . max(0, $credit) . ' Credits.</p>';
    $sql = "SELECT COUNT(*) FROM ycom_library WHERE used=0 AND type='creature'";
    $result = $db->query($sql);
    $amount = $db->result($result, 0);
    echo '<p>
			<a href="index.php?page=Aether&action=buymythcrit">Mythical Creature</a>: ' . $gdCreditCost[0] . ' Credits (' . $amount . ' left)
Ejemplo n.º 19
0
    fTextArea("Text:", "text");
    fEnd("Add");
}
if ($action == "submitnewannouncement") {
    $no = 0;
    if (!$topic || !$text) {
        echo 'Invalid data.<br>';
        $no = 1;
    }
    if ($no == 0) {
        $time = time();
        $sql = "INSERT INTO announcements (topic, text, account, time) VALUES ('{$topic}', '{$text}', '{$acc['id']}', '{$time}')";
        $result = $db->query($sql);
        $id = $db->insert_id($result);
        $content = "\r\n\t\t\tThere is a new, important announcement regarding the status of Castle Quest 2.<br>\r\n\t\t\t<a href=\"index.php?page=home&action=comments&anid={$id}\">Click here</a> to read it.<br>\r\n\t\t\t";
        gNews(2, 5, $topic, $content);
        echo 'Announcement added successfully!<br>';
    }
}
if ($action == "changewelcomemessage") {
    $sql = "SELECT text FROM misctext WHERE name = 'welcome'";
    $result = mysql_query($sql);
    $text = mysql_result($result, 0);
    fTitle("index.php?page=home&action=submitchangewelcomemessage");
    fTextArea("Text:", "text", $text);
    fEnd("Change");
}
if ($action == "submitchangewelcomemessage") {
    $no = 0;
    if (!$text) {
        echo 'Invalid data.<br>';