123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632 |
- //Hier werden alle Events abgefangen und beeinflusst, je nachdem ob ein Skill aktiv ist oder nicht
- event.load("custom_command");
- event.load("function_key");
- event.load("living_hurt");
- event.load("living_pre_hurt");
- event.load("player_move");
- event.load("player_data_tick");
- event.load("item_hit");
- event.load("projectile_hit");
- classes = getScriptVar("gpvp_classes");
- map.new(arrow_to_skill);
- map.new(nail_traps);
- map.new(pre_nail_traps);
- map.new(net_traps);
- map.new(vine_traps);
- map.new(vines_map);
- map.new(cobweb_map);
- map.new(concon_map);
- map.new(platform_map);
- list.new(stürmen_list);
- list.new(klingenwirbel_list);
- map.new(klingenwirbel_map);
- list.new(schmerzertragen_list);
- list.new(rammbock_list);
- list.new(blutrausch_list);
- list.new(wiederherstellung_list);
- list.new(belagerungsleiter_down_facing_list);
- list.new(belagerungsleiter_up_facing_list);
- list.new(belagerungsleiter_up_loc_list);
- list.new(belagerungsleiter_down_loc_list);
- list.new(belagerungsleiter_remove_list);
- map.new(belagerungsleiter_counter_up_map);
- map.new(belagerungsleiter_counter_down_map);
- map.new(belagerungsleiter_remove_map);
- set.new(skill_immunity);
- set.new(schnellfeuer_set);
- air_item_type = "minecraft:air";
- air_item = read.item(air_item_type);
- cobweb_type = "minecraft:cobweb";
- vine_type_all = "minecraft:vine[north=true,east=true,south=true,west=true]";
- glass_type = "minecraft:glass";
- oak_leaves_type = "minecraft:oak_leaves";
- sound_entity_ghast_warn = sound.get("entity.ghast.warn");
- sound_category_player = sound.getCategory("player");
- door_prop = block.getproperty("open");
- spawn_plot_id = 63;
- gpvpworld = world.get("gpvp_spawn");
- initSkills();
- msg("dev", "§bSkillSystem §rwurde geladen");
- @wait
- wait();
- if(player != null) {
- if(loc.getWorld(entity.getLocation(player)) == gpvpworld) {
- igoto(event);
- }
- }
- goto("wait");
- @player_move
- player_id = player.getId(player);
- //Trittnägel Pre wurde ausgelöst
- if(map.contains(pre_nail_traps, id)) {
- trap_player_name = map.get(pre_nail_traps, id);
- trap_player_id = player.getId(player.getUuid(trap_player_name));
- trap_gilden_id = guild.getIdFromDatabase(trap_player_id);
- own_gilden_id = guild.getId(player);
- if(trap_gilden_id == own_gilden_id) {
- cancel = true;
- goto("wait");
- }
- trap_player = read.player(trap_player_name);
- map.remove(pre_nail_traps, id);
- event.removeMoveData(id);
- trap_loc = data.get(trap_player, concat("Trittnägel_Loc_", id));
- move_id = event.addMoveData(loc.mod(trap_loc, -2, 0, -2), loc.mod(trap_loc, 3, 1, 3), 20, 100);
- data.setTimer(trap_player, concat("Trittnägel_Post_", move_id), 100);
- map.add(nail_traps, move_id, trap_player_name);
- goto("wait");
- }
- //Trittnägel
- if(map.contains(nail_traps, id)) {
- trap_player_name = map.get(nail_traps, id);
- trap_player_id = player.getId(player.getUuid(trap_player_name));
- trap_gilden_id = guild.getIdFromDatabase(trap_player_id);
- own_gilden_id = guild.getId(player);
- if(trap_gilden_id == own_gilden_id) {
- cancel = true;
- goto("wait");
- }
- entity.addEffect(player, "slowness", 40, 5);
- trap_player = read.player(trap_player_name);
- if(trap_player == null) {
- entityDamage(player, player, 3, false);
- } else {
- entityDamage(player, trap_player, 3, false);
- }
- goto("wait");
- }
- //Netzfalle
- if(map.contains(net_traps, id)) {
- trap_gilden_id = map.get(net_traps, id);
- own_gilden_id = guild.getId(player);
- if(trap_gilden_id == own_gilden_id) {
- cancel = true;
- goto("wait");
- }
- event.removeMoveData(id);
- map.remove(net_traps, id);
- player_loc = entity.getLocation(player);
- data.setTimer(player, concat("Netzfalle2_", id), 100);
- temp_list = list.new();
- for(y = 0; y <= 2; y++) {
- for(z = -3; z <= 3; z++) {
- for(x = -3; x <= 3; x++) {
- temp_loc = loc.mod(player_loc, x, y, z);
- if(block.getType(temp_loc) == air_item_type) {
- block.set(temp_loc, cobweb_type);
- list.add(temp_list, temp_loc);
- }
- }
- }
- }
- map.add(cobweb_map, id, temp_list);
- goto("wait");
- }
- //Dornenranken
- if(map.contains(vine_traps, id)) {
- trap_gilden_id = map.get(vine_traps, id);
- own_gilden_id = guild.getId(player);
- if(trap_gilden_id == own_gilden_id) {
- cancel = true;
- goto("wait");
- }
- entity.addEffect(player , "poison", 100, 2);
- entity.addEffect(player , "hunger", 100, 2);
- goto("wait");
- }
- goto("wait");
- @projectile_hit
- if(text.class(projectile) != "ArrowEntity") {
- goto("wait");
- }
- if(!isPlayer(shooter)) {
- goto("wait");
- }
- player = shooter;
- if(loc_hit == null) {
- loc = entity.getLocation(entity_hit);
- } else {
- loc = loc_hit;
- }
- skill_name = map.get(arrow_to_skill, projectile);
- map.remove(arrow_to_skill, projectile);
- if(entity_hit != null) {
- if(isPlayer(entity_hit)) {
- if(guild.isSame(entity_hit, player)) {
- goto("wait");
- }
- if(data.getTimer(entity_hit, "Blätterkokon") > 0) {
- entity.setBurning(entity_hit, 0);
- goto("wait");
- }
- }
- if(skill_name != null) {
- //Giftsalve
- if(skill_name == "Giftsalve") {
- entity.addEffect(entity_hit, "poison", 40, 1);
- }
- if(isPlayer(entity_hit)) {
- //Schnellfeuer
- if(skill_name == "Schnellfeuer") {
- set.add(schnellfeuer_set, player.getUuid(entity_hit));
- }
- }
- }
- //Blendpfeil
- if(data.getTimer(player, "Blendpfeil") > 0) {
- entity.addEffect(entity_hit, "blindness", 100, 1);
- data.setTimer(player, "Blendpfeil", -1);
- }
- //Brandpfeil
- if(data.getTimer(player, "Brandpfeil") > 0) {
- entity.setBurning(entity_hit, 5);
- data.setTimer(player, "Brandpfeil", -1);
- status.remove(player, 29);
- }
- //Stachelpfeil
- if(data.getTimer(player, "Stachelpfeil") > 0) {
- entity.addEffect(entity_hit , "slowness", 60, 1);
- data.setTimer(player, "Stachelpfeil", -1);
- status.remove(player, 23);
- }
- //Trägheitspfeil
- if(data.getTimer(player, "Trägheitspfeil") > 0) {
- entity.addEffect(entity_hit, "slowness", 100, 7);
- entity.addEffect(entity_hit, "jump_boost", 100, 128);
- data.setTimer(player, "Trägheitspfeil", -1);
- }
- //ArkanerSchuss
- if(data.getTimer(player, "ArkanerSchuss") > 0) {
- entity.teleport(entity_hit, entity.getLocation(player));
- data.setTimer(player, "ArkanerSchuss", -1);
- }
- }
- //Widerhaken
- if(data.getTimer(player, "Widerhaken") > 0) {
- //TP zum Aufprallort
- bx = loc.getCoord(loc, "bx") + 0.5;
- by = loc.getCoord(loc, "by") + 1;
- bz = loc.getCoord(loc, "bz") + 0.5;
- middle_loc = loc.new(gpvpworld, bx, by, bz);
- entity.teleport(player, middle_loc);
- //Plattform
- temp_list = list.new();
- temp_loc = loc.mod(loc, 0, 0, 0);
- if(setBlockIfNotAir(temp_loc, glass_type)) {
- list.add(temp_list, temp_loc);
- }
- temp_loc = loc.mod(loc, 1, 0, 0);
- if(setBlockIfNotAir(temp_loc, glass_type)) {
- list.add(temp_list, temp_loc);
- }
- temp_loc = loc.mod(loc, 1, 0, 1);
- if(setBlockIfNotAir(temp_loc, glass_type)) {
- list.add(temp_list, temp_loc);
- }
- temp_loc = loc.mod(loc, 0, 0, 1);
- if(setBlockIfNotAir(temp_loc, glass_type)) {
- list.add(temp_list, temp_loc);
- }
- temp_loc = loc.mod(loc, -1, 0, 1);
- if(setBlockIfNotAir(temp_loc, glass_type)) {
- list.add(temp_list, temp_loc);
- }
- temp_loc = loc.mod(loc, -1, 0, 0);
- if(setBlockIfNotAir(temp_loc, glass_type)) {
- list.add(temp_list, temp_loc);
- }
- temp_loc = loc.mod(loc, -1, 0, -1);
- if(setBlockIfNotAir(temp_loc, glass_type)) {
- list.add(temp_list, temp_loc);
- }
- temp_loc = loc.mod(loc, 0, 0, -1);
- if(setBlockIfNotAir(temp_loc, glass_type)) {
- list.add(temp_list, temp_loc);
- }
- temp_loc = loc.mod(loc, 1, 0, -1);
- if(setBlockIfNotAir(temp_loc, glass_type)) {
- list.add(temp_list, temp_loc);
- }
- player_id = player.getId(player);
- map.add(platform_map, player_id, temp_list);
- data.setTimer(player, "Widerhaken", -1);
- data.setTimer(player, "Widerhaken_Remove", 200);
- status.remove(player, 35);
- }
- goto("wait");
- @item_hit
- if(!isPlayer(shooter)) {
- goto("wait");
- }
- player = shooter;
- //Rauchbombe
- if(entity.getType(projectile) == "FireballEntity") {
- if(loc_hit == null) {
- loc = entity.getLocation(entity_hit);
- } else {
- loc = loc_hit;
- }
- //AOE Radius 3
- list = players.near(loc, 3);
- for(i = 0; i < list.getSize(list); i++) {
- p = list.getIndex(list, i);
- if(!guild.isSame(player, p)) {
- entityDamage(p, player, 2, true);
- entity.addEffect(p, "blindness", 80, 1);
- }
- }
- }
- goto("wait");
- @player_data_tick
- player_id = player.getId(player);
- if(text.startsWith(var, "Netzfalle1_", 0)) {
- //Ausgelegte Netzfalle entfernen, weil sie niemand ausgelöst hat
- move_id = read.number(text.replace(var, "Netzfalle1_", ""));
- event.removeMoveData(move_id);
- map.remove(net_traps, move_id);
- goto("wait");
- }
- if(text.startsWith(var, "Netzfalle2_", 0)) {
- //Ausgelöste Netzfalle entfernen
- move_id = read.number(text.replace(var, "Netzfalle2_", ""));
- temp_list = map.get(cobweb_map, move_id);
- for(i = 0; i < list.getSize(temp_list); i++) {
- temp_loc = list.getIndex(temp_list, i);
- block.set(temp_loc, air_item_type);
- }
- map.remove(cobweb_map, move_id);
- goto("wait");
- }
- if(text.startsWith(var, "Dornenranken_", 0)) {
- move_id = read.number(text.replace(var, "Dornenranken_", ""));
- event.removeMoveData(move_id);
- map.remove(vine_traps, move_id);
- //Dornenranken entfernen
- temp_list = map.get(vines_map, player_id);
- for(i = 0; i < list.getSize(temp_list); i++) {
- temp_loc = list.getIndex(temp_list, i);
- block.set(temp_loc, air_item_type);
- }
- map.remove(vines_map, player_id);
- goto("wait");
- }
- if(text.startsWith(var, "Trittnägel_Pre_", 0)) {
- //Trittnägel entfernen, weil niemand hineingelaufen ist
- move_id = read.number(text.replace(var, "Trittnägel_Pre_", ""));
- event.removeMoveData(move_id);
- map.remove(pre_nail_traps, move_id);
- goto("wait");
- }
- if(text.startsWith(var, "Trittnägel_Post_", 0)) {
- //Trittnägel entfernen, weil Falle ausgelaufen ist
- move_id = read.number(text.replace(var, "Trittnägel_Post_", ""));
- map.remove(nail_traps, move_id);
- goto("wait");
- }
- if(text.startsWith(var, "Trollsalbe", 0)) {
- new_hp = entity.getHealth(player) + 1.2;
- entity.setHealth(player, new_hp);
- displayHealth(player);
- goto("wait");
- }
- if(text.startsWith(var, "Giftsalve", 0)) {
- arrow = entity.shootProjectile(player, "net.minecraft.entity.projectile.ArrowEntity", 1, null);
- entity.setNoPickup(arrow);
- map.add(arrow_to_skill, arrow, "Giftsalve");
- goto("wait");
- }
- if(text.startsWith(var, "Schnellfeuer", 0)) {
- arrow = entity.shootProjectile(player, "net.minecraft.entity.projectile.ArrowEntity", 1, null);
- entity.setNoPickup(arrow);
- map.add(arrow_to_skill, arrow, "Schnellfeuer");
- goto("wait");
- }
- if(var == "Widerhaken_Remove") {
- //Plattform entfernen
- temp_list = map.get(platform_map, player_id);
- for(i = 0; i < list.getSize(temp_list); i++) {
- temp_loc = list.getIndex(temp_list, i);
- block.set(temp_loc, air_item_type);
- }
- map.remove(platform_map, player_id);
- goto("wait");
- }
- if(var == "Blätterkokon") {
- //Blätterkokon entfernen
- temp_list = map.get(concon_map, player_id);
- for(i = 0; i < list.getSize(temp_list); i++) {
- temp_loc = list.getIndex(temp_list, i);
- block.set(temp_loc, air_item_type);
- }
- map.remove(concon_map, player_id);
- goto("wait");
- }
- if(var == "Todgeweiht") {
- schaden = data.get(player, "Todgeweiht-Count");
- ent = data.get(player, "Todgeweiht-Ziel");
- try {
- if(isPlayer(ent)) {
- entityDamage(ent, player, schaden, true);
- } else {
- entity.damage(ent, schaden);
- }
- } catch {
- nothing();
- }
- goto("wait");
- }
- if(var == "Rückruf") {
- data.set(player, var, null);
- goto("wait");
- }
- if(var == "Schmerzertragen") {
- list.remove(schmerzertragen_list, player);
- goto("wait");
- }
- if(var == "Blutrausch") {
- list.remove(blutrausch_list, player);
- goto("wait");
- }
- if(var == "Unbeugsam") {
- set.remove(skill_immunity, player.getUuid(player));
- goto("wait");
- }
- if(var == "Wiederherstellung") {
- list.remove(wiederherstellung_list, player);
- goto("wait");
- }
- goto("wait");
- @living_pre_hurt
- sec_player = player.getFromDamageSource(damage_source);
- if(isPlayer(living_entity)) {
- player = living_entity;
- //Blätterkokon
- if(data.getTimer(player, "Blätterkokon") > 0) {
- cancel = true;
- }
- if(isPlayer(sec_player)) {
- if(guild.isSame(player, sec_player)) {
- cancel = true;
- goto("wait");
- }
- //Entwaffnen
- if(data.getTimer(sec_player, "Entwaffnen") > 0) {
- cancel = true;
- goto("wait");
- }
- }
- if(damage.isProjectile(damage_source)) {
- //Drachenhaut
- if(data.getTimer(player, "Drachenhaut") > 0) {
- cancel = true;
- }
- //Schnellfeuer
- player_uuid = player.getUuid(player);
- if(set.contains(schnellfeuer_set, player_uuid)) {
- set.remove(schnellfeuer_set, player_uuid);
- new_hp = entity.getHealth(sec_player) + damage_amount * 1.2;
- entity.setHealth(sec_player, new_hp);
- displayHealth(sec_player);
- }
- }
- }
- goto("wait");
- @living_hurt
- player = null;
- sec_player = player.getFromDamageSource(damage_source);
- if(isPlayer(living_entity)) {
- player = living_entity;
- damage_type = damage.getType(damage_source);
- if(damage_type == "fall") {
- //Assassinensiegel
- if(data.getTimer(player, "Assassinensiegel") > 0) {
- cancel = true;
- }
- }
- if(!damage.isMagic(damage_source)) {
- //EisernerWille
- if(data.getTimer(player, "Eiserner Wille") > 0) {
- damage_amount *= 0.8;
- }
- //Schildwall
- if(data.getTimer(player, "Schildwall") > 0) {
- damage_amount *= 0.8;
- }
- }
- }
- if(isPlayer(sec_player)) {
- if(isPlayer(living_entity)) {
- player = living_entity;
- if(guild.isSame(player, sec_player)) {
- cancel = true;
- return;
- }
- //Giftklinge
- if(data.getTimer(sec_player, "Giftklinge") > 0) {
- entity.addEffect(player, "poison", 80, 1);
- }
- if(!damage.isMagic(damage_source)) {
- if(data.getTimer(sec_player, "Todgeweiht") > 0) {
- if(data.get(sec_player, "Todgeweiht-Ziel") == living_entity) {
- schaden = data.get(sec_player, "Todgeweiht-Count");
- data.set(sec_player, "Todgeweiht-Count", schaden + damage_amount);
- }
- }
- //Dornenpanzer
- if(data.getTimer(player, "Dornenpanzer") > 0) {
- entityDamage(sec_player, player, damage_amount * 0.3, true);
- damage_amount *= 0.7;
- }
- //Wuchtschlag
- if(data.getTimer(sec_player, "Wuchtschlag") > 0) {
- damage_amount *= 2;
- entity.addEffect(player, "slowness", 40, 2);
- status.remove(sec_player, 23);
- data.setTimer(sec_player, "Wuchtschlag", -1);
- }
- }
- //InnereWut
- if(data.getTimer(sec_player, "Innere Wut") > 0) {
- damage_amount *= 1.3;
- }
- //Schattenhieb
- if(data.getTimer(sec_player, "Schattenhieb") > 0) {
- entity.addEffect(sec_player, "invisibility", 40, 1);
- entity.addEffect(sec_player, "speed", 40, 2);
- status.remove(sec_player, 23);
- data.setTimer(sec_player, "Schattenhieb", -1);
- }
- //Schwerthieb
- if(data.getTimer(sec_player, "Schwerthieb") > 0) {
- damage_amount *= 1.5;
- status.remove(sec_player, 21);
- data.setTimer(sec_player, "Schwerthieb", -1);
- }
- //harmonischerHieb
- if(data.getTimer(sec_player, "harmonischerHieb") > 0) {
- damage_amount *= 2.5;
- status.remove(sec_player, 21);
- data.setTimer(sec_player, "harmonischerHieb", -1);
- }
- //Axthieb
- if(data.getTimer(sec_player, "Axthieb") > 0) {
- damage_amount *= 1.5;
- status.remove(sec_player, 21);
- data.setTimer(sec_player, "Axthieb", -1);
- }
- //Dolchangriff
- if(data.getTimer(sec_player, "Dolchangriff") > 0) {
- damage_amount *= 1.5;
- status.remove(sec_player, 21);
- data.setTimer(sec_player, "Dolchangriff", -1);
- }
- //WütenderSchlag
- if(data.getTimer(sec_player, "Wütender Schlag") > 0) {
- damage_amount += 1 - entity.getHealth(sec_player) / 20;
- status.remove(sec_player, 30);
- data.setTimer(sec_player, "Wütender Schlag", -1);
- }
- //Entwaffnen
- if(data.getTimer(sec_player, "Entwaffnen") > 0) {
- cancel = true;
- }
- }
- }
- goto("wait");
- @function_key
- class = guild.getClass(player);
- if(class == "") {
- player.speak(player, "§cFehler", "§rDu besitzt keine Klasse");
- goto("wait");
- }
- plot_id = plot.getIdFromLocation(entity.getLocation(player));
- if(plot_id == spawn_plot_id) {
- player.action(player, "§rAm Spawn nicht einsetzbar");
- goto("wait");
- }
- //Schwertknaufschlag
- if(data.getTimer(player, "Schwertknaufschlag") > 0) {
- goto("wait");
- }
- //Kehlschnitt
- if(data.getTimer(player, "Kehlschnitt") > 0) {
- goto("wait");
- }
- tempskill = hotkey.get(player, class, --key);
- if(tempskill != null) {
- temp = executeSkill(player, tempskill);
- if(temp == true) {
- skill.speak(player, player_name, tempskill);
- skill.setLastExeTime(player, tempskill);
- } elseif(temp == 2) {
- player.action(player, "§rDieser Skill existiert nicht");
- } elseif(temp == 3) {
- player.action(player, "§rFalsche Klasse für diesen Skill");
- } elseif(temp == 4) {
- player.action(player, "§rKein Gegner im Visier");
- } elseif(temp == 5) {
- player.action(player, "§rDein Skill-Level ist zu niedrig");
- } elseif(temp == 8) {
- player.action(player, "§rBelagerungsskill nur während Gildenkämpfen");
- }
- }
- goto("wait");
- @custom_command
- if(command == "skill") {
- size = list.getSize(args);
- if(size == 0) {
- player.speak(player, "§6Commands", "/skill <skillname>");
- goto("wait");
- }
- skillname = text.concatList(args, " ", 0, size - 1);
- class = guild.getClass(player);
- if(class == "") {
- player.speak(player, "§cFehler", "§rDu besitzt keine Klasse");
- goto("wait");
- }
- plot_id = plot.getIdFromLocation(entity.getLocation(player));
- if(plot_id == spawn_plot_id) {
- player.action(player, "§rAm Spawn nicht einsetzbar");
- goto("wait");
- }
- //Schwertknaufschlag
- if(data.getTimer(player, "Schwertknaufschlag") > 0) {
- goto("wait");
- }
- //Kehlschnitt
- if(data.getTimer(player, "Kehlschnitt") > 0) {
- goto("wait");
- }
- if(skillname != null) {
- temp = executeSkill(player, skillname);
- if(temp == true) {
- skill.speak(player, player_name, skillname);
- skill.setLastExeTime(player, skillname);
- } elseif(temp == 2) {
- player.action(player, "§rDieser Skill existiert nicht");
- } elseif(temp == 3) {
- player.action(player, "§rFalsche Klasse für diesen Skill");
- } elseif(temp == 4) {
- player.action(player, "§rKein Gegner im Visier");
- } elseif(temp == 5) {
- player.action(player, "§rDein Skill-Level ist zu niedrig");
- } elseif(temp == 8) {
- player.action(player, "§rBelagerungsskill nur während Gildenkämpfen");
- }
- }
- }
- goto("wait");
|