1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816 |
- /* TODO before RELEASE
- //Todo: nur Skills anzeigen, die der Spieler auch aktiv hat
- //Herzpartikel
- //testphase
- //testphase --> u_gpvp
- */
- /* Erklärung für Codeverständnis
- DB-Table gilden
- - gilden_id GildenID
- - g_type Unterscheidung Gruppe/Gilde 0/1
- - gold_delay Anzahl der Tage, seit eine Gilde im Minus ist
- - gold Gold
- - name Name
- - block_world Location des Gildenblocks (Welt)
- - block_x Location des Gildenblocks (x)
- - block_y Location des Gildenblocks (y)
- - block_z Location des Gildenblocks (z)
- - safetime Wann die Gilde das nächste Mal angegriffen werden kann
- - plot_id Plotid der Gilde
- - share_xp <true/false>; Gruppe/Gilde XP-Teilung an/aus
- - share_gold <true/false>; Gruppe/Gilde Gold-Teilung an/aus
- DB-Table gildenplayer
- - player_id PlayerID
- - gilden_id GildenID
- - gold_atm Gold, das der Spieler bei sich trägt
- - gold_bank Gold, das der Spieler in der Bank aufbewahrt
- - next_join <time>; wann ein Spieler wieder einer Gilde beitreten kann
- - rang Rang eines Spielers innerhalb der Gilde/Gruppe
- - nick Nickname eines Spielers in der Gilde
- DB-Table guild_reward (monatsübersicht der täglichen belohnungen aller spieler)
- - player_id
- - day
- - opened 1 = kiste(geöffnet), null = nicht geöffnet oder zukunft
- CONFIGS
- gilden_data
- player_data/gpvp_data
-
- gvar gildencounter <"SERVER"> <id>; forlaufende ID, Anzahl aller Gilden und Gruppen
- map adcooldown <player_id>, <time>; 180 Sekunden Cooldown für "ad"-Weltnachrichten
- map bindingmenus <player_id>, <inv>; Enthält die Hotkey-Invs zum Skills casten
- map tempskilltosave <player_id>, <skill_name>; Enthält den zuletzt gewählten Skill zum Skills casten
- map fightplayers <plot_id>, <Set>; Set mit allen kämpfenden Spielern am Kampfgrundstück
- map clicks <gildenblockloc>, <0-200>; HP des Gildenblocks
- map blocktime <gilden_id>, <time.getMillis()>; Damit Gildenblock nur 1 Mal pro Sekunde geklickt werden kann
- map gstatus <plot_id>, <0/1>; gstatus: 0 = ersten 60 minuten angriffsphase; 1 = 30 minuten stehl phase
- list gfights <array>; Array: Defender_ID, Attacker_ID, Plot_ID (auf der gekämpft wird), Set(mit allen Spielern eines Kampfes)
- set forbiddenblocks <loc>; Block unter Gildenblock (von allen Gildenblocks)/Artefakt
- set forbiddenblocks2 <loc>; Berech 11x11x7 um den Gildenblock/bzw 17x17x8 um das Artefakt
- list invitations <array>; Liste mit offenen Gilden-Einladungen (Arrays)
- list groupinvitations <array>; Liste mit offenen Gruppen-Einladungen (Arrays)
- list gmoveids <array>; Liste mit player_move-ID's und den zugehörigen gilden_id's
- list checkwinlist <plot_id>; Liste mit Kampfgrundstücken zur Überprüfung, ob die Verteidigung erfolgreich war
- list stealends <plot_id>; Liste mit Kampfgrundstücken, zur Beendigung der Stehl-Phase
- list warned <player_id>; Liste mit allen Spielern auf fremden Grundstücken
- list scheduledtax <gilden_id>; Verzögerte Abrechnung der Steuer, weil Gilde im Kampf ist
- list stealers <array>; Liste mit Arrays mit Infos aller stehlenden Gilden (Name, Location, Stehl-Status)
- */
- //Databank-Statements
- guild.createTables();
- counter = 0;
- while(worker.hasWork()) {
- msg("dev", "Gpvp holded ", ++counter);
- waitfor(20);
- }
- //Events
- event.load("bucket_use");
- event.load("fishing");
- event.load("entity_click");
- event.load("living_death");
- event.load("custom_command");
- event.load("command");
- event.load("block_place");
- event.load("block_break");
- event.load("block_click");
- event.load("inv_click");
- event.load("player_move");
- event.load("player_login");
- event.load("player_logout");
- event.load("player_pre_respawn");
- event.load("player_post_respawn");
- event.load("player_pickup");
- event.load("portal");
- event.load("inv_close");
- event.load("item_air_click");
- event.load("living_drop");
- event.load("item_use_finish");
- event.load("entity_join");
- //Locations
- gamesworld = world.get("games");
- gpvpworld_name = "gpvp_spawn";
- gpvpworld = world.get(gpvpworld_name);
- config = getScriptVar("server_config");
- serverspawn = read.location(config.getString(config, "serverspawn", "games:0:0:0"));
- gildenspawnloc = read.location(config.getString(config, "gildenspawn", "games:0:0:0"));
- gildenvillagerloc = loc.new(gpvpworld, 960, 53, 918);
- answer42loc = loc.new(gpvpworld, 1030, 37, 964);
- grabbyloc = loc.new(gpvpworld, 103, 110, 473);
- grabbyprisonloc = loc.new(gpvpworld, 27.5, 110, 427.5);
- dailyreward_chest_loc = loc.new(gpvpworld, 1010, 37, 951);
- arte_main_loc = loc.new(gpvpworld, 1245, 69, 991);
- pvpsuedfromtploc = loc.new(gpvpworld, 73.5, 129, 511.5);
- pvpsuedtotploc = loc.new(gpvpworld, 82, 68, 536.5);
- //Sonstige Variablen
- goldpräfix = "§eGold";
- chestpräfix = "§8Schloss";
- quests_präfix = "§dQuests";
- arte_präfix = "§9Artefakt";
- fehlerpräfix = "§cFehler";
- commandspräfix = "§6Commands";
- gruppepräfix = "§9Gruppe";
- gildepräfix = "§6Gilde";
- try {
- spawn_plot = list.getIndex(plot.get(gildenspawnloc), 0);
- spawn_plot_id = plot.getId(spawn_plot);
- } catch {
- msg("dev", getSpacer());
- msg("dev", "§cKeine PlotID für Gildenspawn erkannt!");
- msg("dev", "§cLocation: §r", gildenspawnloc);
- msg("dev", "§cScript beendet!");
- msg("dev", getSpacer());
- term();
- }
- buypricegblock = 2000;
- gildenvillagername = "Gildenmeister";
- bankvillagername = "Bänker";
- skill_cast_inv_name = "Skill anklicken > Hotkey anklicken";
- level_up_sound = sound.get("minecraft:entity.experience_orb.pickup");
- sound_category_player = sound.getCategory("player");
- air_item = read.item("minecraft:air");
- scroll = read.item("km:scroll");
- belagerungsitem = read.item("{id:\"minecraft:obsidian\",Count:1b,tag:{HideFlags:1,Enchantments:[{lvl:1s,id:\"minecraft:unbreaking\"}],display:{Lore:['{\"text\":\"Belagerungsturm\"}'],Name:'{\"text\":\"Belagerungsturm\"}'}}}");
- artefact = read.item("km:artefact");
- guild_block = read.item("km:guild_block");
- leaves_tag = block.getTag("minecraft:leaves");
- signs_tag = block.getTag("minecraft:signs");
- age_property = block.getProperty("age_0_7");
- leather_type = "minecraft:leather";
- feather_type = "minecraft:feather";
- ink_sac_type = "minecraft:ink_sac";
- white_wool_type = "minecraft:white_wool";
- porkchop_type = "minecraft:porkchop";
- rabbit_foot_type = "minecraft:rabbit_foot";
- saddle_type = "minecraft:saddle";
- bone_type = "minecraft:bone";
- gunpowder_type = "minecraft:gunpowder";
- infested_cracked_stone_bricks_type = "minecraft:infested_cracked_stone_bricks";
- string_type = "minecraft:string";
- obsidian_type = "minecraft:obsidian";
- wheat_type = "minecraft:wheat";
- potato_type = "minecraft:potato";
- carrot_type = "minecraft:carrot";
- moveidfromworldspawn = event.addMoveData(loc.new(gamesworld, -414, 87, 120), loc.new(gamesworld, -410, 89, 121), 5, -1);
- x1 = plot.getMinX(spawn_plot);
- y1 = plot.getMinY(spawn_plot);
- z1 = plot.getMinZ(spawn_plot);
- x2 = plot.getMaxX(spawn_plot);
- y2 = plot.getMaxY(spawn_plot);
- z2 = plot.getMaxZ(spawn_plot);
- moveidspawn = event.addMoveData(loc.new(gpvpworld, x1, y1, z1), loc.new(gpvpworld, x2, y2, z2), 20, -1);
- //Nur Argumente von (Gilden-)Befehlen, für die man in einer Gilde sein muss
- set.new(gcommandsset);
- set.addAll(gcommandsset, "invite", "newpos", "fight", "leader", "nick", "gold", "xp");
- set.addAll(gcommandsset, "officer", "adel", "degrade", "kick", "leave", "deposit");
- set.addAll(gcommandsset, "steal", "search", "disband", "home", "msg", "mail", "withdraw");
- map.new(aliasmap);
- map.add(aliasmap, "pinfo", "playerinfo");
- map.add(aliasmap, "g", "gilde");
- map.add(aliasmap, "guild", "gilde");
- map.add(aliasmap, "bank", "money");
- map.add(aliasmap, "artefact", "arte");
- map.add(aliasmap, "artefakt", "arte");
- enchanting_menus = map.new();
- g_block_entities = map.new();
- chest_privat = map.new();
- chest_guild = map.new();
- chest_adel = map.new();
- chest_officer = map.new();
- gpvpquests = map.new();
- tempskilltosave = map.new();
- bindingmenus = map.new();
- gstatus = map.new();
- fightplayers = map.new();
- clicks = map.new();
- blocktime = map.new();
- adcooldown = map.new();
- gfights = list.new();
- setScriptVar("gfights", gfights);
- list.new(arte_ruin_forbidden_players);
- list.new(carry_arte_list);
- list.new(hunger1_list);
- list.new(gmoveids);
- list.new(checkwinlist);
- list.new(stealends);
- list.new(invitations);
- list.new(groupinvitations);
- list.new(movelist);
- list.new(warned);
- list.new(scheduledtax);
- list.new(stealers);
- list.new(text_ent_to_remove);
- set.new(forbiddenblocks);
- set.new(forbiddenblocks2);
- scepter_tag = item.getTag("km:scepter");
- dagger_tag = item.getTag("km:dagger");
- battleaxe_tag = item.getTag("km:battleaxe");
- stick_tag = item.getTag("km:stick");
- sword_tag = item.getTag("km:sword");
- axe_tag = item.getTag("km:axe");
- pickaxe_tag = item.getTag("km:pickaxe");
- shovel_tag = item.getTag("km:shovel");
- hoe_tag = item.getTag("km:hoe");
- boots_tag = item.getTag("km:boots");
- leggings_tag = item.getTag("km:leggings");
- chestplate_tag = item.getTag("km:chestplate");
- helmet_tag = item.getTag("km:helmet");
- bankmenu = inv.new("222222222");
- bankinvid = inv.getID(bankmenu);
- inv.setItem(bankmenu, 0, read.item("km:coin_gold", 1, "1 Gold einzahlen"));
- inv.setItem(bankmenu, 1, read.item("km:coin_gold", 1, "10 Gold einzahlen"));
- inv.setItem(bankmenu, 2, read.item("km:coin_gold", 1, "100 Gold einzahlen"));
- inv.setItem(bankmenu, 3, read.item("km:coin_gold", 1, "1000 Gold einzahlen"));
- inv.setItem(bankmenu, 5, read.item("km:coin_silver", 1, "1 Gold abheben"));
- inv.setItem(bankmenu, 6, read.item("km:coin_silver", 1, "10 Gold abheben"));
- inv.setItem(bankmenu, 7, read.item("km:coin_silver", 1, "100 Gold abheben"));
- inv.setItem(bankmenu, 8, read.item("km:coin_silver", 1, "1000 Gold abheben"));
- pvequests = inv.new("222000002");
- pvequestsinvid = inv.getID(pvequests);
- inv.setItem(pvequests, 0, read.item("minecraft:writable_book", 1, "§rFriedliche Mobs"));
- inv.setItem(pvequests, 1, read.item("minecraft:writable_book", 1, "§rFeindliche Mobs"));
- inv.setItem(pvequests, 2, read.item("minecraft:writable_book", 1, "§rBlöcke und Landwirtschaft"));
- inv.setItem(pvequests, 3, read.item("minecraft:writable_book", 1, "§rQuest beenden"));
- pvemenu1 = inv.new("222222222222222222222222222222200002");
- pvemenu1invid = inv.getID(pvemenu1);
- inv.setItem(pvemenu1, 0, read.item(leather_type, 1, "§rTöte 10 Kühe"));
- inv.setItem(pvemenu1, 1, read.item(leather_type, 1, "§rTöte 25 Kühe"));
- inv.setItem(pvemenu1, 2, read.item(leather_type, 1, "§rTöte 50 Kühe"));
- inv.setItem(pvemenu1, 3, read.item(leather_type, 1, "§rTöte 250 Kühe"));
- inv.setItem(pvemenu1, 5, read.item(white_wool_type, 1, "§rTöte 10 Schafe"));
- inv.setItem(pvemenu1, 6, read.item(white_wool_type, 1, "§rTöte 25 Schafe"));
- inv.setItem(pvemenu1, 7, read.item(white_wool_type, 1, "§rTöte 50 Schafe"));
- inv.setItem(pvemenu1, 8, read.item(white_wool_type, 1, "§rTöte 250 Schafe"));
- inv.setItem(pvemenu1, 9, read.item(porkchop_type, 1, "§rTöte 10 Schweine"));
- inv.setItem(pvemenu1, 10, read.item(porkchop_type, 1, "§rTöte 25 Schweine"));
- inv.setItem(pvemenu1, 11, read.item(porkchop_type, 1, "§rTöte 50 Schweine"));
- inv.setItem(pvemenu1, 12, read.item(porkchop_type, 1, "§rTöte 250 Schweine"));
- inv.setItem(pvemenu1, 14, read.item(feather_type, 1, "§rTöte 10 Hühner"));
- inv.setItem(pvemenu1, 15, read.item(feather_type, 1, "§rTöte 25 Hühner"));
- inv.setItem(pvemenu1, 16, read.item(feather_type, 1, "§rTöte 50 Hühner"));
- inv.setItem(pvemenu1, 17, read.item(feather_type, 1, "§rTöte 250 Hühner"));
- inv.setItem(pvemenu1, 18, read.item(rabbit_foot_type, 1, "§rTöte 10 Hasen"));
- inv.setItem(pvemenu1, 19, read.item(rabbit_foot_type, 1, "§rTöte 25 Hasen"));
- inv.setItem(pvemenu1, 20, read.item(rabbit_foot_type, 1, "§rTöte 50 Hasen"));
- inv.setItem(pvemenu1, 21, read.item(rabbit_foot_type, 1, "§rTöte 250 Hasen"));
- inv.setItem(pvemenu1, 23, read.item(saddle_type, 1, "§rTöte 10 Pferde"));
- inv.setItem(pvemenu1, 24, read.item(saddle_type, 1, "§rTöte 25 Pferde"));
- inv.setItem(pvemenu1, 25, read.item(saddle_type, 1, "§rTöte 50 Pferde"));
- inv.setItem(pvemenu1, 26, read.item(saddle_type, 1, "§rTöte 250 Pferde"));
- inv.setItem(pvemenu1, 27, read.item(ink_sac_type, 1, "§rTöte 10 Tintenfische"));
- inv.setItem(pvemenu1, 28, read.item(ink_sac_type, 1, "§rTöte 25 Tintenfische"));
- inv.setItem(pvemenu1, 29, read.item(ink_sac_type, 1, "§rTöte 50 Tintenfische"));
- inv.setItem(pvemenu1, 30, read.item(ink_sac_type, 1, "§rTöte 250 Tintenfische"));
- inv.setItem(pvemenu1, 31, read.item("minecraft:oak_door", 1, "§rZurück"));
- pvemenu2 = inv.new("222222222222222222222200002");
- pvemenu2invid = inv.getID(pvemenu2);
- inv.setItem(pvemenu2, 0, read.item("minecraft:rotten_flesh", 1, "§rTöte 25 Zombies"));
- inv.setItem(pvemenu2, 1, read.item("minecraft:rotten_flesh", 1, "§rTöte 50 Zombies"));
- inv.setItem(pvemenu2, 2, read.item("minecraft:rotten_flesh", 1, "§rTöte 100 Zombies"));
- inv.setItem(pvemenu2, 3, read.item("minecraft:rotten_flesh", 1, "§rTöte 1000 Zombies"));
- inv.setItem(pvemenu2, 5, read.item(bone_type, 1, "§rTöte 25 Skelette"));
- inv.setItem(pvemenu2, 6, read.item(bone_type, 1, "§rTöte 50 Skelette"));
- inv.setItem(pvemenu2, 7, read.item(bone_type, 1, "§rTöte 100 Skelette"));
- inv.setItem(pvemenu2, 8, read.item(bone_type, 1, "§rTöte 1000 Skelette"));
- inv.setItem(pvemenu2, 9, read.item(string_type, 1, "§rTöte 25 Spinnen"));
- inv.setItem(pvemenu2, 10, read.item(string_type, 1, "§rTöte 50 Spinnen"));
- inv.setItem(pvemenu2, 11, read.item(string_type, 1, "§rTöte 100 Spinnen"));
- inv.setItem(pvemenu2, 12, read.item(string_type, 1, "§rTöte 1000 Spinnen"));
- inv.setItem(pvemenu2, 14, read.item(infested_cracked_stone_bricks_type, 1, "§rTöte 25 Silberfische"));
- inv.setItem(pvemenu2, 15, read.item(infested_cracked_stone_bricks_type, 1, "§rTöte 50 Silberfische"));
- inv.setItem(pvemenu2, 16, read.item(infested_cracked_stone_bricks_type, 1, "§rTöte 100 Silberfische"));
- inv.setItem(pvemenu2, 17, read.item(infested_cracked_stone_bricks_type, 1, "§rTöte 1000 Silberfische"));
- inv.setItem(pvemenu2, 18, read.item(gunpowder_type, 1, "§rTöte 25 Creeper"));
- inv.setItem(pvemenu2, 19, read.item(gunpowder_type, 1, "§rTöte 50 Creeper"));
- inv.setItem(pvemenu2, 20, read.item(gunpowder_type, 1, "§rTöte 100 Creeper"));
- inv.setItem(pvemenu2, 21, read.item(gunpowder_type, 1, "§rTöte 1000 Creeper"));
- inv.setItem(pvemenu2, 22, read.item("minecraft:oak_door", 1, "§rZurück"));
- pvemenu3 = inv.new("222222222222222222000000002");
- pvemenu3invid = inv.getID(pvemenu3);
- inv.setItem(pvemenu3, 0, read.item(obsidian_type, 1, "§rSammle 100 Obsidian"));
- inv.setItem(pvemenu3, 1, read.item(obsidian_type, 1, "§rSammle 500 Obsidian"));
- inv.setItem(pvemenu3, 2, read.item(obsidian_type, 1, "§rSammle 1000 Obsidian"));
- inv.setItem(pvemenu3, 3, read.item(obsidian_type, 1, "§rSammle 10000 Obsidian"));
- inv.setItem(pvemenu3, 5, read.item(wheat_type, 1, "§rSammle 100 Weizen"));
- inv.setItem(pvemenu3, 6, read.item(wheat_type, 1, "§rSammle 500 Weizen"));
- inv.setItem(pvemenu3, 7, read.item(wheat_type, 1, "§rSammle 1000 Weizen"));
- inv.setItem(pvemenu3, 8, read.item(wheat_type, 1, "§rSammle 10000 Weizen"));
- inv.setItem(pvemenu3, 9, read.item(carrot_type, 1, "§rSammle 100 Karotten"));
- inv.setItem(pvemenu3, 10, read.item(carrot_type, 1, "§rSammle 500 Karotten"));
- inv.setItem(pvemenu3, 11, read.item(carrot_type, 1, "§rSammle 1000 Karotten"));
- inv.setItem(pvemenu3, 12, read.item(carrot_type, 1, "§rSammle 10000 Karotten"));
- inv.setItem(pvemenu3, 14, read.item(potato_type, 1, "§rSammle 100 Kartoffeln"));
- inv.setItem(pvemenu3, 15, read.item(potato_type, 1, "§rSammle 500 Kartoffeln"));
- inv.setItem(pvemenu3, 16, read.item(potato_type, 1, "§rSammle 1000 Kartoffeln"));
- inv.setItem(pvemenu3, 17, read.item(potato_type, 1, "§rSammle 10000 Kartoffeln"));
- inv.setItem(pvemenu3, 18, read.item("minecraft:oak_door", 1, "§rZurück"));
- smite = enchantment.get("smite");
- unbreaking = enchantment.get("unbreaking");
- bane_of_arthropods = enchantment.get("bane_of_arthropods");
- looting = enchantment.get("looting");
- knockback = enchantment.get("knockback");
- sharpness = enchantment.get("sharpness");
- punch = enchantment.get("punch");
- power = enchantment.get("power");
- infinity = enchantment.get("infinity");
- fire_aspect = enchantment.get("fire_aspect");
- flame = enchantment.get("flame");
- mending = enchantment.get("mending");
- silk_touch = enchantment.get("silk_touch");
- efficiency = enchantment.get("efficiency");
- fortune = enchantment.get("fortune");
- lure = enchantment.get("lure");
- luck_of_the_sea = enchantment.get("luck_of_the_sea");
- respiration = enchantment.get("respiration");
- thorns = enchantment.get("thorns");
- blast_protection = enchantment.get("blast_protection");
- fire_protection = enchantment.get("fire_protection");
- projectile_protection = enchantment.get("projectile_protection");
- protection = enchantment.get("protection");
- aqua_affinity = enchantment.get("aqua_affinity");
- depth_strider = enchantment.get("depth_strider");
- enchantings = map.new();
- weapon_map1 = map.new();
- map.add(weapon_map1, smite, 1);
- map.add(weapon_map1, unbreaking, 1);
- map.add(weapon_map1, bane_of_arthropods, 1);
- map.add(weapon_map1, looting, 1);
- map.add(weapon_map1, knockback, 1);
- map.add(weapon_map1, sharpness, 1);
- map.add(weapon_map1, punch, 1);
- map.add(weapon_map1, power, 1);
- map.add(weapon_map1, infinity, 1);
- map.add(weapon_map1, fire_aspect, 1);
- weapon_map2 = map.new();
- map.add(weapon_map2, smite, 3);
- map.add(weapon_map2, flame, 1);
- map.add(weapon_map2, unbreaking, 3);
- map.add(weapon_map2, bane_of_arthropods, 3);
- map.add(weapon_map2, looting, 2);
- map.add(weapon_map2, knockback, 2);
- map.add(weapon_map2, sharpness, 3);
- map.add(weapon_map2, punch, 2);
- map.add(weapon_map2, power, 3);
- map.add(weapon_map2, infinity, 1);
- map.add(weapon_map2, fire_aspect, 1);
- weapon_map3 = map.new();
- map.add(weapon_map3, smite, 5);
- map.add(weapon_map3, flame, 1);
- map.add(weapon_map3, unbreaking, 5);
- map.add(weapon_map3, bane_of_arthropods, 5);
- map.add(weapon_map3, looting, 3);
- map.add(weapon_map3, mending, 1);
- map.add(weapon_map3, knockback, 2);
- map.add(weapon_map3, sharpness, 5);
- map.add(weapon_map3, punch, 2);
- map.add(weapon_map3, power, 5);
- map.add(weapon_map3, infinity, 1);
- map.add(weapon_map3, fire_aspect, 2);
- tool_map1 = map.new();
- map.add(tool_map1, efficiency, 1);
- map.add(tool_map1, fortune, 1);
- map.add(tool_map1, luck_of_the_sea, 1);
- map.add(tool_map1, unbreaking, 1);
- map.add(tool_map1, lure, 1);
- tool_map2 = map.new();
- map.add(tool_map2, efficiency, 3);
- map.add(tool_map2, fortune, 2);
- map.add(tool_map2, luck_of_the_sea, 2);
- map.add(tool_map2, unbreaking, 2);
- map.add(tool_map2, lure, 2);
- tool_map3 = map.new();
- map.add(tool_map3, silk_touch, 1);
- map.add(tool_map3, efficiency, 5);
- map.add(tool_map3, fortune, 3);
- map.add(tool_map3, luck_of_the_sea, 3);
- map.add(tool_map3, unbreaking, 3);
- map.add(tool_map3, lure, 3);
- map.add(tool_map3, mending, 1);
- armor_map1 = map.new();
- map.add(armor_map1, respiration, 1);
- map.add(armor_map1, thorns, 1);
- map.add(armor_map1, blast_protection, 1);
- map.add(armor_map1, fire_protection, 1);
- map.add(armor_map1, unbreaking, 1);
- map.add(armor_map1, projectile_protection, 1);
- map.add(armor_map1, protection, 1);
- map.add(armor_map1, depth_strider, 1);
- armor_map2 = map.new();
- map.add(armor_map2, respiration, 2);
- map.add(armor_map2, thorns, 2);
- map.add(armor_map2, blast_protection, 2);
- map.add(armor_map2, fire_protection, 2);
- map.add(armor_map2, unbreaking, 2);
- map.add(armor_map2, projectile_protection, 2);
- map.add(armor_map2, protection, 2);
- map.add(armor_map2, depth_strider, 2);
- armor_map3 = map.new();
- map.add(armor_map3, respiration, 3);
- map.add(armor_map3, thorns, 3);
- map.add(armor_map3, blast_protection, 4);
- map.add(armor_map3, fire_protection, 4);
- map.add(armor_map3, unbreaking, 3);
- map.add(armor_map3, mending, 1);
- map.add(armor_map3, projectile_protection, 4);
- map.add(armor_map3, protection, 4);
- map.add(armor_map3, depth_strider, 3);
- enchantings_lvl1 = map.new();
- map.add(enchantings_lvl1, "weapon", weapon_map1);
- map.add(enchantings_lvl1, "tool", tool_map1);
- map.add(enchantings_lvl1, "armor", armor_map1);
- enchantings_lvl2 = map.new();
- map.add(enchantings_lvl2, "weapon", weapon_map2);
- map.add(enchantings_lvl2, "tool", tool_map2);
- map.add(enchantings_lvl2, "armor", armor_map2);
- enchantings_lvl3 = map.new();
- map.add(enchantings_lvl3, "weapon", weapon_map3);
- map.add(enchantings_lvl3, "tool", tool_map3);
- map.add(enchantings_lvl3, "armor", armor_map3);
- map.add(enchantings, 1, enchantings_lvl1);
- map.add(enchantings, 2, enchantings_lvl2);
- map.add(enchantings, 3, enchantings_lvl3);
- map.new(xpforentities); //math.random(xp * 0.7, xp * 1.3);
- map.add(xpforentities, "wither", 1000);
- map.add(xpforentities, "zombie", 110);
- map.add(xpforentities, "spider", 110);
- map.add(xpforentities, "skeleton", 110);
- map.add(xpforentities, "creeper", 110);
- map.add(xpforentities, "pigzombie", 110);
- map.add(xpforentities, "endermite", 110);
- map.add(xpforentities, "magmacube", 110);
- map.add(xpforentities, "slime", 110);
- map.add(xpforentities, "zomievillager", 110);
- map.add(xpforentities, "enderman", 185);
- map.add(xpforentities, "witch", 185);
- map.add(xpforentities, "silverfish", 185);
- map.add(xpforentities, "ghast", 185);
- map.add(xpforentities, "witherskeleton", 185);
- map.new(xpforblocks);
- map.add(xpforblocks, "minecraft:coal_ore", 3);
- map.add(xpforblocks, "minecraft:redstone_ore", 7);
- map.add(xpforblocks, "minecraft:lapis_ore", 12);
- map.add(xpforblocks, "minecraft:iron_ore", 15);
- map.add(xpforblocks, "minecraft:gold_ore", 18);
- map.add(xpforblocks, "minecraft:obsidian", 20);
- map.add(xpforblocks, "minecraft:diamond_ore", 25);
- map.add(xpforblocks, "minecraft:emerald_ore", 35);
- map.add(xpforblocks, "minecraft:oak_log", 2);
- map.add(xpforblocks, "minecraft:birch_log", 2);
- map.add(xpforblocks, "minecraft:spruce_log", 2);
- map.add(xpforblocks, "minecraft:jungle_log", 2);
- map.add(xpforblocks, "minecraft:acacia_log", 2);
- map.add(xpforblocks, "minecraft:dark_oak_log", 2);
- map.add(xpforblocks, "minecraft:oak_leaves", 2);
- map.add(xpforblocks, "minecraft:birch_leaves", 2);
- map.add(xpforblocks, "minecraft:jungle_leaves", 2);
- map.add(xpforblocks, "minecraft:acacia_leaves", 2);
- map.add(xpforblocks, "minecraft:dark_oak_leaves", 2);
- map.add(xpforblocks, "minecraft:spruce_leaves", 2);
- map.add(xpforblocks, "km:plum_leaves", 2);
- map.add(xpforblocks, "km:apricot_leaves", 2);
- map.add(xpforblocks, "km:pear_leaves", 2);
- map.add(xpforblocks, "km:cherry_leaves", 2);
- map.add(xpforblocks, "minecraft:cobweb", 2);
- map.add(xpforblocks, "minecraft:potatoes", 3);
- map.add(xpforblocks, "minecraft:carrots", 3);
- map.add(xpforblocks, "minecraft:beetroot", 3);
- map.add(xpforblocks, "minecraft:cocoa", 3);
- map.add(xpforblocks, "minecraft:sugar_cane", 3);
- map.add(xpforblocks, "minecraft:pumpkin", 15);
- map.add(xpforblocks, "minecraft:melon", 15);
- set.new(richblocks);
- set.add(richblocks, "minecraft:coal_block");
- set.add(richblocks, "minecraft:gold_block");
- set.add(richblocks, "minecraft:iron_block");
- set.add(richblocks, "minecraft:redstone_block");
- set.add(richblocks, "minecraft:lapis_block");
- set.add(richblocks, "minecraft:emerald_block");
- set.add(richblocks, "minecraft:diamond_block");
- set.add(richblocks, "minecraft:coal_ore");
- set.add(richblocks, "minecraft:gold_ore");
- set.add(richblocks, "minecraft:iron_ore");
- set.add(richblocks, "minecraft:redstone_ore");
- set.add(richblocks, "minecraft:lapis_ore");
- set.add(richblocks, "minecraft:emerald_ore");
- set.add(richblocks, "minecraft:diamond_ore");
- list.new(forbidden_items);
- list.add(forbidden_items, "minecraft:ender_pearl");
- list.add(forbidden_items, "minecraft:elytra");
- list.new(rewardlist1); //Diamanten
- list.add(rewardlist1, read.item("minecraft:diamond"));
- list.add(rewardlist1, read.item("minecraft:diamond", 2));
- list.add(rewardlist1, read.item("minecraft:diamond", 3));
- list.add(rewardlist1, read.item("minecraft:diamond", 4));
- list.add(rewardlist1, read.item("minecraft:diamond", 5));
- list.add(rewardlist1, read.item("minecraft:diamond", 6));
- list.add(rewardlist1, read.item("minecraft:diamond", 7));
- list.add(rewardlist1, read.item("minecraft:diamond_block"));
- list.new(rewardlist2); //Gold
- list.addAll(rewardlist2, 20, 50, 125, 175, 250, 300, 350, 500);
- list.new(rewardlist3); //KlassenXP
- list.addAll(rewardlist3, 500, 1000, 1500, 2000, 2500, 3000, 3500, 4000);
- list.new(rewardlist4); //Villager-Spawnei
- list.add(rewardlist4, read.item("minecraft:villager_spawn_egg"));
- list.new(allrewards);
- list.addAll(allrewards, rewardlist1, rewardlist2, rewardlist3, rewardlist4);
- map.new(rewardstext);
- map.add(rewardstext, rewardlist1, "Diamanten");
- map.add(rewardstext, rewardlist2, "Gold");
- map.add(rewardstext, rewardlist3, "KlassenXP");
- map.add(rewardstext, rewardlist4, "Villager-Spawnei");
- map.new(monthlist);
- map.add(monthlist, 1, "Januar");
- map.add(monthlist, 2, "Februar");
- map.add(monthlist, 3, "März");
- map.add(monthlist, 4, "April");
- map.add(monthlist, 5, "Mai");
- map.add(monthlist, 6, "Juni");
- map.add(monthlist, 7, "Juli");
- map.add(monthlist, 8, "August");
- map.add(monthlist, 9, "September");
- map.add(monthlist, 10, "Oktober");
- map.add(monthlist, 11, "November");
- map.add(monthlist, 12, "Dezember");
- map.new(monthdays);
- map.add(monthdays, 1, 31);
- map.add(monthdays, 2, 29);
- map.add(monthdays, 3, 31);
- map.add(monthdays, 4, 30);
- map.add(monthdays, 5, 31);
- map.add(monthdays, 6, 30);
- map.add(monthdays, 7, 31);
- map.add(monthdays, 8, 31);
- map.add(monthdays, 9, 30);
- map.add(monthdays, 10, 31);
- map.add(monthdays, 11, 30);
- map.add(monthdays, 12, 31);
- gosub("init_daily_reward");
- gosub("setreward");
- now_time = time.getMillis();
- now_cal = time.new(now_time);
- now_day = time.getDay(now_cal);
- now_hour = time.getHour(now_cal);
- now_min = time.getMinute(now_cal);
- diff = 8 * 60 - now_hour * 60 + now_min; //in minuten
- if(diff < 0) {
- diff = 24 * 60 - now_hour * 60 + now_min + 8 * 60; //in minuten
- }
- tax_time = now_time + diff * 60 * 1000; //8 Uhr
- diff = 19 * 60 + 30 - now_hour * 60 + now_min; //in minuten
- if(diff < 0) {
- diff = 24 * 60 - now_hour * 60 + now_min + 19 * 60 + 30; //in minuten
- }
- arte_announcer_time = now_time + diff * 60 * 1000; //19:30 Uhr
- diff = 20 * 60 - now_hour * 60 + now_min; //in minuten
- if(diff < 0) {
- diff = 24 * 60 - now_hour * 60 + now_min + 20 * 60; //in minuten
- }
- arte_reset_time = now_time + diff * 60 * 1000; //20:00 Uhr
- arte_time = now_time; //Variable, damit das Artefakt nur einmal pro Sekunde angeklickt werden kann
- actualday = now_day; //Variable, um Tageswechsel zu erkennen
- initSkills();
- //Alle Gilden durchlaufen
- id_list = getAllGuildIds();
- for(i = 0; i < list.getSize(id_list); i++) {
- gilden_id = list.getIndex(id_list, i);
- g_block = getGuildBlock(gilden_id);
- //11x11x7 Bereich und Block darunter
- setGuildBlockArea(g_block);
- //Move-Gebiete erstellen
- createMoveArea(gilden_id, g_block);
- text_ent = entity.get(g_block, 3, "me.km.entities.EntityNobody");
- if(text_ent == null) {
- text_ent = entity.spawn("km:nobody", loc.mod(g_block, 0.5, 1.5, 0.5), "{NoGravity:true}");
- if(text_ent != null) {
- //Chunk ist geladen
- entity.setName(text_ent, concat("200/200 §c❤\n§r[§6", getGuildName(gilden_id), "§r]"));
- }
- }
- map.add(g_block_entities, g_block, text_ent);
- }
- //Alle Online-Spieler, egal in welcher Welt im Gpvp registrieren
- onlinelist = players.toList();
- for(i = 0; i < list.getSize(onlinelist); i++) {
- player = list.getIndex(onlinelist, i);
- registerGpvpPlayer(player);
- }
- while(worker.hasWork()) {
- msg("dev", "Gpvp holded ", ++counter);
- waitfor(20);
- }
- //Alle Spieler in der Gpvp-Welt "joinen" dem Gildenpvp
- gpvpworld = world.get(gpvpworld_name);
- worldlist = players.toWorldList(gpvpworld);
- for(i = 0; i < list.getSize(worldlist); i++) {
- player = list.getIndex(worldlist, i);
- joinGpvpWorld(player);
- }
- if(ggv("SERVER", "gildencounter") == null) {
- sgv("SERVER", "gildencounter", 0);
- }
- if(ggv("SERVER", "artedaycounter") == null) {
- sgv("SERVER", "artedaycounter", 2);
- }
- //Artefakt
- arte_ruin_radius = 25;
- arte_hp = 250;
- arte_yet_loc = ggv("SERVER", "arte_yet_loc");
- if(arte_yet_loc == null) {
- //Erstmalige Initialisierung
- sgv("SERVER", "arte_yet_loc", text.location(arte_main_loc));
- arte_yet_loc = arte_main_loc;
- } else {
- arte_yet_loc = read.location(arte_yet_loc);
- arte_loc_type = "placed";
- //Ist das Artefakt noch an der zuletzt platzierten Position? Wenn nicht, dann hatte es ein Spieler --> Artereset
- if(block.getType(arte_yet_loc) != "km:artefact") {
- arteresetcore();
- } else {
- //Artefakt ist an der richtigen Stelle. Blöcke rundherum schützen
- if(arte_yet_loc != arte_main_loc) {
- arte_hp = 10;
- setArteBlockArea(arte_yet_loc);
- }
- }
- }
- //Kistensicherungen aus Datenbank einlesen
- loadChestDB1();
- loadChestDB2();
- sgoto(200, "witherloop");
- sgoto(20, "manaloop");
- sgoto(100, "arte_ruin_loop");
- sgoto(1200, "timerloop");
- sgoto(1200, "arte_drops_loop");
- msg("dev", "§bGildenpvp §rwurde geladen");
- @wait
- wait();
- if(event == "portal") { //Wird zum Teil aus anderer Welt ausgelöst
- if(from == gpvpworld_name) {
- if(arte_loc_type == "player") {
- if(arte_yet_uuid == player.getUuid(player)) {
- arteresetcore();
- }
- }
- display.reset(player);
- stacks.setActive(player, false);
- entity.setName(player, player_name);
- goto("wait");
- }
- if(to == gpvpworld_name) {
- if(!registerGpvpPlayer(player)) {
- joinGpvpWorld(player);
- }
- goto("wait");
- }
- goto("wait");
- }
- if(event == "player_move") {
- player_loc = entity.getLocation(player);
- if(id == moveidfromworldspawn) {
- if(perm.has(player, "isTeam")) {
- teleportPlayer(player, gildenspawnloc, false);
- if(!registerGpvpPlayer(player)) {
- joinGpvpWorld(player);
- }
- }
- goto("wait");
- }
- if(id == moveidspawn) {
- display.add(player, 39, "§6Spawn");
- list.add(movelist, player_name);
- sgoto(160, "checkifwildnis");
- goto("wait");
- }
- //Gilden-Move-Gebiete
- displayMovePlot(player, id);
- list.add(movelist, player_name);
- sgoto(160, "checkifwildnis");
- goto("wait");
- }
- //Wenn Event aus Gpvp-Welt, dann wird er verarbeitet
- if(event == "living_death") {
- entity_loc = entity.getLocation(living_entity);
- if(world.getName(loc.getWorld(entity_loc)) == gpvpworld_name) {
- ignoreGoto(event);
- }
- goto("wait");
- }
- if(player == null) {
- goto("wait");
- }
- player_loc = entity.getLocation(player);
- //Wenn Event aus Gpvp-Welt, dann wird er verarbeitet
- if(world.getName(loc.getWorld(player_loc)) == gpvpworld_name) {
- ignoreGoto(event);
- }
- goto("wait");
- @custom_command
- origin = map.get(aliasmap, command);
- if(origin != null) {
- command = origin;
- }
- size = list.getSize(args);
- if(command == "droptables") {
- if(!isGameAdmin(player)) {
- speakPrefix(player, fehlerpräfix, "Keine Permissions");
- goto("wait");
- }
- droptables();
- speakPrefix(player, commandspräfix, "Datanbank Tables gelöscht");
- goto("wait");
- }
- if(command == "arte") {
- if(arte_loc_type == "player") {
- p_name = player.getName(arte_yet_uuid);
- p = player.get(arte_yet_uuid);
- p_loc = entity.getLocation(p);
- bx = loc.getCoord(p_loc, "bx");
- by = loc.getCoord(p_loc, "by");
- bz = loc.getCoord(p_loc, "bz");
- speakPrefix(player, arte_präfix, concat("§x", p_name, "§r trägt das Artefakt: ", text.number(bx), ":", text.number(by), ":", text.number(bz)));
- } elseif(arte_loc_type == "placed") {
- bx = loc.getCoord(arte_yet_loc, "bx");
- by = loc.getCoord(arte_yet_loc, "by");
- bz = loc.getCoord(arte_yet_loc, "bz");
- plot_id = getPlotId(arte_yet_loc);
- if(plot_id == null) {
- speakPrefix(player, arte_präfix, "Artefakt steht auf keinem Grundstück. marvinius informieren.");
- goto("wait");
- }
- if(arte_yet_loc == arte_main_loc) {
- speakPrefix(player, arte_präfix, concat("Das Artefakt steht in der Artefaktruine: ", text.number(bx), ":", text.number(by), ":", text.number(bz)));
- } else {
- gilden_id = getGuildIdFromPlotId(plot_id);
- speakPrefix(player, arte_präfix, concat("Das Artefakt steht am Gildengebiet von §6", getGuildName(gilden_id), "§r: ", text.number(bx), ":", text.number(by), ":", text.number(bz)));
- }
- } else {
- speakPrefix(player, arte_präfix, "Unbestimmte Position des Artefakts. marvinius informieren.");
- }
- goto("wait");
- }
- if(command == "playerinfo") {
- if(size > 1) {
- speakPrefix(player, commandspräfix, "/playerinfo [player]");
- goto("wait");
- }
- if(size == 0) {
- p_name = player.getName(player);
- } else {
- p_name = list.getIndex(args, 0);
- if(!checkIfEverOnline(p_name)) {
- speakPrefix(player, fehlerpräfix, "§rDieser Spieler war noch nie online");
- goto("wait");
- }
- }
- p_id = player.getId(player.getUuid(p_name));
- p_name = player.getNameFromId(p_id);
- gilden_id = guild.getIdFromDatabase(p_id);
- speakPrefix(player, commandspräfix, concat(p_name, " (ID:", text.number(p_id), ")"));
- if(isGroup(gilden_id)) {
- msg(player, "Gruppe: ", text.number(gilden_id));
- } elseif(isGuild(gilden_id)) {
- msg(player, "Gilde: ", text.number(gilden_id), " ", getGuildName(gilden_id));
- }
- if(isOnline(p_name)) {
- p = read.player(p_name);
- msg(player, "Leben: ", text.number(entity.getHealth(p)));
- msg(player, "Hunger: ", text.number(player.getHunger(p)));
- class = guild.getClass(p);
- if(class != "none") {
- msg(player, "Klasse: ", class);
- msg(player, "Level: ", text.number(guild.getLevel(p)));
- msg(player, "XP: ", text.number(guild.getXp(p)));
- msg(player, "Mana: ", text.number(getManaAtm(p)), "/", text.number(getManaMax(p)));
- }
- }
- msg(player, "Gold atm: ", text.number(getGoldAtm(p_name)));
- goto("wait");
- }
- if(command == "slots") {
- plot_id = getPlotId(player_loc);
- if(!isGuildSpawnId(plot_id)) {
- speakPrefix(player, fehlerpräfix, "§rSkillbinding geht nur am Spawn");
- goto("wait");
- }
- class = guild.getClass(player);
- if(class == "none") {
- speakPrefix(player, fehlerpräfix, "§rDu besitzt keine Klasse");
- goto("wait");
- }
- //Für jeden Spieler ein neues Inventar erstellen, weil es sich um ein veränderndes Inventar handelt
- new_bind_inv = inv.new("222222222222222222000000000222222220222222220222222220");
- for(i = 0; i <= 8; i++) {
- hotkey_item = read.item("minecraft:name_tag");
- item.setName(hotkey_item, concat("§rHotkey", text.number(i + 1)));
- inv.setItem(new_bind_inv, i, hotkey_item);
- tempskill = hotkey.get(player, class, i);
- if(tempskill != null) {
- inv.setItem(new_bind_inv, i + 9, skill.getItem(tempskill));
- } else {
- inv.setItem(new_bind_inv, i + 9, air_item);
- }
- }
- skills_list = getSkillsFromJob(class);
- for(i = 0; i < list.getSize(skills_list); i++) {
- //Todo: nur Skills anzeigen, die der Spieler auch aktiv hat
- skill_name = list.getIndex(skills_list, i);
- item = skill.getItem(skill_name);
- description = skill.getDescription(skill_name);
- item.setName(item, concat("§r", skill_name));
- list.new(lore_list);
- list.add(lore_list, concat("§r§5", description));
- item.setLore(item, lore_list);
- inv.setItem(new_bind_inv, 18 + i, item);
- }
- inv.open(new_bind_inv, player, skill_cast_inv_name);
- map.add(bindingmenus, player.getID(player), new_bind_inv);
- goto("wait");
- }
- if(command == "money") {
- if(size > 1) {
- speakPrefix(player, commandspräfix, "/bank <player>");
- speakPrefix(player, commandspräfix, "/money <player>");
- goto("wait");
- } elseif(size == 0) {
- gold = getGoldBank(player);
- } else {
- p = list.getIndex(args, 0);
- gold = getGoldBank(p);
- }
- speakPrefix(player, goldpräfix, concat("Bank: ", text.number(gold)));
- goto("wait");
- }
- if(command == "placearte") {
- //Check ob Spieler Arte-Träger ist
- if(arte_loc_type == "placed") {
- speakPrefix(player, fehlerpräfix, "§rDu trägst das Artefakt nicht");
- goto("wait");
- }
- if(arte_yet_uuid != player.getUuid(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu trägst das Artefakt nicht");
- goto("wait");
- }
- //Check ob eigenes Gilden GS
- temploc = entity.getLocation(player);
- temploc = getBlockLocation(temploc);
- if(!isAPlot(temploc)) {
- speakPrefix(player, chestpräfix, "Du bist nicht auf deinem Gildengebiet");
- goto("wait");
- }
- gilden_id = guild.getId(player);
- if(!isOnGuildPlot(gilden_id, temploc)) {
- speakPrefix(player, chestpräfix, "Du bist nicht auf deinem Gildengebiet");
- goto("wait");
- }
- if(!checkArteArea(temploc)) {
- speakPrefix(player, fehlerpräfix, "§rIm Bereich von 8 Blöcken seitlich und nach oben dürfen sich keine anderen Blöcke befinden");
- cancel = true;
- goto("wait");
- }
- y_guild_bloc = getGuildBlockY(gilden_id);
- y = loc.getY(temploc);
- if(y < 35 || y > 150) {
- speakPrefix(player, fehlerpräfix, "§rDas Artefakt muss zwischen 35 bis 150 Blöcke Höhe platziert werden");
- goto("wait");
- }
- y_diff = math.abs(y - y_guild_bloc);
- if(y_diff < 20) {
- speakPrefix(player, fehlerpräfix, "§rDas Artefakt muss mindestens 20 Blöcke Y-Abstand zum Gildenblock haben");
- goto("wait");
- }
- lowerblock = loc.mod(temploc, 0, -1, 0);
- if(!block.isSolid(lowerblock)) {
- speakPrefix(player, fehlerpräfix, "§rDer Block unter dem Artefakt muss ein solider Block sein");
- goto("wait");
- }
- btype = block.getType(lowerblock);
- if(block.hasTag(leaves_tag, block.get(lowerblock))) {
- speakPrefix(player, fehlerpräfix, "§rDer Block unter dem Artefakt darf kein Laub sein");
- cancel = true;
- goto("wait");
- }
- if(set.contains(richblocks, btype)) {
- speakPrefix(player, fehlerpräfix, "§rDer Block unter dem Artefakt darf kein wertvoller Block sein");
- cancel = true;
- goto("wait");
- }
- arte_hp = 10;
- arte_loc_type = "placed";
- arte_yet_loc = temploc;
- setArteBlockArea(arte_yet_loc);
- sgv("SERVER", "arte_yet_loc", text.location(arte_yet_loc));
- block.set(arte_yet_loc, "km:artefact");
- arte_ent = entity.spawn("km:nobody", loc.mod(arte_yet_loc, 0.5, 1.5, 0.5), "{NoGravity:true}");
- entity.setName(arte_ent, concat("10/10 §c❤\n§r[§9Artefakt§r]"));
- sendWorldMessage(arte_präfix, concat("§rDas Artefakt wurde von §6", getGuildName(gilden_id), "§r platziert"));
- goto("wait");
- }
- if(command == "pay") {
- if(size != 2) {
- speakPrefix(player, commandspräfix, "/pay <player> <gold>");
- } else {
- p_name = list.getIndex(args, 0);
- betrag = list.getIndex(args, 1);
- if(!isDouble(betrag)) {
- speakPrefix(player, fehlerpräfix, "Zahl erwartet");
- goto("wait");
- }
- if(betrag < 0) {
- speakPrefix(player, fehlerpräfix, "Positive Zahl erwartet");
- goto("wait");
- }
- if(!checkIfEverOnline(p_name)) {
- speakPrefix(player, fehlerpräfix, "§rDieser Spieler war noch nie online");
- goto("wait");
- }
- if(!isOnline(p_name)) {
- speakPrefix(player, fehlerpräfix, "§rDer Empfänger muss online sein");
- goto("wait");
- }
- p = read.player(p_name);
- if(!isInGpvpWorld(p)) {
- speakPrefix(player, fehlerpräfix, "§rDer Empfänger muss sich bei einer Überweisung in der Gildenpvp-Welt aufhalten");
- goto("wait");
- }
- gold_atm = getGoldAtm(player);
- if(!isDouble(gold_atm)) {
- speakPrefix(player, fehlerpräfix, "Transaktion zu schnell");
- goto("wait");
- }
- if(betrag > gold_atm) {
- speakPrefix(player, fehlerpräfix, "§rDu kannst nicht mehr überweisen, als du in deinem Geldbeutel hast");
- goto("wait");
- }
- speakPrefix(player, goldpräfix, "§rTransaktion erfolgreich");
- speakPrefix(p, goldpräfix, concat("§r", player_name, " hat dir ", text.number(betrag), " Gold überwiesen"));
- subGoldAtm(player, betrag);
- addGoldAtm(p, betrag);
- }
- goto("wait");
- }
- if(command == "group") {
- if(size == 0) {
- speakPrefix(player, gruppepräfix, "§r/group ...");
- msg(player, "§9 - info §rZeigt Infos über deine Gruppe");
- msg(player, "§9 - leave §rVerlasst die Gruppe");
- msg(player, "§9 - accept <Spieler-Name> §rAkzeptiert die Einladung einer Gruppe");
- gilden_id = guild.getId(player);
- if(isLeader(player_name)) {
- msg(player, "§9 - invite <Name> §rLädt einen Spieler in die Gruppe ein");
- msg(player, "§9 - kick <Name> §rKickt einen Spieler aus der Gruppe");
- msg(player, "§9 - disband §rLöst die Gruppe auf");
- msg(player, "§9 - gold §rAktiviert/deaktiviert die Gold-Teilung");
- msg(player, "§9 - xp §rAktiviert/deaktiviert die XP-Teilung");
- }
- goto("wait");
- }
- arg0 = toLowerCase(list.getIndex(args, 0));
- if(arg0 == "gold" || arg0 == "xp") {
- if(!isLeader(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu bist nicht der Leiter der Gruppe");
- goto("wait");
- }
- gilden_id = guild.getId(player);
- toggleGoldOrXp(gilden_id);
- goto("wait");
- }
- if(arg0 == "info") {
- if(size != 1) {
- speakPrefix(player, commandspräfix, "/group info");
- } else {
- gilden_id = guild.getId(player);
- if(!isPlayerInGroup(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu befindest dich in keiner Gruppe");
- goto("wait");
- }
- templist = getGuildPlayers(gilden_id);
- list.new(memberslist);
- for(i = 0; i < list.getSize(templist); i++) {
- p_id = list.getIndex(templist, i);
- p_name = player.getNameFromId(p_id);
- if(isLeader(p_name)) {
- leader = p_name;
- } else {
- list.add(memberslist, p_name);
- }
- }
- members = text.concatList(memberslist, ", ", 0, list.getSize(memberslist) - 1);
- msg(player, "§lGruppe");
- msg(player, "§lLeiter");
- msg(player, "§r", leader);
- msg(player, "§lMitglieder");
- msg(player, "§r", members);
- }
- goto("wait");
- }
- if(arg0 == "disband") {
- if(size != 1) {
- speakPrefix(player, commandspräfix, "/group disband");
- } else {
- if(!isPlayerInGroup(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu befindest dich in keiner Gruppe");
- goto("wait");
- }
- gilden_id = guild.getId(player);
- if(!isLeader(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu bist nicht der Leiter der Gruppe");
- goto("wait");
- }
- msg(player, "[", gruppepräfix, "§r] Möchtest du die Gruppe wirklich auflösen? ", text.click("§r[§cAuflösen§r]", concat("/group disband2")));
- }
- goto("wait");
- }
- if(arg0 == "disband2") {
- if(size == 1) {
- if(!isPlayerInGroup(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu befindest dich in keiner Gruppe");
- goto("wait");
- }
- gilden_id = guild.getId(player);
- if(!isLeader(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu bist nicht der Leiter der Gruppe");
- goto("wait");
- }
- templist = getGuildPlayers(gilden_id);
- for(i = 0; i < list.getSize(templist); i++) {
- p_id = list.getIndex(templist, i);
- guild.setId(p_id, 0);
- }
- deleteGuildFromData(gilden_id);
- speakPrefix(player, gruppepräfix, "§rDu hast die Gruppe aufgelöst");
- }
- goto("wait");
- }
- if(arg0 == "invite") {
- if(size != 2) {
- speakPrefix(player, commandspräfix, "/group invite <player>");
- } else {
- if(isPlayerInGuild(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu befindest dich in einer Gilde");
- goto("wait");
- }
- //Beim Einladen muss nicht zwingend eine Gruppe bestehen
- if(isPlayerInGroup(player)) {
- gilden_id = guild.getId(player);
- if(!isLeader(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu bist nicht der Leiter der Gruppe");
- goto("wait");
- }
- if(getGuildSize(gilden_id) >= 7) {
- speakPrefix(player, fehlerpräfix, "§rEine Gruppe ist auf sieben Spieler begrenzt");
- goto("wait");
- }
- }
- player_id = player.getId(player);
-
- if(hasGroupInvitation(player_id)) {
- speakPrefix(player, fehlerpräfix, "§rWarte bis die offene Einladung abläuft oder angenommen wird");
- goto("wait");
- }
- p_name = list.getIndex(args, 1);
- if(player_name == p_name) {
- speakPrefix(player, fehlerpräfix, "§rDu kannst dich nicht selbst einladen");
- goto("wait");
- }
- if(!checkIfEverOnline(p_name)) {
- speakPrefix(player, fehlerpräfix, "§rDieser Spieler war noch nie online");
- goto("wait");
- }
- if(!isOnline(p_name)) {
- speakPrefix(player, fehlerpräfix, "§rEs können nur Online-Spieler eingeladen werden");
- goto("wait");
- }
- p = read.player(p_name);
- if(isPlayerInGroup(p)) {
- speakPrefix(player, fehlerpräfix, "§rDieser Spieler befindet sich bereits in einer Gruppe");
- goto("wait");
- }
- if(isPlayerInGuild(p)) {
- speakPrefix(player, fehlerpräfix, "§rDieser Spieler ist in einer Gilde");
- goto("wait");
- }
- p_id = player.getId(player.getUuid(p_name));
- if(hasGroupInvitationFromThisPlayer(p_id, player_id)) {
- speakPrefix(player, fehlerpräfix, "§rDu hast diesen Spieler bereits eingeladen");
- goto("wait");
- }
- addGroupInvitation(p_id, player_id);
- sgoto(1200, "removeGroupInvitation"); //1 Minute
- speakPrefix(player, gruppepräfix, "§rEinladung gesendet");
- speakPrefix(p, gruppepräfix, concat("§7", player_name, "§r hat dich in seine Gruppe eingeladen"));
- }
- goto("wait");
- }
- if(arg0 == "accept") {
- if(size != 2) {
- speakPrefix(player, commandspräfix, "/group accept <player>");
- } else {
- if(isPlayerInGroup(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu befindest dich bereits in einer Gruppe");
- goto("wait");
- }
- if(isPlayerInGuild(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu befindest dich in einer Gilde");
- goto("wait");
- }
- p_name = list.getIndex(args, 1);
- if(!checkIfEverOnline(p_name)) {
- speakPrefix(player, fehlerpräfix, "§rDieser Spieler war noch nie online");
- goto("wait");
- }
- p_id = player.getId(player.getUuid(p_name));
- player_id = player.getUuid(player_name);
- if(!hasGroupInvitationFromThisPlayer(player_id, p_id)) {
- speakPrefix(player, fehlerpräfix, "§rDu hast keine Einladung dieses Spielers");
- goto("wait");
- }
- if(!isOnline(p_name)) {
- speakPrefix(player, fehlerpräfix, "§rDieser Spieler ist nicht mehr online");
- goto("wait");
- }
- p = read.player(p_name);
- if(!isPlayerInGroup(p)) { //Überprüfung ob Einlader in Gruppe. Wenn Nein: Gruppe erstellen
- //Gruppe erstellen
- gilden_id = getNewGuildId();
- g_type = 0;
- gold_delay = 0;
- gold = 0;
- block_world = gpvpworld_name;
- block_x = 0;
- block_y = 0;
- block_z = 0;
- safetime = 0;
- plot_id = 0;
- share_xp = 1;
- share_gold = 1;
- elo = 0;
- addNewGuild(gilden_id, g_type, gold_delay, gold, gilden_name, block_world, block_x, block_y, block_z, safetime, plot_id, share_xp, share_gold, elo);
-
- //Einlader zur Gruppe hinzufügen
- guild.setId(p_id, gilden_id);
- setLeader(p_id);
- } else {
- //Gruppe existiert
- P_id = player.getId(player.getUuid(p_name));
- gilden_id = guild.getIdFromDatabase(p_id);
- if(getGuildSize(gilden_id) >= 7) {
- speakPrefix(player, fehlerpräfix, "§rEine Gruppe ist auf sieben Spieler begrenzt");
- goto("wait");
- }
- }
- //Spieler hinzufügen
- list.add(list, player);
- setMember(player_id);
- guild.setId(player, gilden_id);
- speakPrefix(player, gruppepräfix, "§rEinladung angenommen");
- sendmessage(p_name, gruppepräfix, concat("§7", player_name, " §rhat die Einladung angenommen"), true);
- }
- goto("wait");
- }
- if(arg0 == "leave") {
- if(size != 1) {
- speakPrefix(player, commandspräfix, "/group leave");
- } else {
- gilden_id = guild.getId(player);
- if(!isPlayerInGroup(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu befindest dich in keiner Gruppe");
- goto("wait");
- }
- guild.setId(player, 0);
- removeRang(player);
- speakPrefix(player, gruppepräfix, "§rDu hast die Gruppe verlassen");
- checkGroupSize(gilden_id);
- }
- goto("wait");
- }
- if(arg0 == "kick") {
- if(size != 1) {
- speakPrefix(player, commandspräfix, "/group kick <player>");
- } else {
- if(!isPlayerInGroup(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu befindest dich in keiner Gruppe");
- goto("wait");
- }
- gilden_id = guild.getId(player);
- if(!isLeader(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu bist nicht der Leiter der Gruppe");
- goto("wait");
- }
- p_name = list.getIndex(args, 1);
- if(!checkIfEverOnline(p_name)) {
- speakPrefix(player, fehlerpräfix, "§rDieser Spieler war noch nie online");
- goto("wait");
- }
- p_id = player.getId(player.getUuid(p_name));
- if(!guild.isSame(p_name, player_name)) {
- speakPrefix(player, fehlerpräfix, "§rDieser Spieler ist nicht in deiner Gruppe");
- goto("wait");
- }
- guild.setId(p_id, 0);
- removeRang(p_id);
- speakPrefix(player, gruppepräfix, "§rSpieler aus der Gruppe entfernt");
- sendmessage(p_name, gruppepräfix, concat("§rDu bist aus der Gruppe entfernt worden"), false);
- goto("checkgroupsize");
- }
- goto("wait");
- }
- goto("wait");
- }
- if(command == "gilde") {
- if(size == 0) {
- speakPrefix(player, commandspräfix, "§r/gilde... (/g, /guild)");
- msg(player, "§6 - invite <name> §rLädt einen Spieler in deine Gilde ein");
- msg(player, "§6 - accept <name> §rNimmt eine Einladung an");
- msg(player, "§6 - info [gildenid/-name] §rGibt Infos über eine Gilde");
- msg(player, "§6 - create <name> <tag> §rRegistriert eine Gilde");
- msg(player, "§6 - kick <name> §rKickt einen Spieler aus deiner Gilde");
- msg(player, "§6 - leader <name> §rBefördert einen Spieler zum einzigen Leiter");
- msg(player, "§6 - officer <name> §rBefördert einen Spieler zum Offizier");
- msg(player, "§6 - adel <name> §rBefördert einen Spieler zum Adel");
- msg(player, "§6 - degrade <name> §rDegradiert einen Spieler");
- msg(player, "§6 - leave §rDu verlässt die Gilde");
- msg(player, "§6 - disband §rDer Leiter löst die Gilde auf");
- msg(player, "§6 - newpos §rDer Gildenblock wird umgesetzt");
- msg(player, "§6 - rename <gname> §rDie Gilde wird umbenannt");
- msg(player, "§6 - fight §rGreift eine andere Gilde an");
- msg(player, "§6 - steal §rStiehlt Gold");
- msg(player, "§6 - search §rOrtet Gegner am Gildengebiet");
- msg(player, "§6 - spawn §rTeleportiert dich zum Gildenspawn");
- msg(player, "§6 - home §rTeleportiert dich zum Gildenblock");
- msg(player, "§6 - msg <nachricht> §rNachricht an alle Gildenmitglieder");
- msg(player, "§6 - mail <nachricht> §rMail an alle Gildenmitglieder");
- msg(player, "§6 - nick <name> <nickname> §rWeist Nicknamen zu");
- msg(player, "§6 - deposit <zahl> §rLegt Gold aufs Gildenkonto");
- msg(player, "§6 - withdraw <zahl> §rHebt Gold vom Gildenkonto ab");
- msg(player, "§6 - gold §rAktiviert/deaktiviert die Gold-Teilung (nur Leader)");
- msg(player, "§6 - xp §rAktiviert/deaktiviert die XP-Teilung (nur Leader)");
- msg(player, "§6 - ad <nachricht> §rNachricht an alle Spieler in der Welt");
- msg(player, "§6 - class <class> §7[player] §rWählt eine Klasse");
- if(isGameAdmin(player)) {
- msg(player, "§6 - reset §rResettet Gildenpvp");
- }
- if(isGameMod(player)) {
- msg(player, "§6 - resetsafetime <gildenid/-name> §rSchutzzeit einer Gilde");
- msg(player, "§6 - resetnextjoin <player> §rSetzt die Wartezeit auf 0");
- msg(player, "§6 - setxp <name> <level> <xp> §rFür die aktuelle Klasse eines Spielers");
- msg(player, "§6 - setgoldatm <gold> [player] §rSetzt das Gold eines Spielers");
- msg(player, "§6 - setgoldbank <gold> [player] §rSetzt das Gold eines Spielers");
- msg(player, "§6 - setguildgold <gildenid> <gold> §rSetzt das Gold einer Gilde");
- msg(player, "§6 - setguildelo <gildenid> <elo> §rSetzt den Einfluss einer Gilde");
- msg(player, "§6 - setguildname <gildenid> <name> §rSetzt den Namen neu");
- msg(player, "§6 - tp <gildenid> §rTp zum Gildenblock der Gilde");
- }
- goto("wait");
- }
- arg0 = text.toLowerCase(list.getIndex(args, 0));
- if(set.contains(gcommandsset, arg0)) {
- if(!isPlayerInGuild(player)) {
- speakPrefix(player, fehlerpräfix, "§rFür diesen Befehl musst du einer Gilde angehören");
- goto("wait");
- }
- }
- if(arg0 == "create") {
- if(loc.distance(player_loc, gildenvillagerloc) > 8) {
- speakPrefix(player, fehlerpräfix, "§rDieser Befehl geht nur neben dem Gildenvillager");
- goto("wait");
- }
- if(size != 3) {
- speakPrefix(player, commandspräfix, "§r/gilde create <name> <tag>");
- goto("wait");
- }
- if(isPlayerInGuild(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu bist bereits in einer Gilde");
- goto("wait");
- }
- gildenname = list.getIndex(args, 1);
- if(text.length(gildenname) > 20) {
- speakPrefix(player, fehlerpräfix, "§rDer Gildenname darf maximal 20 Zeichen lang sein");
- goto("wait");
- }
- if(!text.onlyletters(gildenname)) {
- speakPrefix(player, fehlerpräfix, "§rDer Gildenname darf nur Buchstaben enthalten");
- goto("wait");
- }
- if(isExistingGuildName(gildenname)) {
- speakPrefix(player, fehlerpräfix, "§rDieser Gildenname existiert bereits");
- goto("wait");
- }
- gold_atm = getGoldAtm(player);
- if(gold_atm < buypricegblock) {
- speakPrefix(player, fehlerpräfix, "§rDu besitzt nicht genug Gold");
- goto("wait");
- }
- gilden_tag = list.getIndex(args, 2);
- if(text.length(gilden_tag) > 3) {
- speakPrefix(player, fehlerpräfix, "§rDer Gildentag darf maximal 3 Zeichen lang sein");
- goto("wait");
- }
- if(!text.onlyletters(gilden_tag)) {
- speakPrefix(player, fehlerpräfix, "§rDer Gildentag darf nur Buchstaben enthalten");
- goto("wait");
- }
- subGoldAtm(player, buypricegblock);
- nextid = getNewGuildId();
- g_block = read.item("km:guild_block");
- lore_list = list.new();
- list.add(lore_list, gildenname);
- list.add(lore_list, gilden_tag);
- list.add(lore_list, text.number(nextid));
- item.setLore(g_block, lore_list);
- player.giveItem(player, g_block);
- speakPrefix(player, gildepräfix, "§rGilde erfolgreich erstellt");
- goto("wait");
- }
- if(arg0 == "rename") {
- if(size != 3) {
- speakPrefix(player, commandspräfix, "§r/gilde rename <name> <tag>");
- goto("wait");
- }
- gildenname = list.getIndex(args, 1);
- if(text.length(gildenname) > 20) {
- speakPrefix(player, fehlerpräfix, "§rDer Gildenname darf maximal 20 Zeichen lang sein");
- goto("wait");
- }
- if(!text.onlyletters(gildenname)) {
- speakPrefix(player, fehlerpräfix, "§rDer Gildenname darf nur Buchstaben enthalten");
- goto("wait");
- }
- if(isExistingGuildName(gildenname)) {
- speakPrefix(player, fehlerpräfix, "§rDieser Gildenname existiert bereits");
- goto("wait");
- }
- gilden_tag = list.getIndex(args, 2);
- if(text.length(gilden_tag) > 3) {
- speakPrefix(player, fehlerpräfix, "§rDer Gildentag darf maximal 3 Zeichen lang sein");
- goto("wait");
- }
- if(!text.onlyletters(gilden_tag)) {
- speakPrefix(player, fehlerpräfix, "§rDer Gildentag darf nur Buchstaben enthalten");
- goto("wait");
- }
- if(isPlayerInGuild(player)) {
- gilden_id = guild.getId(player);
- gildenkonto = getGuildGold(gilden_id);
- if(gildenkonto < 1000) {
- speakPrefix(player, fehlerpräfix, concat("§rDeine Gilde hat nur ", text.number(gildenkonto), " von 1000 Gold"));
- goto("wait");
- }
- setGuildGold(gilden_id, gildenkonto - 1000);
- setGuildName(gilden_id, gildenname);
- plot = getGuildPlot(gilden_id);
- setPlotName(plot, gildenname);
- nachricht = concat("§rDie Gilde wurde in §7", gildenname, "§r umbenannt");
- sendGuildMessage(gilden_id, gildepräfix, nachricht, false);
- //Gilden-Tag bei Spielern ändern
- guild_list = getOnlineGuildPlayers(gilden_id);
- for(i = 0; i < list.getSize(guild_list); i++) {
- p = list.getIndex(guild_list, i);
- class = guild.getClass(p);
- if(class != "none") {
- level = guild.getLevel(p);
- } else {
- level = null;
- }
- setHeadName(p);
- }
- } else {
- item = entity.getEquip(player, "hand");
- if(item.getType(item) != "km:guild_block") {
- speakPrefix(player, fehlerpräfix, "§rHalte den Gildenblock in der Hand");
- goto("wait");
- }
- lore_list = item.getLore(item);
- list.setIndex(lore_list, 0, gildenname);
- list.setIndex(lore_list, 1, gilden_tag);
- item.setLore(item, lore_list);
- speakPrefix(player, fehlerpräfix, "§rName erfolgreich geändert");
- }
- goto("wait");
- }
- if(arg0 == "newpos") {
- if(!isPlayerInGuild(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu bist in keiner Gilde");
- goto("wait");
- }
- if(!isLeader(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu bist nicht der Leiter der Gilde");
- goto("wait");
- }
- gilden_id = guild.getId(player);
- if(checkIfGuildInFight(gilden_id)) {
- speakPrefix(player, fehlerpräfix, "§rDeine Gilde befindet sich im Kampf");
- cancel = true;
- goto("wait");
- }
- gildenkonto = getGuildGold(gilden_id);
- if(gildenkonto < 500) {
- speakPrefix(player, fehlerpräfix, concat("§rDeine Gilde hat nur ", text.number(gildenkonto), " Gold. Es werden aber 500 benötigt"));
- cancel = true;
- goto("wait");
- }
- player_loc = entity.getLocation(player);
- block_list = getAllGuildBlocks();
- oldpos = getGuildBlock(gilden_id);
- list.remove(block_list, oldpos); //Eigener bestehender Block wird nicht berücksichtigt
- for(i = 0; i < list.getSize(block_list); i++) {
- distance = loc.distance(list.getIndex(block_list, i), player_loc);
- if(distance < 1100) {
- speakPrefix(player, fehlerpräfix, concat("§rGildenblöcke müssen mindestens 1100 Blöcke voneinander entfernt sein (Aktuell: ", text.number(math.roundUp(distance)), ")"));
- cancel = true;
- goto("wait");
- }
- }
- if(!checkGuildBlockArea(player_loc)) {
- speakPrefix(player, fehlerpräfix, "§rIm Bereich von 5 Blöcken seitlich und 7 Blöcken nach oben dürfen sich keine anderen Blöcke befinden");
- cancel = true;
- goto("wait");
- }
- bloc = loc.mod(player_loc, 0, -1, 0);
- if(!block.isSolid(bloc)) {
- speakPrefix(player, fehlerpräfix, "§rDer Block unter dem Gildenblock muss ein solider Block sein");
- cancel = true;
- goto("wait");
- }
- btype = block.getType(bloc);
- if(block.hasTag(leaves_tag, block.get(bloc))) {
- speakPrefix(player, fehlerpräfix, "§rDer Block unter dem Gildenblock darf kein Laub sein");
- cancel = true;
- goto("wait");
- }
- if(set.contains(richblocks, btype)) {
- speakPrefix(player, fehlerpräfix, "§rDer Block unter dem Gildenblock darf kein wertvoller Block sein");
- cancel = true;
- goto("wait");
- }
- //Neue Location setzen
- w = loc.getCoord(player_loc, "w");
- x = loc.getCoord(player_loc, "bx");
- y = loc.getCoord(player_loc, "by");
- z = loc.getCoord(player_loc, "bz");
- newpos = loc.new(gpvpworld, x, y, z);
-
- x1 = x - 150;
- x2 = x + 150;
- z1 = z - 150;
- z2 = z + 150;
- gs_edge1 = loc.new(gpvpworld, x1, 0, z1);
- gs_edge2 = loc.new(gpvpworld, x2, 255, z2);
- //Überschneidungen suchen
- if(doesPlotIntersect(gs_edge1, gs_edge2)) {
- speakPrefix(player, fehlerpräfix, "§rIm Gebiet herrscht bereits eine andere Gilde");
- cancel = true;
- goto("wait");
- }
-
- //Plot anpassen
- plot = getGuildPlot(gilden_id);
- changePlotEdges(plot, gs_edge1, gs_edge2);
- removeMoveArea(gilden_id);
- //Move-Gebiet erstellen
- createMoveArea(gilden_id, newpos);
- //Aktion bezahlen
- setGuildGold(gilden_id, gildenkonto - 500);
-
- //Alten Block entfernen
- block.set(oldpos, "minecraft:air");
- removeGuildBlockArea(oldpos);
- map.remove(g_block_entities, oldpos);
- text_ent = entity.get(oldpos, 3, "me.km.entities.EntityNobody");
- if(text_ent == null) {
- list.add(text_ent_to_remove, loc.mod(oldpos, 0.5, 1.5, 0.5));
- } else {
- entity.remove(text_ent);
- }
- //Obsidian-Plattform entfernen
- y = loc.getY(oldpos) - 1;
- x1 = loc.getX(oldpos) - 5;
- z1 = loc.getZ(oldpos) - 5;
- x2 = loc.getX(oldpos) + 5;
- z2 = loc.getZ(oldpos) + 5;
- iter = loc.iterator(loc.getWorld(oldpos), x1, y, z1, x2, y, z2);
- while(hasNext(iter)) {
- block.set(next(iter), "minecraft:air");
- }
-
- //Neuen Block setzen
- block.set(newpos, "km:guild_block");
- setGuildBlock(gilden_id, block_loc);
- setGuildBlockArea(newpos);
- text_ent = entity.spawn("km:nobody", loc.mod(newpos, 0.5, 1.5, 0.5), "{NoGravity:true}");
- entity.setName(text_ent, concat("200/200 §c❤\n§r[§6", getGuildName(gilden_id), "§r]"));
- map.add(g_block_entities, newpos, text_ent);
-
- speakPrefix(player, gildepräfix, "§rDer Gildenblock wurde erfolgreich umgesetzt");
- goto("wait");
- }
- if(arg0 == "home") {
- gilden_id = guild.getId(player);
- if(!isPlayerInGuild(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu bist in keiner Gilde");
- goto("wait");
- }
- if(arte_loc_type == "player") {
- if(arte_yet_uuid == player.getUuid(player)) {
- speakPrefix(player, fehlerpräfix, "Als Artefakt-Träger darfst du dich nicht teleportieren");
- goto("wait");
- }
- }
- if(checkForEnimies(player)) {
- cancelCauseEnimy();
- goto("wait");
- }
- location = getGuildBlock(gilden_id);
- teleportPlayer(player, loc.mod(location, 0.5, 1.1, 0.5), true);
- elo = getGuildElo(gilden_id);
- gold = getGuildGold(gilden_id);
- //Gildenextra: Siedlung
- if(elo >= 1000 && gold >= 5000) {
- player.setHunger(player, 20);
- player.setSaturation(player, 5);
- }
- //Gildenextra: Schnellstart
- if(elo >= 3000 && gold >= 20000) {
- entity.addEffect(player, "speed", 200, 3);
- }
- goto("wait");
- }
- if(arg0 == "setxp") {
- if(!isGameMod(player)) {
- speakPrefix(player, fehlerpräfix, "§rNur für Gamemaster");
- goto("wait");
- }
- if(size != 4) {
- speakPrefix(player, commandspräfix, "/g setxp <spieler> <level> <xp>");
- goto("wait");
- }
- p = read.player(list.getIndex(args, 1));
- if(p == null) {
- speakPrefix(player, fehlerpräfix, "§rDer angegebene Spieler muss online sein");
- goto("wait");
- }
- level = list.getIndex(args, 2);
- if(!isDouble(level)) {
- speakPrefix(player, fehlerpräfix, "Zahl erwartet");
- goto("wait");
- }
- if(level <= 0) {
- level = 1;
- }
- xp = list.getIndex(args, 3);
- if(!isDouble(xp)) {
- speakPrefix(player, fehlerpräfix, "Zahl erwartet");
- goto("wait");
- }
- class = guild.getClass(p);
- if(class != "none") {
- guild.setLevel(p, level);
- guild.setXp(p, xp);
- displayclass(p, class);
- displaylevel(p, level);
- displayxp(p, level, xp);
- setManaMax(p, calcManaMax(class, level));
- displaymana(p);
- setHeadName(p);
- }
- speakPrefix(player, commandspräfix, "§rÄnderungen durchgeführt");
- goto("wait");
- }
- if(arg0 == "setgoldatm") {
- if(!isGameMod(player)) {
- speakPrefix(player, fehlerpräfix, "§rNur für Gamemaster");
- goto("wait");
- }
- if(size < 2 || size > 3) {
- speakPrefix(player, commandspräfix, "/g setgoldatm <gold> [player]");
- goto("wait");
- }
- gold = list.getIndex(args, 1);
- if(!isDouble(gold)) {
- speakPrefix(player, fehlerpräfix, "Zahl erwartet");
- goto("wait");
- }
- p = player;
- p_name = player_name;
- if(size == 3) {
- p_name = list.getIndex(args, 2);
- if(!checkIfEverOnline(p_name)) {
- speakPrefix(player, fehlerpräfix, "§rDieser Spieler war noch nie online");
- goto("wait");
- }
- p = read.player(p_name);
- p_name = player.getName(p);
- }
- setGoldAtm(p, gold);
- if(p != null) {
- displaygold(p, gold);
- }
- speakPrefix(player, gildepräfix, concat("Gold für ", p_name, " auf ", text.number(gold), " gesetzt"));
- goto("wait");
- }
- if(arg0 == "setgoldbank") {
- if(!isGameMod(player)) {
- speakPrefix(player, fehlerpräfix, "§rNur für Gamemaster");
- goto("wait");
- }
- if(size < 2 || size > 3) {
- speakPrefix(player, commandspräfix, "/g setgoldbank <gold> [player]");
- goto("wait");
- }
- gold = list.getIndex(args, 1);
- if(!isDouble(gold)) {
- speakPrefix(player, fehlerpräfix, "Zahl erwartet");
- goto("wait");
- }
- if(size == 3) {
- p_name = list.getIndex(args, 2);
- if(!checkIfEverOnline(p_name)) {
- speakPrefix(player, fehlerpräfix, "§rDieser Spieler war noch nie online");
- goto("wait");
- }
- }
- setGoldBank(p_name, gold);
- speakPrefix(player, gildepräfix, concat("Gold für ", p_name, " auf ", text.number(gold), " gesetzt"));
- goto("wait");
- }
- if(arg0 == "ad") {
- if(size < 2) {
- speakPrefix(player, commandspräfix, "/g ad <nachricht>");
- } else {
- //Check auf 2 Gold
- coinsnow = getGoldAtm(player);
- if(coinsnow < 2) {
- speakPrefix(player, fehlerpräfix, "§rDu besitzt nicht genug Gold dafür");
- goto("wait");
- }
- //Cooldown 180 Sek Check
- player_id = player.getId(player);
- lasttime = map.get(adcooldown, player_id);
- nowtime = time.getMillis();
- if(lasttime != null) {
- difftime = nowtime - lasttime;
- if(difftime < 180000) { //180 Sekunden
- speakPrefix(player, fehlerpräfix, text.number(math.roundDown(difftime / 1000)), " von 180 Sekunden vergangen");
- goto("wait");
- }
- }
- //endgültige Bearbeitung
- map.add(adcooldown, player_id, nowtime);
- subGoldAtm(player, 2);
- nachricht = text.concatList(args, " ", 1, size - 1);
- sendWorldMessage("§6Handel", concat("§6", nachricht));
- }
- goto("wait");
- }
- if(arg0 == "mail") {
- gilden_id = guild.getId(player);
- if(!isLeaderOrOfficer(player)) {
- speakPrefix(player, fehlerpräfix, "§rNur für Gildenleiter bzw. Offiziere");
- goto("wait");
- }
- sendGuildMail(player.getName(player), gilden_id, text.concatList(args, " ", 1, size - 1));
- goto("wait");
- }
- if(arg0 == "msg") {
- gilden_id = guild.getId(player);
- nachricht = concat("§e", player_name, "§r ", text.concatList(args, " ", 1, size - 1));
- sendGuildMessage(gilden_id, gildepräfix, nachricht, false);
- goto("wait");
- }
- if(arg0 == "fight") {
- if(!isPlayerInGuild(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu bist in keiner Gilde");
- goto("wait");
- }
- if(!isLeaderOrOfficer(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu bist kein Leiter oder Offizier deiner Gilde");
- goto("wait");
- }
- list = plot.get(entity.getLocation(player));
- plot = list.getIndex(list, 0);
- plot_id = plot.getId(plot);
- gilden_id = getGuildIdFromPlotId(plot_id);
- if(gilden_id == null) {
- speakPrefix(player, fehlerpräfix, "§rDu befindest dich auf keinem Gildengebiet");
- goto("wait");
- }
- own_gilden_id = guild.getId(player);
- if(gilden_id == own_gilden_id) {
- speakPrefix(player, fehlerpräfix, "§rDu kannst dich nicht selbst angreifen");
- goto("wait");
- }
- if(checkIfGuildInFight(own_gilden_id)) {
- speakPrefix(player, fehlerpräfix, "§rDeine Gilde befindet sich im Kampf");
- goto("wait");
- }
- if(checkIfGuildInFight(gilden_id)) {
- speakPrefix(player, fehlerpräfix, "§rDiese Gilde befindet sich gerade in einem Kampf");
- goto("wait");
- }
- nextattacktime = getGuildSafetime(gilden_id);
- if(time.getMillis() < nextattacktime) {
- minutes = math.round((nextattacktime - time.getMillis()) / 60000);
- if(minutes < 60) {
- speakPrefix(player, fehlerpräfix, "§rDiese Gilde kann erst in ", minutes, " min angegriffen werden");
- } else {
- hours = text.number(math.roundDown(minutes / 60));
- minutes = text.number(minutes % 60);
- speakPrefix(player, fehlerpräfix, "§rDiese Gilde kann erst in ", hours, " h und ", minutes, " min angegriffen werden");
- }
- goto("wait");
- }
- own_list = getOnlineGuildPlayerIds(own_gilden_id);
- enimies_list = getOnlineGuildPlayerIds(gilden_id);
- own_online = list.getSize(own_list);
- enimies_online = list.getSize(enimies_list);
- set.new(fightset);
- for(i = 0; i < list.getSize(own_list); i++) {
- player_id = list.getIndex(own_list, i);
- set.add(fightset, player_id);
- }
- for(i = 0; i < list.getSize(enimies_list); i++) {
- player_id = list.getIndex(enimies_list, i);
- set.add(fightset, player_id);
- }
- //testphase anfang
- if(enimies_online < 1 && own_online < 1) {
- speakPrefix(player, fehlerpräfix, "§rFür die Testphase muss je Gilde 1 Spieler online sein.");
- goto("wait");
- }
- /*if(enimies_online < 3) {
- speakPrefix(player, fehlerpräfix, "§rEs müssen mindestens drei Mitglieder der anzugreifenden Gilde online sein");
- goto("wait");
- }
- if(enimies_online / own_online < 0.8) {
- speakPrefix(player, fehlerpräfix, "§rDas Verteidiger/Angreifer-Verhältnis muss mindestens 0,8 betragen");
- goto("wait");
- }*/
- //testphase ende
- gfights = getScriptVar("gfights");
- array = array.new(4);
- array[0] = gilden_id;
- array[1] = own_gilden_id;
- array[2] = plot_id;
- array[3] = fightset;
- list.add(gfights, array);
- setScriptVar("gfights", gfights);
- map.add(fightplayers, plot_id, fightset);
- map.add(gstatus, plot_id, 0);
- //testphase
- //map.add(clicks, getGuildBlock(gilden_id), 200);
- map.add(clicks, getGuildBlock(gilden_id), 10);
- map.add(blocktime, gilden_id, time.getMillis());
- name = getGuildName(gilden_id);
- own_name = getGuildName(own_gilden_id);
-
- setGuildSafetime(own_gilden_id, time.getMillis()); //Schutzzeit der Angreifer-Gilde aufheben
-
- nachricht = concat("§cDeine Gilde befindet sich nun im Kampf mit ", name);
- sendGuildMessage(own_gilden_id, gildepräfix, nachricht, false);
- subtitle = concat("§cIhr greift ", getGuildName(gilden_id), " an");
- sendGuildTitle(own_gilden_id, "§4Kampf", subtitle);
-
- nachricht = concat("§cDie Gilde ", own_name, " hat euch soeben den Krieg erklärt!");
- sendGuildMessage(gilden_id, gildepräfix, nachricht, false);
- subtitle = concat("§cIhr werdet von ", own_name, " angegriffen");
- sendGuildTitle(gilden_id, "§4Kampf", subtitle);
-
- list.add(checkwinlist, plot_id);
- sgoto(72000, "checkdefendwin"); //60 Minuten
- goto("wait");
- }
- if(arg0 == "steal") {
- own_gilden_id = guild.getId(player);
- if(!isPlayerInGuild(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu bist in keiner Gilde");
- goto("wait");
- }
- if(!checkIfAttacker(own_gilden_id)) {
- speakPrefix(player, fehlerpräfix, "§rDeine Gilde greift niemanden an (§6/g fight§r)!");
- goto("wait");
- }
- gilden_id = getOppFighter(own_gilden_id);
- plot_id = getFightPlot(own_gilden_id);
- if(map.contains(fightplayers, plot_id)) {
- fightset = map.get(fightplayers, plot_id);
- if(!set.contains(fightset, player.getId(player))) {
- speakPrefix(player, fehlerpräfix, "§rDu nimmmst nicht am Kampf deiner Gilde teil");
- goto("wait");
- }
- }
- if(map.get(gstatus, plot_id) == 0) {
- speakPrefix(player, fehlerpräfix, "§rDu kannst diesen Befehl erst verwenden, wenn der Gildenblock zerstört wurde");
- goto("wait");
- }
- for(i = 0; i < list.getSize(stealers); i++) {
- temparray = list.getIndex(stealers, i);
- p_name = temparray[0];
- if(player_name == p_name) {
- speakPrefix(player, fehlerpräfix, "§rDu stiehlst bereits!");
- goto("wait");
- }
- }
- ploc = entity.getLocation(player);
- x = text.number(loc.getCoord(ploc, "bx"));
- y = text.number(loc.getCoord(ploc, "by"));
- z = text.number(loc.getCoord(ploc, "bz"));
- nachricht = concat("§cAus der Schatzkammer wird Gold gestohlen!");
- sendGuildMessage(gilden_id, gildepräfix, nachricht, false);
- nachricht = concat("§7", player_name, "§r ", x, " / ", y, " / ", z);
- sendGuildMessage(gilden_id, gildepräfix, nachricht, false);
- entity.addEffect(player, "weakness", 600, 4);
- entity.addEffect(player, "slowness", 600, 5);
- temparray = array.new(5);
- temparray[0] = player_name;
- temparray[1] = ploc;
- temparray[2] = 0;
- temparray[3] = own_gilden_id;
- temparray[4] = gilden_id;
- list.add(stealers, temparray);
- sgoto(100, "stealchecker"); //5 Sekunden
- speakPrefix(player, fehlerpräfix, "§rDu versuchst Gold zu stehlen!");
- speakPrefix(player, fehlerpräfix, "§rBewege dich nicht vom Fleck!");
- goto("wait");
- }
- if(arg0 == "search") {
- if(!isLeaderOrOfficer(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu bist kein Leiter oder Offizier deiner Gilde");
- goto("wait");
- }
- own_gilden_id = guild.getId(player);
- gildenkonto = getGuildGold(own_gilden_id);
- if(gildenkonto < 100) {
- speakPrefix(player, fehlerpräfix, concat("§rDeine Gilde hat nur ", text.number(gildenkonto), " von 100 Gold"));
- goto("wait");
- }
- setGuildGold(own_gilden_id, gildenkonto - 100);
- nachricht = concat(player_name, " hat eine Suche gestartet");
- sendGuildMessage(own_gilden_id, gildepräfix, nachricht, false);
- plot = getGuildPlot(own_gilden_id);
- gpvpworld = world.get(gpvpworld_name);
- world_list = players.toWorldList(gpvpworld);
- counter = 0;
- for(i = 0; i < list.getSize(world_list); i++) {
- p = list.getIndex(world_list, i);
- g_id = guild.getId(p);
- if(g_id != own_gilden_id) {
- ploc = entity.getLocation(p);
- list = plot.get(ploc);
- if(list.contains(list, plot)) {
- counter++;
- x = text.number(loc.getCoord(ploc, "bx"));
- y = text.number(loc.getCoord(ploc, "by"));
- z = text.number(loc.getCoord(ploc, "bz"));
- nachricht = concat("§7", player.getName(p), "§r ", x, " / ", y, " / ", z);
- sendGuildMessage(own_gilden_id, gildepräfix, nachricht, false);
- }
- }
- }
- if(counter == 0) {
- nachricht = concat("Keine Gegner am eigenen Gildengebiet erkannt");
- sendGuildMessage(own_gilden_id, gildepräfix, nachricht, false);
- }
- goto("wait");
- }
- if(arg0 == "nick") {
- if(size < 3) {
- speakPrefix(player, commandspräfix, "/g nick <player> <nickname>");
- goto("wait");
- }
- gilden_id = guild.getId(player);
- p_name = list.getIndex(args, 1);
- nickname = text.concatList(args, " ", 2, size - 1);
- if(!checkIfEverOnline(p_name)) {
- speakPrefix(player, fehlerpräfix, "§rDieser Spieler war noch nie online");
- goto("wait");
- }
- if(!isLeaderOrOfficer(player)) {
- speakPrefix(player, fehlerpräfix, "§rNur für Gildenleiter bzw. Offiziere");
- goto("wait");
- }
- if(!guild.isSame(p_name, player_name)) {
- speakPrefix(player, fehlerpräfix, "§rDieser Spieler ist nicht in deiner Gilde");
- goto("wait");
- }
- if(text.length(nickname) > 15) {
- speakPrefix(player, fehlerpräfix, "§rDer Nickname darf maximal 15 Zeichen lang sein");
- goto("wait");
- }
- setNick(p_name, nickname);
- speakPrefix(player, gildepräfix, concat("§rNickname §7", nickname, "§r für §7", p_name, "§r gesetzt"));
- goto("wait");
- }
- if(arg0 == "info") {
- if(size == 1) {
- if(!isPlayerInGuild(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu bist in keiner Gilde");
- goto("wait");
- }
- gilden_id = guild.getId(player);
- gilden_name = getGuildName(gilden_id);
- }
- if(size == 2) {
- arg1 = list.getIndex(args, 1);
- //Gilden-ID
- if(text.class(arg1) == "Double") {
- gilden_id = arg1;
- gilden_name = getGuildName(gilden_id);
- if(!isExistingGuildName(gilden_name)) {
- speakPrefix(player, fehlerpräfix, "§rDiese Gilde existiert nicht");
- goto("wait");
- }
- }
- //Gilden-Name
- else {
- gilden_name = arg1;
- gilden_id = getGuildIdFromName(gilden_name);
- if(gilden_id == null) {
- speakPrefix(player, fehlerpräfix, "§rDieser Gildenname existiert nicht");
- goto("wait");
- }
- }
- }
- templist = getGuildPlayers(gilden_id);
- list.new(adellist);
- list.new(officerslist);
- list.new(memberslist);
- for(i = 0; i < list.getSize(templist); i++) {
- p_id = list.getIndex(templist, i);
- p_name = player.getNameFromId(p_id);
- //Leiter ?
- if(isLeader(p_name)) {
- nick = getNick(p_name);
- if(nick == null) {
- leader = p_name;
- } else {
- leader = concat(nick, " ", p_name);
- }
- }
- //Offizier ?
- else {
- if(isOfficer(p_name)) {
- nick = getNick(p_name);
- if(nick == null) {
- list.add(officerslist, p_name);
- } else {
- list.add(officerslist, concat(nick, " ", p_name));
- }
- }
- //Adel ?
- else {
- if(isAdel(p_name)) {
- nick = getNick(p_name);
- if(nick == null) {
- list.add(adellist, p_name);
- } else {
- list.add(adellist, concat(nick, " ", p_name));
- }
- }
- //restliche Mitglieder
- else {
- nick = getNick(p_name);
- if(nick == null) {
- list.add(memberslist, p_name);
- } else {
- list.add(memberslist, concat(nick, " ", p_name));
- }
- }
- }
- }
- }
- if(list.getSize(officerslist) == 0) {
- officers = "-";
- } else {
- officers = text.concatList(officerslist, ", ", 0, list.getSize(officerslist) - 1);
- }
- if(list.getSize(adellist) == 0) {
- adel = "-";
- } else {
- adel = text.concatList(adellist, ", ", 0, list.getSize(adellist) - 1);
- }
- if(list.getSize(memberslist) == 0) {
- members = "-";
- } else {
- members = text.concatList(memberslist, ", ", 0, list.getSize(memberslist) - 1);
- }
- msg(player, concat("§6§lGilde §r", gilden_name, " (", getGuildTag(gilden_id), " #ID:", text.number(gilden_id), ")"));
- msg(player, "§6Leiter");
- msg(player, "§r", leader);
- msg(player, "§6Offiziere");
- msg(player, "§r", officers);
- msg(player, "§6Adlige");
- msg(player, "§r", adel);
- msg(player, "§6Mitglieder");
- msg(player, "§r", members);
- msg(player, "§6Einfluss");
- msg(player, "§r", text.number(getGuildElo(gilden_id)));
- if(size == 1) {
- msg(player, "§6Schatzkammer");
- msg(player, text.number(getGuildGold(gilden_id)));
- }
- if(perm.has(player, "isSnuviMaster")) {
- if(size == 2) {
- msg(player, "§6Schatzkammer");
- msg(player, text.number(getGuildGold(gilden_id)));
- }
- msg(player, "§6PlotId");
- msg(player, "§r", text.number(getGuildPlotId(gilden_id)));
- msg(player, "§6Gildenblock");
- msg(player, "§r", getGuildBlock(gilden_id));
- }
- goto("wait");
- }
- if(arg0 == "tp") {
- if(!isGameMod(player)) {
- speakPrefix(player, fehlerpräfix, "§rNur für Gamemaster");
- goto("wait");
- }
- if(size != 2) {
- speakPrefix(player, commandspräfix, "/g tp <gildenid>");
- goto("wait");
- }
- gilden_id = list.getIndex(args, 1);
- if(!isDouble(gilden_id)) {
- speakPrefix(player, fehlerpräfix, "Zahl erwartet");
- goto("wait");
- }
- gilden_name = getGuildName(gilden_id);
- if(gilden_name == null) {
- speakPrefix(player, fehlerpräfix, "§rDiese Gilde existiert nicht");
- goto("wait");
- }
- player.setGamemode(player, "spectator");
- teleportPlayer(player, loc.mod(getGuildBlock(gilden_id), 0, 1, 0), true);
- speakPrefix(player, gildepräfix, concat("§rDu wurdest zur Gilde §7", gilden_name, " §rteleportiert"));
- goto("wait");
- }
- if(arg0 == "setguildgold") {
- if(!isGameMod(player)) {
- speakPrefix(player, fehlerpräfix, "§rNur für Gamemaster");
- goto("wait");
- }
- if(size != 3) {
- speakPrefix(player, commandspräfix, "/g setguildgold <gildenid> <gold>");
- goto("wait");
- }
- gilden_id = list.getIndex(args, 1);
- if(!isDouble(gilden_id)) {
- speakPrefix(player, fehlerpräfix, "Zahl erwartet");
- goto("wait");
- }
- gold = list.getIndex(args, 2);
- if(!isDouble(gold)) {
- speakPrefix(player, fehlerpräfix, "Zahl erwartet");
- goto("wait");
- }
- gilden_name = getGuildName(gilden_id);
- if(gilden_name == null) {
- speakPrefix(player, fehlerpräfix, "§rDiese Gilde existiert nicht");
- goto("wait");
- }
- setGuildGold(gilden_id, gold);
- speakPrefix(player, gildepräfix, "§rSchatzkammer der Gilde wurde verändert");
- goto("wait");
- }
- if(arg0 == "setguildelo") {
- if(!isGameMod(player)) {
- speakPrefix(player, fehlerpräfix, "§rNur für Gamemaster");
- goto("wait");
- }
- if(size != 3) {
- speakPrefix(player, commandspräfix, "/g setguildelo <gildenid> <elo>");
- goto("wait");
- }
- gilden_id = list.getIndex(args, 1);
- if(!isDouble(gilden_id)) {
- speakPrefix(player, fehlerpräfix, "Zahl erwartet");
- goto("wait");
- }
- elo = list.getIndex(args, 2);
- if(!isDouble(elo)) {
- speakPrefix(player, fehlerpräfix, "Zahl erwartet");
- goto("wait");
- }
- if(elo < 0) {
- speakPrefix(player, fehlerpräfix, "Positive Zahl erwartet");
- goto("wait");
- }
- gilden_name = getGuildName(gilden_id);
- if(gilden_name == null) {
- speakPrefix(player, fehlerpräfix, "§rDiese Gilde existiert nicht");
- goto("wait");
- }
- setGuildElo(gilden_id, elo);
- speakPrefix(player, gildepräfix, "§rEinfluss der Gilde wurde verändert");
- goto("wait");
- }
- if(arg0 == "setguildname") {
- if(!isGameMod(player)) {
- speakPrefix(player, fehlerpräfix, "§rNur für Gamemaster");
- goto("wait");
- }
- if(size != 3) {
- speakPrefix(player, commandspräfix, "/g setguildname <gildenid> <name>");
- goto("wait");
- }
- gilden_id = list.getIndex(args, 1);
- if(!isDouble(gilden_id)) {
- speakPrefix(player, fehlerpräfix, "Zahl erwartet");
- goto("wait");
- }
- gilden_name = getGuildName(gilden_id);
- if(gilden_name == null) {
- speakPrefix(player, fehlerpräfix, "§rDiese Gilde existiert nicht");
- goto("wait");
- }
- gildenname = list.getIndex(args, 2);
- if(text.length(gildenname) > 20) {
- speakPrefix(player, fehlerpräfix, "§rDer Gildenname darf maximal 20 Zeichen lang sein");
- goto("wait");
- }
- if(!text.onlyletters(gildenname)) {
- speakPrefix(player, fehlerpräfix, "§rDer Gildenname darf nur Buchstaben enthalten");
- goto("wait");
- }
- if(isExistingGuildName(gildenname)) {
- speakPrefix(player, fehlerpräfix, "§rDieser Gildenname existiert bereits");
- goto("wait");
- }
- setGuildName(gilden_id, gildenname);
- speakPrefix(player, gildepräfix, "§rDer Name wurde geändert");
- goto("wait");
- }
- if(arg0 == "spawn") {
- if(arte_loc_type == "player") {
- if(arte_yet_uuid == player.getUuid(player)) {
- speakPrefix(player, fehlerpräfix, "Als Artefakt-Träger darfst du dich nicht teleportieren");
- goto("wait");
- }
- }
- if(checkForEnimies(player)) {
- cancelCauseEnimy();
- goto("wait");
- }
- teleportPlayer(player, gildenspawnloc, true);
- goto("wait");
- }
- if(arg0 == "gold" || arg0 == "xp") {
- gilden_id = guild.getId(player);
- toggleGoldOrXp(gilden_id);
- goto("wait");
- }
- if(arg0 == "class") {
- if(size != 2) {
- speakPrefix(player, commandspräfix, "/g class <class>");
- goto("wait");
- }
- class = list.getIndex(args, 1);
- classes = getScriptVar("gpvp_classes");
- if(!list.contains(classes, class)) {
- speakPrefix(player, fehlerpräfix, "Klasse nicht vorhanden");
- goto("wait");
- }
- //Hat der Spieler die Klasse bereits gewählt?
- if(guild.isActiveClass(player, class)) {
- speakPrefix(player, fehlerpräfix, "Klasse bereits gewählt");
- goto("wait");
- }
- //Neue Klasse aktivieren
- guild.setClass(player, class);
- displayclass(player, class);
- level = guild.getLevel(player);
- xp = guild.getXp(player);
- displaylevel(player, level);
- displayxp(player, level, xp);
- setManaAtm(player, 0);
- setManaMax(player, calcManaMax(class, level));
- displaymana(player);
- fillStacksBar(player, class);
- speakPrefix(player, gildepräfix, concat("Du bist nun ", class));
- gilden_id = guild.getId(player);
- gilden_tag = getGuildTag(gilden_id);
- setHeadName(player);
- goto("wait");
- }
- if(arg0 == "leave") {
- gilden_id = guild.getId(player);
- if(!isPlayerInGuild(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu bist in keiner Gilde");
- goto("wait");
- }
- if(checkIfGuildInFight(gilden_id)) {
- speakPrefix(player, fehlerpräfix, "§rDeine Gilde befindet sich im Kampf");
- goto("wait");
- }
- if(isLeader(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu musst zuerst jemand anderen mit /leader zum Leiter ernennen");
- goto("wait");
- }
- removePlayerFromGuild(player, false);
- //Spieler vom Gildengrundstück entfernen
- plot = getGuildPlot(gilden_id);
- removePlotPlayer(plot, player_name);
- speakPrefix(player, gildepräfix, "§rDu hast die Gilde verlassen");
- nachricht = concat("§7", player_name, "§r hat die Gilde verlassen");
- sendGuildMessage(gilden_id, gildepräfix, nachricht, false);
- goto("wait");
- }
- if(arg0 == "kick") {
- if(size != 2) {
- speakPrefix(player, commandspräfix, "/g kick <name>");
- goto("wait");
- }
- p_name = list.getIndex(args, 1);
- if(!isPlayerInGuild(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu bist in keiner Gilde");
- goto("wait");
- }
- if(!checkIfEverOnline(p_name)) {
- speakPrefix(player, fehlerpräfix, "§rDieser Spieler war noch nie online");
- goto("wait");
- }
- gilden_id = guild.getId(player);
- if(!isLeaderOrOfficer(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu bist kein Leiter oder Offizier deiner Gilde");
- goto("wait");
- }
- if(!guild.isSame(p_name, player_name)) {
- speakPrefix(player, fehlerpräfix, "§rDieser Spieler ist nicht in deiner Gilde");
- goto("wait");
- }
- if(checkIfGuildInFight(gilden_id)) {
- speakPrefix(player, fehlerpräfix, "§rDeine Gilde befindet sich im Kampf");
- goto("wait");
- }
- if(isLeader(p_name)) {
- speakPrefix(player, fehlerpräfix, "§rDer Leiter kann nicht entlassen werden");
- goto("wait");
- }
- if(isOfficer(player_name) && isOfficer(p_name)) {
- speakPrefix(player, fehlerpräfix, "§rDu kannst einen anderen Offizier nicht entlassen");
- goto("wait");
- }
- //Spieler vom Grundstück entfernen
- plot = getGuildPlot(gilden_id);
- removePlotPlayer(plot, p_name);
- //Spieler aus Gilde entfernen
- removePlayerFromGuild(p_name, true);
- sendmessage(p_name, gildepräfix, concat("§rDu wurdest aus der Gilde entlassen"), true);
- nachricht = concat("§7", p_name, "§r wurde aus der Gilde entlassen");
- sendGuildMessage(gilden_id, gildepräfix, nachricht, false);
- goto("wait");
- }
- if(arg0 == "disband") {
- gilden_id = guild.getId(player);
- if(!isPlayerInGuild(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu bist in keiner Gilde");
- goto("wait");
- }
- if(!isLeader(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu bist nicht der Leiter der Gilde");
- goto("wait");
- }
- if(checkIfGuildInFight(gilden_id)) {
- speakPrefix(player, fehlerpräfix, "§rDeine Gilde befindet sich im Kampf");
- goto("wait");
- }
- if(getGuildGold(gilden_id) != 0) {
- speakPrefix(player, fehlerpräfix, "§rDer Kontostand der Gilde muss 0 sein");
- goto("wait");
- }
- msg(player, "[", gildepräfix, "§r] Möchtest du die Gilde wirklich auflösen? ", text.click("§r[§cAuflösen§r]", concat("/gilde disband2")));
- goto("wait");
- }
- if(arg0 == "disband2") {
- gilden_id = guild.getId(player);
- if(!isPlayerInGuild(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu bist in keiner Gilde");
- goto("wait");
- }
- if(!isLeader(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu bist nicht der Leiter der Gilde");
- goto("wait");
- }
- if(checkIfGuildInFight(gilden_id)) {
- speakPrefix(player, fehlerpräfix, "§rDeine Gilde befindet sich im Kampf");
- goto("wait");
- }
- if(getGuildGold(gilden_id) != 0) {
- speakPrefix(player, fehlerpräfix, "§rDer Kontostand der Gilde muss 0 sein");
- goto("wait");
- }
- //Artefakt zurücksetzen, falls die Gilde das Artefakt besitzt
- if(arte_loc_type == "placed") {
- if(isOnGuildPlot(gilden_id, arte_yet_loc)) {
- arteresetcore();
- }
- }
- //Spieler entfernen
- templist = getGuildPlayers(gilden_id);
- for(i = 0; i < list.getSize(templist); i++) {
- p_id = list.getIndex(templist, i);
- removePlayerFromGuild(p_id, true);
- }
- //Gilde löschen
- deleteGuild(gilden_id);
- g_block = getGuildBlock(gilden_id);
- map.remove(g_block_entities, g_block);
- text_ent = entity.get(g_block, 3, "me.km.entities.EntityNobody");
- if(text_ent == null) {
- list.add(text_ent_to_remove, loc.mod(g_block, 0.5, 1.5, 0.5));
- } else {
- entity.remove(text_ent);
- }
- speakPrefix(player, gildepräfix, "§rDu hast die Gilde gelöscht");
- goto("wait");
- }
- if(arg0 == "reset") {
- if(!isGameAdmin(player)) {
- speakPrefix(player, fehlerpräfix, "§rNur §6DER EINE §rkann diesen Befehl ausführen");
- goto("wait");
- }
- //Alle Spieler in der Gildenpvp-Welt zum Spawn teleportieren
- gpvpworld = world.get(gpvpworld_name);
- worldlist = players.toWorldList(gpvpworld);
- for(i = 0; i < list.getSize(worldlist); i++) {
- p = list.getIndex(worldlist, i);
- player.clearInventory(p);
- display.reset(p);
- stacks.setActive(p, false);
- entity.setName(p, player.getName(p));
- teleportPlayer(p, serverspawn, true);
- }
-
- //Artefakt
- arte_yet_loc = read.location(ggv("SERVER", "arte_yet_loc"));
- if(arte_loc_type == "placed") {
- block.set(arte_yet_loc, "minecraft:air");
- }
-
- //Gildenblöcke und Grundstücke entfernen
- list = getAllGuildIds();
- list_size = list.getSize(list);
- for(i = 0; i < list_size; i++) {
- gilden_id = list.getIndex(list, i);
- location = getGuildBlock(gilden_id);
- block.set(location, "minecraft:air");
- plot = getGuildPlot(gilden_id);
- removePlot(plot, gpvpworld);
- }
- msg("dev", "§7Debug: ", text.number(list_size), " Gilden entfernt");
- //Datenbank leeren
- dropTables();
- dgv("SERVER", "gildencounter");
- dgv("SERVER", "artedaycounter");
- dgv("SERVER", "arte_yet_loc");
- msg("online", "Loading .");
- waitfor(20);
- msg("online", "14% Hässliche Gildenbasen abreißen");
- waitfor(20);
- msg("online", "Loading ..");
- msg("online", "45% Hässliche Gildenbasen abreißen");
- waitfor(20);
- msg("online", "Loading ...");
- msg("online", "79% Hässliche Gildenbasen abreißen");
- waitfor(20);
- msg("online", "Loading .");
- msg("online", "FINISHED Hässliche Gildenbasen abreißen");
- waitfor(20);
- msg("online", "Loading ..");
- msg("online", "8% Spawn neu konzipieren");
- waitfor(20);
- msg("online", "Loading ...");
- msg("online", "36% Spawn neu konzipieren");
- waitfor(20);
- msg("online", "Loading .");
- msg("online", "68% Spawn neu konzipieren");
- waitfor(20);
- msg("online", "Loading ..");
- msg("online", "99% Spawn neu konzipieren");
- waitfor(20);
- msg("online", "Loading completed");
- msg("online", "Wir behalten doch den alten :^)");
- waitfor(20);
- msg("online", "§6Gildenpvp §rwurde resettet. Ein neues §6Zeitalter §rbeginnt!");
-
- msg("dev", "§cScript neu starten");
- gpvpworld = world.get(gpvpworld_name);
- worldlist = players.toWorldList(gpvpworld);
- size = list.getSize(worldlist);
- if(size > 0) {
- msg("dev", "§7Debug: §cNoch ", text.number(size), " Spieler in der Welt!");
- }
- term();
- }
- if(arg0 == "resetnextjoin") {
- if(!isGameMod(player)) {
- speakPrefix(player, fehlerpräfix, "§rNur für Gamemaster");
- goto("wait");
- }
- if(size != 2) {
- speakPrefix(player, commandspräfix, "§r/gilde resetnextjoin <gildenid/gildenname>");
- goto("wait");
- }
- p_name = list.getIndex(args, 1);
- if(!checkIfEverOnline(p_name)) {
- speakPrefix(player, fehlerpräfix, "§rDieser Spieler war noch nie online");
- goto("wait");
- }
- setNextJoin(p_name, time.getMillis());
- speakPrefix(player, commandspräfix, "§rDer Spieler kann jetzt sofort einer Gilde beitreten");
- goto("wait");
- }
- if(arg0 == "resetsafetime") {
- if(!isGameMod(player)) {
- speakPrefix(player, fehlerpräfix, "§rNur für Gamemaster");
- goto("wait");
- }
- if(size != 2) {
- speakPrefix(player, commandspräfix, "§r/gilde resetsafetime <gildenid/gildenname>");
- goto("wait");
- }
- gilden_name = list.getIndex(args, 1);
- if(isDouble(gilden_name)) {
- gilden_name = getGuildName(gilden_name);
- }
- if(!isExistingGuildName(gilden_name)) {
- speakPrefix(player, fehlerpräfix, "§rDiese Gilde existiert nicht");
- goto("wait");
- }
- gilden_id = getGuildIdFromName(gilden_name);
- setGuildSafetime(gilden_id, time.getMillis());
- speakPrefix(player, commandspräfix, "§rDie Schutzzeit der Gilde wurde entfernt");
- goto("wait");
- }
- if(arg0 == "invite") {
- if(size != 2) {
- speakPrefix(player, commandspräfix, "/g invite <name>");
- goto("wait");
- }
- gilden_id = guild.getId(player);
- player_id = player.getId(player);
- if(!isPlayerInGuild(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu bist in keiner Gilde");
- goto("wait");
- }
- if(!isLeaderOrOfficer(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu bist kein Leiter oder Offizier deiner Gilde");
- goto("wait");
- }
- p_name = list.getIndex(args, 1);
- if(player_name == p_name) {
- speakPrefix(player, fehlerpräfix, "§rDu kannst dich nicht selbst einladen");
- goto("wait");
- }
- if(!checkIfEverOnline(p_name)) {
- speakPrefix(player, fehlerpräfix, "§rDieser Spieler war noch nie online");
- goto("wait");
- }
- if(!isOnline(p_name)) {
- speakPrefix(player, fehlerpräfix, "§rDer Eingeladene muss online sein");
- goto("wait");
- }
- p = read.player(p_name);
- if(isPlayerInGuild(p)) {
- speakPrefix(player, fehlerpräfix, "§rDieser Spieler ist bereits in einer Gilde");
- goto("wait");
- }
- if(isPlayerInGroup(p)) {
- speakPrefix(player, fehlerpräfix, "§rDieser Spieler ist in einer Gruppe");
- goto("wait");
- }
- p_id = player.getId(player.getUuid(p_name));
- if(hasInvitationFromThisGuild(p_id, gilden_id)) {
- speakPrefix(player, fehlerpräfix, "§rDieser Spieler hat bereits eine Einladung deiner Gilde erhalten");
- goto("wait");
- }
-
- gilden_name = getGuildName(gilden_id);
- addGuildInvitation(p_id, gilden_id, player_id);
-
- nachricht = concat("§r", p_name, " hat eine Einladung von deiner Gilde erhalten. Sie ist für 5 Minuten aktiv");
- sendGuildMessage(gilden_id, gildepräfix, nachricht, false);
- sendmessage(p_name, gildepräfix, concat("Du wurdest eingeladen, der Gilde ", gilden_name, " beizutreten"), true);
- msg(p_name, text.click("§r[§aAnnehmen§r]", concat("/gilde accept ", gilden_name)));
- sgoto(6000, "removeGuildInvitation"); //5 Minuten
- goto("wait");
- }
- if(arg0 == "accept") {
- if(size != 2) {
- speakPrefix(player, commandspräfix, "/g accept <name>");
- goto("wait");
- }
- if(isPlayerInGuild(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu bist bereits in einer Gilde");
- goto("wait");
- }
- if(isPlayerInGroup(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu bist in einer Gruppe");
- goto("wait");
- }
- gilden_name = list.getIndex(args, 1);
- if(!isExistingGuildName(gilden_name)) {
- speakPrefix(player, fehlerpräfix, "§rDiese Gilde existiert nicht");
- goto("wait");
- }
- player_id = player.getId(player);
- gilden_id = getGuildIdFromName(gilden_name);
- if(!hasInvitationFromThisGuild(player_id, gilden_id)) {
- speakPrefix(player, fehlerpräfix, "§rDu hast keine Einladung von dieser Gilde erhalten");
- goto("wait");
- }
- jointime = getNextJoin(player);
- if(time.getMillis() < jointime) {
- speakPrefix(player, fehlerpräfix, "§rDu musst insgesamt 12 Stunden warten, bis du wieder einer Gilde beitreten darfst");
- goto("wait");
- }
- if(getGuildSize(gilden_id) >= getGuildSizeMax(gilden_id)) {
- speakPrefix(player, fehlerpräfix, "§rDiese Gilde ist bereits voll");
- goto("wait");
- }
- //Spieler zum Grundstück hinzufügen
- plot = getGuildPlot(gilden_id);
- addPlotPlayer(plot, player_name);
-
- //Rang und Gildenid setzen
- guild.setId(player, gilden_id);
- setMember(player);
- setHeadName(player);
- nachricht = concat("§7", concat(player_name, "§r ist der Gilde beigetreten"));
- sendGuildMessage(gilden_id, gildepräfix, nachricht, false);
- speakPrefix(player, commandspräfix, "§rDu bist der Gilde beigetreten");
- goto("wait");
- }
- if(arg0 == "deposit") {
- if(size != 2) {
- speakPrefix(player, commandspräfix, "/g deposit <zahl>");
- goto("wait");
- }
- if(!isPlayerInGuild(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu bist in keiner Gilde");
- goto("wait");
- }
- gilden_id = guild.getId(player);
- player_loc = entity.getLocation(player);
- if(!isOnGuildPlot(gilden_id, player_loc)) {
- speakPrefix(player, fehlerpräfix, "Dafür musst du dich am Gildengebiet befinden");
- goto("wait");
- }
- betrag = list.getIndex(args, 1);
- if(!isDouble(betrag)) {
- speakPrefix(player, fehlerpräfix, "Zahl erwartet");
- goto("wait");
- }
- if(betrag < 0) {
- speakPrefix(player, fehlerpräfix, "Positive Zahl erwartet");
- goto("wait");
- }
- gold_atm = getGoldAtm(player);
- gildenkonto = getGuildGold(gilden_id);
- if(betrag > gold_atm) {
- speakPrefix(player, fehlerpräfix, "§rDu kannst nicht mehr überweisen, als du in deinem Geldbeutel hast");
- goto("wait");
- }
- subGoldAtm(player, betrag);
- setGuildGold(gilden_id, gildenkonto + betrag);
- nachricht = concat("§7", player_name, "§r hat §7", text.number(betrag), " Gold §rins Gildenkonto eingezahlt");
- sendGuildMessage(gilden_id, goldpräfix, nachricht, false);
- goto("wait");
- }
- if(arg0 == "withdraw") {
- if(size != 2) {
- speakPrefix(player, commandspräfix, "/g withdraw <zahl>");
- goto("wait");
- }
- if(!isPlayerInGuild(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu bist in keiner Gilde");
- goto("wait");
- }
- gilden_id = guild.getId(player);
- if(isMember(player_name)) {
- speakPrefix(player, fehlerpräfix, "§rNur der Leiter, die Offiziere und der Adel können Gold vom Gildenkonto abheben");
- goto("wait");
- }
- player_loc = entity.getLocation(player);
- if(!isOnGuildPlot(gilden_id, player_loc)) {
- speakPrefix(player, fehlerpräfix, "Dafür musst du dich am Gildengebiet befinden");
- goto("wait");
- }
- betrag = list.getIndex(args, 1);
- if(!isDouble(betrag)) {
- speakPrefix(player, fehlerpräfix, "Zahl erwartet");
- goto("wait");
- }
- if(betrag < 0) {
- speakPrefix(player, fehlerpräfix, "Positive Zahl erwartet");
- goto("wait");
- }
- gildenkonto = getGuildGold(gilden_id);
- if(!isDouble(gildenkonto)) {
- speakPrefix(player, fehlerpräfix, "Transaktion zu schnell");
- goto("wait");
- }
- if(betrag > gildenkonto) {
- speakPrefix(player, fehlerpräfix, "§rDu kannst nicht mehr abheben, als auf dem Gildenkonto ist");
- goto("wait");
- }
- if(checkIfGuildInFight(gilden_id)) {
- speakPrefix(player, fehlerpräfix, "§rDeine Gilde befindet sich im Kampf");
- goto("wait");
- }
- addGoldAtm(player, betrag);
- setGuildGold(gilden_id, gildenkonto - betrag);
- speakPrefix(player, goldpräfix, "§rTransaktion erfolgreich");
- goto("wait");
- }
- if(arg0 == "degrade") {
- if(size != 2) {
- speakPrefix(player, commandspräfix, "/g degrade <name>");
- goto("wait");
- }
- p_name = list.getIndex(args, 1);
- gilden_id = guild.getId(player);
- if(!isPlayerInGuild(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu bist in keiner Gilde");
- goto("wait");
- }
- if(!isLeaderOrOfficer(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu bist weder Leiter der Gilde noch ein Offizier");
- goto("wait");
- }
- if(!checkIfEverOnline(p_name)) {
- speakPrefix(player, fehlerpräfix, "§rDieser Spieler war noch nie online");
- goto("wait");
- }
- if(!guild.isSame(p_name, player_name)) {
- speakPrefix(player, fehlerpräfix, "§rDieser Spieler ist nicht in deiner Gilde");
- goto("wait");
- }
- if(player_name == p_name) {
- speakPrefix(player, fehlerpräfix, "§rDu kannst diesen Befehl nicht auf dich selbst anwenden");
- goto("wait");
- }
- own_rang = getRang(player);
- p_rang = getRang(p_name);
- if(own_rang == "Offizier") {
- if(p_rang != "Adel") {
- speakPrefix(player, fehlerpräfix, "§rDu kannst nur Adel degradieren");
- goto("wait");
- }
- }
- setMember(p_name);
- nachricht = concat("§r", p_name, " wurde degradiert");
- sendGuildMessage(gilden_id, gildepräfix, nachricht, false);
- goto("wait");
- }
- if(arg0 == "officer" || arg0 == "adel" || arg0 == "leader") {
- if(size != 2) {
- goto("wait");
- }
- p_name = list.getIndex(args, 1);
- gilden_id = guild.getId(player);
- if(!isPlayerInGuild(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu bist in keiner Gilde");
- goto("wait");
- }
- if(arg0 == "officer" || arg0 == "leader") {
- if(!isLeader(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu bist nicht Leiter der Gilde");
- goto("wait");
- }
- }
- if(arg0 == "adel") {
- if(!isLeaderOrOfficer(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu bist weder Leiter der Gilde noch ein Offizier");
- goto("wait");
- }
- }
- if(!checkIfEverOnline(p_name)) {
- speakPrefix(player, fehlerpräfix, "§rDieser Spieler war noch nie online");
- goto("wait");
- }
- if(!guild.isSame(p_name, player_name)) {
- speakPrefix(player, fehlerpräfix, "§rDieser Spieler ist nicht in deiner Gilde");
- goto("wait");
- }
- if(player_name == p_name) {
- speakPrefix(player, fehlerpräfix, "§rDu kannst diesen Befehl nicht auf dich selbst anwenden");
- goto("wait");
- }
- if(arg0 == "leader") {
- setLeader(p_name);
- nachricht = concat("§7", pname, "§r wurde zum Leiter der Gilde ernannt");
- sendGuildMessage(gilden_id, gildepräfix, nachricht, false);
- officers = getOfficersAmount(gilden_id);
- if(officers == getOfficersMax(gilden_id)) {
- setMember(player);
- speakPrefix(player, gildepräfix, "§rMaximale Anzahl an Offizieren bereits erreicht, daher bist du nun Mitglied");
- } else {
- setOfficer(player);
- speakPrefix(player, gildepräfix, "§rDu bist nun Offizier");
- }
- goto("wait");
- }
- if(arg0 == "adel") {
- if(isAdel(p_name)) {
- speakPrefix(player, fehlerpräfix, "§rDieser Spieler gehört bereits dem Adel an");
- goto("wait");
- }
- if(isLeaderOrOfficer(p_name)) {
- speakPrefix(player, fehlerpräfix, "§rDieser Spieler befindet sich bereits in einem höheren Rang");
- goto("wait");
- }
- adel = getAdelAmount(gilden_id);
- max_adel = getAdelMax(gilden_id);
- if(adel >= max_adel) {
- speakPrefix(player, fehlerpräfix, "§rEs können im Moment nicht mehr Adelige ernannt werden");
- goto("wait");
- }
- setAdel(p_name);
- nachricht = concat("§r", p_name, " ist nun ein Adeliger");
- sendGuildMessage(gilden_id, gildepräfix, nachricht, false);
- goto("wait");
- }
- if(arg0 == "officer") {
- if(isOfficer(p_name)) {
- speakPrefix(player, fehlerpräfix, "§rDieser Spieler ist bereits Offizier");
- goto("wait");
- }
- officers = getOfficersAmount(gilden_id);
- if(officers == getOfficersMax(gilden_id)) {
- speakPrefix(player, fehlerpräfix, "§rMaximale Anzahl an Offizieren bereits erreicht");
- goto("wait");
- }
- setOfficer(p_name);
- nachricht = concat("§7", p_name, "§r wurde zum Offizier ernannt");
- sendGuildMessage(gilden_id, gildepräfix, nachricht, false);
- }
- goto("wait");
- }
- speakPrefix(player, commandspräfix, "Command nicht erkannt. /gilde");
- }
- goto("wait");
- @checkdefendwin
- //Überprüfung, ob die Verteidigung erfolgreich war
- plot_id = list.getIndex(checkwinlist, 0);
- list.removeIndex(checkwinlist, 0);
- //Ist der Status noch immer 0 (Angriffsphase)? Dann haben die Verteiger gewonnen
- status = map.get(gstatus, plot_id);
- if(status == 0) {
- array = getFightArray(plot_id);
- defenderid = array[0];
- attackerid = array[1];
- nachricht = concat("§6", getGuildName(defenderid), "§r hat den Angriff von §6", getGuildName(attackerid), "§r erfolgreich verteidigt");
- sendGuildMessage(defenderid, gildepräfix, nachricht, false);
- sendGuildMessage(attackerid, gildepräfix, nachricht, false);
- //Schutzzeit für Verteiger setzen
- minutes = 450;
- setGuildSafetime(defenderid, time.getMillis() + minutes * 60000); //ms
- //Kampf aus Datenstruktur entfernen
- gfights = getScriptVar("gfights");
- list.remove(gfights, array);
- setScriptVar("gfights", gfights);
- map.remove(gstatus, plot_id);
- map.remove(fightplayers, plot_id);
- map.remove(clicks, getGuildBlock(defenderid));
- map.remove(blocktime, defenderid);
- }
- goto("wait");
- @stealends
- plot_id = list.getIndex(stealends, 0);
- list.removeIndex(stealends, 0);
- array = getFightArray(plot_id);
- defenderid = array[0];
- attackerid = array[1];
- nachricht = concat("§6", getGuildName(attackerid), "§r hat den Angriff gegen §6", getGuildName(defenderid), "§r gewonnen");
- sendGuildMessage(defenderid, gildepräfix, nachricht, false);
- nachricht = concat("§rVerlasst sofort das Gildengebiet, sonst ereilt euch der Tod");
- sendGuildMessage(attackerid, gildepräfix, nachricht, false);
- //Kampf aus Datenstruktur entfernen
- gfights = getScriptVar("gfights");
- list.remove(gfights, array);
- setScriptVar("gfights", gfights);
- map.remove(gstatus, plot_id);
- map.remove(fightplayers, plot_id);
- map.remove(clicks, getGuildBlock(defenderid));
- map.remove(blocktime, defenderid);
- //Verzögerte Steuerabrechnung, falls die Gilde im Kampf war
- if(list.contains(scheduledtax, defenderid)) {
- calculateTax(defenderid);
- list.remove(scheduledtax, defenderid);
- }
- goto("wait");
- @stealchecker
- temparray = list.getIndex(stealers, 0);
- list.removeIndex(stealers, 0);
- p_name = temparray[0];
- p_loc = temparray[1];
- status = temparray[2];
- own_gilden_id = temparray[3];
- gilden_id = temparray[4];
- p = read.player(p_name);
- if(p == null) {
- goto("wait");
- }
- if(loc.distance(p_loc, entity.getLocation(p)) < 1) {
- if(++status == 6) {
- //Distanz zum Gildenblock
- distance = loc.distance(p_loc, getGuildBlock(gilden_id));
- if(distance <= 25) {
- //Stehlrate: 2%
- steal_rate = 0.02;
- } elseif(distance > 25 && distance <= 50) {
- //Stehlrate: 1,5%
- steal_rate = 0.015;
- } else {
- //Stehlrate: 1%
- steal_rate = 0.01;
- }
- gildenkonto = getGuildGold(gilden_id);
- stolen_gold = gildenkonto * steal_rate;
- if(stolen_gold > 200) {
- stolen_gold = 200;
- } elseif(stolen_gold < 10) {
- stolen_gold = 10;
- }
- speakPrefix(p, gildepräfix, "§rDu hast §7", text.number(stolen_gold), " Gold §rgestohlen!");
- nachricht = concat("§7", p_name, "§r hat §7", text.number(stolen_gold), " Gold §rgestohlen!");
- sendGuildMessage(gilden_id, gildepräfix, nachricht, false);
- setGuildGold(gilden_id, gildenkonto - stolen_gold);
- setGuildGold(own_gilden_id, gildenkonto + stolen_gold);
- goto("wait");
- }
- temparray[2] = status;
- list.add(stealers, temparray);
- sgoto(100, "stealchecker"); //5 Sekunden
- } else {
- speakPrefix(p, gildepräfix, "§rStehlversuch gescheitert!");
- }
- goto("wait");
- @fishing
- class = guild.getClass(player);
- if(class != "none") {
- addXp(player, 150, true, false);
- xp = 150;
- goto("wait");
- }
- goto("wait");
- @inv_close
- if(inv_name == skill_cast_inv_name) {
- class = guild.getClass(player);
- fillStacksBar(player, class);
- speakPrefix(player, "§2Skills", "§rVeränderungen wurden gespeichert");
- goto("wait");
- }
- if(inv_name == "Verzaubern") {
- item = inv.getItem(inv, 0);
- item.drop(entity.getLocation(player), item);
- goto("wait");
- }
- goto("wait");
- @block_click
- if(block_type == "minecraft:chest") {
- //Daily Reward
- if(block_loc == dailyreward_chest_loc) {
- cancel = true;
- list = guild.getRewardList(player);
- for(i = 0; i < daysofmonth; i++) { //inv befüllen
- if(list.contains(list, i)) {
- type = "minecraft:minecart";
- } elseif(i + 1 >= actualday) {
- type = "minecraft:chest_minecart";
- } else {
- type = "minecraft:black_concrete";
- }
- inv.setItem(dailyrewardinv, i, read.item(type, 1, concat("§rTag ", text.number(i + 1))));
- }
- inv.open(dailyrewardinv, player, monthname);
- goto("wait");
- }
- //Kistensicherungen erstellen
- item = entity.getEquip(player, "hand");
- item_type = item.getType(item);
- if(item_type == "km:golden_key" || item_type == "km:silver_key" || item_type == "km:bronze_key" || item_type == "km:copper_key") {
- cancel = true;
- if(!isAPlot(block_loc)) {
- speakPrefix(player, chestpräfix, "Du bist nicht auf deinem Gildengebiet");
- goto("wait");
- }
- own_gilden_id = guild.getId(player);
- if(!isOnGuildPlot(own_gilden_id, block_loc)) {
- speakPrefix(player, chestpräfix, "Du bist nicht auf deinem Gildengebiet");
- goto("wait");
- }
- if(isALockedChest(block_loc)) {
- speakPrefix(player, chestpräfix, "Diese Kiste ist bereits gesichert");
- goto("wait");
- }
- chestloc2 = block.getSecChest(block_loc);
- if(item_type == "km:golden_key") {
- lockGuildChest(block_loc, own_gilden_id);
- if(chestloc2 != null) {
- lockGuildChest(chestloc2, own_gilden_id);
- }
- speakPrefix(player, chestpräfix, "Gildenkiste gesichert");
- } elseif(item_type == "km:silver_key") {
- lockOfficerChest(block_loc, own_gilden_id);
- if(chestloc2 != null) {
- lockOfficerChest(chestloc2, own_gilden_id);
- }
- speakPrefix(player, chestpräfix, "Offizierskiste gesichert");
- } elseif(item_type == "km:bronze_key") {
- lockAdelChest(block_loc, own_gilden_id);
- if(chestloc2 != null) {
- lockAdelChest(chestloc2, own_gilden_id);
- }
- speakPrefix(player, chestpräfix, "Adelskiste gesichert");
- } elseif(item_type == "km:copper_key") {
- lockPrivatChest(block_loc, player.getUuid(player));
- if(chestloc2 != null) {
- lockPrivatChest(chestloc2, player.getUuid(player));
- }
- speakPrefix(player, chestpräfix, "Privatkiste gesichert");
- }
- goto("wait");
- }
- //Kistensicherungen entfernen
- if(item_type == "minecraft:shears") {
- chestloc2 = block_loc;
- chestloc1 = block.getSecChest(chestloc2);
- own_gilden_id = guild.getId(player);
- if(map.contains(chest_guild, chestloc2)) {
- cancel = true;
- gilden_id = map.get(chest_guild, chestloc2);
- if(gilden_id != own_gilden_id) {
- speakPrefix(player, chestpräfix, concat("Die Kiste ist mit einem Gildenschloss der Gilde ", getGuildName(gilden_id), " versehen!"));
- goto("wait");
- }
- if(isLeaderOrOfficer(player)) {
- if(chestloc1 != null) {
- unlockGuildChest(chestloc1);
- }
- unlockGuildChest(chestloc2);
- speakPrefix(player, chestpräfix, "Gildenschloss entfernt");
- }
- goto("wait");
- }
- if(map.contains(chest_officer, chestloc2)) {
- cancel = true;
- gilden_id = map.get(chest_officer, chestloc2);
- if(gilden_id != own_gilden_id) {
- speakPrefix(player, chestpräfix, concat("Die Kiste ist mit einem Offiziersschloss der Gilde ", getGuildName(gilden_id), " versehen!"));
- goto("wait");
- }
- if(isLeaderOrOfficer(player)) {
- if(chestloc1 != null) {
- unlockOfficerChest(chestloc1);
- }
- unlockOfficerChest(chestloc2);
- speakPrefix(player, chestpräfix, "Offiziersschloss entfernt");
- }
- goto("wait");
- }
- if(map.contains(chest_adel, chestloc2)) {
- cancel = true;
- gilden_id = map.get(chest_adel, chestloc2);
- if(gilden_id != own_gilden_id) {
- speakPrefix(player, chestpräfix, concat("Die Kiste ist mit einem Adelsschloss der Gilde ", getGuildName(gilden_id), " versehen!"));
- goto("wait");
- }
- if(isLeaderOrOfficer(player)) {
- if(chestloc1 != null) {
- unlockAdelChest(chestloc1);
- }
- unlockAdelChest(chestloc2);
- speakPrefix(player, chestpräfix, "Adelsschloss entfernt");
- }
- goto("wait");
- }
- if(map.contains(chest_privat, chestloc2)) {
- cancel = true;
- uuid = map.get(chest_privat, chestloc2);
- //Gehört dem Spieler die Kiste?
- if(uuid == player.getUuid(player)) {
- if(chestloc1 != null) {
- unlockPrivatChest(chestloc1);
- }
- unlockPrivatChest(chestloc2);
- speakPrefix(player, chestpräfix, "Privatschloss entfernt");
- goto("wait");
- }
- //Ist der Spieler in derselben Gilde?
- if(guild.isSame(player_name, player.getName(uuid))) {
- //Ist der Spieler der Gildenleiter?
- if(isLeader(player)) {
- if(chestloc1 != null) {
- unlockPrivatChest(chestloc1);
- }
- unlockPrivatChest(chestloc2);
- speakPrefix(player, chestpräfix, "Privatschloss entfernt");
- goto("wait");
- }
- }
- speakPrefix(player, chestpräfix, concat("Die Kiste ist mit einem Privatschloss von ", player.getName(uuid), " versehen!"));
- goto("wait");
- }
- goto("wait");
- }
- //Kistensicherungen kontrollieren
- own_gilden_id = guild.getId(player);
- if(map.contains(chest_guild, block_loc)) {
- gilden_id = map.get(chest_guild, block_loc);
- if(gilden_id != own_gilden_id) {
- cancel = true;
- speakPrefix(player, chestpräfix, concat("Die Kiste ist mit einem Gildenschloss der Gilde ", getGuildName(gilden_id), " versehen!"));
- }
- goto("wait");
- }
- if(map.contains(chest_officer, block_loc)) {
- gilden_id = map.get(chest_officer, block_loc);
- if(gilden_id != own_gilden_id) {
- cancel = true;
- speakPrefix(player, chestpräfix, concat("Die Kiste ist mit einem Offiziersschloss der Gilde ", getGuildName(gilden_id), " versehen!"));
- goto("wait");
- }
- if(!isLeaderOrOfficer(player)) {
- cancel = true;
- speakPrefix(player, chestpräfix, "Die Kiste ist mit einem Offiziersschloss versehen!");
- goto("wait");
- }
- goto("wait");
- }
- if(map.contains(chest_adel, block_loc)) {
- gilden_id = map.get(chest_adel, block_loc);
- if(gilden_id != own_gilden_id) {
- cancel = true;
- speakPrefix(player, chestpräfix, concat("Die Kiste ist mit einem Adelsschloss der Gilde ", getGuildName(gilden_id), " versehen!"));
- }
- if(!isLeaderOrOfficer(player) && !isAdel(player)) {
- cancel = true;
- speakPrefix(player, chestpräfix, "Die Kiste ist mit einem Adelsschloss versehen!");
- goto("wait");
- }
- goto("wait");
- }
- if(map.contains(chest_privat, block_loc)) {
- uuid = map.get(chest_privat, block_loc);
- if(uuid != player.getUuid(player)) {
- cancel = true;
- speakPrefix(player, chestpräfix, concat("Die Kiste ist mit einem Privatschloss von ", player.getName(uuid), " versehen!"));
- }
- goto("wait");
- }
- goto("wait");
- }
- /*if(block_type == "minecraft:enchanting_table" && action == "right") {
- //Verzauberungsmenü
- cancel = true;
- lvl = player.getLevel(player);
- enchanting_menu = inv.new("000012000020000020000020000");
- inv.setItem(enchanting_menu, 1, read.item("km:arrow_right", 1, "§rAuswerten"));
- if(lvl >= 1) {
- inv.setItem(enchanting_menu, 2, read.item("minecraft:experience_bottle", 1, "§rLvl. 1"));
- } else {
- inv.setItem(enchanting_menu, 2, read.item("minecraft:gray_dye", 1, "§rLvl. 1"));
- }
- if(lvl >= 30) {
- inv.setItem(enchanting_menu, 3, read.item("minecraft:experience_bottle", 30, "§rLvl. 30"));
- } else {
- inv.setItem(enchanting_menu, 3, read.item("minecraft:gray_dye", 30, "§rLvl. 30"));
- }
- if(lvl >= 15) {
- inv.setItem(enchanting_menu, 4, read.item("minecraft:experience_bottle", 15, "§rLvl. 15"));
- } else {
- inv.setItem(enchanting_menu, 4, read.item("minecraft:gray_dye", 15, "§rLvl. 15"));
- }
- inv.open(enchanting_menu, player, "Verzaubern");
- map.add(enchanting_menus, player.getUuid(player), inv.getId(enchanting_menu));
- goto("wait");
- }*/
- if(block.hasTag(signs_tag, block)) {
- if(block_loc == answer42loc) {
- msg(player, "...the right answer is always 42");
- goto("wait");
- }
- if(block_loc == grabbyloc) {
- teleportPlayer(player, grabbyprisonloc, true);
- sendWorldMessage("§cGalgen", concat("§r", player_name, " hat sich als gierig erwiesen"));
- goto("wait");
- }
- goto("wait");
- }
- if(item.getType(entity.getEquip(player, "hand")) == "minecraft:diamond_pickaxe") {
- if(block_type == "km:guild_block") {
- plot_id = getPlotId(block_loc);
- if(!isAFightPlot(plot_id)) {
- goto("wait"); //Grundstück ist nicht in Gildenkampf verwickelt
- }
- defender_id = getGuildIdFromPlotId(plot_id);
- attacker_id = getOppFighter(defender_id);
- blockstatus = map.get(clicks, block_loc) - 1;
- if(blockstatus >= 0) {
- nowtime = time.getMillis();
- if(nowtime - map.get(blocktime, defender_id) >= 1000) {
- map.add(blocktime, defender_id, nowtime);
- nachricht = concat("§rDer Gildenblock hat noch §6", text.number(blockstatus), "§r/§6200 §rHaltbarkeit!");
- sendGuildMessage(attacker_id, gildepräfix, nachricht, false);
- //Gildenextra: Schatzwachen
- elo = getGuildElo(defender_id);
- gold = getGuildGold(defender_id);
- if(elo >= 250 && gold >= 1000) {
- sendGuildMessage(defender_id, gildepräfix, nachricht, false);
- }
- map.add(clicks, block_loc, blockstatus);
- text_ent = map.get(g_block_entities, oldpos);
- if(text_ent == null) {
- text_ent = entity.spawn("km:nobody", loc.mod(newpos, 0.5, 1.5, 0.5), "{NoGravity:true}");
- map.add(g_block_entities, block_loc, text_ent);
- }
- entity.setName(text_ent, concat(text.number(blockstatus), "/200 §c❤\n§r[§6", getGuildName(defender_id), "§r]"));
- if(blockstatus == 0) {
- nachricht = concat("§rDer Gildenblock wurde zerstört");
- sendGuildMessage(attacker_id, gildepräfix, nachricht, false);
- sendGuildMessage(defender_id, gildepräfix, nachricht, false);
- nachricht = concat("§rDie Angreifer haben nun 30 Minuten Zeit, Gold zu stehlen und Kisten zu knacken");
- sendGuildMessage(attacker_id, gildepräfix, nachricht, false);
- sendGuildMessage(defender_id, gildepräfix, nachricht, false);
- title = "§4Stehlphase";
- subtitle = concat("§rAuf die Kisten, fertig - stehlt!");
- sendGuildTitle(defender_id, title, subtitle);
- sendGuildTitle(attacker_id, title, subtitle);
- //Status des Gfights ändern
- map.add(gstatus, plot_id, 1);
- list.add(stealends, plot_id);
- sgoto(36000, "stealends"); //30 Minuten
- //Schutzzeit der Verteidiger-Gilde setzen
- minutes = 450;
- attacker_elo = getGuildElo(attacker_id);
- ratio = attacker_elo / elo;
- if(ratio < 0.5) {
- minutes += 120;
- } elseif(ratio < 0.8) {
- minutes += 180;
- } elseif(ratio < 1) {
- minutes += 240;
- } elseif(ratio < 1.2) {
- minutes += 300;
- } elseif(ratio < 1.4) {
- minutes += 420;
- } elseif(ratio < 1.7) {
- minutes += 540;
- } elseif(ratio < 2) {
- minutes += 600;
- } else {
- minutes += 720;
- }
- setGuildSafetime(defender_id, time.getMillis() + minutes * 60000); //ms
- }
- }
- }
- goto("wait");
- }
- if(block_type == "km:artefact") {
- nowtime = time.getMillis();
- if(nowtime - arte_time >= 1000) {
- arte_time = nowtime;
- arte_hp--;
- //Ist das Artefakt in der Ruine?
- arte_ent = entity.get(block_loc, 3, "me.km.entities.EntityNobody");
- if(block_loc == arte_main_loc) {
- if(arte_hp == 0) {
- sendWorldMessage(arte_präfix, concat("§x", player_name, "§r trägt nun das Artefakt"));
- arte_loc_type = "player";
- arte_yet_uuid = player.getUuid(player);
- block.set(block_loc, "minecraft:air");
- if(arte_ent != null) {
- entity.remove(arte_ent);
- }
- entity.remove(arte_ent);
- player.setHunger(player, 2);
- //Herzpartikel
- list.add(carry_arte_list, arte_yet_uuid);
- speakPrefix(player, arte_präfix, "Platziere das Artefakt auf deinem Gildengebiet mit /placearte");
- sgoto(72000, "checkcarryarte"); //60 Minuten
- } else {
- sendRadiusMessage(arte_präfix, concat("§rDas Artefakt hat noch §6", text.number(arte_hp), "§r/§6250 §rHaltbarkeit!"), block_loc, 200);
- if(arte_ent == null) {
- arte_ent = entity.spawn("km:nobody", loc.mod(block_loc, 0.5, 1.5, 0.5), "{NoGravity:true}");
- }
- entity.setName(arte_ent, concat(text.number(arte_hp), "/250 §c❤\n§r[§9Artefakt§r]"));
- }
- } else {
- //Wenn Artefakt in einem Gildengebiet ist
- own_gilden_id = guild.getId(player);
- list = plot.get(entity.getLocation(player));
- if(list.getSize(list) == 0) {
- msg(player, "Melde an marvinius: Artefakt steht auf keinem Grundstück");
- goto("wait");
- }
- plot = list.getIndex(list, 0);
- plot_id = plot.getId(plot);
- plot_gilden_id = getGuildIdFromPlotId(plot_id);
- if(own_gilden_id == plot_gilden_id) {
- if(!isLeader(player)) {
- goto("wait"); //Spieler der eigenen Gilde können den ArteBlock nicht zerstören, außer der Leiter
- }
- }
- if(arte_hp == 0) { //Direkter Reset in Arte-Ruine
- arteresetcore();
- } else {
- sendRadiusMessage(arte_präfix, concat("§rDas Artefakt hat noch §6", text.number(arte_hp), "§r/§610 §rHaltbarkeit!"), block_loc, 200);
- if(arte_ent == null) {
- arte_ent = entity.spawn("km:nobody", loc.mod(block_loc, 0.5, 1.5, 0.5), "{NoGravity:true}");
- }
- entity.setName(arte_ent, concat(text.number(arte_hp), "/10 §c❤\n§r[§9Artefakt§r]"));
- }
- }
- }
- }
- }
- goto("wait");
- @checkcarryarte
- uuid = list.getIndex(carry_arte_list, 0);
- list.removeIndex(carry_arte_list, 0);
- if(arte_loc_type == "player") {
- if(uuid == arte_yet_uuid) {
- //Spieler hat das Artefakt nach einer Stunde noch immer bei sich
- arteresetcore();
- }
- }
- goto("wait");
- @bucket_use
- player_loc = entity.getLocation(player);
- //Eimer können im Gildenblock-/Artefaktbereich nicht verwendet werden
- if(block_loc != null) {
- bucket_loc = block_loc;
- radius = loc.distance(block_loc, player_loc);
- while(block_loc == bucket_loc) {
- bucket_loc = getBlockLocation(player.getTarget(player, radius, false));
- radius -= 0.1;
- }
- if(set.contains(forbiddenblocks2, bucket_loc)) {
- speakPrefix(player, fehlerpräfix, "§rHier kannst du keine Eimer verwenden");
- cancel = true;
- goto("wait");
- }
- }
- //Während eines Gildenkampfes können Eimer am Kampfgrundstück nicht benutzt werden
- plot_id = getPlotId(player_loc);
- if(isAFightPlot(plot_id)) {
- speakPrefix(player, fehlerpräfix, "§rGildenkampf in Gange. Eimer nicht benutzbar");
- cancel = true;
- }
- goto("wait");
- @block_break
- //Quest
- player_uuid = player.getUuid(player);
- if(map.contains(gpvpquests, player_uuid)) {
- array = map.get(gpvpquests, player_uuid);
- quest_type = removeFormat(array[4]);
- if(quest_type == "Sammle") {
- age = block.getState(block_loc, age_property);
- if(age == null || age == 7) {
- type = array[0];
- if(block_type == type) {
- wort = array[1];
- amount = array[2];
- progress = ++array[3];
- speakPrefix(player, quests_präfix, concat(wort, " gesammelt: ", text.number(progress), "/", text.number(amount)));
- if(progress >= amount) {
- speakPrefix(player, quests_präfix, "Quest abgeschlossen");
- }
- }
- }
- }
- }
- //Überprüfung, ob ein Gildenblock/Artefakt abgebaut wird
- if(block_type == "km:guild_block" || block_type == "km:artefact") {
- speakPrefix(player, fehlerpräfix, "Artefakt und Gildenblock lassen sich nicht einfach so abbauen");
- cancel = true;
- goto("wait");
- }
- plot_id = getPlotId(block_loc);
- //Am Spawn wird nicht durch Code reingepfuscht, es gelten die normalen Baugegebenheiten
- if(isGuildSpawnId(plot_id)) {
- goto("wait");
- }
- //Wertvolle Blöcke/Erze können trotz Plot-Protection von fremden Grundstücken abgebaut werden
- if(set.contains(richblocks, block_type)) {
- cancel = false; //Aktiv erlauben
- }
- //XP-Vergabe für das Abbauen von Blöcken
- xp = map.getOrDefault(xpforblocks, block_type, 1);
- addXp(player, xp, false, false);
- //Überprüfung, ob ein Block unter einem der Gildenblöcke/dem Artefakt abgebaut wird
- if(set.contains(forbiddenblocks, block_loc)) {
- speakPrefix(player, fehlerpräfix, "§rBlock unter Artefakt/Gildenblock darf nicht abgebaut werden");
- cancel = true;
- goto("wait");
- }
- //Kistensicherungen
- if(block_type == "minecraft:chest") {
- own_gilden_id = guild.getId(player);
- if(map.contains(chest_guild, block_loc)) {
- cancel = true;
- gilden_id = map.get(chest_guild, block_loc);
- if(gilden_id != own_gilden_id) {
- speakPrefix(player, chestpräfix, concat("Die Kiste ist mit einem Gildenschloss der Gilde ", getGuildName(gilden_id), " versehen!"));
- goto("wait");
- }
- if(isLeaderOrOfficer(player)) {
- player.removeItem(player, item);
- speakPrefix(player, chestpräfix, "Entferne die Sicherung zuerst mit einer Schere");
- }
- goto("wait");
- }
- if(map.contains(chest_officer, block_loc)) {
- cancel = true;
- gilden_id = map.get(chest_officer, block_loc);
- if(gilden_id != own_gilden_id) {
- speakPrefix(player, chestpräfix, concat("Die Kiste ist mit einem Offiziersschloss der Gilde ", getGuildName(gilden_id), " versehen!"));
- goto("wait");
- }
- if(isLeaderOrOfficer(player)) {
- speakPrefix(player, chestpräfix, "Entferne die Sicherung zuerst mit einer Schere");
- }
- goto("wait");
- }
- if(map.contains(chest_adel, block_loc)) {
- cancel = true;
- gilden_id = map.get(chest_adel, block_loc);
- if(gilden_id != own_gilden_id) {
- speakPrefix(player, chestpräfix, concat("Die Kiste ist mit einem Adelsschloss der Gilde ", getGuildName(gilden_id), " versehen!"));
- goto("wait");
- }
- if(isLeaderOrOfficer(player)) {
- speakPrefix(player, chestpräfix, "Entferne die Sicherung zuerst mit einer Schere");
- }
- goto("wait");
- }
- if(map.contains(chest_privat, block_loc)) {
- cancel = true;
- uuid = map.get(chest_privat, block_loc);
- //Gehört dem Spieler die Kiste?
- if(uuid == player.getUuid(player)) {
- speakPrefix(player, chestpräfix, "Entferne die Sicherung zuerst mit einer Schere");
- goto("wait");
- }
- //Ist der Spieler in derselben Gilde?
- if(guild.isSame(player_name, player.getName(uuid))) {
- //Ist der Spieler der Gildenleiter?
- if(isLeader(player)) {
- speakPrefix(player, chestpräfix, "Entferne die Sicherung zuerst mit einer Schere");
- goto("wait");
- }
- }
- speakPrefix(player, chestpräfix, concat("Die Kiste ist mit einem Privatschloss von ", player.getName(uuid), " versehen!"));
- goto("wait");
- }
- }
- //Absicherung, damit angreifende Teamler während eines Kampfes auch am fremden GS nichts abbauen können
- if(plot_id != null) {
- gfights = getScriptVar("gfights");
- if(list.contains(gfights, plot_id)) {
- gilden_id = guild.getId(player);
- if(checkIfAttacker(gilden_id)) {
- speakPrefix(player, fehlerpräfix, "§rGildenkampf im Gange. Blöcke nicht abbaubar");
- cancel = true;
- }
- }
- goto("wait");
- }
- goto("wait");
- @inv_click
- cancel = true;
- if(item.getType(item) == "minecraft:air") {
- goto("wait");
- }
- if(inv_id == bankinvid) { //Bankmenü
- if(inv_slot == 0 || inv_slot == 5) {
- betrag = 1;
- }
- elseif(inv_slot == 1 || inv_slot == 6) {
- betrag = 10;
- }
- elseif(inv_slot == 2 || inv_slot == 7) {
- betrag = 100;
- }
- elseif(inv_slot == 3 || inv_slot == 8) {
- betrag = 1000;
- }
- gold_atm = getGoldAtm(player);
- gold_bank = getGoldBank(player);
- if(!isDouble(gold_atm)) {
- speakPrefix(player, fehlerpräfix, "Transaktion zu schnell");
- goto("wait");
- }
- if(!isDouble(gold_bank)) {
- speakPrefix(player, fehlerpräfix, "Transaktion zu schnell");
- goto("wait");
- }
- if(inv_slot < 4) {
- //einzahlen
- if(betrag > gold_atm) {
- //Abbruch der Transaktion. Keine genaue Abrechnung (Anweisung von Luca)
- speakPrefix(player, fehlerpräfix, "§rSoviel Geld trägst du nicht mit dir");
- goto("wait");
- }
- if(gold_bank + betrag > 2000) {
- betrag2 = 2000 - gold_bank;
- subGoldAtm(player, betrag2);
- setGoldBank(player, gold_bank + betrag2);
- speakPrefix(player, goldpräfix, "§rKonto auf 2000 Gold aufgestockt");
- } else {
- subGoldAtm(player, betrag);
- setGoldBank(player, gold_bank + betrag);
- speakPrefix(player, goldpräfix, "§rTransaktion erfolgreich");
- }
- goto("wait");
- }
- //auszahlen
- if(betrag > gold_bank) {
- speakPrefix(player, fehlerpräfix, "§rZu wenig Gold am Konto");
- goto("wait");
- }
- setGoldBank(player, gold_bank - betrag);
- addGoldAtm(player, betrag);
- speakPrefix(player, goldpräfix, "§rTransaktion erfolgreich");
- goto("wait");
- }
- if(inv_id == dailyrewardinvid) { //Daily Reward
- if(inv_slot + 1 == actualday) {
- if(guild.hasRewardOpened(player, actualday)) {
- speakPrefix(player, "§6Belohnung", "§rTägliche Belohnung bereits abgeholt");
- goto("wait");
- }
- guild.openedReward(player, actualday);
- text = map.get(rewardstext, dailyrewardlist);
- if(text == "Diamanten") {
- speakPrefix(player, "§6Belohnung", concat("§rDu bekommst ", text.number(item.getAmount(dailyreward)), " ", text));
- player.giveItem(player, dailyreward);
- } elseif(text == "Villager-Spawnei") {
- player.giveItem(player, dailyreward);
- speakPrefix(player, "§6Belohnung", concat("§rDu bekommst 1 ", text));
- } elseif(text == "Gold") {
- gold = getGoldAtm(player) + dailyreward;
- setGoldAtm(player, gold);
- displaygold(player, gold);
- speakPrefix(player, "§6Belohnung", concat("§rDu bekommst ", text.number(dailyreward), " ", text));
- } elseif(text == "KlassenXP") {
- addXp(player, dailyreward, true, false);
- speakPrefix(player, "§6Belohnung", concat("§rDu bekommst ", text.number(dailyreward), " ", text));
- }
- inv.setItem(inv, inv_slot, read.item("minecraft:minecart", 1, item.getName(item)));
- inv.update(player);
- }
- goto("wait");
- }
- if(inv_id == pvequestsinvid) {
- if(inv_slot == 0) {
- inv.open(pvemenu1, player, "§rFriedliche Mobs");
- } elseif(inv_slot == 1) {
- inv.open(pvemenu2, player, "§rFeindliche Mobs");
- } elseif(inv_slot == 2) {
- inv.open(pvemenu3, player, "§rBlöcke und Landwirtschaft");
- } elseif(inv_slot == 3) {
- player_uuid = player.getUuid(player);
- if(map.contains(gpvpquests, player_uuid)) {
- map.remove(gpvpquests, player_uuid);
- speakPrefix(player, quests_präfix, "Deine Quest wurde beendet");
- }
- }
- goto("wait");
- }
- if(inv_id == pvemenu1invid) {
- if(inv_slot == 31) {
- inv.open(pvequests, player, "§rPvE Quests");
- goto("wait");
- }
- player_uuid = player.getUuid(player);
- if(map.contains(gpvpquests, player_uuid)) {
- speakPrefix(player, "§dQuests", "§rDu arbeitest gerade an einer Quest");
- goto("wait");
- }
- item_name = item.getName(item);
- split_list = text.split(" ", item_name);
- array = array.new(5);
- array[1] = list.getIndex(split_list, 2);
- array[2] = list.getIndex(split_list, 1);
- array[3] = 0;
- array[4] = list.getIndex(split_list, 0);
- if(item.getType(item) == leather_type) {
- array[0] = "cow";
- } elseif(item.getType(item) == white_wool_type) {
- array[0] = "sheep";
- } elseif(item.getType(item) == porkchop_type) {
- array[0] = "pig";
- } elseif(item.getType(item) == feather_type) {
- array[0] = "chicken";
- } elseif(item.getType(item) == rabbit_foot_type) {
- array[0] = "rabbit";
- } elseif(item.getType(item) == saddle_type) {
- array[0] = "horse";
- } elseif(item.getType(item) == ink_sac_type) {
- array[0] = "squid";
- }
- map.add(gpvpquests, player_uuid, array);
- speakPrefix(player, quests_präfix, item_name);
- goto("wait");
- }
- if(inv_id == pvemenu2invid) {
- if(inv_slot == 22) {
- inv.open(pvequests, player, "§rPvE Quests");
- goto("wait");
- }
- player_uuid = player.getUuid(player);
- if(map.contains(gpvpquests, player_uuid)) {
- speakPrefix(player, "§dQuests", "§rDu arbeitest gerade an einer Quest");
- goto("wait");
- }
- item_name = item.getName(item);
- split_list = text.split(" ", item_name);
- array = array.new(5);
- array[1] = list.getIndex(split_list, 2);
- array[2] = list.getIndex(split_list, 1);
- array[3] = 0;
- array[4] = list.getIndex(split_list, 0);
- if(item.getType(item) == "minecraft:rotten_flesh") {
- array[0] = "zombie";
- } elseif(item.getType(item) == bone_type) {
- array[0] = "skeleton";
- } elseif(item.getType(item) == string_type) {
- array[0] = "spider";
- } elseif(item.getType(item) == infested_cracked_stone_bricks_type) {
- array[0] = "silverfish";
- } elseif(item.getType(item) == gunpowder_type) {
- array[0] = "creeper";
- }
- map.add(gpvpquests, player_uuid, array);
- speakPrefix(player, quests_präfix, item_name);
- goto("wait");
- }
- if(inv_id == pvemenu3invid) {
- if(inv_slot == 18) {
- inv.open(pvequests, player, "§rPvE Quests");
- goto("wait");
- }
- player_uuid = player.getUuid(player);
- if(map.contains(gpvpquests, player_uuid)) {
- speakPrefix(player, "§dQuests", "§rDu arbeitest gerade an einer Quest");
- goto("wait");
- }
- item_name = item.getName(item);
- split_list = text.split(" ", item_name);
- array = array.new(5);
- array[1] = list.getIndex(split_list, 2);
- array[2] = list.getIndex(split_list, 1);
- array[3] = 0;
- array[4] = list.getIndex(split_list, 0);
- if(item.getType(item) == obsidian_type) {
- array[0] = obsidian_type;
- } elseif(item.getType(item) == wheat_type) {
- array[0] = wheat_type;
- } elseif(item.getType(item) == carrot_type) {
- array[0] = carrot_type;
- } elseif(item.getType(item) == potato_type) {
- array[0] = potato_type;
- }
- map.add(gpvpquests, player_uuid, array);
- speakPrefix(player, quests_präfix, item_name);
- goto("wait");
- }
- if(inv_name == "Verzaubern") {
- tool_item = inv.getItem(inv, 0);
- map = enchantment.readFromItem(tool_item);
- if(map.getSize(map) > 0) {
- //Item bereits verzaubert
- goto("wait");
- }
- if(inv_slot == 1) {
- tool_type = null;
- //Waffen
- if(item.hasTag(scepter_tag, tool_item) || item.hasTag(dagger_tag, tool_item) || item.hasTag(battleaxe_tag, tool_item) || item.hasTag(stick_tag, tool_item) || item.hasTag(sword_tag, tool_item) || item.getType(tool_item) == "minecraft:bow") {
- tool_type = "weapon";
- }
- //Werkzeuge
- if(item.hasTag(axe_tag, tool_item) || item.hasTag(pickaxe_tag, tool_item) || item.hasTag(hoe_tag, tool_item) || item.hasTag(shovel_tag, tool_item)) {
- tool_type = "tool";
- }
- //Rüstung
- if(item.hasTag(helmet_tag, tool_item) || item.hasTag(chestplate_tag, tool_item) || item.hasTag(leggings_tag, tool_item) || item.hasTag(boots_tag, tool_item)) {
- tool_type = "armor";
- }
- //Zufällige Verzauberungen auswählen und auf Exp-Flaschen im Inventory anzeigen
- lvl = player.getLevel(player);
- if(lvl >= 1) {
- map = map.get(map.get(enchantings, 1), tool_type);
- if(map == null) {
- goto("wait");
- }
- map_size = map.getSize(map);
- index1 = math.random(0, map_size - 1);
- index2 = math.random(0, map_size - 1);
- iter = map.iterator(map);
- counter = 0;
- map_new = map.new();
- while(hasNext(iter)) {
- element = next(iter);
- if(counter == index1 || counter == index2) {
- key = map.getKey(element);
- value = map.getValue(element);
- value_new = math.random(1, value);
- map.add(map_new, key, value_new);
- }
- counter++;
- }
- item = read.item("minecraft:experience_bottle", 1, concat("§rLvl. 1"));
- enchantment.writeToItem(map_new, item);
- inv.setItem(inv, 2, item);
- }
- if(lvl >= 15) {
- map = map.get(map.get(enchantings, 2), tool_type);
- if(map == null) {
- goto("wait");
- }
- map_size = map.getSize(map);
- index1 = math.random(0, map_size - 1);
- index2 = math.random(0, map_size - 1);
- iter = map.iterator(map);
- counter = 0;
- map_new = map.new();
- while(hasNext(iter)) {
- element = next(iter);
- if(counter == index1 || counter == index2) {
- key = map.getKey(element);
- value = map.getValue(element);
- value_new = math.random(1, value);
- map.add(map_new, key, value_new);
- }
- counter++;
- }
- item = read.item("minecraft:experience_bottle", 15, concat("§rLvl. 15"));
- enchantment.writeToItem(map_new, item);
- inv.setItem(inv, 4, item);
- }
- if(lvl >= 30) {
- map = map.get(map.get(enchantings, 3), tool_type);
- if(map == null) {
- goto("wait");
- }
- map_size = map.getSize(map);
- index1 = math.random(0, map_size - 1);
- index2 = math.random(0, map_size - 1);
- iter = map.iterator(map);
- counter = 0;
- map_new = map.new();
- while(hasNext(iter)) {
- element = next(iter);
- if(counter == index1 || counter == index2) {
- key = map.getKey(element);
- value = map.getValue(element);
- value_new = math.random(1, value);
- map.add(map_new, key, value_new);
- }
- counter++;
- }
- item = read.item("minecraft:experience_bottle", 30, concat("§rLvl. 30"));
- enchantment.writeToItem(map_new, item);
- inv.setItem(inv, 3, item);
- }
- inv.update(player);
- goto("wait");
- }
- if(inv_slot > 1) {
- ench_lvl = inv_slot - 1;
- //Item verzaubern
- //...
- //
- //...
- }
- goto("wait");
- }
- if(inv_name == skill_cast_inv_name) {
- player_id = player.getId(player);
- //Skill einem Hotkey zuweisen
- if(inv_slot >= 0 && inv_slot <= 8) {
- skill_name = map.get(tempskilltosave, player_id);
- if(skill_name != null) {
- belagerungsskills_set = getScriptVar("belagerungsskills_set");
- if(set.contains(belagerungsskills_set, skill_name)) {
- if(inv_slot != 8) {
- //Belagerungsskill nur auf letztem Hotkey zuweisbar
- goto("wait");
- }
- } else {
- if(inv_slot == 8) {
- //Auf dem letztem Hotkey sind nur Belagerungsskill zuweisbar
- goto("wait");
- }
- }
- class = guild.getClass(player);
- hotkey.set(player, class, inv_slot, skill_name);
- temp_inv = map.get(bindingmenus, player_id);
- temp_item = skill.getItem(skill_name);
- description = skill.getDescription(skill_name);
- item.setName(temp_item, concat("§r", skill_name));
- list.new(lore_list);
- list.add(lore_list, concat("§r§5", description));
- item.setLore(temp_item, lore_list);
- inv.setItem(temp_inv, 9 + inv_slot, temp_item);
- map.remove(tempskilltosave, player_id);
- inv.update(player);
- }
- goto("wait");
- }
- //Skillbinding entfernen
- if(inv_slot >= 9 && inv_slot <= 17) {
- class = guild.getClass(player);
- hotkey.del(player, class, inv_slot - 9);
- temp_inv = map.get(bindingmenus, player_id);
- inv.setItem(temp_inv, inv_slot, air_item);
- inv.update(player);
- goto("wait");
- }
- //Skill auswählen
- if(inv_slot >= 18 && inv_slot <= 41) {
- if(item.getType(item) != "minecraft:air") {
- item_name = item.getName(item);
- skill_name = removeFormat(item_name);
- map.add(tempskilltosave, player_id, skill_name);
- }
- goto("wait");
- }
- }
- goto("wait");
- @entity_click
- if(hand == "OFF_HAND") {
- goto("wait");
- }
- entity_name = entity.getName(entity);
- first_new_line = text.indexOf(entity_name, "\n", 0);
- entity_name = removeFormat(text.subString(entity_name, first_new_line + 1, text.length(entity_name)));
- if(entity_name == "Tutorial") {
- msg(player, "§rHallo, ich werde vllt ein Tutorial sein");
- goto("wait");
- }
- if(entity_name == "PvE") {
- inv.open(pvequests, player, "§rPvE Quests");
- goto("wait");
- }
- class = entity_name;
- classes = getScriptVar("gpvp_classes");
- if(list.contains(classes, class)) {
- msg(player, concat("§rKlasse ", entity_name, " §rwählen? "), text.click("§r[§aJa§r]", concat("/gilde class ", class)));
- goto("wait");
- }
- if(entity_name == bankvillagername) {
- inv.open(bankmenu, player, "§rBank");
- goto("wait");
- }
- if(entity_name == gildenvillagername) {
- if(isPlayerInGuild(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu bist bereits in einer Gilde");
- goto("wait");
- }
- plot_id = getPlotId(player_loc);
- if(!isGuildSpawnId(plot_id)) {
- speakPrefix(player, fehlerpräfix, "§rDu bist nicht am Gildenpvp-Spawn");
- goto("wait");
- }
- if(getGoldAtm(player) < buypricegblock) {
- speakPrefix(player, fehlerpräfix, "§rDu besitzt nicht genug Gold");
- } else {
- speakPrefix(player, gildepräfix, "§rGib den gewünschten Gildennamen folgendermaßen ein:");
- msg(player, "/gilde create <name> <tag>");
- msg(player, " - nur 1 Wort");
- msg(player, " - nur Buchstaben");
- msg(player, " - Name: max 20 Zeichen");
- msg(player, " - Tag: max 3 Zeichen");
- }
- }
- goto("wait");
- @player_login
- if(!registerGpvpPlayer(player)) {
- joinGpvpWorld(player);
- }
- goto("wait");
- @player_logout
- player_uuid = player.getUuid(player);
- map.remove(gpvpquests, player_uuid);
- //Falls der Spieler Artefakt-Träger ist, Artefakt resetten
- if(arte_loc_type == "player") {
- if(arte_yet_uuid == player_uuid) {
- arteresetcore();
- }
- }
- goto("wait");
- @player_post_respawn
- class = guild.getClass(player);
- if(class != "none") {
- level = guild.getLevel(player);
- mana = 0;
- gilden_id = guild.getId(player);
- if(isGuild(gilden_id)) {
- elo = getGuildElo(gilden_id);
- gold = getGuildGold(gilden_id);
- //Gildenextra: Kampfgeist
- if(elo >= 2000 && gold >= 12500) {
- mana = getManaMax(player);
- }
- }
- setManaAtm(player, mana);
- displaymana(player);
- }
- gold = getGoldAtm(player);
- setGoldAtm(player, 0);
- displaygold(player, 0);
- displayHealth(player);
- goto("wait");
- @player_pre_respawn
- player.setSpawn(player, gildenspawnloc);
- goto("wait");
- @entity_join
- //(Text-)Entities nachträglich entfernen, weil der Chunk eventuell nicht geladen war
- entity_loc = entity.getLocation(entity);
- if(list.contains(text_ent_to_remove, entity_loc)) {
- cancel = true;
- list.remove(text_ent_to_remove, entity_loc);
- }
- goto("wait");
- @item_use_finish
- if(isPlayer(living_entity)) {
- player = living_entity;
- if(arte_loc_type == "player") {
- player_uuid = player.getUuid(player);
- if(arte_yet_uuid == player_uuid) {
- list.add(hunger1_list, player_uuid);
- sgoto(1, "setHunger1");
- }
- }
- }
- goto("wait");
- @setHunger1
- p_uuid = list.getIndex(list, 0);
- list.removeIndex(list, 0);
- p = player.get(p_uuid);
- player.setHunger(p, 2);
- goto("wait");
- @living_drop
- if(entity.getType(living_entity) == "enderman") {
- list.clear(drops);
- }
- goto("wait");
- @item_air_click
- if(hand == "MAIN_HAND") {
- item = entity.getEquip(player, "hand");
- } else {
- item = entity.getEquip(player, "offhand");
- }
- if(item.getType(item) == "km:scroll") {
- if(!isPlayerInGuild(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu bist in keiner Gilde");
- goto("wait");
- }
- gilden_id = guild.getId(player);
- addGuildElo(gilden_id, 100);
- player.removeItem(player, scroll);
- speakPrefix(player, gildepräfix, "+100 Gildeneinfluss");
- goto("wait");
- }
- if(item.getType(item) == "minecraft:ender_pearl") {
- cancel = true;
- class = guild.getClass(player);
- if(class != "none") {
- guild.setLevel(player, 1);
- guild.setXp(player, 0);
- displaylevel(player, 1);
- displayxp(player, level, 0);
- }
- entity.damage(player, 100);
- nachricht = concat(player_name, " starb beim Experimentieren. Enderperlen sind tödlich!");
- mail.send("marvinius", "eropster", nachricht);
- goto("wait");
- }
- goto("wait");
- @player_pickup
- item_type = item.getType(item);
- if(list.contains(forbidden_items, item_type)) {
- cancel = true;
- entity.remove(entity);
- item_type = text.replace(item_type, "minecraft:", "");
- nachricht = concat(player_name, " war ein böser Bube und hat ", item_type, " aufgesammelt.");
- mail.send("marvinius", "eropster", nachricht);
- goto("wait");
- }
- if(removeFormat(item.getName(item)) == "Golddrop") {
- cancel = true;
- entity.remove(entity);
- if(item_type == "minecraft:gold_ingot" || item_type == "minecraft:gold_nugget") {
- lore_list = item.getLore(item);
- if(list.getSize(lore_list) != 0) {
- gold = read.number(list.getIndex(lore_list, 0));
- gilden_id = guild.getId(player);
- if(getGuildType(gilden_id) != null) {
- if(getShareGold(gilden_id) == 1) {
- addSharedGold(gilden_id, gold);
- } else {
- addGoldAtm(player, gold);
- if(gold > 0) {
- speakPrefix(player, goldpräfix, concat("§rDu hast §6", text.number(gold), " §rGold erhalten"));
- }
- }
- } else {
- addGoldAtm(player, gold);
- if(gold > 0) {
- speakPrefix(player, goldpräfix, concat("§rDu hast §6", text.number(gold), " §rGold erhalten"));
- }
- }
- }
- }
- }
- goto("wait");
- @living_death
- killer = getPlayerFromDamageSource(damage_source);
- if(isPlayer(killer)) {
- entity_type = entity.getType(living_entity);
- //XP und Golddrop
- prexp = map.get(xpforentities, entity_type);
- if(prexp != null) {
- xp = math.random(prexp * 7, prexp * 13);
- xp = math.round(xp / 10);
- gold = math.random(1, 14);
- gold /= 10;
- gilden_id = guild.getId(killer);
- if(getGuildType(gilden_id) != null) {
- if(getShareXp(gilden_id) == 1) {
- addSharedXp(gilden_id, xp);
- } else {
- addXp(killer, xp, true, false);
- }
- } else {
- addXp(killer, xp, true, false);
- }
- entity_loc = entity.getLocation(living_entity);
- gold_item1 = read.item("minecraft:gold_nugget");
- gold_item2 = read.item("minecraft:gold_nugget");
- item.setName(gold_item1, "§rGolddrop");
- item.setName(gold_item2, "§rGolddrop");
- list.new(lore_list);
- list.add(lore_list, gold);
- item.setLore(gold_item1, lore_list);
- item.drop(entity_loc, gold_item1);
- item.drop(entity_loc, gold_item2);
- }
- //Belagerungsturm
- if(entity_type == "zombie") {
- if(math.random(0, 9) == 0) {
- entity_loc = entity.getLocation(living_entity);
- item.drop(entity_loc, belagerungsitem);
- }
- }
- //Quest
- player_uuid = player.getUuid(killer);
- if(map.contains(gpvpquests, player_uuid)) {
- array = map.get(gpvpquests, player_uuid);
- quest_type = removeFormat(array[4]);
- if(quest_type == "Töte") {
- type = array[0];
- if(entity.getType(living_entity) == type) {
- wort = array[1];
- amount = array[2];
- progress = ++array[3];
- speakPrefix(killer, quests_präfix, concat(wort, " getötet: ", text.number(progress), "/", text.number(amount)));
- if(progress >= amount) {
- speakPrefix(killer, quests_präfix, "Quest abgeschlossen");
- }
- }
- }
- }
- }
- if(isPlayer(living_entity)) {
- loc = entity.getLocation(living_entity);
- uuid = player.getUuid(living_entity);
- player.dropInventory(living_entity, loc);
- //Falls der Spieler Artefakt-Träger ist, Artefakt resetten
- if(arte_loc_type == "player") {
- if(arte_yet_uuid == uuid) {
- arteresetcore();
- }
- }
- //Gold und Items droppen
- gold = getGoldAtm(living_entity);
- if(gold > 0) {
- gold_item1 = read.item("minecraft:gold_ingot");
- gold_item2 = read.item("minecraft:gold_nugget");
- item.setName(gold_item1, "§rGolddrop");
- item.setName(gold_item2, "§rGolddrop");
- item.setAmount(gold_item1, 3);
- list.new(lore_list);
- list.add(lore_list, gold);
- item.setLore(gold_item1, lore_list);
- item.drop(loc, gold_item1);
- item.drop(loc, gold_item2);
- }
- if(killer != null) {
- killer_id = player.getId(killer);
- class = guild.getClass(killer_id);
- if(class != "none") {
- addXp(killer, 400, true, false);
- }
- }
- //Wenn der Spieler in der Arte-Ruine gestorben ist, darf er dort 5 Minuten lang nicht mehr hinein
- if(loc.distance(loc, arte_main_loc) <= arte_ruin_radius) {
- list.add(arte_ruin_forbidden_players, uuid);
- sgoto(6000, "removeArteRuinForbiddenPlayer"); //5 Minuten
- }
- }
- goto("wait");
- @removeArteRuinForbiddenPlayer
- list.removeIndex(arte_ruin_forbidden_players, 0);
- goto("wait");
- @block_place
- plot_id = getPlotId(block_loc);
- //Wertvolle Blöcke/Erze dürfen nicht gesetzt werden
- //testphase
- /*if(set.contains(richblocks, block_type)) {
- cancel = true;
- speakPrefix(player, fehlerpräfix, "§rWertvolle Blöcke/Erze dürfen nicht gesetzt werden");
- goto("wait");
- }*/
- if(block_type == "km:artefact") {
- //Illegales Artefakt im Umlauf. Bewusst zulassen und eropster informieren
- nachricht = concat(player_name, " hat ein illegales Artefakt platziert: ", block_loc);
- mail.send("marvinius", "eropster", nachricht);
- goto("wait");
- }
- //Platzieren von Blöcken am Kampfgrundstück
- if(plot_id != null) {
- if(isAFightPlot(plot_id)) {
- if(block_type == obsidian_type) {
- item = entity.getEquip(player, "hand");
- if(item.getType(item) != block_type) {
- item = entity.getEquip(player, "off_hand");
- }
- lore_list = item.getLore(item);
- if(list.getSize(lore_list) == 1 && list.getIndex(lore_list == "Belagerungsturm")) {
- setTurmGround();
- goto("wait");
- }
- }
- speakPrefix(player, fehlerpräfix, "§rGildenkampf im Gange. Blöcke nicht platzierbar");
- cancel = true;
- goto("wait");
- }
- }
- //Platzieren von Blöcken im Bereich 11x11x7 um den Gildenblock/das Artefakt
- if(set.contains(forbiddenblocks2, block_loc)) {
- speakPrefix(player, fehlerpräfix, "§rHier kannst du nicht bauen");
- cancel = true;
- goto("wait");
- }
- if(block_type == "km:guild_block") {
- if(isPlayerInGuild(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu bist bereits in einer Gilde");
- cancel = true;
- goto("wait");
- }
- if(isPlayerInGroup(player)) {
- speakPrefix(player, fehlerpräfix, "§rDu bist in einer Gruppe");
- cancel = true;
- goto("wait");
- }
- item = entity.getEquip(player, "hand");
- if(item.getType(item) != block_type) {
- item = entity.getEquip(player, "off_hand");
- }
- lore_list = item.getLore(item);
- if(list.getSize(lore_list) != 3) {
- cancel = true;
- speakPrefix(player, fehlerpräfix, "§rDieser Gildenblock wurde nicht vom Gildenvillager ausgehändigt");
- goto("wait");
- }
- gilden_name = list.getIndex(lore_list, 0);
- gilden_tag = list.getIndex(lore_list, 1);
- gilden_id = read.number(list.getIndex(lore_list, 2));
- if(isExistingGuildName(gilden_name)) {
- speakPrefix(player, fehlerpräfix, "§rDieser Gildenname existiert bereits, verwende /g rename");
- goto("wait");
- }
- if(isAPlot(block_loc)) {
- speakPrefix(player, fehlerpräfix, "§rAuf dieser Position befindet sich bereits ein Grundstück");
- cancel = true;
- goto("wait");
- }
- bloc = loc.mod(block_loc, 0, -1, 0);
- if(!block.isSolid(bloc)) {
- speakPrefix(player, fehlerpräfix, "§rDer Block unter dem Gildenblock muss ein solider Block sein");
- cancel = true;
- goto("wait");
- }
- btype = block.getType(bloc);
- if(block.hasTag(leaves_tag, block.get(bloc))) {
- speakPrefix(player, fehlerpräfix, "§rDer Block unter dem Gildenblock darf kein Laub sein");
- cancel = true;
- goto("wait");
- }
- if(set.contains(richblocks, btype)) {
- speakPrefix(player, fehlerpräfix, "§rDer Block unter dem Gildenblock darf kein wertvoller Block sein");
- cancel = true;
- goto("wait");
- }
- y = loc.getY(block_loc);
- if(y < 35 || y > 150) {
- speakPrefix(player, fehlerpräfix, "§rDer Gildenblock muss zwischen 35 bis 150 Blöcke Höhe platziert werden");
- cancel = true;
- goto("wait");
- }
- block_list = getAllGuildBlocks();
- for(i = 0; i < list.getSize(block_list); i++) {
- distance = loc.distance(list.getIndex(block_list, i), block_loc);
- if(distance < 1100) {
- speakPrefix(player, fehlerpräfix, concat("§rGildenblöcke müssen mindestens 1100 Blöcke voneinander entfernt sein (Aktuell: ", text.number(math.roundUp(distance)), ")"));
- cancel = true;
- goto("wait");
- }
- }
- if(!checkGuildBlockArea(block_loc)) {
- speakPrefix(player, fehlerpräfix, "§rIm Bereich von 5 Blöcken seitlich und 7 Blöcken nach oben dürfen sich keine anderen Blöcke befinden");
- cancel = true;
- goto("wait");
- }
- x = loc.getX(block_loc);
- x1 = x - 150;
- x2 = x + 150;
- z = loc.getZ(block_loc);
- z1 = z - 150;
- z2 = z + 150;
- gs_edge1 = loc.new(gpvpworld, x1, 0, z1);
- gs_edge2 = loc.new(gpvpworld, x2, 255, z2);
- //Überschneidungen suchen
- if(doesPlotIntersect(gs_edge1, gs_edge2)) {
- speakPrefix(player, fehlerpräfix, "§rIm Gebiet herrscht bereits eine andere Gilde");
- cancel = true;
- goto("wait");
- }
-
- //Move-Gebiet erstellen
- createMoveArea(gilden_id, block_loc);
- //Plot erstellen
- player.removeItem(player, item);
- plot = addPlot(gs_edge1, gs_edge2);
- setPlotName(plot, gilden_name);
- addPlotPlayer(plot, player_name);
- plot_id = plot.getId(plot);
-
- //Gilde erstellen
- g_type = 1;
- gold_delay = 0;
- gold = 0;
- block_world = loc.getCoord(block_loc, "w");
- block_x = loc.getCoord(block_loc, "bx");
- block_y = loc.getCoord(block_loc, "by");
- block_z = loc.getCoord(block_loc, "bz");
- safetime = time.getMillis() + 259200000;
- share_xp = 1;
- share_gold = 1;
- elo = 100;
- addNewGuild(gilden_id, g_type, gold_delay, gold, gilden_name, block_world, block_x, block_y, block_z, safetime, plot_id, share_xp, share_gold, elo, gilden_tag);
-
- //Leiter festlegen
- setLeader(player);
- guild.setId(player, gilden_id);
- class = guild.getClass(player);
- if(class != "none") {
- level = guild.getLevel(player);
- }
- setHeadName(player);
-
- setGuildBlock(gilden_id, block_loc);
- setGuildBlockArea(block_loc);
- text_ent = entity.spawn("km:nobody", loc.mod(block_loc, 0.5, 1.5, 0.5), "{NoGravity:true}");
- entity.setName(text_ent, concat("200/200 §c❤\n§r[§6", gilden_name, "§r]"));
- map.add(g_block_entities, block_loc, text_ent);
- sendWorldMessage(gildepräfix, concat("§rDie Gilde §6", gilden_name, "§r wurde von §6", player_name, "§r gegründet"));
- goto("wait");
- }
- //Hopper unter gesichertern Kisten sind verboten
- if(block_type == "minecraft:hopper") {
- b_loc = loc.mod(block_loc, 0, 1, 0);
- b_type = block.getType(b_loc);
- if(b_type == "minecraft:chest") {
- if(isALockedChest(b_loc)) {
- cancel = true;
- speakPrefix(player, chestpräfix, "Trichter unter gesicherter Kiste nicht platzierbar");
- goto("wait");
- }
- }
- }
- //Kistensicherungen
- if(block_type == "minecraft:chest") {
- chestloc2 = block_loc;
- chestloc1 = block.getSecChest(chestloc2);
- if(chestloc1 != null) {
- own_gilden_id = guild.getId(player);
- if(map.contains(chest_guild, chestloc1)) {
- gilden_id = map.get(chest_guild, chestloc1);
- if(gilden_id != own_gilden_id) {
- cancel = true;
- speakPrefix(player, chestpräfix, concat("Die Kiste ist mit einem Gildenschloss der Gilde ", getGuildName(gilden_id), " versehen!"));
- goto("wait");
- }
- if(isLeaderOrOfficer(player)) {
- player.removeItem(player, item);
- lockGuildChest(chestloc2, own_gilden_id);
- speakPrefix(player, chestpräfix, "§rSicherung erweitert");
- }
- goto("wait");
- }
- if(map.contains(chest_officer, chestloc1)) {
- gilden_id = map.get(chest_officer, chestloc1);
- if(gilden_id != own_gilden_id) {
- cancel = true;
- speakPrefix(player, chestpräfix, concat("Die Kiste ist mit einem Offiziersschloss der Gilde ", getGuildName(gilden_id), " versehen!"));
- goto("wait");
- }
- if(isLeaderOrOfficer(player)) {
- lockOfficerChest(chestloc2, own_gilden_id);
- speakPrefix(player, chestpräfix, "§rSicherung erweitert");
- }
- goto("wait");
- }
- if(map.contains(chest_adel, chestloc1)) {
- gilden_id = map.get(chest_adel, chestloc1);
- if(gilden_id != own_gilden_id) {
- cancel = true;
- speakPrefix(player, chestpräfix, concat("Die Kiste ist mit einem Adelsschloss der Gilde ", getGuildName(gilden_id), " versehen!"));
- goto("wait");
- }
- if(isLeaderOrOfficer(player)) {
- lockAdelChest(chestloc2, own_gilden_id);
- speakPrefix(player, chestpräfix, "§rSicherung erweitert");
- }
- goto("wait");
- }
- if(map.contains(chest_privat, chestloc1)) {
- uuid = map.get(chest_privat, chestloc1);
- //Gehört dem Spieler die Kiste?
- if(uuid == player.getUuid(player)) {
- lockPrivatChest(chestloc2, player.getUuid(player));
- speakPrefix(player, chestpräfix, "§rSicherung erweitert");
- goto("wait");
- }
- //Ist der Spieler in derselben Gilde?
- if(guild.isSame(player_name, player.getName(uuid))) {
- //Ist der Spieler der Gildenleiter?
- if(isLeader(player)) {
- lockPrivatChest(chestloc2, player.getUuid(player));
- speakPrefix(player, chestpräfix, "§rSicherung erweitert");
- goto("wait");
- }
- }
- cancel = true;
- speakPrefix(player, chestpräfix, concat("Die Kiste ist mit einem Privatschloss von ", player.getName(uuid), " versehen!"));
- goto("wait");
- }
- }
- }
- if(checkForEnimies(player)) {
- cancelCauseEnimy();
- goto("wait");
- }
- goto("wait");
- @removeGroupInvitation
- list.removeIndex(groupinvitations, 0);
- goto("wait");
- @removeGuildInvitation
- list.removeIndex(invitations, 0);
- goto("wait");
- @checkifwildnis
- p_name = list.getIndex(movelist, 0);
- list.removeIndex(movelist, 0);
- if(!isOnline(p_name)) {
- goto("wait");
- }
- p = read.player(p_name);
- player_loc = entity.getLocation(p);
- gpvpworld = world.get(gpvpworld_name);
- if(loc.getWorld(player_loc) == gpvpworld) {
- plot_id = getPlotId(player_loc);
- if(plot_id == null) {
- display.add(p, 39, "§6Wildnis");
- }
- }
- goto("wait");
- @witherloop
- gpvpworld = world.get(gpvpworld_name);
- world_list = players.toWorldList(gpvpworld);
- for(i = 0; i < list.getSize(world_list); i++) {
- p = list.getIndex(world_list, i);
- p_id = player.getId(p);
- p_name = player.getName(p);
- gilden_id = guild.getId(p);
- list = plot.get(entity.getLocation(p));
- if(list.getSize(list) > 0) { //Wenn der Spieler auf einem Grundstück ist...
- plot = list.getIndex(list, 0);
- plot_id = plot.getId(plot);
- if(isAGuildPlot(plot_id)) { //...und dieses GS ein Gildengrundstück ist...
- own_plot_id = getGuildPlotId(gilden_id);
- if(map.contains(fightplayers, plot_id)) { //...und auf dem Grundstück gekämpft wird...
- fightset = map.get(fightplayers, plot_id);
- if(!set.contains(fightset, p_id)) { //...und der Spieler nicht Teil des Kampfes ist...
- //...dann hat er dort nichts verloren und wird zum Spawn teleportiert.
- teleportPlayer(p, gildenspawnloc, false);
- speakPrefix(p, gildepräfix, "§rAuf diesem Grundstück wird gerade gekämpft und du bist kein Kampfteilnehmer");
- }
- } elseif(own_plot_id == null || plot_id != own_plot_id) { //Wenn auf diesem GS nicht gekämpft wird und es nicht das eigene ist, bekommt man eine Warnung und irgendwann den Withereffekt
- title.clear(p);
- title.reset(p);
- title.setSub(p, "§rFremdes Grundstück");
- title.send(p, "§cAchtung");
- if(!list.contains(warned, p_id)) { //Überprüfung, ob Spieler bereits auf Warnliste
- list.add(warned, p_id);
- sgoto(600, "checkifaway");
- }
- }
- }
- }
- }
- sgoto(200, "witherloop");
- goto("wait");
- @checkifaway
- p_id = list.getIndex(warned, 0);
- list.removeIndex(warned, 0);
- p_name = player.getNameFromId(p_id);
- p = read.player(p_name);
- if(p == null) {
- goto("wait");
- }
- //Überprüfung, ob sich Spieler noch immer auf fremdem GS befindet
- list = plot.get(entity.getLocation(p));
- if(list.getSize(list) > 0) { //Wenn der Spieler auf einem Grundstück ist...
- plot_id = plot.getId(list.getIndex(list, 0));
- if(isAGuildPlot(plot_id)) { //...und dieses GS ein Gildengrundstück ist.
- if(map.contains(fightplayers, plot_id)) { //Wenn auf dem Grundstück gekämpft wird...
- fightset = map.get(fightplayers, plot_id);
- if(set.contains(fightset, p_id)) { //...und der Spieler Teil des Kampfes ist.
- goto("wait");
- }
- } else {
- own_gilden_id = guild.getId(p);
- own_plot_id = getGuildPlotId(own_gilden_id);
- if(plot_id != own_plot_id) { //Wenn das GS nicht das eigene ist, bekommt man den Withereffekt.
- entity.addEffect(p, "wither", 200, 5);
- }
- }
- }
- }
- goto("wait");
- function arteresetcore() {
- if($arte_loc_type == "placed") {
- arte_ent = entity.get($arte_yet_loc, 3, "me.km.entities.EntityNobody");
- if(arte_ent == null) {
- list.add($text_ent_to_remove, loc.mod($arte_yet_loc, 0.5, 1.5, 0.5));
- } else {
- entity.remove(arte_ent);
- }
- block.set($arte_yet_loc, "minecraft:air");
- removeArteBlockArea($arte_yet_loc);
- }
- block.set($arte_main_loc, "km:artefact");
- sendWorldMessage($arte_präfix, "Das Artefakt ist in die Ruine zurückgekehrt");
- sgv("SERVER", "arte_yet_loc", text.location($arte_main_loc));
- $arte_yet_loc = $arte_main_loc;
- $arte_loc_type = "placed";
- $arte_hp = 250;
- arte_ent = entity.spawn("km:nobody", loc.mod($arte_yet_loc, 0.5, 1.5, 0.5), "{NoGravity:true}");
- entity.setName(arte_ent, concat("250/250 §c❤\n§r[§9Artefakt§r]"));
- return;
- }
- @manaloop
- gpvpworld = world.get(gpvpworld_name);
- worldlist = players.toWorldList(gpvpworld);
- for(i = 0; i < list.getSize(worldlist); i++) {
- player = list.getIndex(worldlist, i);
- class = guild.getClass(player);
- if(class != "none") {
- mana_atm = getManaAtm(player);
- mana_max = getManaMax(player);
- if(mana_atm < mana_max) {
- new_mana = mana_atm + getManaRegenerationForClass(class);
- if(new_mana > mana_max) {
- setManaAtm(player, mana_max);
- } else {
- setManaAtm(player, new_mana);
- }
- displaymana(player);
- }
- }
- }
- sgoto(20, "manaloop");
- goto("wait");
- @arte_drops_loop
- if(arte_loc_type == "placed") {
- if(arte_yet_loc != arte_main_loc) {
- drop_chance = math.random(1, 100);
- if(drop_chance <= 55) {
- item = read.item("minecraft:gold_ingot");
- item.setName(item, "§rGolddrop");
- list.new(lore_list);
- list.add(lore_list, 0.25);
- item.setLore(item, lore_list);
- item.drop(arte_yet_loc, item);
- }
- if(drop_chance <= 21) {
- item = read.item("minecraft:gold_ingot");
- item.setName(item, "§rGolddrop");
- list.new(lore_list);
- list.add(lore_list, 0.5);
- item.setLore(item, lore_list);
- item.drop(arte_yet_loc, item);
- }
- if(drop_chance <= 10) {
- item = read.item("minecraft:gold_ingot");
- item.setName(item, "§rGolddrop");
- list.new(lore_list);
- list.add(lore_list, 0.75);
- item.setLore(item, lore_list);
- item.drop(arte_yet_loc, item);
- }
- if(drop_chance <= 3) {
- item = read.item("minecraft:diamond");
- item.drop(arte_yet_loc, item);
- }
- if(drop_chance <= 2) {
- item = read.item("minecraft:iron_block");
- item.drop(arte_yet_loc, item);
- }
- }
- }
- sgoto(1200, "arte_drops_loop");
- goto("wait");
- @arte_ruin_loop
- //Wenn der Spieler in der Arte-Ruine gestorben ist, darf er dort 5 Minuten lang nicht mehr hinein
- size = list.getSize(arte_ruin_forbidden_players);
- for(i = 0; i < size; i++) {
- uuid = list.getIndex(arte_ruin_forbidden_players, i);
- p = player.get(uuid);
- if(p != null) {
- loc = entity.getLocation(p);
- if(loc.distance(loc, arte_main_loc) <= arte_ruin_radius) {
- //Teleport zum Spawn
- teleportPlayer(p, gildenspawnloc, false);
- speakPrefix(p, arte_präfix, "Warte nach deinem Tod insgesamt 5 Minuten, bis du wieder in die Artefaktruine darfst");
- }
- }
- }
- sgoto(100, "arte_ruin_loop");
- goto("wait");
- @timerloop //Minutentakt. Code ausführen, wenn eine bestimmte Uhrzeit überschritten wurde
- now_time = time.getMillis();
- now_cal = time.new(now_time);
- now_day = time.getDay(now_cal);
- now_sec = time.getSecond(now_cal);
- //Daily Reward
- if(now_day != actualday) {
- //nächster Tag
- actualday = now_day;
- if(actualday == 1) {
- //nächster Monat
- gosub("init_daily_reward");
- guild.clearRewards();
- }
- gosub("setreward");
- }
- //Artefakt-Reset-Announce
- if(now_time > arte_announcer_time) {
- arte_announcer_time += 86400000; //19:30 Uhr (+24 Stunden)
- counter = ggv("SERVER", "artedaycounter");
- if(counter == 0) {
- if(arte_loc_type == "placed") {
- if(arte_yet_loc == arte_main_loc) {
- goto("wait");
- }
- }
- sendWorldMessage(arte_präfix, "Das Artefakt kehrt bald in die Ruine zurück");
- }
- }
- //3 Tages-Reset des Artefakts
- if(now_time > arte_reset_time) {
- arte_reset_time += 86400000; //20:00 Uhr (+24 Stunden)
- counter = ggv("SERVER", "artedaycounter");
- if(counter == 0) {
- sgv("SERVER", "artedaycounter", 2);
- if(arte_loc_type == "placed") {
- if(arte_yet_loc == arte_main_loc) {
- goto("wait");
- }
- }
- arteresetcore();
- } else {
- sgv("SERVER", "artedaycounter", counter - 1);
- }
- }
- //Steuer
- if(now_time > tax_time) {
- tax_time += 86400000; //8 Uhr (+24 Stunden)
- id_list = getAllGuildIds();
- for(i = 0; i < list.getSize(id_list); i++) {
- gilden_id = list.getIndex(id_list, i);
- if(checkIfGuildInFight(gilden_id)) {
- list.add(scheduledtax, gilden_id);
- } else {
- calculateTax(gilden_id);
- }
- }
- }
- //Timer auf volle Minuten synchronisieren
- time = (60 - now_sec) * 20;
- sgoto(time, "timerloop");
- goto("wait");
- @init_daily_reward
- //Initialisierung des Daily Reward Invs
- nowtime = time.new(time.getMillis());
- monthnumber = time.getMonth(nowtime); //Welcher Monat ist jetzt?
- monthname = map.get(monthlist, monthnumber); //Wie heißt der Monat?
- daysofmonth = map.get(monthdays, monthnumber); //Wieviele Tage hat der Monat?
- //Anzahl der Slots festlegen (Ergebnis: invstring = "222222222...")
- invstring = "";
- for(i = 0; i < daysofmonth; i++) {
- invstring = concat(invstring, "2");
- }
- dailyrewardinv = inv.new(invstring); //Inv erstellen
- dailyrewardinvid = inv.getID(dailyrewardinv);
- return;
- @setreward
- dailyrewardlist = list.getIndex(allrewards, math.random(0, list.getSize(allrewards) - 1));
- dailyreward = list.getIndex(dailyrewardlist, math.random(0, list.getSize(dailyrewardlist) - 1));
- return;
- function isGuildSpawnId(plot_id) {
- return plot_id == $spawn_plot_id;
- }
- function setTurmGround() {
-
- }
- //Kistensicherungen
- function isALockedChest(location) {
- if(map.contains($chest_guild, location)) {
- return true;
- }
- if(map.contains($chest_officer, location)) {
- return true;
- }
- if(map.contains($chest_adel, location)) {
- return true;
- }
- if(map.contains($chest_privat, location)) {
- return true;
- }
- return false;
- }
- function lockGuildChest(location, gilden_id) {
- map.add($chest_guild, location, gilden_id);
- lockChestDB_1(gilden_id, "guild", location);
- return;
- }
- function lockOfficerChest(location, gilden_id) {
- map.add($chest_officer, location, gilden_id);
- lockChestDB_1(gilden_id, "officer", location);
- return;
- }
- function lockAdelChest(location, gilden_id) {
- map.add($chest_adel, location, gilden_id);
- lockChestDB_1(gilden_id, "adel", location);
- return;
- }
- function lockPrivatChest(location, uuid) {
- map.add($chest_privat, location, uuid);
- lockChestDB_2(uuid, location);
- return;
- }
- function unlockGuildChest(location) {
- map.remove($chest_guild, location);
- unlockChestDB_1(location);
- return;
- }
- function unlockOfficerChest(location) {
- map.remove($chest_officer, location);
- unlockChestDB_1(location);
- return;
- }
- function unlockAdelChest(location) {
- map.remove($chest_adel, location);
- unlockChestDB_1(location);
- return;
- }
- function unlockPrivatChest(location) {
- map.remove($chest_privat, location);
- unlockChestDB_2(location);
- return;
- }
- function lockChestDB_1(gilden_id, type, location) {
- stmt = databank.prepare("INSERT INTO gilden_chests_1 (gilden_id, block_world, block_x, block_y, block_z, type) VALUES (?, ?, ?, ?, ?, ?);");
- databank.setInt(stmt, 1, gilden_id);
- databank.setString(stmt, 2, world.getName(loc.getWorld(location)));
- databank.setInt(stmt, 3, loc.getX(location));
- databank.setInt(stmt, 4, loc.getY(location));
- databank.setInt(stmt, 5, loc.getZ(location));
- databank.setString(stmt, 6, type);
- databank.workerExecute(stmt);
- return;
- }
- function lockChestDB_2(uuid, location) {
- stmt = databank.prepare("INSERT INTO gilden_chests_2 (player_id, block_world, block_x, block_y, block_z) VALUES (?, ?, ?, ?, ?);");
- databank.setInt(stmt, 1, player.getId(uuid));
- databank.setString(stmt, 2, world.getName(loc.getWorld(location)));
- databank.setInt(stmt, 3, loc.getX(location));
- databank.setInt(stmt, 4, loc.getY(location));
- databank.setInt(stmt, 5, loc.getZ(location));
- databank.workerExecute(stmt);
- return;
- }
- function unlockChestDB_1(location) {
- world_name = world.getName(loc.getWorld(location));
- x = loc.getX(location);
- y = loc.getY(location);
- z = loc.getZ(location);
- stmt = databank.prepare("DELETE FROM gilden_chests_1 WHERE block_world = ? AND block_x = ? AND block_y = ? AND block_z = ?;");
- databank.setString(stmt, 1, world_name);
- databank.setInt(stmt, 2, x);
- databank.setInt(stmt, 3, y);
- databank.setInt(stmt, 4, z);
- databank.workerExecute(stmt);
- return;
- }
- function unlockChestDB_2(location) {
- world_name = world.getName(loc.getWorld(location));
- x = loc.getX(location);
- y = loc.getY(location);
- z = loc.getZ(location);
- stmt = databank.prepare("DELETE FROM gilden_chests_2 WHERE block_world = ? AND block_x = ? AND block_y = ? AND block_z = ?;");
- databank.setString(stmt, 1, world_name);
- databank.setInt(stmt, 2, x);
- databank.setInt(stmt, 3, y);
- databank.setInt(stmt, 4, z);
- databank.workerExecute(stmt);
- return;
- }
- function loadChestDB1() {
- stmt = databank.prepare("SELECT gilden_id, block_world, block_x, block_y, block_z, type FROM gilden_chests_1;");
- result = databank.execute(stmt);
- while(databank.next(result)) {
- gilden_id = databank.getInt(result, 1);
- world_name = databank.getString(result, 2);
- x = databank.getInt(result, 3);
- y = databank.getInt(result, 4);
- z = databank.getInt(result, 5);
- type = databank.getString(result, 6);
- world = world.get(world_name);
- location = loc.new(world, x, y, z);
- if(type == "guild") {
- map.add($chest_guild, location, gilden_id);
- } elseif(type == "officer") {
- map.add($chest_officer, location, gilden_id);
- } elseif(type == "adel") {
- map.add($chest_adel, location, gilden_id);
- }
- }
- databank.close(result);
- databank.close(stmt);
- return;
- }
- function loadChestDB2() {
- stmt = databank.prepare("SELECT player_id, block_world, block_x, block_y, block_z FROM gilden_chests_2;");
- result = databank.execute(stmt);
- while(databank.next(result)) {
- player_id = databank.getInt(result, 1);
- world_name = databank.getString(result, 2);
- x = databank.getInt(result, 3);
- y = databank.getInt(result, 4);
- z = databank.getInt(result, 5);
- world = world.get(world_name);
- location = loc.new(world, x, y, z);
- uuid = player.getUuidFromId(player_id);
- map.add($chest_privat, location, uuid);
- }
- databank.close(result);
- databank.close(stmt);
- return;
- }
|