123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532 |
- %addList teamcolors;
- %addListElement teamcolors §4;
- %addListElement teamcolors §c;
- %addListElement teamcolors §6;
- %addListElement teamcolors §e;
- %addListElement teamcolors §2;
- %addListElement teamcolors §a;
- %addListElement teamcolors §b;
- %addListElement teamcolors §3;
- %addListElement teamcolors §1;
- %addListElement teamcolors §9;
- %addListElement teamcolors §d;
- %addListElement teamcolors §5;
- %addListElement teamcolors §f;
- %addListElement teamcolors §7;
- %addListElement teamcolors §8;
- %addListElement teamcolors §0;
- %addList teamcolortext;
- %addListElement teamcolortext §4dunkelrote;
- %addListElement teamcolortext §crote;
- %addListElement teamcolortext §6orange;
- %addListElement teamcolortext §egelbe;
- %addListElement teamcolortext §2dunkelgrüne;
- %addListElement teamcolortext §agrüne;
- %addListElement teamcolortext §btürkise;
- %addListElement teamcolortext §3dunkeltürkise;
- %addListElement teamcolortext §1dunkelblaue;
- %addListElement teamcolortext §9blaue;
- %addListElement teamcolortext §dpinke;
- %addListElement teamcolortext §5violette;
- %addListElement teamcolortext §fweiße;
- %addListElement teamcolortext §7graue;
- %addListElement teamcolortext §8dunkelgraue;
- %addListElement teamcolortext §0schwarze;
- %addList teamcolortext2;
- %addListElement teamcolortext2 §4Dunkelrot;
- %addListElement teamcolortext2 §cRot;
- %addListElement teamcolortext2 §6Orange;
- %addListElement teamcolortext2 §eGelb;
- %addListElement teamcolortext2 §2Dunkelgrün;
- %addListElement teamcolortext2 §aGrün;
- %addListElement teamcolortext2 §bTürkis;
- %addListElement teamcolortext2 §3Dunkeltürkis;
- %addListElement teamcolortext2 §1Dunkelblau;
- %addListElement teamcolortext2 §9Blau;
- %addListElement teamcolortext2 §dPink;
- %addListElement teamcolortext2 §5Violett;
- %addListElement teamcolortext2 §fWeiß;
- %addListElement teamcolortext2 §7Grau;
- %addListElement teamcolortext2 §8Dunkelgrau;
- %addListElement teamcolortext2 §0Schwarz;
- %addList teamnames;
- %addListElement teamnames darkredteam;
- %addListElement teamnames redteam;
- %addListElement teamnames orangeteam;
- %addListElement teamnames yellowteam;
- %addListElement teamnames darkgreenteam;
- %addListElement teamnames greenteam;
- %addListElement teamnames aquateam;
- %addListElement teamnames darkaquateam;
- %addListElement teamnames darkblueteam;
- %addListElement teamnames blueteam;
- %addListElement teamnames purpleteam;
- %addListElement teamnames darkpurpleteam;
- %addListElement teamnames whiteteam;
- %addListElement teamnames greyteam;
- %addListElement teamnames darkgreyteam;
- %addListElement teamnames blackteam;
- %loadEvent player-hurt;
- %loadEvent block-break;
- %loadEvent block-place;
- %loadEvent block-click;
- %loadEvent air-click;
- %loadEvent inv-click;
- %loadEvent player-leave;
- %addList spectators;
- %addList allteams;
- %setVar i 0;
- @createteams
- %addList %getListElementAt teamnames $i;;
- %addListElement allteams %getListElementAt teamnames $i;;
- %setVar %concat %getListElementAt teamnames $i; kills; 0;
- %if %inc i; < $teams then goto createteams;
- %addList waiters;
- %addList all;
- %addMap players;
- %setVars %getQuestLeader;;
- @lobby
- %if %getListSize all; >= $gamesize goto fullhouse;
- %setVar p $player-name;
- %speak $p §eSkyWars §eDu befindest dich nun in der §bSkyWars §eLobby.;
- %speak all §eSkyWars §8$p §3hat das Spiel betreten.;
- %addGlobalMapElement swstartkit %getPlayerUUID $p; true;
- %setHealth $p 20;
- %setHunger $p 20;
- %setSaturation $p 5;
- %command clear $p;
- %command title $p times 20 60 0;
- %command title $p subtitle {"text":"%getVar mapname;"};
- %command title $p title {"text":"SkyWars","color":"yellow"};
- %sbreset $p;
- %sbadd $p 5 §r;
- %sbadd $p 4 §eSkyWars;
- %sbadd $p 3 $mapname;
- %sbadd $p 2 $7$playersperteam;
- %sbadd $p 1 §6Coins: §r%ggV $p swcoins;;
- %teleportPlayer $p $lobbyloc;
- %addListElement all $p;
- %addListElement waiters $p;
- %addMapElement players $p waiters;
- %if %getListSize all; >= $playersneeded && $started != true then goto startgame;
- %if $started == true then goto checklobby;
- @waiting
- %setVar started false;
- %setVar waitfor %sub $playersneeded %getListSize all;;;
- %speak all §eSkyWars §3Es wird auf §e$waitfor §3Spieler gewartet.;
- @checklobby
- %wait;
- %if $event == player-join then goto lobby;
- %if $event == player-hurt || $event == block-break || $event == block-place then goto cancel;
- %if $event == air-click || $event == block-click && $player-item-type == CHEST then goto showkits;
- %if $event == block-click then goto blockclickevent;
- %if $event == player-leave then goto leavelobby;
- %if $event == inv-click && $inv-name == §8Kits && $inv-slot == 0 then goto cancel;
- %if $event == inv-click && $inv-name == §8Kits && $inv-type == CHEST then goto maybuykit;
- %if $inv-slot == 1 || $inv-slot == 8 && $event == inv-click then closeMenu $player-name;
- %if $event == inv-click && $inv-slot == 0 then goto buykit;
- %if $event == inv-click then goto cancel;
- %goto checklobby;
- @cancel
- %setVar cancel true;
- %goto checklobby;
- @blockclickevent
- %if %checkForListElement teamblocks $block-loc; == true then goto jointeam;
- %goto checklobby;
- @buykit
- %setVar mapname %getVar %concat $player-name buykit;;;
- %getGlobalMap $mapname $mapname;
- %setVar cancel true;
- %if %checkForMapKey $mapname $player-name; == true then goto checklobby;
- %setVar price %getMapValueAt kits %getIndexOfListElement kitnames %getVar %concat $player-name buykit;;;;;
- %if %ggV $player-name swcoins; < $price then goto checklobby;
- %addGlobalMapElement $mapname %getPlayerUUID $player-name; true;
- %sgV $player-name swcoins %sub %ggV $player-name swcoins; $price;;
- %speak $player-name §eSkyWars §3Du hast dir das Kit %getVar %concat $player-name buykit;; §3gekauft.;
- %goto showkits;
- @showkits
- %setVar i 1;
- @getmaplabel
- %setVar mapname %getListElementAt kitnames $i;;
- %getGlobalMap $mapname $mapname;
- %if %checkForMapKey $mapname $player-name; == true then setMenuItem 0 $i %getListElementAt boughtkits %sub $i 1;;;;
- %if %inc i; < %getListSize kitnames; then goto getmaplabel;
- %openmenu 0 $player-name;
- %goto checklobby;
- @maybuykit
- %setVar cancel true;
- %setVar mapname $item-name;
- %getGlobalMap $mapname $mapname;
- %if %checkForMapKey $mapname $player-name; == true then goto choosekit;
- %setVar %concat $player-name buykit; $item-name;
- %loadmenu 1 1 '$item-name §fKaufen? §6Preis: §f%getMapValueAt kits %getIndexOfListElement kitnames $item-name ';;;
- %setMenuItem 1 0 {id:"minecraft:wool",Count:1b,tag:{display:{Name:"§aJa"}},Damage:13s};
- %setMenuItem 1 1 {id:"minecraft:wool",Count:1b,tag:{display:{Name:"§cNein"}},Damage:14s};
- %setMenuItem 1 8 {id:"minecraft:wooden_door",Count:1b,tag:{display:{Name:"§fAbbrechen"}},Damage:0s};
- %openMenu 1 $player-name;
- %goto checklobby;
- @choosekit
- %speak $player-name §eSkyWars §3Du hast das Kit $item-name $eausgewählt.;
- %sgV $p lastkit $item-name;
- %goto checklobby;
- @leavelobby
- %setVar p $player-name;
- %speak all §eSkyWars §8$p §3hat das Spiel verlassen.;
- %removeListElement all $p;
- %removeListElement waiters $p;
- %removeListElement %getMapValue players $p; $p;
- %removeMapElement players $p;
- %setHealth $p 20;
- %setHunger $p 20;
- %setSaturation $p 5;
- %command clear $p;
- %sbreset $p;
- %teleportPlayer $p $gamesworldloc;
- %kick $p;
- %if %getListSize all; < $playersneeded then goto waiting;
- %goto checklobby;
- @jointeam
- %setVar p $player-name;
- %if %checkForListElement %getMapValue players $p; $p; == true then goto alreadyteam;
- %if %getListSize %getMapValue players $p;; >= $teamsize then goto fullteam;
- %setVar index %getIndexOfListElement teamblocks $block-loc;;
- %removeListElement %getMapValue players $p; $p;
- %setVar newteam %getListElementAt teamnames $index;;
- %addListElement $newteam $p;
- %addMapElement players $newteam;
- %speak $p §eSkyWars §3Du bist nun im %getListElementAt teamcolortext $index;n Team.;
- %goto checklobby;
- @alreadyteam
- %speak $p §eSkyWars §3Du bist bereits in diesem Team.;
- %goto checklobby;
- @fullteam
- %speak $p §eSkyWars §3Dieses Team ist voll.;
- %goto checklobby;
- @fullhouse
- %speak $player-name §eSkyWars §3Diese Map ist bereits voll.;
- %kick $player-name;
- %goto checklobby;
- @startgame
- %if %getListSize all; < $playersneeded then goto waiting;
- %setVar started true;
- %speak all §eSkyWars §3Das Spiel startet in §e20 §3Sekunden.;
- %sgoto 100 start15;
- %goto playstartsound;
- @start15
- %if %getListSize all; < $playersneeded then goto waiting;
- %speak all §eSkyWars §3Das Spiel startet in §e15 §3Sekunden.;
- %sgoto 100 start10;
- %goto playstartsound;
- @start10
- %if %getListSize all; < $playersneeded then goto waiting;
- %speak all §eSkyWars §3Das Spiel startet in §e10 §3Sekunden.;
- %sgoto 100 start5;
- %goto playstartsound;
- @start5
- %if %getListSize all; < $playersneeded then goto waiting;
- %speak all §eSkyWars §3Das Spiel startet in §e5 §3Sekunden.;
- %sgoto 20 start4;
- %goto playstartsound;
- @start4
- %if %getListSize all; < $playersneeded then goto waiting;
- %speak all §eSkyWars §3Das Spiel startet in §e4 §3Sekunden.;
- %sgoto 20 start3;
- %goto playstartsound;
- @start3
- %if %getListSize all; < $playersneeded then goto waiting;
- %speak all §eSkyWars §3Das Spiel startet in §e3 §3Sekunden.;
- %sgoto 20 start2;
- %goto playstartsound;
- @start2
- %if %getListSize all; < $playersneeded then goto waiting;
- %speak all §eSkyWars §3Das Spiel startet in §e2 §3Sekunden.;
- %sgoto 20 start1;
- %goto playstartsound;
- @start1
- %if %getListSize all; < $playersneeded then goto waiting;
- %speak all §eSkyWars §3Das Spiel startet in §e1 §3Sekunde.;
- %sgoto 20 start0;
- %goto playstartsound;
- @playstartsound
- %setVar i 0;
- @playstartsoundlabel
- %setVar p %getListElementAt all $i;;
- %playSoundPlayer $p %getPlayerLoc $p; BLOCK_NOTE_BASS;
- %if %inc i; < %getListSize all; then goto playstartsoundlabel;
- %goto checklobby;
- @start0
- %if %getListSize all; < $playersneeded then goto waiting;
- %speak all §eSkyWars §3Das Spiel beginnt.;
- %setVar no-join true;
- %setVar phase 1;
- %setVar i 0;
- @playstartsoundlabel2
- %setVar p %getListElementAt all $i;;
- %setVar index %getIndexOfListElement teamnames %getMapValue players $p;;;
- %teleportPlayer $p %getListElementAt spawnlocs $index;;
- %playSound %getListElementAt spawnlocs $index; BLOCK_NOTE_HARP;
- %if %gGV $p swcoins; == null then sGV $p swcoins 0;
- %if %gGV $p lastkit; == null then sGV $p lastkit §cStarterkit;
- %setVar %concat $p kills; 0;
- %if %gGV $p swplayedgames; == null then sGV $p swplayedgames 0;
- %if %gGV $p swwongames; == null then sGV $p swwongames 0;
- %if %gGV $p swkills; != null then sGV $p swkills 0;
- %sGV $p swplayedgames %add %gGV $p swplayedgames; 1;;
- %playSoundPlayer $p %getPlayerLoc $p; BLOCK_NOTE_HARP;
- %if %hasFly $p; == true then command fly $p off;
- %if %getPlayerGameMode $p; == CREATIVE then command gamemode survival $p;
- %if %inc i; < %getListSize all; then goto playstartsoundlabel2;
- %sbreset all;
- %sbadd all 6 §r;
- %sbadd all 5 §eSkyWars;
- %sbadd all 4 §7Teams verbleibend: §r%getListSize allteams;;
- %sbadd all 3 §7Spieler verbleibend: §r%getListSize all;;
- %sbadd all 2 §7Deine Kills: §r0;
- %sbadd all 1 §7Team Kills: §r0;
- %unloadEvent air-click;
- %unloadEvent inv-click;
- %unloadEvent player-hurt;
- %loadEvent player-death;
- %loadEvent player-respawn;
- %setVar i 0;
- @removezeroteams
- %setVar teamsize %getListSize %getListElementAt teamnames $i;;;
- %if $teamsize == 0 then removeListElement allteams %getListElementAt teamnames $i;;
- %if %inc i; < $teams then goto removezeroteams;
- %setVar i 0;
- @resetchests
- %setVar chest %getListElementAt chestlocs $i;;
- %setBlock $chest %concat CHEST: %blockData $chest;;;
- %if %inc i; < %getListSize chestlocs; then goto resetchests;
- #kisten befüllen
- %setVar i 0;
- @equipplayer
- %setVar p %getListElementAt all $i;;
- %setVar itemlistname %concat %getListElementAt kits %getIndexOfListElement kitnames %ggV $p lastkit;;; items;;
- %setVar equiplistname %concat %getListElementAt kits %getIndexOfListElement kitnames %ggV $p lastkit;;; equip;;
- %if %getListSize $itemlistname; == 0 then goto overridegiveitems;
- %setVar itemindex 0;
- @giveplayeritems
- %giveItemPlayer $p %getListElementAt itemlistname $itemindex;;
- %if %inc itemindex; < %getListSize itemlistname; then goto giveplayeritems;
- @overridegiveitems
- %if %getListSize $equiplistname; == 0 then goto overridegiveequip;
- %equipEntity %getPlayerID $p; head %getListElementAt equiplistname $equipindex;;
- %equipEntity %getPlayerID $p; chest %getListElementAt equiplistname $equipindex;;
- %equipEntity %getPlayerID $p; legs %getListElementAt equiplistname $equipindex;;
- %equipEntity %getPlayerID $p; feet %getListElementAt equiplistname $equipindex;;
- @overridegiveequip
- %if %inc i; < %getListSize all; then goto equipplayer;
- @startloop
- %sgoto 100 loop;
- @checkgame
- %wait;
- %if $event == player-death && $player-killed == true then goto death;
- %if $event == player-respawn then goto respawn;
- %if $event == block-break || $event == block-place goto blockaction;
- %if $event == player-leave then goto leavegame;
- %if $event == block-click && %checkForListElement spectators $player-name; == true then setVar cancel true;
- %goto checkgame;
- @loop
- %if %getListSize spectators; == 0 then goto startloop;
- %setVar i 0;
- @spectatorslabel
- %setVar p %getListElementAt spectators $i;;
- %if %distance %getPlayerLoc $p; $middleloc; > $radius then teleportPlayer $p $middleloc;
- %if %inc i; < %getListSize spectators; then goto spectatorslabel;
- %goto startloop;
- @blockaction
- %setVar cancel true;
- %if $event == block-place && $block-type-before == STATIONARY_WATER then goto checkgame;
- %if $event == block-place && $block-type-before == LONG_GRASS then goto checkgame;
- %if $event == block-break && %checkForListElement placedblocks $block-loc; == false then goto checkgame;
- %setVar cancel false;
- %addListElement placedblocks $block-loc;
- %goto checkgame;
- @respawn
- %command gamemode 3 $player-name;
- %teleportPlayer $player-name $middleloc;
- %if %checkForListElement spectators $player-name; != true then addListElement spectators $player-name;
- %goto checkgame;
- @death
- %setVar color %getListElementAt teamcolors %getIndexOfListElement teamnames %getMapValue players $player-name;;;;
- %if $sec-player-name != null then goto deathbyplayer;
- %speak all §eSkyWars %concat $color $player-name; §bist gestorben.;
- %goto deathcore;
- @deathbyplayer
- %setVar oppcolor %getListElementAt teamcolors %getIndexOfListElement teamnames %getMapValue players $sec-player-name;;;;
- %speak all §eSkyWars %concat $color $player-name; §bist durch %concat $oppcolor $sec-player-name; §bgestorben.;
- %setVar %concat $sec-player-name kills; %add %getVar %concat $sec-player-name kills;; 1;;
- %sGV $sec-player-name swkills %add %gGV $sec-player-name swkills; 1;;
- %sGV $sec-player-name swcoins %add %gGV $sec-player-name swcoins; 100;;
- %speak $sec-player-name §eSkyWars §r+100 §6Coins;
- %sbadd $p 2 §7Deine Kills: §r%getVar %concat $sec-player-name kills;;;
- %setVar i 0;
- %setVar teamname %getMapValue players $p;;
- %setVar %concat $teamname kills; %add %getVar %concat $teamname kills;; 1;;
- @teamslabel
- %setVar teamplayer %getListElementAt $teamname $i;;
- %sbadd $p 1 §7Team Kills: §r%getVar %concat $teamname kills;;;
- %if %inc i; < %getListSize $teamname; then goto teamslabel;
- %goto deathcore;
- @deathcore
- %setVar sec-player-name null;
- %setVar p $player-name;
- %removeListElement all $p;
- %setVar teamname %getMapValue players $p;;
- %removeListElement $teamname $p;
- %removeMapElement players $p;
- %setHealth $p 20;
- %setHunger $p 20;
- %setSaturation $p 5;
- %command clear $p;
- %setVar teamsize %getListSize $teamname;;
- %if $teamsize == 0 then removeListElement allteams $teamname;
- %sbadd all 4 §7Teams verbleibend: §r%getListSize allteams;;
- %sbadd all 3 §7Spieler verbleibend: §r%getListSize all;;
- %if %getListSize allteams; == 0 then goto win;
- %goto checkgame;
- @giveup
- %if $phase == 0 then goto leavelobby;
- %teleportPlayer $player-name $gamesworldloc;
- @leavegame
- %setVar p $player-name;
- %speak all §eSkyWars §8$p §3hat das Spiel verlassen.;
- %removeListElement all $p;
- %setVar teamname %getMapValue players $p;;
- %removeListElement $teamname $p;
- %removeMapElement players $p;
- %setHealth $p 20;
- %setHunger $p 20;
- %setSaturation $p 5;
- %command clear $p;
- %sbreset $p;
- %kick $p;
- %setVar teamsize %getListSize $teamname;;
- %if $teamsize == 0 then removeListElement allteams $teamname;
- %if %getListSize allteams; == 0 then goto win;
- %sbadd all 4 §7Teams verbleibend: §r%getListSize allteams;;
- %sbadd all 3 §7Spieler verbleibend: §r%getListSize all;;
- %goto checkgame;
- @win
- %setVar winnerteam %getListElementAt allteams 0;;
- %setVar winner %getListElementAt teamcolortext2 %getIndexOfListElement teamnames $winnerteam;;;
- %goto wincore;
- @wincore
- %setVar endtime %getTime;;
- %speak all §eSkyWars §bTeam $winner §bhat gewonnen!;
- %if %getListSize spectators; == 0 then goto overridespectators;
- %setVar i 0;
- @convertspectators
- %addListElement all %getListElementAt spectators $i;;
- %teleportPlayer %getListElementAt spectators $i; $gamesworldloc;
- %command gamemode SURVIVAL %getListElementAt spectators $i;;
- %if %inc i; < %getListSize spectators; then goto convertspectators;
- @overridespectators
- %removeList spectators;
- %setVar i 0;
- @winnerteam
- %setVar p %getListElementAt $winnerteam $i;;
- %sGV $p swwongames %add %gGV $p swwongames; 1;;
- %sGV $p swcoins %add %gGV $p swcoins; 500;;
- %speak $p §eSkyWars §r+500 §6Coins;
- %addGlobalMapElement swranks %getPlayerUUID $p; %ggV $p swwongames;;
- %if %inc i; < %getListSize $winnerteam; then goto winnerteam;
- %getGlobalMap swranks swranks;
- %sortMap swranks;
- %inverseMap swranks;
- %setVar i 0;
- @tpout
- %setVar p %getListElementAt all $i;;
- %sbreset $p;
- %teleportPlayer $p $gamesworldloc;
- %setHealth $p 20;
- %setHunger $p 20;
- %setSaturation $p 5;
- %command clear $p;
- %speak $p §eSkyWars §7-= §bStatistik dieses Spiels §7=-;
- %setVar time %div %sub $endtime $starttime; 1000;;
- %speak $p §eSkyWars §bZeit§8: §r%round %div $time 60;; Minuten %round %mod $time 60;; Sekunden;
- %speak $p §eSkyWars §bDeine Kills§8: §r%getVar %concat $p kills;;;
- %speak $p §eSkyWars §bDeine Kills gesamt§8: §r%gGV $p swkills;;
- %speak $p §eSkyWars §bGespielte Spiele§8: §r%gGV $p swplayedgames;;
- %speak $p §eSkyWars §bGewonnene Spiele§8: §r%gGV $p swwongames;;
- %speak $p §eSkyWars §bSiegwahrscheinlichkeit§8: §r%roundComma %mul %div %gGV $p swwongames; %gGV $p swplayedgames;; 100; 2;%percent;;
- %speak $p §eSkyWars §bDein Rang§8: §r%add %getIndexOfMapKey swranks %getPlayerUUID $p;; 1;;
- %if %inc i; < %getListSize all; then goto tpout;
- %if %getListSize placedblocks; == 0 then goto end;
- %setVar i 0;
- %setVar counter 0;
- @resetblocks
- %setBlock %getListElementAt placedblocks $i; AIR;
- %setVar counter %add $counter 1;;
- %if $counter == 400 then gosub waitforeins;
- %if %inc i; < %getListSize placedblocks; then goto resetblocks;
- @end
- %waitfor 40;
- %removeEntities Item $middleloc $radius;
- %removeEntities Arrow $middleloc $radius;
- %term;
- @waitforeins
- %waitfor 1;
- %setVar counter 0;
- %return;
|