1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216 |
- setMoney(114, 0);
- event.load("entity_click");
- event.load("container_click");
- event.load("inv_click");
- event.load("player_pre_respawn");
- event.load("player_post_respawn");
- event.load("player_login");
- event.load("player_move");
- event.load("block_break");
- event.load("block_click");
- event.load("living_death");
- event.load("living_pre_hurt");
- event.load("pre_explosion");
- event.load("mob_griefing");
- event.load("item_air_click");
- event.load("projectile_hit");
- event.load("ender_teleport");
- setScriptVar("skills", list.new());
- skill.add("Keep Inventory", "skill.subcu_inv", "minecraft:chest", "Keeps the inventory on death", 100, false, false, true);
- skill.add("Comeback", "skill.comeback", "km:skill55", "Respawn at your death location", 100, false, false, true);
- skill.add("Head Hunter", "skill.head_human", "minecraft:player_head", "Drops a player's head with a 20% chance if you kill a player (5% if a staff member is killed)", 1000, true, false, false);
- skill.add("Mobheads", "skill.head_monster", "minecraft:zombie_head", "Drops a mobs's head with a 20% chance (zombie / skeleton / creeper)", 500, true, false, false);
- skill.add("Fly 10min", "skill.fly10min", "minecraft:elytra", "You can fly for 10 minutes", 4096, false, true, false);
- skill.add("Grow", "skill.grow", "minecraft:farmland", "Grow seeds in radius 5", 25, false, true, false);
- skill.add("Haste", "skill.haste", "minecraft:iron_pickaxe", "Haste for 2 minutes", 25, false, true, false);
- skill.add("Speed", "skill.speed", "minecraft:iron_boots", "Speed for 2 minutes", 25, false, true, false);
- skill.add("Jump Boost", "skill.jump_boost", "minecraft:rabbit_foot", "JumpBoost Lvl.2 for 2 minutes", 25, false, true, false);
- skill.add("Dolphin", "skill.dolphin", "minecraft:fire_coral", "Swim like a dolphin for a minute", 25, false, true, false);
- skill.add("Block Up", "skill.block_up", "minecraft:diamond_pickaxe", "Break a block and the block above for a minute", 25, false, true, false);
- skill.add("Block Down", "skill.block_down", "minecraft:diamond_pickaxe", "Break a block and the block below for a minute", 25, false, true, false);
- skill.add("Timber", "skill.timber", "minecraft:iron_axe", "Break whole trees with an axe for a minute", 128, false, true, false);
- skill.add("Fire Arrow", "skill.fire_arrow", "minecraft:arrow", "For a minute with an flame enchanted bow your arrows ignite hit blocks", 50, false, true, false);
- skill.add("Better Shears", "skill.better_shears", "minecraft:shears", "Sharpness enchanted shears increase the radius for destruction of leaves", 500, true, false, true);
- skill.add("Cobweb Miner", "skill.cobweb_miner", "minecraft:cobweb", "Swords increase the radius for destruction of cobwebs", 250, true, false, true);
- clan.loadData();
- tp_list = list.new();
- tp_map = map.new();
- tp_set = set.new();
- afk_loop_map = map.new();
- death_loc_map = map.new();
- survival_respawn = set.new();
- overworld = world.getOverWorld();
- moveid_storyspawn = event.addMoveData(loc.new(overworld, 167, 70, 241), loc.new(overworld, 169, 72, 243), 5, -1);
- moveid_gamesspawn = event.addMoveData(loc.new(overworld, 219, 66, 253), loc.new(overworld, 223, 69, 258), 5, -1);
- move_id_afk_loop = event.addMoveData(loc.new(overworld, 208, 69, 226), loc.new(overworld, 209, 69.5, 227), 5, -1);
- move_id_afk_loop_2 = event.addMoveData(loc.new(overworld, 208, 62, 242), loc.new(overworld, 209, 62.5, 243), 5, -1);
- move_id_afk_loop_3 = event.addMoveData(loc.new(overworld, 210, 62, 242), loc.new(overworld, 211, 62.5, 243), 5, -1);
- move_id_afk_loop_4 = event.addMoveData(loc.new(overworld, 206, 62, 246), loc.new(overworld, 207, 62.5, 247), 5, -1);
- move_id_afk_loop_5 = event.addMoveData(loc.new(overworld, 212, 62, 246), loc.new(overworld, 213, 62.5, 247), 5, -1);
- afk_loop_ids = set.new();
- set.add(afk_loop_ids, move_id_afk_loop);
- set.add(afk_loop_ids, move_id_afk_loop_2);
- set.add(afk_loop_ids, move_id_afk_loop_3);
- set.add(afk_loop_ids, move_id_afk_loop_4);
- set.add(afk_loop_ids, move_id_afk_loop_5);
- config = getScriptVar("server_config");
- survival_spawn = read.location(config.getString(config, "surv_spawn", "games:0:0:0"));
- adventure_chest_loc = loc.new(overworld, 177, 74, 237);
- adventure_aim_loc = loc.new(overworld, 180, 70, 241);
- lottery_loc_1 = loc.new(overworld, 186, 69, 227);
- lottery_loc_2 = loc.new(overworld, 186, 69, 223);
- gambler_loc = loc.new(overworld, 185, 68, 225);
- prefix_money = "§2Money";
- prefix_skill = "§2Skill";
- sword_tag = item.getTag("km:sword");
- dye_tag = item.getTag("km:dye");
- leaves_tag = block.getTag("minecraft:leaves");
- sign_tag = block.getTag("minecraft:signs");
- prop_persistent = block.getProperty("persistent");
- ench_flame = enchantment.get("flame");
- ench_unbreaking = enchantment.get("unbreaking");
- ench_sharpness = enchantment.get("sharpness");
- piston_sound = sound.get("block.piston.extend");
- adv_tp_sound = sound.get("block.portal.travel");
- sound_category_ambient = sound.getCategory("ambient");
- sound_category_master = sound.getCategory("master");
- sound_flute = sound.get("block.note_block.flute");
- sound_harp = sound.get("block.note_block.harp");
- sound_pling = sound.get("block.note_block.pling");
- sound_cat = sound.get("entity.cat.ambient");
- sound_stray_cat = sound.get("entity.cat.stray_ambient");
- sound_purreow = sound.get("entity.cat.purreow");
- sound_drink_milk = sound.get("entity.wandering_trader.drink_milk");
- sound_slime_place = sound.get("block.slime_block.place");
- sound_eating = sound.get("entity.generic.eat");
- music_chirp = sound.get("music_disc.chirp");
- Sound_Pitch_List = list.new();
- for(a = -12; a <= 12; a++){
- list.add(Sound_Pitch_List, math.pow(2, -a / 12));
- }
- gambler_inv = inv.new("020202020");
- gambler_inv_id = inv.getId(gambler_inv);
- inv.setItem(gambler_inv, 0, read.item("km:coin_copper", 1, "§f1 snuvi"));
- inv.setItem(gambler_inv, 1, read.item("km:coin_silver", 1, "§f64 snuvis"));
- inv.setItem(gambler_inv, 2, read.item("km:coin_gold", 1, "§f4096 snuvis"));
- inv.setItem(gambler_inv, 3, read.item("minecraft:netherite_block", 1, "§fAll in"));
- //bankmenu = inv.new("233302332233302332");
- bankmenu = inv.new("233330000233330000000000000233200000233200000");
- //bankmenu = inv.new("233330000 233330000 000000000 233200000 233200000");
- bankinvid = inv.getId(bankmenu);
- coin_gold = read.item("km:coin_gold");
- coin_silver = read.item("km:coin_silver");
- coin_copper = read.item("km:coin_copper");
- coin_silver64 = read.item("km:coin_silver", 64);
- coin_copper64 = read.item("km:coin_copper", 64);
- arrow_left = read.item("km:arrow_left", 1, "§fchange to");
- arrow_right = read.item("km:arrow_right", 1, "§fchange to");
- inv.setItem(bankmenu, 0, read.item("km:plus_green", 1, "§fDeposit..."));
- inv.setItem(bankmenu, 1, read.item("km:coin_copper", 1, "§f1 snuvi"));
- inv.setItem(bankmenu, 2, read.item("km:coin_silver", 1, "§f64 snuvis"));
- inv.setItem(bankmenu, 3, read.item("km:coin_gold", 1, "§f4096 snuvis"));
- inv.setItem(bankmenu, 4, read.item("minecraft:netherite_block", 1, "§fAll snuvis"));
- inv.setItem(bankmenu, 5, read.item("km:minus_red", 1, "§fWithdraw..."));
- inv.setItem(bankmenu, 6, read.item("km:coin_copper", 1, "§f1 snuvi"));
- inv.setItem(bankmenu, 7, read.item("km:coin_silver", 1, "§f64 snuvis"));
- inv.setItem(bankmenu, 8, read.item("km:coin_gold", 1, "§f4096 snuvis"));
- inv.setItem(bankmenu, 9, read.item("minecraft:netherite_block", 1, "§fAll snuvis"));
- inv.setItem(bankmenu, 10, read.item("km:coin_copper", 64, "§f64 snuvis"));
- inv.setItem(bankmenu, 11, arrow_left);
- inv.setItem(bankmenu, 12, arrow_right);
- inv.setItem(bankmenu, 13, read.item("km:coin_silver", 1, "§f64 snuvis"));
- inv.setItem(bankmenu, 14, read.item("km:coin_silver", 64, "§f4096 snuvis"));
- inv.setItem(bankmenu, 15, arrow_left);
- inv.setItem(bankmenu, 16, arrow_right);
- inv.setItem(bankmenu, 17, read.item("km:coin_gold", 1, "§f4096 snuvis"));
- msg("dev", "§bSurvival §rloaded.");
- @wait
- wait();
- if(event == "player_move") {
- if(id == moveid_storyspawn) {
- player.setBackPosLoc(player, world.getServerSpawn());
- player.teleport(player, world.getStorySpawn(), false);
- goto("wait");
- }
- if(id == moveid_gamesspawn) {
- player.setBackPosLoc(player, world.getServerSpawn());
- player.teleport(player, world.getGamesSpawn(), false);
- goto("wait");
- }
- if(set.contains(afk_loop_ids, id)) {
- player_uuid = player.getUuid(player);
- now_time = time.getMillis();
- time = map.getOrDefault(afk_loop_map, player_uuid, 0);
- if(now_time - time > 9000) { //9 Sekunden
- map.add(afk_loop_map, player_uuid, now_time);
- money.addBoost(player, 1);
- }
- goto("wait");
- }
- goto("wait");
- }
- //Wenn Event aus Survival-Welten, dann wird er verarbeitet
- if(event == "living_death" || event == "living_pre_hurt") {
- loc = entity.getLocation(living_entity);
- } elseif(event == "ender_teleport") {
- loc = location;
- } elseif(event == "pre_explosion") {
- loc = location;
- } elseif(event == "mob_griefing") {
- if(entity == null) {
- goto("wait");
- }
- loc = entity.getLocation(entity);
- } else {
- loc = entity.getLocation(player);
- }
- world_name = world.getName(loc.getWorld(loc));
- if(world.isSurvName(world_name)) {
- ignoreGoto(event);
- }
- goto("wait");
- @ender_teleport
- if(!isPlayer(living_entity)) {
- goto("wait");
- }
- player = living_entity;
- if(player.isOnAdventure(player)) {
- cancel = true;
- msg.prefix(player, "§5Adventure", "Using Enderpearls during adventures? Nope!");
- goto("wait");
- }
- //Verhindert während eines (Abenteuer-)Teleports, die Benutzung der Enderperle
- player_uuid = player.getUuid(player);
- if(set.contains(tp_set, player_uuid)) {
- cancel = true;
- msg.prefix(player, "§5Adventure", "Using Enderpearls during adventures? Nope!");
- }
- goto("wait");
- @item_air_click
- player_loc = entity.getLocation(player);
- world = loc.getWorld(player_loc);
- if(world.getName(world) != "overworld") {
- goto("wait");
- }
- item = living.getEquip(player, "hand");
- if(item.getType(item) != "minecraft:clock") {
- goto("wait");
- }
- time = world.getTime(world);
- time_h = math.roundDown(time/1000) + 6;
- while(time_h >= 24) {
- time_h -= 24;
- }
- //m min = t ticks * 60m / 1000 ticks
- time_m = time%1000;
- time_m = math.roundDown(time_m * 60 / 1000);
- if(time_m < 10) {
- time_m = concat("0", text.number(time_m));
- } else {
- time_m = text.number(time_m);
- }
- msg.prefix(player, "§eClock", concat(text.number(time_h), ":", time_m));
- goto("wait");
- @mob_griefing
- if(entity.getType(entity) == "enderman") {
- cancel = true;
- }
- goto("wait");
- @pre_explosion
- plot_list = plot.get(location);
- for(i = 0; i < list.getSize(plot_list); i++) {
- plot = list.getIndex(plot_list, i);
- if(plot.isExplosive(plot)) {
- cancel = false;
- }
- }
- //Kein Grundstück existiert
- if(i == 0) {
- cancel = false;
- }
- goto("wait");
- @living_pre_hurt
- if(!isPlayer(living_entity)) {
- damager = player.getFromDamageSource(damage_source);
- if(!isPlayer(damager)) {
- goto("wait");
- }
- pet_type = entity.getType(living_entity);
- if(pet_type == "wolf" || pet_type == "cat" || pet_type == "parrot" || pet_type == "horse") {
- if(pet.isTamed(living_entity)) {
- owner_uuid = pet.getOwner(living_entity);
- if(owner_uuid == player.getUuid(damager)) {
- if(player.getNoPetDamage(damager)) {
- cancel = true;
- }
- }
- }
- }
- goto("wait");
- }
- player = living_entity;
- damager = player.getFromDamageSource(damage_source);
- if(!isPlayer(damager)) {
- player_loc = entity.getLocation(player);
- if(loc.hasPlotId(player_loc, 128) && damage.getType(damage_source) == "fall") {
- cancel = true;
- }
- goto("wait");
- }
- if(player == damager) {
- goto("wait");
- }
- if(!hasPvpOn(damager)) {
- cancel = true;
- msg.prefix(damager, "§5PvP", "You have PvP disabled.");
- goto("wait");
- }
- if(!hasPvpOn(player)) {
- cancel = true;
- msg.prefix(damager, "§5PvP", concat(player.getName(player), " has PvP disabled."));
- goto("wait");
- }
- goto("wait");
- @entity_click
- if(hand == "OFF_HAND") {
- goto("wait");
- }
- if(entity.getType(entity) == "human") {
- entity_name = entity.getName(entity);
- if(entity_name == "Administrator\n§cmarvinius") {
- item = living.getHand(player);
- item_name = item.getName(item);
- if(removeFormat(item_name) == "Beer") {
- sound.spawnForPlayer(player, $sound_drink_milk, $sound_category_master, 1, 1);
- msg.prefix(player, "§cmarvinius", "Prost!");
- }
- else{
- msg.prefix(player, "§cmarvinius", "Ich mag Gösser.");
- }
- goto("wait");
- }
- if(entity_name == "Owner\n§4kajetanjohannes") {
- item = living.getHand(player);
- item_type = item.getType(item);
- sound.spawnForPlayer(player, $sound_slime_place, $sound_category_master, 1, 1);
- if(item_type == "minecraft:redstone") {
- rand_number = math.roundup(math.random(0,3));
- if(rand_number == 0){
- temp_message = "WUSIWUSIWUSIWUSIWUSIWUSIWUSIWUSI";
- }
- if(rand_number == 1){
- temp_message = "Wusi!";
- }
- if(rand_number == 2){
- temp_message = "Wusi?";
- }
- if(rand_number == 3){
- temp_message = "Wusi.";
- }
- msg.prefix(player, "§4kajetanjohannes", temp_message);
- goto("wait");
- }
- if(item_type == "minecraft:ice" || item_type == "minecraft:blue_ice" || item_type == "minecraft:packed_ice"){
- msg.prefix(player, "§4kajetanjohannes", "§bDas sieht nach mir aus.");
- }else{
- msg.prefix(player, "§4kajetanjohannes", "wusi");
- }
- goto("wait");
- }
- if(entity_name == "Supporter\n§bImKillerKatze") {
- rand_number = math.roundup(math.random(0,25));
- if(rand_number > 13){
- sound.spawnForPlayer(player, $sound_cat, $sound_category_master, 1, 1);
- msg.prefix(player, "§bImKillerKatze", "Miau");
- goto("wait");
- }
- if(rand_number < 12){
- sound.spawnForPlayer(player, $sound_stray_cat, $sound_category_master, 1, 1);
- msg.prefix(player, "§bImKillerKatze", "Miau!");
- goto("wait");
- }
- else{
- sound.spawnForPlayer(player, $sound_purreow, $sound_category_master, 1, 1);
- msg.prefix(player, "§bImKillerKatze", "Schnurrr!");
- goto("wait");
- }
- }
- if(entity_name == "Administrator\n§cwertibaldi") {
- msg.prefix(player, "§cwertibaldi", "Kann grad nicht, bin im Einsatz für den Katastrophenschutz.");
- goto("wait");
- }
- if(entity_name == "Administrator\n§cMentorMentos") {
- item = living.getHand(player);
- item_name = item.getName(item);
- if(removeFormat(item_name) == "Beer") {
- msg.prefix(player, "§cMentorMentos", "Folg mir auf Twitch! ");
- msg(player, text.link("Klick mich an :D","https://www.twitch.tv/Mentor_Mentos"));
- }
- else{
- msg.prefix(player, "§cMentorMentos", "Ich mag Kölsch.");
- }
- goto("wait");
- }
- if(entity_name == "Moderator\n§9SirTerence7") {
- rand_number = math.roundup(math.random(0,7));
- if(rand_number < 4){
- msg.prefix(player, "§9SirTerence7", "Mathe bla... bla... bla...");
- }
- if(rand_number == 4){
- msg.prefix(player, "§9SirTerence7", "Fraktale bla... bla... bla...");
- }
- if(rand_number == 5){
- msg.prefix(player, "§9SirTerence7", "Höhere Dimensionen bla... bla... bla...");
- }
- if(rand_number == 6){
- msg.prefix(player, "§9SirTerence7", "*redet mit Händen weiter*");
- }
- if(rand_number == 7){
- msg.prefix(player, "§9SirTerence7", "*wechselt voller Faszination zwischen scheinbar zusammenhangslosen Themen hin und her*");
- }
- rand_number = math.roundup(math.random(0,500));
- if(rand_number <= 2){
- sound.spawnForPlayer(player, $music_chirp, $sound_category_master, 1, 1);
- }else{
- rand_pitch = math.roundup(math.random(4, list.getSize(Sound_Pitch_List)-5));
- if(rand_number < 200){
- pitch1 = list.getIndex(Sound_Pitch_List, rand_pitch-4);
- pitch2 = list.getIndex(Sound_Pitch_List, rand_pitch);
- pitch3 = list.getIndex(Sound_Pitch_List, rand_pitch+3);
- }else{
- if(rand_number < 300){
- pitch1 = list.getIndex(Sound_Pitch_List, rand_pitch-4);
- pitch1_2 = list.getIndex(Sound_Pitch_List, rand_pitch-2);
- pitch2 = list.getIndex(Sound_Pitch_List, rand_pitch);
- pitch3_2 = list.getIndex(Sound_Pitch_List, rand_pitch+1);
- pitch3 = list.getIndex(Sound_Pitch_List, rand_pitch+3);
- sound.spawnForPlayer(player, $sound_harp, $sound_category_master, 0.5, pitch1_2);
- sound.spawnForPlayer(player, $sound_harp, $sound_category_master, 0.5, pitch3_2);
- sound.spawnForPlayer(player, $sound_flute, $sound_category_master, 0.75, pitch1_2);
- sound.spawnForPlayer(player, $sound_flute, $sound_category_master, 0.75, pitch3_2);
- }else{
- pitch1 = list.getIndex(Sound_Pitch_List, rand_pitch-3);
- pitch2 = list.getIndex(Sound_Pitch_List, rand_pitch);
- pitch3 = list.getIndex(Sound_Pitch_List, rand_pitch+4);
- }
- }
- sound.spawnForPlayer(player, $sound_harp, $sound_category_master, 0.8, pitch1);
- sound.spawnForPlayer(player, $sound_harp, $sound_category_master, 0.9, pitch2);
- sound.spawnForPlayer(player, $sound_harp, $sound_category_master, 0.8, pitch2);
- sound.spawnForPlayer(player, $sound_flute, $sound_category_master, 0.9, pitch1);
- sound.spawnForPlayer(player, $sound_flute, $sound_category_master, 1, pitch2);
- sound.spawnForPlayer(player, $sound_flute, $sound_category_master, 0.9, pitch3);
- }
- goto("wait");
- }
- if(entity_name == "Moderator\n§9Mareeeen") {
- rand_number = math.roundup(math.random(0,5));
- if(rand_number > 1){
- msg.prefix(player, "§9Mareeeen", "Wo ist die Schokolade versteckt!?");
- }else{
- msg.prefix(player, "§9Mareeeen", "Ich esse deine Schokolade!");
- sound.spawnForPlayer(player, $sound_eating, $sound_category_master, 1, 1);
- }
- goto("wait");
- }
-
- if(entity_name == "Info-Point") {
- msg(player, getSpacer());
- msg(player, text.click("§r [§cclick§r] [§eSurvival§r]", "/infopoint1"));
- msg(player, text.click("§r [§cclick§r] [§eAdventure§r]", "/infopoint2"));
- msg(player, text.click("§r [§cclick§r] [§ePlots§r]", "/infopoint3"));
- msg(player, text.click("§r [§cclick§r] [§eClans§r]", "/infopoint4"));
- msg(player, text.click("§r [§cclick§r] [§eCities§r]", "/infopoint5"));
- msg(player, text.click("§r [§cclick§r] [§eShops§r]", "/infopoint6"));
- msg(player, text.click("§r [§cclick§r] [§eMinigames§r]", "/infopoint7"), " ", text.click("§f[§bTeleport§f]", "/games"));
- msg(player, text.click("§r [§cclick§r] [§eQuests§r]", "/infopoint8"), " ", text.click("§f[§bTeleport§f]", "/story"));
- msg(player, text.click("§r [§cclick§r] [§eCreative§r]", "/infopoint12"), " ", text.click("§f[§bTeleport§f]", "/creative"));
- msg(player, text.click("§r [§cclick§r] [§eRanking§r]", "/infopoint9"), " ", text.link("§f[§bRanks§f]", "https://minecraft.hammerle.me/?site=ranks"));
- msg(player, text.click("§r [§cclick§r] [§eRules§r]", "/infopoint10"), " ", text.link("§f[§bFake Rules§f]", "https://minecraft.hammerle.me/?site=rules"));
- msg(player, text.click("§r [§cclick§r] [§eNote§r]", "/infopoint11"));
- goto("wait");
- }
- if(entity_name == "Banker") {
- inv.open(bankmenu, player, "Banker");
- goto("wait");
- }
- if(entity_name == "Adventure") {
- if(!player.isOnAdventure(player)) {
- msg.prefix(player, "§5Adventure", "You aren't on an adventure. Click the chest in the teleporter to start an adventure.");
- goto("wait");
- }
- player.setAdventure(player, false);
- adventures = player.getAdventureAmounts(player);
- if(adventures == null) {
- adventures = 0;
- }
- player.setAdventureAmounts(player, ++adventures);
- msg.prefix(player, "§5Adventure", "Congratulations, you finished your adventure, here ist your reward!");
- if(adventures == 10) {
- offerRank(player, "rank.pioneer");
- } elseif(adventures == 5) {
- offerRank(player, "rank.explorer");
- } elseif(adventures == 1) {
- offerRank(player, "rank.adventurer");
- }
- removeAdventureDisplay(player);
- player.safeGiveItem(player, item.getAmber());
- money.addBoost(player, 4096);
- goto("wait");
- }
- }
- goto("wait");
- @player_login
- if(player.isOnAdventure(player)) {
- addAdventureDisplay(player, adventure_aim_loc);
- }
- goto("wait");
- @container_click
- //Verhindert während eines (Abenteuer-)Teleports, die Benutzung des Spielerinventars (inkl. Crafting-Bereich!)
- player_uuid = player.getUuid(player);
- if(set.contains(tp_set, player_uuid)) {
- cancel = true;
- }
- goto("wait");
- @inv_click
- if(inv_id == bankinvid) { //Bankmenü
- factor = 1;
- if(click_type == "QUICK_MOVE") {
- factor = 8;
- }
- gold_inv = player.getItemAmount(player, false, coin_gold);
- silver_inv = player.getItemAmount(player, false, coin_silver);
- copper_inv = player.getItemAmount(player, false, coin_copper);
- //Wechseln
- if(inv_slot == 11 || inv_slot == 12 || inv_slot == 15 || inv_slot == 16) {
- if(inv_slot == 11) {
- //1 Silbermünze --> 64 Kupfermünzen
- from_item = coin_silver;
- to_item = coin_copper64;
- message = "Not enough silvercoins in inventory.";
- item_type = "km:coin_copper";
- needed_inv_coins = silver_inv;
- }
- elseif(inv_slot == 12) {
- //64 Kupfermünzen --> 1 Silbermünze
- from_item = coin_copper64;
- to_item = coin_silver;
- message = "Not enough coppercoins in inventory.";
- item_type = "km:coin_silver";
- needed_inv_coins = copper_inv;
- }
- elseif(inv_slot == 15) {
- //1 Goldmünze --> 64 Silbermünzen
- from_item = coin_gold;
- to_item = coin_silver64;
- message = "Not enough goldcoins in inventory.";
- item_type = "km:coin_silver";
- needed_inv_coins = gold_inv;
- }
- elseif(inv_slot == 16) {
- //64 Silbermünzen --> 1 Goldmünze
- from_item = coin_silver64;
- to_item = coin_gold;
- message = "Not enough silvercoins in inventory.";
- item_type = "km:coin_gold";
- needed_inv_coins = silver_inv;
- }
- item_1 = item.clone(from_item);
- item.setAmount(item_1, item.getAmount(item_1) * factor);
- item_2 = item.clone(to_item);
- item.setAmount(item_2, item.getAmount(item_2) * factor);
- amount1 = item.getAmount(item_1);
- amount2 = item.getAmount(item_2);
- if(needed_inv_coins * factor < amount1 * factor) {
- msg.prefix(player, prefix_money, message);
- goto("wait");
- }
- player.removeItemNbt(player, item_1);
- notgiven = player.giveItem(player, item_2);
- if(item.getType(notgiven) != "minecraft:air") {
- amount = item.getAmount(notgiven);
- player.removeItemNbt(player, read.item(item_type, amount2 - amount));
- player.giveItem(player, item_1);
- msg.prefix(player, prefix_money, "Not enough space in inventory.");
- goto("wait");
- }
- inv.update(player);
- msg.prefix(player, prefix_money, "Exchange succesfull.");
- goto("wait");
- }
- //Kontobewegungen
- if(inv_slot == 1 || inv_slot == 6) {
- betrag = 1 * factor;
- coin_inv = copper_inv;
- }
- elseif(inv_slot == 2 || inv_slot == 7) {
- betrag = 64 * factor;
- coin_inv = silver_inv;
- }
- elseif(inv_slot == 3 || inv_slot == 8) {
- betrag = 4096 * factor;
- coin_inv = gold_inv;
- }
- elseif(inv_slot == 4 || inv_slot == 9) {
- if(inv_slot == 4) {
- betrag = copper_inv + silver_inv * 64 + gold_inv * 4096;
- coin_inv = 8;
- } elseif(inv_slot == 9) {
- betrag = getMoney(player);
- coin_inv = 8;
- }
- }
- //Einzahlen
- if(inv_slot > 0 && inv_slot < 5) {
- if(coin_inv < 1 * factor) {
- msg.prefix(player, prefix_money, "Coins not in inventory.");
- goto("wait");
- }
- if(betrag == 0) {
- msg.prefix(player, prefix_money, "No coins in your inventory.");
- goto("wait");
- }
- addMoney(player, betrag);
- if(inv_slot == 4) {
- player.removeItemNbt(player, read.item("km:coin_gold", gold_inv));
- player.removeItemNbt(player, read.item("km:coin_silver", silver_inv));
- player.removeItemNbt(player, read.item("km:coin_copper", copper_inv));
- } else {
- remove_item = item.clone(inv.getItem(bankmenu, inv_slot));
- item.setAmount(remove_item, item.getAmount(remove_item) * factor);
- player.removeItemNbt(player, remove_item);
- }
- inv.update(player);
- goto("wait");
- }
- //Auszahlen
- if(inv_slot > 5 && inv_slot < 10) {
- if(!hasEnoughMoney(player, betrag)) {
- msg.prefix(player, prefix_money, "Not enough snuvis on your account.");
- } else {
- subMoney(player, betrag);
- if(inv_slot == 9) {
- gold_amount = math.roundDown(betrag / 4096);
- betrag %= 4096;
- silver_amount = math.roundDown(betrag / 64);
- copper_amount = math.roundDown(betrag % 64);
- coin_item = read.item("km:coin_gold", gold_amount);
- player.safeGiveItem(player, coin_item);
- coin_item = read.item("km:coin_silver", silver_amount);
- player.safeGiveItem(player, coin_item);
- coin_item = read.item("km:coin_copper", copper_amount);
- player.safeGiveItem(player, coin_item);
- } else {
- item = inv.getItem(bankmenu, inv_slot);
- new_item = read.item(item.getType(item), item.getAmount(item) * factor);
- player.safeGiveItem(player, new_item);
- }
- inv.update(player);
- }
- goto("wait");
- }
- goto("wait");
- }
- if(inv_id == gambler_inv_id) {
- if(inv_slot == 0) {
- amount = 1;
- } elseif(inv_slot == 1) {
- amount = 64;
- } elseif(inv_slot == 2) {
- amount = 4096;
- } elseif(inv_slot == 3) {
- amount = getMoney(player);
- if(amount == 0) {
- msg.prefix(player, prefix_money, "You need at least 1 snuvi on your account.");
- goto("wait");
- }
- }
- if(!hasEnoughMoney(player, amount)) {
- msg.prefix(player, prefix_money, "Not enough snuvis on your account.");
- goto("wait");
- }
- win = math.random(1, 2);
- if(win == 1) {
- addMoney(player, amount);
- temp = " won ";
- } else {
- subMoney(player, amount);
- temp = " lost ";
- }
- if(amount == 1) {
- message = concat(player.getName(player), temp, text.number(amount), " snuvi.");
- } else {
- message = concat(player.getName(player), temp, text.number(amount), " snuvis.");
- }
- if(amount < 64) {
- msg.prefix(player, "§2Gambler", message);
- } elseif(amount >= 131072) {
- msg.online("§2Gambler", message);
- } else {
- msg.radius("§2Gambler", message, entity.getLocation(player), 10);
- }
- goto("wait");
- }
- goto("wait");
- @projectile_hit
- if(!isPlayer(shooter)) {
- goto("wait");
- }
- player = shooter;
- duration = data.getTimer(player, "skill.fire_arrow");
- if(duration > 0) {
- if(loc_hit == null) {
- goto("wait");
- }
- flame = enchantment.getLevel(ench_flame, living.getHand(player));
- if(flame <= 0) {
- goto("wait");
- }
- if(!plot.check(loc_hit, player, 3, true) && !perm.has(player, "plot.bypass")) {
- msg.prefix(player, prefix_skill, "You have no permissions on this plot.");
- goto("wait");
- }
- ent_loc = entity.getLocation(projectile);
- if(block.isAir(ent_loc)){
- block.set(ent_loc, "minecraft:fire");
- }
- fire_ring(ent_loc, "minecraft:fire", 0);
- }
- goto("wait");
- function fire_ring(location, block_string, radius){
- loc_x = loc.getX(location);
- loc_y = loc.getY(location);
- loc_z = loc.getZ(location);
- for(a = -radius; a < radius + 1; a++){
- loc.setX(location, loc_x + a);
- for(b = -radius; b < radius + 1; b++){
- loc.setY(location, loc_y + b);
- for(c = -radius; c < radius + 1; c++){
- loc.setZ(location, loc_z + c);
- if(block.isAir(location)){
- block.set(location, block_string);
- }
- }
- }
- }
- }
- @block_break
- duration = data.getTimer(player, "block_down");
- if(duration > 0) {
- do = true;
- loc = loc.mod(block_loc, 0, -1, 0);
- b_type = block.getType(loc);
- if(b_type == "minecraft:bedrock" || b_type == "minecraft:end_portal_frame") {
- do = false;
- }
- if(!plot.check(loc, player, 2, true)) {
- do = false;
- }
- if(do) {
- block.break(loc, player);
- }
- }
- duration = data.getTimer(player, "block_up");
- if(duration > 0) {
- do = true;
- loc = loc.mod(block_loc, 0, 1, 0);
- b_type = block.getType(loc);
- if(b_type == "minecraft:bedrock" || b_type == "minecraft:end_portal_frame") {
- do = false;
- }
- if(!plot.check(loc, player, 2, true)) {
- do = false;
- }
- if(do) {
- block.break(loc, player);
- }
- }
- if(block_type == "minecraft:cobweb") {
- if(cancel) {
- goto("wait");
- }
- hand_item = living.getHand(player);
- if(!item.hasTag(sword_tag, hand_item)) {
- goto("wait");
- }
- amount = skill.getAmount(player, "skill.cobweb_miner");
- if(amount <= 0) {
- goto("wait");
- }
- if(!skill.isActivated(player, "skill.cobweb_miner")) {
- goto("wait");
- }
- location = loc.mod(block_loc, 0, 0, 0);
- cobweb_X = loc.getX(location);
- cobweb_Y = loc.getY(location);
- cobweb_Z = loc.getZ(location);
- cobweb_radius = 1;
- unbreaking_level = enchantment.getLevel(ench_unbreaking, hand_item);
- for(a = -cobweb_radius; a < cobweb_radius + 1; a++) {
- loc.setX(location, cobweb_X + a);
- for(b = -cobweb_radius; b < cobweb_radius + 1; b++) {
- loc.setY(location, cobweb_Y + b);
- for(c = -cobweb_radius; c < cobweb_radius + 1; c++) {
- loc.setZ(location, cobweb_Z + c);
- if(math.abs(a) + math.abs(b) + math.abs(c) + math.random(0, 2) < cobweb_radius + 2) {
- shear_cobweb(location, block_type, player, unbreaking_level);
- }
- }
- }
- }
- goto("wait");
- }
- if(block.hasTag(leaves_tag, block)) {
- if(cancel) {
- goto("wait");
- }
- hand_item = living.getHand(player);
- if(item.getType(hand_item) != "minecraft:shears") {
- goto("wait");
- }
- if(block.property.getValue(block_loc, prop_persistent)){
- goto("wait");
- }
- amount = skill.getAmount(player, "skill.better_shears");
- if(amount <= 0) {
- goto("wait");
- }
- if(!skill.isActivated(player, "skill.better_shears")) {
- goto("wait");
- }
- location = loc.mod(block_loc, 0, 0, 0);
- shears_X = loc.getX(location);
- shears_Y = loc.getY(location);
- shears_Z = loc.getZ(location);
- unbreaking_level = enchantment.getLevel(ench_unbreaking, hand_item);
- radius = enchantment.getLevel(ench_sharpness, hand_item);
- if(radius > 0) {
- cancel = true;
- }
- orig_item = block.toStack(location);
- for(a = -radius; a < radius + 1; a++){
- loc.setX(location, shears_X + a);
- for(b = -radius; b < radius + 1; b++){
- loc.setY(location, shears_Y + b);
- for(c = -radius; c < radius + 1; c++){
- loc.setZ(location, shears_Z + c);
- if(math.abs(a) + math.abs(b) + math.abs(c) + math.random(0, 2) < radius + 2) {
- shear_leave(location, block_type, orig_item, player, unbreaking_level);
- }
- }
- }
- }
- goto("wait");
- }
- goto("wait");
- function shear_leave(block_loc, original_block_type, original_item, player, unbreaking_level){
- if(block.getType(block_loc) != original_block_type) {
- return;
- }
- if(block.property.getValue(block_loc, $prop_persistent)) {
- return;
- }
- block.set(block_loc, "minecraft:air");
- item.drop(block_loc, original_item);
- if(player.isSurvival(player)) {
- player.damageItem(player, 1);
- }
- }
- function shear_cobweb(block_loc, original_block_type, player, unbreaking_level) {
- if(block.getType(block_loc) != original_block_type) {
- return;
- }
- block.break(block_loc, player);
- if(math.random(0, 99) < 100 / (unbreaking_level + 1)) {
- player.damageItem(player, 1);
- }
- }
- @block_click
- if(action == "right" && player.checkHandsForTag(player, dye_tag)) {
- if(block.hasTag(sign_tag, block)) {
- if(!perm.has(player, "plot.bypass")) {
- if(!plot.check(block_loc, player, 3, true)) {
- cancel = true;
- goto("wait");
- }
- }
- }
- }
- if(hand == "OFF_HAND") {
- goto("wait");
- }
- if(block_type == "minecraft:chest") {
- if(isATpReceiver(block_loc)) {
- tp_item = read.item("km:gear", 1, "§rTeleport");
- list = list.new();
- list.add(list, world.getName(loc.getWorld(block_loc)));
- list.add(list, text.number(loc.getX(block_loc)));
- list.add(list, text.number(loc.getY(block_loc)));
- list.add(list, text.number(loc.getZ(block_loc)));
- item.setLore(tp_item, list);
- player.giveItem(player, tp_item);
- goto("wait");
- }
- if(isATpTransmitter(block_loc)) {
- player_uuid = player.getUuid(player);
- clicked = map.getOrDefault(tp_map, player_uuid, 0);
- now_time = time.getMillis();
- if(now_time - clicked < 5000) {
- msg.prefix(player, "§5Adventure", "Wait 5 seconds!");
- goto("wait");
- }
- map.add(tp_map, player_uuid, now_time);
- //Abenteuer-Teleport
- if(block_loc == adventure_chest_loc) {
- if(!player.isOnAdventure(player)) {
- if(!player.hasClearInventory(player)) {
- msg.prefix(player, "§5Adventure", "Your inventory needs to be empty!");
- goto("wait");
- }
- alpha = math.random(0, 360);
- alpha *= math.pi() / 180;
- x = math.round(math.sin(alpha) * 10000) + 0.5;
- z = math.round(math.cos(alpha) * 10000) + 0.5;
- y = 255;
- tp_loc = loc.new(world.getOverWorld(), x, y, z);
- while(block.isAir(tp_loc)) {
- loc.setY(tp_loc, y);
- y--;
- }
- tp_loc = loc.mod(tp_loc, 0, 1, 0);
- setTpWallX(block_loc, "minecraft:lime_stained_glass");
- sound.spawn(block_loc, piston_sound, sound_category_ambient);
- player_uuid = player.getUuid(player);
- array = array.new(4);
- array[0] = player_uuid;
- array[1] = block_loc;
- array[2] = tp_loc;
- array[3] = true;
- list.add(tp_list, array);
- set.add(tp_set, player_uuid);
- sgoto(30, "tp_ticker");
- }
- goto("wait");
- }
- //Normaler Teleport
- temp = false;
- inv = block.getInv(block_loc);
- inv_size = inv.getSize(inv);
- for(i = 0; i < inv_size; i++) {
- item = inv.getItem(inv, i);
- if(item.getType(item) == "km:gear") {
- if(item.getName(item) == "§rTeleport") {
- temp = true;
- break;
- }
- }
- }
- if(!temp) {
- msg.prefix(player, "§5Adventure", "No receiver found!");
- goto("wait");
- }
-
- lore_list = item.getLore(item);
- if(list.getSize(lore_list) != 4) {
- msg.prefix(player, "§5Adventure", "No receiver found!");
- goto("wait");
- }
- world = world.get(list.getIndex(lore_list, 0));
- x = read.number(list.getIndex(lore_list, 1));
- y = read.number(list.getIndex(lore_list, 2));
- z = read.number(list.getIndex(lore_list, 3));
- tp_loc = loc.new(world, x, y, z);
- if(!isATpReceiver(tp_loc)) {
- msg.prefix(player, "§5Adventure", "No receiver found!");
- goto("wait");
- }
- loc.add(tp_loc, 0.5, -3, 0.5);
-
- setTpWallX(block_loc, "minecraft:lime_stained_glass");
- sound.spawn(block_loc, piston_sound, sound_category_ambient);
- array = array.new(4);
- array[0] = player.getUuid(player);
- array[1] = block_loc;
- array[2] = tp_loc;
- array[3] = false;
- list.add(tp_list, array);
- sgoto(30, "tp_ticker");
- }
- goto("wait");
- }
- if(block_loc == gambler_loc) {
- cancel = true;
- inv.open(gambler_inv, player, "Choose your amount to bet with");
- goto("wait");
- }
- if(block_loc == lottery_loc_1 || block_loc == lottery_loc_2) {
- if(!hasEnoughMoney(player, 1)) {
- msg.prefix(player, prefix_money, "Not enough snuvis on your account.");
- goto("wait");
- }
- subMoney(player, 1);
- amount = lottery.add(block_loc, 1);
- if(amount == null) {
- goto("wait");
- }
- if(block_loc == lottery_loc_1) {
- winrate = 1000;
- } else {
- winrate = 10000;
- }
- win = math.random(1, winrate);
- if(win == 1) {
- addMoney(player, amount);
- lottery.set(block_loc, 0);
- message = concat(player.getName(player), " has won ", text.number(amount), " snuvis.");
- msg.radius(prefix_money, message, block_loc, 50);
- }
- goto("wait");
- }
- goto("wait");
- @living_death
- if(isPlayer(living_entity)) {
- player = living_entity;
- setDeathLoc(player);
- loc = entity.getLocation(player);
- amount = skill.getAmount(player, "skill.subcu_inv");
- if(skill.isActivated(player, "skill.subcu_inv") && amount > 0) {
- new_amount = amount - 1;
- skill.setAmount(player, "skill.subcu_inv", new_amount);
- msg.prefix(player, prefix_skill, concat("Used Subcutaneous Inventory. New amount: ", text.number(new_amount)));
- } else {
- player.dropInventory(player, loc);
- }
- killer = player.getFromDamageSource(damage_source);
- if(isPlayer(killer)) {
- amount = skill.getAmount(player, "skill.head_human");
- if(amount >= 1) {
- if(perm.has(player, "isTeam")) {
- temp = math.random(1, 20);
- } else {
- temp = math.random(1, 5);
- }
- if(temp == 1) {
- item.drop(loc, player.getHead(player.getUuid(player), player.getName(player)));
- }
- }
- }
- goto("wait");
- }
- killer = player.getFromDamageSource(damage_source);
- if(isPlayer(killer)) {
- r = math.random(1, 20);
- if(r == 1) {
- amount = skill.getAmount(killer, "skill.head_monster");
- if(amount >= 1) {
- entity_type = entity.getType(living_entity);
- if(entity_type == "creeper") {
- item.drop(loc, read.item("minecraft:creeper_head"));
- goto("wait");
- }
- if(entity_type == "zombie") {
- item.drop(loc, read.item("minecraft:zombie_head"));
- goto("wait");
- }
- if(entity_type == "skeleton") {
- item.drop(loc, read.item("minecraft:skeleton_skull"));
- goto("wait");
- }
- }
- }
- }
- goto("wait");
- @player_pre_respawn
- if(loc.isInSurvWorld(entity.getLocation(player))) {
- set.add(survival_respawn, player.getUuid(player));
- }
- goto("wait");
- @player_post_respawn
- player_uuid = player.getUuid(player);
- if(set.contains(survival_respawn, player_uuid)) {
- set.remove(survival_respawn, player_uuid);
- if(player.isOnAdventure(player)) {
- tp_loc = player.getAdventureStart(player);
- entity.teleport(player, tp_loc);
- goto("wait");
- }
- amount = skill.getAmount(player, "skill.comeback");
- if(skill.isActivated(player, "skill.comeback") && amount > 0) {
- new_amount = amount - 1;
- skill.setAmount(player, "skill.comeback", new_amount);
- msg.prefix(player, prefix_skill, concat("Used Comeback. New amount: ", text.number(new_amount)));
- entity.teleport(player, getDeathLoc(player));
- goto("wait");
- }
- entity.teleport(player, world.getServerSpawn());
- }
- goto("wait");
- @tp_ticker
- array = list.getIndex(tp_list, 0);
- list.removeIndex(tp_list, 0);
- block_loc = array[1];
- list.add(tp_list, array);
- setTpWallFull(block_loc, "minecraft:lime_stained_glass");
- sound.spawn(block_loc, piston_sound, sound_category_ambient);
- sgoto(30, "tp_final");
- goto("wait");
- @tp_final
- array = list.getIndex(tp_list, 0);
- list.removeIndex(tp_list, 0);
- player_uuid = array[0];
- block_loc = array[1];
- tp_loc = array[2];
- adventure = array[3];
- set.remove(tp_set, player_uuid);
- sound.spawn(block_loc, piston_sound, sound_category_ambient);
- setTpWallFull(block_loc, "minecraft:air");
- player = player.get(player_uuid);
- if(player == null) {
- goto("wait");
- }
- sound.spawn(tp_loc, adv_tp_sound, sound_category_ambient);
- if(adventure) {
- //Party
- if(player.isInParty(player) && player.isPartyLeader(player)) {
- party_id = player.getPartyId(player);
- party_list = party.getList(party_id);
- iter = list.iterator(party_list);
- while(hasNext(iter)) {
- p = player.get(next(iter));
- p_name = player.getName(p);
- p_loc = entity.getLocation(p);
- if(!loc.isSameWorld(adventure_chest_loc, p_loc)) {
- msg.prefix(player, "§5Party", concat(p_name, "§c is in another world."));
- msg.prefix(p, "§5Party", "§cYou are in another world.");
- continue;
- }
- if(loc.distance(adventure_chest_loc, p_loc) > 5) {
- msg.prefix(player, "§5Party", concat(p_name, "§c is too far away."));
- msg.prefix(p, "§5Party", "§cYou are too far away.");
- continue;
- }
- if(player.hasMinigame(p)) {
- msg.prefix(player, "§5Party", concat(p_name, "§c is in a game."));
- msg.prefix(p, "§5Party", "§cYou are in a game.");
- continue;
- }
- if(player.hasQuest2(p)) {
- msg.prefix(player, "§5Party", concat(p_name, "§c is doing a quest."));
- msg.prefix(p, "§5Party", "§cYou are doing a quest.");
- continue;
- }
- if(player.isOnAdventure(p)) {
- msg.prefix(player, "§5Party", concat(p_name, "§c is already on an adventure."));
- msg.prefix(p, "§5Party", "§cYou are already on an adventure.");
- continue;
- }
- if(player.isAfk(p)) {
- msg.prefix(player, "§5Party", concat(p_name, "§c is afk."));
- msg.prefix(p, "§5Party", "§cYou are afk.");
- continue;
- }
- if(!player.hasClearInventory(p)) {
- msg.prefix(player, "§5Party", concat(p_name, "§c has no clear inventory."));
- msg.prefix(p, "§5Party", "§cYou have no clear inventory.");
- continue;
- }
- player.teleport(p, tp_loc, false);
- player.setAdventure(p, true);
- player.setAdventureStart(p, tp_loc);
- addAdventureDisplay(p, adventure_aim_loc);
- title.reset(p);
- title.setSub(p, "Have fun!");
- title.send(p, "§cAdventure");
- msg.prefix(p, "§5Adventure", "To complete your adventure, go to the survival spawn. You cannot teleport. If you die, you start again!");
- }
- goto("wait");
- }
- if(!player.hasClearInventory(player)) {
- msg.prefix(player, "§5Adventure", "Your inventory needs to be empty!");
- goto("wait");
- }
- player.teleport(player, tp_loc, false);
- player.setAdventure(player, true);
- player.setAdventureStart(player, tp_loc);
- addAdventureDisplay(player, adventure_aim_loc);
- title.reset(player);
- title.setSub(player, "Have fun!");
- title.send(player, "§cAdventure");
- msg.prefix(player, "§5Adventure", "To complete your adventure, go to the survival spawn. You cannot teleport. If you die, you start again!");
- goto("wait");
- }
- player.teleport(player, tp_loc, false);
- goto("wait");
- function lottery.set(location, amount) {
- location = loc.mod(location, 0.5, 0, 0.5);
- list = living.near(location, 0.1);
- text_entity = list.getIndex(list, 0);
- name = entity.getName(text_entity);
- if(!text.startsWith(name, "Snuvis to win: ", 0)) {
- snuvi.debug("Lottery error");
- return;
- }
- entity.setName(text_entity, concat("Snuvis to win: ", text.number(amount)), true);
- }
- function lottery.add(location, amount) {
- location = loc.mod(location, 0.5, 0, 0.5);
- list = living.near(location, 0.1);
- text_entity = list.getIndex(list, 0);
- name = entity.getName(text_entity);
- if(!text.startsWith(name, "Snuvis to win:", 0)) {
- snuvi.debug("Lottery error");
- return null;
- }
- amount = text.convert(text.subString(name, 15, text.length(name))) + 1;
- entity.setName(text_entity, concat("Snuvis to win: ", text.number(amount)), true);
- return amount;
- }
- function setDeathLoc(player) {
- map.add($death_loc_map, player.getUuid(player), entity.getLocation(player));
- }
- function getDeathLoc(player) {
- return map.getOrDefault($death_loc_map, player.getUuid(player), world.getServerSpawn());
- }
|