12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214 |
- 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, read.slot("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, string.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());
- }
|