Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var movements = {
- upleft: {
- up: -1,
- left: -1
- },
- up: {
- up: -1,
- left: 0
- },
- upright: {
- up: -1,
- left: 1
- },
- left: {
- up: 0,
- left: -1
- },
- right: {
- up: 0,
- left: 1
- },
- downleft: {
- up: 1,
- left: -1
- },
- down: {
- up: 1,
- left: 0
- },
- downright: {
- up: 1,
- left: 1
- },
- };
- var x = 12,
- y = 19;
- var map = [
- [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 5, 0, 1, 0, 5, 0, 1, 1, 1, 1, 1, 1, 1],
- [6, 6, 6, 6, 6, 6, 6, 1, 1, 1, 6, 0, 0, 6, 6, 6, 6, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 5, 0, 1, 0, 5, 0, 1, 1, 1, 1, 1, 1, 1],
- [6, 6, 6, 6, 6, 6, 6, 1, 1, 1, 1, 1, 1, 6, 6, 6, 6, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 5, 0, 0, 0, 5, 0, 0, 0, 0, 1, 1, 1, 1],
- [6, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 6, 6, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 1, 1, 1, 1],
- [6, 6, 6, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 6, 6, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 1, 1, 1, 1],
- [6, 6, 6, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5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 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 1, 1, 7, 7, 7, 7, 7, 7, 7, 7, 11, 11, 11, 0, 0, 0],
- [11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 0, 9, 0, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 0, 1, 1],
- [11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 0, 0, 11, 11, 11, 11, 11, 11, 0, 0, 0, 11, 11, 11, 11, 11, 11, 11, 11, 0, 0, 0, 0, 0, 0],
- [11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 0, 4, 0, 11, 11, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1],
- [11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 0, 0, 0, 0, 0, 0, 0, 4, 0, 11, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
- [11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1],
- [11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1],
- [11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 4, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1],
- [11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 4, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1]
- ];
- function Spielerbewegen(key) {
- var result1 = $.ajax({
- url: "ajax_call/walk_animation.php?map=1",
- type: "post",
- data: {
- animation: "laufen"
- },
- success: function(data) {
- laufeeeen = data;
- }
- });
- var result2 = $.ajax({
- url: "ajax_call/geschlecht.php?map=1",
- type: "post",
- data: {
- geschlecht: "weiber"
- },
- success: function(data) {
- geschlecht = data;
- }
- });
- var Spieler = document.getElementById("mySprite");
- var newX = x + movements[key].left;
- var newY = y + movements[key].up;
- if (typeof map[newY] !== "undefined" && typeof map[newY][newX] !== "undefined" && (map[newY][newX] == 1 || map[newY][newX] > 1)) {
- x = newX;
- y = newY;
- Spieler.style.left = x * 16 + "px";
- Spieler.style.top = y * 16 - 4 + "px";
- $("#result").html("<img src='https://forum.ragezone.com/images/loading.gif' /></br>Please wait...");
- $.get("ajax_call/map_ajax2.php?map=1&x=" + x + "&y=" + y, function(result) {
- var res = jQuery.parseJSON(result);
- if (typeof res.name !== "undefined") {
- var html = "";
- html += "<p>";
- html += "<span>";
- html += "<a href=" ? page = poke - info & pokemon = " + res.id + "
- " target="
- _blank "><img src='https://forum.ragezone.com/images/pokemon/' + res.id + '.gif' width='70px' /></a><br />";
- html += "<font size='4' style='text-shadow: 0 0 0.6em #000, 0 0 0.4em #000;color:#fff;'><b>A wild <a href='?page=poke-info&pokemon=' + res.id + '' target='_blank'>' + res.name + '</a>!</b></font><br />";
- html += "</div>";
- html += "</span>";
- html += "</p>";
- html += "<form action="
- index.php ? page = attack / beta_map & map = 1 & id = " + res.id + " & level = " + res.level + " & 382203 = 7 " method="
- post ">";
- html += " <input type="
- submit " value="
- Fight!" class="
- button "/>";
- html += "</form>";
- $("#result").html(html);
- } else {
- $("#result").html("<center><img src='http://www.national-dex.com/theme/image/pokeball-grey.png' width='55'/></center><br>Es wurde kein Pokemon gefunden.");
- }
- });
- }
- if (map[y][x] == 1) {
- $.ajax({
- url: "ajax_call/gebiet.php?map=1",
- type: "post",
- data: {
- gebiet: "undefined"
- },
- success: function(data) {
- console.log("Erfolgreich Gebiet ge\xC3\xA4ndert!");
- }
- });
- }
- if (map[y][x] == 3) {
- $.ajax({
- url: "ajax_call/gebiet.php?map=1",
- type: "post",
- data: {
- gebiet: "Gras"
- }
- });
- }
- if (map[y][x] == 4) {
- $.ajax({
- url: "ajax_call/gebiet.php?map=1",
- type: "post",
- data: {
- gebiet: "Grot"
- }
- });
- }
- if (map[y][x] == 5) {
- $.ajax({
- url: "ajax_call/gebiet.php?map=1",
- type: "post",
- data: {
- gebiet: "Spookhuis"
- }
- });
- }
- if (map[y][x] == 6) {
- $.ajax({
- url: "ajax_call/gebiet.php?map=1",
- type: "post",
- data: {
- gebiet: "Lavagrot"
- }
- });
- }
- if (map[y][x] == 7) {
- $.ajax({
- url: "ajax_call/gebiet.php?map=1",
- type: "post",
- data: {
- gebiet: "Strand"
- }
- });
- }
- if (map[y][x] == 8) {
- $.ajax({
- url: "ajax_call/gebiet.php?map=1",
- type: "post",
- data: {
- gebiet: "Vechtschool"
- }
- });
- }
- if (map[y][x] == 9) {
- $(function() {
- $("#dialog").dialog();
- });
- Spielerbewegen("up");
- }
- if (map[y][x] == 11) {
- $(function() {
- $("#dialog_surfer").dialog();
- });
- if (key == "up") {
- Spielerbewegen("down");
- } else if (key == "down") {
- Spielerbewegen("up");
- } else if (key == "left") {
- Spielerbewegen("right");
- } else if (key == "right") {
- Spielerbewegen("left");
- }
- }
- if (map[y][x] == 20) {
- setTimeout(function() {
- window.location.href = "?page=pokemarket";
- }, 3000);
- $(function() {
- $("#dialog_pokemarkt").dialog();
- });
- if (key == "up") {
- Spielerbewegen("down");
- }
- }
- if (map[y][x] == 21) {
- setTimeout(function() {
- window.location.href = "?page=pokemoncenter";
- }, 3000);
- $(function() {
- $("#dialog_pokecenter").dialog();
- });
- if (key == "up") {
- Spielerbewegen("down");
- }
- }
- if (map[y][x] == 2) {
- var Wasser1 = "https://forum.ragezone.com/images/sprites2/male/" + key + "/320.png";
- var Wasser2 = "https://forum.ragezone.com/images/sprites2/male/" + key + "/320.png";
- document.getElementById("mySprite").src = Wasser1;
- setTimeout(function() {
- document.getElementById("mySprite").src = Wasser1;
- }, 150);
- setTimeout(function() {
- document.getElementById("mySprite").src = Wasser2;
- }, 400);
- $.ajax({
- url: "ajax_call/gebiet.php?map=1",
- type: "post",
- data: {
- gebiet: "Water"
- }
- });
- } else {
- var WALK = "https://forum.ragezone.com/images/sprites2/" + geschlecht + "/" + key + "/0.png";
- var WALK1 = "https://forum.ragezone.com/images/sprites2/" + geschlecht + "/" + key + "w" + laufeeeen + "/0.png";
- setTimeout(function() {
- document.getElementById("mySprite").src = WALK1;
- }, 100);
- setTimeout(function() {
- document.getElementById("mySprite").src = WALK;
- }, 300);
- }
- }
- function SpieleraufKarte() {
- for (var i = 0; i < users.length; i++) {
- var user = users[i];
- var emotion = document.createElement("img");
- emotion.src = "https://forum.ragezone.com/images/emotions/" + user.emotion + ".png";
- emotion.style.position = "absolute";
- emotion.style.marginTop = "-17px";
- emotion.style.top = user.y * 16 - 4 + "px";
- emotion.style.left = user.x * 16 + "px";
- var wild_poke = document.createElement("img");
- wild_poke.src = "https://forum.ragezone.com/images/pokemon/icon/" + user.map_wild + ".gif";
- wild_poke.style.position = "absolute";
- wild_poke.style.zIndex = 15;
- wild_poke.style.top = user.y * 16 - 4 + "px";
- wild_poke.style.left = user.x * 16 + "px";
- var image2 = document.createElement("img");
- image2.src = "https://forum.ragezone.com/images/in_battle" + user.in_battle + ".gif";
- image2.style.position = "absolute";
- image2.title = "Ist in einem Kampf";
- image2.style.marginTop = "-16px";
- image2.style.top = user.y * 16 - 4 + "px";
- image2.style.left = user.x * 16 + "px";
- var image = document.createElement("img");
- image.src = "https://forum.ragezone.com/images/sprites2/" + user.gender + "/" + user.direction + "/" + user.sprite + ".png";
- image.title = user.username;
- image.style.position = "absolute";
- image.style.top = user.y * 16 - 4 + "px";
- image.style.left = user.x * 16 + "px";
- image.onclick = (function(user) {
- return function() {
- var html = "";
- html += "<img src="
- https: //forum.ragezone.com/images/sprites2/" + user.gender + "/" + user.direction + "/" + user.sprite + ".png" /> ";
- html += "<a href=" ? page = profile & player = " + user.username + "
- ">" + user.username + "</a> • ";
- html += "<a href=" ? page = send - message & player = " + user.username + "
- ">Nachricht</a> • ";
- html += "<a href=" ? page = attack / duel / invite & player = " + user.username + "
- ">Duellieren</a> • ";
- html += "<a href=" ? page = buddylist & player = " + user.username + "
- ">Freundschaftsanfrage</a> • ";
- html += "<span onclick="
- document.getElementById('pInfo').style.display = 'none';
- ">";
- html += "<br>[Schliessen]";
- html += "</span>";
- document.getElementById("pInfo").style.display = "table-row";
- document.getElementById("info").innerHTML = html;
- };
- })(user);
- $(emotion).insertAfter("#mySprite");
- $(wild_poke).insertAfter("#mySprite");
- $(image).insertAfter("#mySprite");
- $(image2).insertAfter("#mySprite");
- }
- }
- function removeUsersFromMap() {
- var mapImgs = document.querySelectorAll("#map img:not([id="
- mySprite "])");
- for (var i = 0; i < mapImgs.length; i++) {
- mapImgs[i].parentNode.removeChild(mapImgs[i]);
- }
- }
- function remove_emoticons() {
- var mapImgs = document.querySelectorAll("#map img:not([id="
- mySprite "])");
- for (var i = 0; i < mapImgs.length; i++) {
- mapImgs[i].parentNode.removeChild(mapImgs[i]);
- }
- }
- var timer;
- function startTimer() {
- timer = setInterval(function() {
- $.get("ajax_call/map_users.php?map=1", function(userData) {
- users = JSON.parse(userData);
- removeUsersFromMap();
- SpieleraufKarte();
- });
- }, 400);
- }
- function checkKeysUp(evt) {
- if (evt.keyCode == 38) {
- Spielerbewegen("up");
- $.ajax({
- url: "ajax_call/direction.php?map=1",
- type: "post",
- data: {
- direction: "up"
- },
- success: function(data) {}
- });
- } else if (evt.keyCode == 37) {
- Spielerbewegen("left");
- $.ajax({
- url: "ajax_call/direction.php?map=1",
- type: "post",
- data: {
- direction: "left"
- },
- success: function(data) {}
- });
- } else if (evt.keyCode == 39) {
- Spielerbewegen("right");
- $.ajax({
- url: "ajax_call/direction.php?map=1",
- type: "post",
- data: {
- direction: "right"
- },
- success: function(data) {}
- });
- } else if (evt.keyCode == 40) {
- Spielerbewegen("down");
- $.ajax({
- url: "ajax_call/direction.php?map=1",
- type: "post",
- data: {
- direction: "down"
- },
- success: function(data) {}
- });
- }
- }
- function nachOben() {
- Spielerbewegen("up");
- $.ajax({
- url: "ajax_call/direction.php?map=1",
- type: "post",
- data: {
- direction: "up"
- },
- success: function(data) {}
- });
- }
- function nachRechts() {
- Spielerbewegen("right");
- $.ajax({
- url: "ajax_call/direction.php?map=1",
- type: "post",
- data: {
- direction: "right"
- },
- success: function(data) {}
- });
- }
- function nachLinks() {
- Spielerbewegen("left");
- $.ajax({
- url: "ajax_call/direction.php?map=1",
- type: "post",
- data: {
- direction: "left"
- },
- success: function(data) {}
- });
- }
- function nachUnten() {
- Spielerbewegen("down");
- $.ajax({
- url: "ajax_call/direction.php?map=1",
- type: "post",
- data: {
- direction: "down"
- },
- success: function(data) {}
- });
- }
- function checkKeysDown(evt) {
- if (evt.keyCode >= 37 || evt.keyCode <= 40) {
- if (evt.preventDefault) {
- evt.preventDefault();
- }
- if (evt.stopPropagation) {
- evt.stopPropagation();
- }
- }
- }
- window.addEventListener("load", function() {
- SpieleraufKarte();
- startTimer();
- }, false);
- window.addEventListener("keyup", checkKeysUp, false);
- window.addEventListener("keydown", checkKeysDown, false);
- $(function() {
- $("#ziehen").draggable({
- containment: "document",
- stop: function(event, ui) {
- var offset = $(this).offset(),
- pos_x = offset.left,
- pos_y = offset.top;
- console.log(offset);
- $(this);
- $.ajax({
- url: "ajax_call/arrow_position.php?map=1",
- type: "post",
- data: {
- position_x: +pos_x
- }
- });
- $.ajax({
- url: "ajax_call/arrow_position.php?map=1",
- type: "post",
- data: {
- position_y: +pos_y
- }
- });
- }
- });
- });
- $(function() {
- $("#ziehen").draggable({
- containment: "parent",
- scroll: false,
- stop: function(event, ui) {
- var offset = $(this).offset(),
- pos_x = offset.left,
- pos_y = offset.top;
- $(this);
- $.ajax({
- url: "ajax_call/arrow_position.php?map=1",
- type: "post",
- data: {
- position_x: +pos_x
- }
- });
- $.ajax({
- url: "ajax_call/arrow_position.php?map=1",
- type: "post",
- data: {
- position_y: +pos_y
- }
- });
- }
- });
- });
- function reset_navi() {
- reset_x = 924;
- reset_y = 355;
- $.ajax({
- url: "ajax_call/arrow_position.php?map=1",
- type: "post",
- data: {
- position_x: +reset_x
- }
- });
- $.ajax({
- url: "ajax_call/arrow_position.php?map=1",
- type: "post",
- data: {
- position_y: +reset_y
- },
- success: function(data) {
- location.reload();
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement