123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915 |
- error_counter = 0;
- last_error_message = null;
- @on_error
- error_counter++;
- if(error_counter > 1) {
- msg.dev("Error Handler activated");
- if(last_error_message == error_message) {
- msg.dev("Same error again");
- term();
- }
- last_error_message = error_message;
- if(event == "custom_command") {
- msg.dev(string.concat("Command ", command, " failed."));
- set.add(failed_cmds, command);
- goto("wait");
- }
- msg.dev("Restarting script...");
- error_counter++;
- if(error_counter >= 5) {
- msg.dev("Script terminated. Endless loop.");
- term();
- }
- }
- waitfor(5); //Verhindert Endlos-Schleife durch "/start commands"
- setCommandHelps();
- command.clear();
- //--- Register commands not shown on /help here ---
- //Games
- command.add("nextplayer");
- command.add("invstats");
- command.add("topinvstats");
- command.add("removeinvstats");
- command.add("sfstats");
- command.add("topsfstats");
- command.add("removesfstats");
- command.add("questanswer");
- //Overwrite vanilla
- command.add("butcher");
- //--- Register commands shown on /help here ---
- alias_map = map.new();
- command_list = list.new();
- command_map = map.new();
- command.register("afk", "Toggles afk");
- command.register("allsounds", "Plays all sounds");
- command.register("answer", "Answers the last private message");
- command.register("armorstand", "Armorstand commands");
- command.register("ass", "Armor Stand Signs");
- command.register("back", "Teleports to the last position");
- command.register("ban", "Bans a player");
- command.register("block", "Block commands");
- //command.register("clan", "Clan-Commands");
- command.register("color", "Shows all colors");
- command.register("comeback", "Teleports to your death location");
- command.register("copyisland", "Copyisland-Commands");
- command.register("creative", "Teleports to creative-spawn");
- command.register("customitems", "Shows all custom items");
- command.register("databank", "Databank-Commands");
- command.register("datatools", "Datatools-Commands");
- command.register("dev", "Dev-Commands");
- command.register("enchant", "Enchants an item in your hand");
- command.register("enderchest", "Shows enderchests");
- command.register("error", "Error-Logger");
- command.register("feed", "Fills hunger bar");
- command.register("fly", "Toggles fly");
- command.register("friend", "Friend-Commands");
- command.register("game", "marvs minigame shit");
- command.register("gamemode", "Change gamemode");
- command.register("gamerule", "Manage gamerules");
- command.register("games", "Teleports to games-spawn");
- command.register("giveup", "Giveup a quest");
- command.register("grow", "Grow seeds");
- command.register("hat", "Be fame with a new hat");
- command.register("head", "Gives you the head of a player");
- command.register("heal", "Heals, fills hunger bar and remove effects");
- command.register("help", "Shows this help");
- command.register("home", "Manage your homes");
- command.register("icon", "Shows all icons");
- command.register("live", "Toggles Live-Mode");
- command.register("lag", "Executes a lag test");
- command.register("leave", "Leaves a minigame");
- command.register("loginrequests", "Lists the last login requests");
- command.register("human", "Human-Commands");
- command.register("inv", "Inv-Commands");
- command.register("iteminfo", "Returns information about an item");
- command.register("jail", "Sends a player to jail");
- command.register("joinme", "Sends a party invitation to all online players");
- command.register("jumpto", "Jumps to a block in sight");
- command.register("kick", "Kicks a player");
- command.register("lastseen", "Shows the last players online");
- command.register("lightning", "Summons a lightning_bolt");
- command.register("list", "List all players online");
- command.register("mail", "Mail-Commands");
- command.register("mailbox", "Mailbox-Commands");
- command.register("memory", "Returns RAM-usage");
- command.register("msg", "Send a private message");
- command.register("mute", "Mutes a player");
- command.register("news", "Send Push-News to all players");
- command.register("nickname", "Set a nickname");
- command.register("nowb", "Sends no 'is back' message if afk");
- command.register("party", "Party-Commands");
- command.register("perm", "Manage permissions");
- command.register("playtime", "Shows your playtime");
- command.register("plot", "Plot-Commands");
- command.register("potion", "Adds a potion effects to an item");
- command.register("pvp", "Toggles pvp");
- command.register("quest", "Quest-Commands");
- command.register("rank", "Shows your available ranks");
- command.register("repair", "Repairs your item in mainhand");
- command.register("ride", "Rides an entity");
- command.register("say", "[Server] chat message");
- command.register("script", "Script-Commands");
- command.register("settings", "Opens settings menu");
- command.register("seen", "Returns the last date the player was online");
- //command.register("senditem", "Sends an itemstack to another player");
- command.register("setmessage", "Set your join/leave-message");
- command.register("setrank", "");
- command.register("setservermessage", "Sets the server-message in the serverlist");
- command.register("setspawn", "Changes a spawn");
- command.register("shop", "Shop-Commands");
- command.register("sign", "Edit a sign");
- command.register("silentjoin", "Toggles your silentjoins");
- command.register("skills", "Shows all skills");
- command.register("skipnight", "Skips the night");
- command.register("spawn", "Teleports to spawn");
- command.register("speed", "Sets your speed");
- command.register("sponsor", "See what a sponsor can do");
- command.register("start", "Starts a script");
- command.register("startgame", "Reduces start-countdown for a minigame");
- command.register("stats", "Statistics-Commands");
- //command.register("stopadventure", "Stops an adventure");
- command.register("suicide", "Kill yourself");
- command.register("support", "Creates a ticket for support");
- command.register("tempban", "Bans a player temporarly");
- command.register("tempfly", "Let a player temporarly fly");
- command.register("ticket", "Ticket-Commands");
- command.register("time", "Time-Commands");
- command.register("tip", "Tip-Commands");
- command.register("top", "Teleports to to highest point at the current position");
- command.register("tp", "Teleport command");
- command.register("tpa", "Sends a teleport request to a player");
- command.register("tpahere", "Sends a teleport request to a player");
- command.register("tpaccept", "Accepts a teleport request");
- command.register("tpaccepthere", "Accepts a teleport request");
- command.register("tppos", "Teleports to coordinates");
- command.register("unban", "Unbans a player");
- command.register("unjail", "Releases a player from jail");
- command.register("unmute", "Unmutes a player");
- command.register("user", "Returns infos about a user");
- command.register("vanish", "Vanishes a player");
- command.register("var", "Reads variables from a scripts");
- command.register("vote", "Show vote links");
- command.register("voteshop", "Show vote rewars");
- command.register("warn", "Warns a player");
- command.register("warp", "Warp-Commands");
- command.register("weather", "Weather-Commands");
- command.register("world", "World-Commands");
- command.registerAlias("as", "armorstand");
- command.registerAlias("h", "home");
- command.registerAlias("skull", "head");
- command.registerAlias("r", "answer");
- command.registerAlias("pardon", "unban");
- command.registerAlias("j", "jumpto");
- command.registerAlias("mimimi", "help");
- command.registerAlias("ci", "copyisland");
- command.registerAlias("mem", "memory");
- command.registerAlias("ram", "memory");
- command.registerAlias("colour", "color");
- command.registerAlias("gm", "gamemode");
- command.registerAlias("p", "plot");
- command.registerAlias("dt", "datatools");
- command.registerAlias("l", "leave");
- command.registerAlias("hub", "leave");
- command.registerAlias("v", "vanish");
- command.registerAlias("fuckit", "giveup");
- command.registerAlias("thor", "lightning");
- composter_par = particle.get("COMPOSTER");
- wall_signs_tag = block.getTag("minecraft:wall_signs");
- beds_tag = block.getTag("minecraft:beds");
- chest_tag = block.getTag("km:container");
- all_signs_tag = block.getTag("minecraft:all_signs");
- sign_tag = block.getTag("minecraft:signs");
- //dirt_tag = block.getTag("minecraft:dirt");
- prefix_shop = "§6Shop";
- prefix_clan = "§2Clan";
- prefix_tips = "§eTips";
- prefix_lock = "§eLock";
- prefix_commands = "§6Commands";
- prefix_vote = "§dVote";
- prefix_friends = "§5Friends";
- prefix_world = "§bWorld";
- prefix_jail = "§5Jail";
- prefix_quest = "§dQuest";
- prefix_perms = "§6Perms";
- prefix_datatools = "§6DataTools";
- prefix_human = "§6Human";
- prefix_plot = "§dPlots";
- prefix_party = "§5Party";
- prefix_skill = "§2Skill";
- initPlotFlags();
- initAllSounds();
- allsounds_list = getAllSounds();
- allsounds_indizes = map.new();
- allsounds_uuids = list.new();
- allsounds_uuids_cross_check = list.new();
- party_ids = getScriptVar("party_ids");
- if(party_ids == null) {
- party_ids = map.new();
- setScriptVar("party_ids", map.new()); //Player, partyid
- }
- party_lists = getScriptVar("party_lists");
- if(party_lists == null) {
- party_lists = map.new();
- setScriptVar("party_lists", map.new()); //partyid, Liste mit Players aller Partymitglieder
- }
- party_ranks = getScriptVar("party_ranks");
- if(party_ranks == null) {
- party_ranks = map.new();
- setScriptVar("party_ranks", map.new()); //Player, "leader"/"mod"/"player"
- }
- party_counter = getScriptVar("party_counter");
- if(party_counter == null) {
- party_counter = 0;
- setScriptVar("party_counter", party_counter); //Player, partyid
- }
- delkeytime = list.new(); //Alle Zeitpunkte zum Löschen der Einladungen (Vergleichsliste)
- delkeytimes = map.new(); //Player_uuid, Liste mit Zeitpunkten zum Löschen der Einladungen
- deluuid = list.new(); //Alle Player_uuids zum Löschen der Einladungen
- party_invitations = map.new(); //Player_uuid, Liste mit Player_uuids aller Einlader
- party_invite_ids = map.new(); //Player_uuid, partyid
- sign_copy_map = map.new();
- list = getScriptVar("block_commands_list");
- if(list == null) {
- list = list.new();
- setScriptVar("block_commands_list", list);
- }
- live_set = getScriptVar("live_set");
- if(live_set == null) {
- live_set = set.new();
- setScriptVar("live_set", live_set);
- } else {
- //Register all Live-Players again
- iter = iterator(live_set);
- while(hasNext(iter)) {
- player = player.get(next(iter));
- if(player != null) {
- player.setLive(player, true);
- }
- }
- }
- afk_loop_active = false;
- afk_map = getScriptVar("afk_map");
- if(afk_map == null) {
- afk_map = map.new();
- setScriptVar("afk_map", afk_map);
- } else {
- //Alle Spieler, die AFK waren, wieder als AFK registrieren
- iter = map.iterator(afk_map);
- while(hasNext(iter)) {
- element = next(iter);
- player = player.get(map.getKey(element));
- if(player != null) {
- player.setAfk(player, true);
- afk_loop_active = true;
- }
- }
- }
- if(afk_loop_active) {
- sgoto(30, "afk_loop");
- }
- setScriptVar("ha_data_lists", map.new());
- setScriptVar("ha_undo_lists", map.new());
- money.setBoostFactor(1);
- sgoto(200, "sb_title_loop");
- sgoto(100, "coordsloop");
- sgoto(1200, "afk_checker_loop");
- sgoto(1200, "minute_loop");
- logo = read.item("{id:\"minecraft:brown_banner\",Count:1b,tag:{BlockEntityTag:{Patterns:[{Pattern:\"bs\",Color:15},{Pattern:\"ts\",Color:15},{Pattern:\"bo\",Color:12},{Pattern:\"cs\",Color:12},{Pattern:\"mr\",Color:15},{Pattern:\"mc\",Color:14}]}}}");
- lag_list = list.new();
- clan_invitations = list.new();
- friend_requests = map.new();
- lock_chests = map.new();
- chatbuffer = map.new();
- tpa_request = list.new();
- answer_map = map.new();
- plotpos1 = map.new();
- plotpos2 = map.new();
- invseeids = set.new();
- fields = set.new();
- vanish_set = set.new();
- failed_cmds = set.new();
- skip_night_set = set.new();
- afk_checker_map = map.new();
- butcher_set = set.new();
- set.add(butcher_set, "zombie");
- set.add(butcher_set, "zombie_villager");
- set.add(butcher_set, "husk");
- set.add(butcher_set, "skeleton");
- set.add(butcher_set, "creeper");
- set.add(butcher_set, "enderman");
- set.add(butcher_set, "pillager");
- set.add(butcher_set, "spider");
- set.add(butcher_set, "phantom");
- set.add(butcher_set, "witch");
- set.add(butcher_set, "stray");
- set.add(butcher_set, "drowned");
- set.add(butcher_set, "wither");
- set.add(butcher_set, "silverfish");
- set.add(butcher_set, "zombified_piglin");
- set.add(butcher_set, "cod");
- set.add(butcher_set, "guardian");
- attribut_set = set.new();
- set.add(attribut_set, "GENERIC_ARMOR");
- set.add(attribut_set, "GENERIC_ARMOR_TOUGHNESS");
- set.add(attribut_set, "GENERIC_ATTACK_DAMAGE");
- set.add(attribut_set, "GENERIC_ATTACK_KNOCKBACK");
- set.add(attribut_set, "GENERIC_ATTACK_SPEED");
- set.add(attribut_set, "GENERIC_FLYING_SPEED");
- set.add(attribut_set, "GENERIC_FOLLOW_RANGE");
- set.add(attribut_set, "GENERIC_KNOCKBACK_RESISTANCE");
- set.add(attribut_set, "GENERIC_LUCK");
- set.add(attribut_set, "GENERIC_MAX_HEALTH");
- set.add(attribut_set, "GENERIC_MOVEMENT_SPEED");
- set.add(attribut_set, "HORSE_JUMP_STRENGTH");
- set.add(attribut_set, "ZOMBIE_SPAWN_REINFORCEMENTS");
- operation_set = set.new();
- set.add(operation_set, "ADD_NUMBER");
- set.add(operation_set, "ADD_SCALAR");
- set.add(operation_set, "MULTIPLY_SCALAR_1");
- not_blocked_cmd = set.new();
- set.add(not_blocked_cmd, "leave");
- set.add(not_blocked_cmd, "ban");
- set.add(not_blocked_cmd, "kick");
- set.add(not_blocked_cmd, "warn");
- set.add(not_blocked_cmd, "tempban");
- set.add(not_blocked_cmd, "mute");
- set.add(not_blocked_cmd, "unmute");
- set.add(not_blocked_cmd, "unban");
- set.add(not_blocked_cmd, "tip");
- set.add(not_blocked_cmd, "var");
- set.add(not_blocked_cmd, "quest");
- set.add(not_blocked_cmd, "msg");
- set.add(not_blocked_cmd, "help");
- rank_array = array.new(28, 2);
- //Playtime
- rank.add(0, "rank.owner", "4Owner");
- rank.add(1, "rank.admin", "cAdmin");
- rank.add(2, "rank.moderator", "9Moderator");
- rank.add(3, "rank.supporter", "bSupporter");
- rank.add(4, "rank.dev", "5Developer");
- rank.add(5, "rank.builder", "5Builder");
- rank.add(6, "rank.vip", "dVIP");
- rank.add(7, "rank.influencer", "dInfluencer");
- rank.add(8, "rank.sponsor", "dSponsor");
- rank.add(9, "rank.legend", "2Legend");
- rank.add(10, "rank.pioneer", "2Pioneer");
- rank.add(11, "rank.lord", "2Lord");
- rank.add(12, "rank.altruist", "2Altruist");
- rank.add(13, "rank.major", "2Major");
- rank.add(14, "rank.frequenter", "6Frequenter");
- rank.add(15, "rank.explorer", "6Explorer");
- rank.add(16, "rank.chief", "6Chief");
- rank.add(17, "rank.friend", "6Friend");
- rank.add(18, "rank.colonizer", "6Colonizer");
- rank.add(19, "rank.newcomer", "eNewcomer");
- rank.add(20, "rank.adventurer", "eAdventurer");
- rank.add(21, "rank.commander", "eCommander");
- rank.add(22, "rank.volunteer", "eVolunteer");
- rank.add(23, "rank.settler", "eSettler");
- rank.add(24, "rank.user", "3User");
- rank.add(25, "rank.challenger", "5Challenger");
- rank.add(26, "rank.mobhunter", "6Mobhunter");
- rank.add(27, "rank.collector", "2Collector");
- setScriptVar("ranks", rank_array);
- month_array = array.new(12, 2);
- month.register(0, "Jan", 31);
- month.register(1, "Feb", 28);
- month.register(2, "Mar", 31);
- month.register(3, "Apr", 30);
- month.register(4, "May", 31);
- month.register(5, "Jun", 30);
- month.register(6, "Jul", 31);
- month.register(7, "Aug", 31);
- month.register(8, "Sep", 30);
- month.register(9, "Oct", 31);
- month.register(10, "Nov", 30);
- month.register(11, "Dec", 31);
- jailed_list = list.new();
- ironbars = item.create("minecraft:iron_bars", 1, "§r", null);
- jailmenu = inv.new("00000000", text.new("§8Jail"));
- inv.setItem(jailmenu, 0, ironbars);
- inv.setItem(jailmenu, 1, ironbars);
- inv.setItem(jailmenu, 2, ironbars);
- inv.setItem(jailmenu, 3, ironbars);
- inv.setItem(jailmenu, 4, ironbars);
- inv.setItem(jailmenu, 5, ironbars);
- inv.setItem(jailmenu, 6, ironbars);
- inv.setItem(jailmenu, 7, ironbars);
- inv.setItem(jailmenu, 8, ironbars);
- skip_night_inv = inv.new("002020200", text.new("Skip Night?"));
- inv.setItem(skip_night_inv, 2, item.custom.create("CHECK_GREEN", 1, "§fYes", null));
- inv.setItem(skip_night_inv, 4, item.create("clay_ball", 1, "§fI don´t care", null));
- inv.setItem(skip_night_inv, 6, item.custom.create("CROSS_RED", 1, "§fNo", null));
- skip_night_inv_id = inv.getId(skip_night_inv);
- vote_inv = inv.new("222222222", text.new("§8Voteshop"));
- lore_list = list.new();
- list.add(lore_list, text.new("§fCost: §e6 VP"));
- list.add(lore_list, text.new("§5Doubles incoming money for 10 minutes."));
- list.add(lore_list, text.new("§5Effects quests, minigames and mobarena."));
- inv.setItem(vote_inv, 0, item.custom.create("GOLD_COIN", 1, "§aMoney Booster", lore_list));
- lore_list = list.new();
- list.add(lore_list, text.new("§fCost: §e2 VP"));
- list.add(lore_list, text.new("§5Rickroles every player on the server."));
- inv.setItem(vote_inv, 1, item.create("JUKEBOX", 1, "§aRick is in the house", lore_list));
- updateVoteInv();
- lore_list = list.new();
- list.add(lore_list, text.new("§fCost: §e2 VP"));
- list.add(lore_list, text.new("§5Be a kiddie and enjoy it."));
- inv.setItem(vote_inv, 3, item.create("JUKEBOX", 1, "§aBi Ba Bobby Car", lore_list));
- lore_list = list.new();
- list.add(lore_list, text.new("§fCost: §e1 VP"));
- list.add(lore_list, text.new("§5Plays a creeper sound for each player."));
- inv.setItem(vote_inv, 4, item.create("JUKEBOX", 1, "§aFalse Alarm", lore_list));
- lore_list = list.new();
- list.add(lore_list, text.new("§fCost: §e1 VP"));
- list.add(lore_list, text.new("§5Opens your enderchest."));
- inv.setItem(vote_inv, 5, item.create("ENDER_CHEST", 1, "§aMobile Enderchest", lore_list));
- lore_list = list.new();
- list.add(lore_list, text.new("§fCost: §e7 VP"));
- list.add(lore_list, text.new("§5A sapphire for your armor."));
- list.add(lore_list, text.new("§5To use at jewelry smith."));
- inv.setItem(vote_inv, 6, item.custom.create("SAPPHIRE", 1, "§aSapphire", lore_list));
- vote_inv_id = inv.getId(vote_inv);
- consoleCommands = set.new();
- set.add(consoleCommands, "ban");
- set.add(consoleCommands, "help");
- set.add(consoleCommands, "kick");
- set.add(consoleCommands, "lastseen");
- set.add(consoleCommands, "list");
- set.add(consoleCommands, "memory");
- set.add(consoleCommands, "mute");
- set.add(consoleCommands, "say");
- set.add(consoleCommands, "start");
- set.add(consoleCommands, "tempban");
- set.add(consoleCommands, "tempfly");
- set.add(consoleCommands, "unban");
- set.add(consoleCommands, "unmute");
- set.add(consoleCommands, "user");
- set.add(consoleCommands, "warn");
- set.add(consoleCommands, "world");
- databank.workerExecute(databank.prepare("
- CREATE TABLE IF NOT EXISTS friends (
- player_id INT NOT NULL,
- friend_id INT NOT NULL,
- time BIGINT NOT NULL,
- PRIMARY KEY (player_id, friend_id)
- );
- "));
- databank.workerExecute(databank.prepare("
- CREATE TABLE IF NOT EXISTS new_plotranks (
- plot_id INT NOT NULL,
- player_id INT NOT NULL,
- rank VARCHAR(10),
- PRIMARY KEY (plot_id, player_id)
- );
- "));
- databank.workerExecute(databank.prepare("
- CREATE TABLE IF NOT EXISTS new_homes (
- player_id INT NOT NULL,
- name VARCHAR(20) NOT NULL,
- world_name VARCHAR(20) NOT NULL,
- x DOUBLE NOT NULL,
- y DOUBLE NOT NULL,
- z DOUBLE NOT NULL,
- yaw DOUBLE NOT NULL,
- pitch DOUBLE NOT NULL,
- PRIMARY KEY (player_id, name)
- );
- "));
- databank.workerExecute(databank.prepare("
- CREATE TABLE IF NOT EXISTS votes (
- id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
- name VARCHAR(20) NOT NULL,
- player_id INT,
- time BIGINT NOT NULL
- );
- "));
- databank.workerExecute(databank.prepare("
- CREATE TABLE IF NOT EXISTS newbies (
- id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
- player_id INT NOT NULL,
- time BIGINT NOT NULL
- );
- "));
- //plot ranks cachen
- plot_ranks_map = map.new();
- stmt = databank.prepare("SELECT plot_id, player_id, rank FROM new_plotranks");
- result = databank.execute(stmt);
- while(databank.next(result)) {
- plot_id = databank.getInt(result, 1);
- player_id = databank.getInt(result, 2);
- rank = databank.getString(result, 3);
- map = map.get(plot_ranks_map, plot_id);
- if(map == null) {
- map = map.new();
- }
- map.add(map, player_id, rank);
- map.add(plot_ranks_map, plot_id, map);
- }
- databank.close(result);
- databank.close(stmt);
- setScriptVar("plot_ranks", plot_ranks_map);
- last_skip_night = 0;
- skip_night_started = false;
- jail_loop_active = false;
- actual_move_id = map.new(); //Key: player_uuid, Value: move_id. Diese Map speichert das aktuell betretene Plot eines Spielers.
- plot_move_ids_list = list.new(); //Speichert Array mit plot_id und move_id
- check_for_plot_list = list.new();
- plot.registerMoveEvents(world.getOverworld());
- plot.registerMoveEvents(world.getTheNether());
- plot.registerMoveEvents(world.getTheEnd());
- plot.registerMoveEvents(world.getCreative());
- RickRollSounds = getRickRollSounds();
- RickRollSoundDists = getRickRollSoundDists();
- rick_sounds_amount = list.getSize(RickRollSoundDists);
- bobbyCarSounds = getBobbyCarSounds();
- bobbyCarSoundDists = getBobbyCarSoundDists();
- bcar_sounds_amount = list.getSize(bobbyCarSoundDists);
- item_flags = getItemFlags();
- sound_category_master = sound.getCategory("MASTER");
- sound_flute = sound.get("BLOCK_NOTE_BLOCK_FLUTE");
- sound_harp = sound.get("BLOCK_NOTE_BLOCK_HARP");
- sound_pling = sound.get("BLOCK_NOTE_BLOCK_PLING");
- creeper_primed = sound.get("ENTITY_CREEPER_PRIMED");
- event.load("player_move");
- event.load("snuvi_click");
- event.load("inv_close");
- event.load("missing_perm");
- event.load("missing_command");
- event.load("command");
- event.load("custom_command");
- event.load("block_click");
- event.load("player_quit");
- event.load("vote");
- msg("dev", text.new("§bCommands §rloaded."));
- @wait
- wait();
- if(event == "command") {
- if(string.startsWith(permission, "worldedit", 0)) {
- if(perm.has("creative.we", player)) {
- world_name = world.getName(loc.getWorld(entity.getLocation(player)));
- if(!world.isCreativeName(world_name)) {
- cancel = true;
- msg.prefix(player, prefix_commands, "You are not in the creative world.");
- goto("wait");
- }
- }
- }
- goto("wait");
- }
- if(event == "custom_command") {
- //Permission-Check
- command = string.toLowerCase(command);
- command = map.getOrDefault(alias_map, command, command);
- size = list.getSize(args);
- if(isPlayer(sender)) {
- player = sender;
- } else {
- if(!set.contains(consoleCommands, command)) {
- msg.string(sender, "Sorry. Not a console command yet. Go and tell marvinius.");
- goto("wait");
- }
- player = null;
- }
- if(!perm.has(command, sender)) {
- perm.no(command, sender);
- goto("wait");
- }
- if(set.contains(failed_cmds, command)) {
- msg.prefix(sender, prefix_commands, "§cCommand temporarly deactivated due to failure.");
- goto("wait");
- }
- if(player.isCommandBlocked(sender)) {
- if(!set.contains(not_blocked_cmd, command)) {
- msg.prefix(sender, prefix_commands, "The most important rule in competition: Sabotage!");
- goto("wait");
- }
- }
- ignoreGoto(command);
- goto("wait");
- }
- if(event == "vote") {
- now_time = time.getMillis();
- vote.register(name, now_time);
- p_uuid = player.getUuid(name);
- if(p_uuid != null) {
- p_id = player.getId(p_uuid);
- player.addVotePoints(p_id, 1);
- if(from == "minecraft-server.eu") {
- msg("online", text.merge(text.new(string.getPrefix(prefix_vote)), text.new(string.concat(" §b", name, "§r has voted! ")), string.getLinkText("[§bminecraft-server.eu§r]", "https://minecraft-server.eu/vote/index/2227F")));
- } else {
- msg("online", text.merge(text.new(string.getPrefix(prefix_vote)), text.new(string.concat(" §b", name, "§r has voted! ")), string.getLinkText("[§bminecraft-server-list.com§r]", "https://minecraft-server-list.com/server/478200/vote/")));
- }
- last_vote_time = player.getLastVoteTime(p_id);
- new_streak = player.getVoteStreak(p_id);
- if(last_vote_time == 0) {
- new_streak++;
- } elseif(isFollowingDay(last_vote_time, now_time)) {
- new_streak++;
- } elseif(!isSameDay(last_vote_time, now_time)) {
- new_streak = 1;
- }
- if(new_streak % 7 == 0) {
- msg.online(prefix_vote, string.concat(player.getName(p_uuid), " reached a votestreak of 7 and gets an additional votepoint."));
- player.addVotePoints(p_id, 1);
- }
- player.setVoteStreak(p_id, new_streak);
- player.setLastVoteTime(p_id, now_time);
- }
- goto("wait");
- }
- if(event == "player_move") {
- player_uuid = player.getUuid(player);
- last_move_id = map.getOrDefault(actual_move_id, player_uuid, null);
- if(last_move_id == id) {
- goto("wait");
- }
- player_loc = entity.getLocation(player);
- new_plot_id = plot.getPlotIdFromMoveId(id);
- new_plot = plot.getFromId(new_plot_id, loc.getWorld(player_loc));
- if(new_plot == null) {
- goto("wait");
- }
- high_plot_id = plot.getHighestId(player_loc);
- if(new_plot_id < high_plot_id) {
- goto("wait");
- }
- if(plot.isCity(new_plot)) {
- color_code = "§c";
- } else {
- color_code = "§e";
- }
- title.send(player, text.new(""), text.new(string.concat("You entered ", color_code, plot.getName(new_plot), ".")));
- map.add(actual_move_id, player_uuid, id);
- list.add(check_for_plot_list, player_uuid);
- sgoto(100, "checkForPlot");
- goto("wait");
- }
- if(event == "block_click") {
- if(block == null) {
- goto("wait");
- }
- world_name = world.getName(loc.getWorld(entity.getLocation(player)));
- if(action == "RIGHT_CLICK_BLOCK" && !world.isSurvName(world_name) && block.hasTag(block, beds_tag)) {
- cancel = true;
- goto("wait");
- }
- if(player.hasBypass(player)) {
- goto("wait");
- }
- if(block.hasTag(block, chest_tag)) {
- block_loc = block.getLocation(block);
- if(plot.check(block_loc, player, 16, true)) {
- cancel = false;
- goto("wait");
- }
- player_id = player.getId(player);
- player_uuid = player.getUuid(player);
- list = plot.get(block_loc);
- if(list.getSize(list) > 0) {
- iter = iterator(list);
- access = false;
- while(hasNext(iter)) {
- plot = next(iter);
- canOpenChests = plot.canOpenChests(plot, player_id);
- if(plot.isSub(plot)) {
- if(canOpenChests) {
- cancel = false;
- goto("wait");
- }
- cancel = true;
- msg.prefix(player, prefix_plot, "This chest is locked for you.");
- goto("wait");
- }
- if(canOpenChests) {
- access = true;
- cancel = false;
- }
- }
- if(!access && !plot.hasBlock(block_loc)) {
- if(!world.isGamesName(world_name)) {
- msg.prefix(player, prefix_plot, "This chest is locked for you.");
- }
- }
- }
- goto("wait");
- }
- if(action == "RIGHT_CLICK_BLOCK" && block.hasTag(block, sign_tag)) {
- line0 = sign.getString(block, "FRONT", 0);
- if(line0 != "§3[§bFree Plot§3]") {
- goto("wait");
- }
- price = read.number(string.removeFormat(sign.getString(block, "FRONT", 1)));
- if(price == null || !isDouble(price) || price < 0) {
- msg.prefix(player, prefix_plot, "Positive number expected.");
- goto("wait");
- }
- p_id = read.number(sign.getString(block, "FRONT", 3));
- if(p_id == null || !isDouble(p_id)) {
- msg.prefix(player, prefix_plot, "Invalid city owner.");
- goto("wait");
- }
- if(player.getNameFromId(p_id) == null) {
- msg.prefix(player, prefix_plot, "Invalid city owner.");
- goto("wait");
- }
- if(!hasEnoughMoney(player, price)) {
- msg.prefix(player, prefix_plot, string.concat("You´ll need §6", string.number(price), "§r snuvis for this."));
- goto("wait");
- }
- block_loc = block.getLocation(block);
- plot_list = plot.get(block_loc);
- iter = iterator(plot_list);
- while(hasNext(iter)) {
- plot = next(iter);
- if(plot.isFree(plot)) {
- break;
- }
- }
- if(!plot.isFree(plot)) {
- msg.prefix(player, prefix_plot, "You aren´t on a free plot.");
- goto("wait");
- }
- //Plot claimen
- money.sub(player, price);
- money.add(p_id, price);
- plot.setSub(plot, true);
- plot.setLeader(plot, player.getId(player));
- player_name = player.getName(player);
- plot.addPlayer(plot, player_name);
- plot.setName(plot, string.concat("Plot of ", player_name));
- msg.prefix(player, prefix_plot, string.concat("Plot claimed. Spent §6", string.number(price), "§r snuvis."));
- goto("wait");
- }
- goto("wait");
- }
- if(event == "missing_command") {
- msg.prefix(sender, prefix_commands, string.concat("No command ", command));
- goto("wait");
- }
- if(event == "player_quit") {
- map.remove(afk_checker_map, uuid);
- player.setAfk(player, false);
- list.remove(jailed_list, player.getUuid(player));
- if(player.hasQuest(player)) {
- script_id = quest.getFromPlayer(player);
- script = script.getFromId(script_id);
- if(script == null) {
- msg.dev("Player logged out with corrupt quest");
- quest.removePlayer(player); //in case of corrupt quest
- goto("wait");
- }
- setScriptVar("player", player);
- modTimer.scriptCallEvent("quest_term", script);
- quest.term(script, player);
- }
- if(player.isInParty(player)) {
- party.kickPlayer(player, "logout");
- }
- goto("wait");
- }
- if(event == "missing_perm") {
- perm.no(command, sender);
- msg.prefix(sender, prefix_perms, string.concat("Missing Perm: §c", perm));
- goto("wait");
- }
- if(event == "snuvi_click") {
- inv_id = inv.getId(inv);
- item = inv.getItem(inv, inv_slot);
- if(item == null) {
- goto("wait");
- }
- title_string = string.text(inv_title);
- if(string.startsWith(title_string, "Mailbox", 0)) {
- item.removeFlag(item, "HIDE_DESTROYS");
- if(click == "SHIFT_LEFT") {
- //Clone item
- player.safeGiveItem(player, item);
- goto("wait");
- }
- //Take item
- player.safeGiveItem(player, item);
- inv.setItem(inv, inv_slot, item.create("BLACK_STAINED_GLASS_PANE", 1, "", null));
- split_array = string.split(" ", title_string);
- p_name = split_array[2];
- p_uuid = player.getUuid(p_name);
- if(p_uuid == null) {
- inv.close(player);
- msg.prefix(player, prefix_commands, "Mailbox closed. Unknown player.");
- goto("wait");
- }
- p_id = player.getId(p_uuid);
- mailbox.removeItem(p_id, inv_slot);
- goto("wait");
- }
- if(string.startsWith(title_string, "Customitems", 0)) {
- item = inv.getItem(inv, inv_slot);
- if(item != null) {
- player.safeGiveItem(player, item);
- }
- goto("wait");
- }
- if(set.contains(invseeids, inv_id)) {
- if(!perm.has("inv.see.plus", player)) {
- perm.no("inv.see.plus", player);
- goto("wait");
- }
- split_array = string.split(" ", title_string);
- p_name = split_array[2];
- p = read.player(p_name);
- if(p == null) {
- inv.close(player);
- msg.prefix(player, prefix_commands, "This player is no longer online. Use /inv to load and overwrite an inventory of a offline player.");
- goto("wait");
- }
- item.removeFlag(item, "HIDE_DESTROYS");
- if(click == "SHIFT_LEFT") {
- //Clone item
- player.safeGiveItem(player, item);
- goto("wait");
- }
- //Transmit item
- player.removeItem(p, item);
- player.safeGiveItem(player, item);
- inv.setItem(inv, inv_slot, item.create("BLACK_STAINED_GLASS_PANE", 1, "", null));
- goto("wait");
- }
- if(inv_id == vote_inv_id) {
- if(inv_slot == 0) {
- if(money.getBoostFactor() > 1) {
- msg.prefix(player, prefix_commands, "Boost already active.");
- goto("wait");
- }
- vp = player.getVotePoints(player);
- if(vp < 6) {
- msg.prefix(player, prefix_commands, "Not enough vote points.");
- goto("wait");
- }
- player.setVotePoints(player, vp - 6);
- msg.online(prefix_vote, string.concat(player.getName(player), " activated §dMoney Booster§r."));
- money.setBoostFactor(2);
- online_list = players.toList();
- iter = iterator(online_list);
- while(hasNext(iter)) {
- p = next(iter);
- sb.add(p, 5, "§6Money Booster +100%");
- }
- sgoto(12000, "resetMoneyBoost");
- goto("wait");
- }
- if(inv_slot == 1) {
- vp = player.getVotePoints(player);
- if(vp < 2) {
- msg.prefix(player, prefix_commands, "Not enough vote points.");
- goto("wait");
- }
- msg.online(prefix_vote, string.concat(player.getName(player), " activated §dRick is in the house§r."));
- player.setVotePoints(player, vp - 2);
- rickIndex = 0;
- goto("RickRole_play");
- }
- if(inv_slot == 2) {
- vp = player.getVotePoints(player);
- if(vp < 1) {
- msg.prefix(player, prefix_commands, "Not enough vote points.");
- goto("wait");
- }
- player.setVotePoints(player, vp - 1);
- increaseHomeBoost();
- msg.online(prefix_vote, string.concat(player.getName(player), " spend their votepoints to §dMore Homes§r."));
- goto("wait");
- }
- if(inv_slot == 3) {
- vp = player.getVotePoints(player);
- if(vp < 2) {
- msg.prefix(player, prefix_commands, "Not enough vote points.");
- goto("wait");
- }
- msg.online(prefix_vote, string.concat(player.getName(player), " activated §dBi Ba Bobby Car§r."));
- player.setVotePoints(player, vp - 2);
- bobbycarIndex = 0;
- goto("bobbycar_play");
- }
- if(inv_slot == 4) {
- vp = player.getVotePoints(player);
- if(vp < 1) {
- msg.prefix(player, prefix_commands, "Not enough vote points.");
- goto("wait");
- }
- msg.online(prefix_vote, string.concat(player.getName(player), " activated §dFalse Alarm§r."));
- player.setVotePoints(player, vp - 1);
- iter = iterator(players.toList());
- while(hasNext(iter)) {
- sound.spawnForPlayer(next(iter), creeper_primed, sound_category_master);
- }
- goto("wait");
- }
- if(inv_slot == 5) {
- vp = player.getVotePoints(player);
- if(vp < 1) {
- msg.prefix(player, prefix_commands, "Not enough vote points.");
- goto("wait");
- }
- player.setVotePoints(player, vp - 1);
- inv.open(player.getEnderInv(player), player);
- goto("wait");
- }
- if(inv_slot == 6) {
- vp = player.getVotePoints(player);
- if(vp < 7) {
- msg.prefix(player, prefix_commands, "Not enough vote points.");
- goto("wait");
- }
- msg.online(prefix_vote, string.concat(player.getName(player), " spend their votepoints to §dSapphire§r."));
- player.setVotePoints(player, vp - 7);
- player.giveItem(player, item.getSapphire());
- goto("wait");
- }
- goto("wait");
- }
- if(inv_id == skip_night_inv_id) {
- world = world.getOverWorld();
- world_time = world.getTime(world);
- while(world_time >= 24000) {
- world_time -= 24000;
- }
- if(world_time <= 12500) {
- goto("wait");
- }
- player_uuid = player.getUuid(player);
- if(set.contains(skip_night_set, player_uuid)) {
- msg.prefix(player, prefix_commands, "Already voted.");
- goto("wait");
- }
- if(!skip_night_started) {
- skip_night_yes_list = list.new();
- world.addTimedStatus(world, 49, 300, "Skip night?");
- msg("online", text.merge(text.new(string.getPrefix(prefix_commands)), text.new(" Skip night? Vote within 15 seconds. "), string.getClickText("[§cClick§r]", "/skipnight")));
- skip_night_counter = 15;
- skip_night_yes = 0;
- skip_night_no = 0;
- skip_night_no_care = 0;
- skip_night_started = true;
- sgoto(20, "skip_night_loop");
- }
- if(inv_slot == 2) {
- skip_night_yes++;
- inv.close(player);
- set.add(skip_night_set, player_uuid);
- list.add(skip_night_yes_list, player_uuid);
- goto("wait");
- }
- if(inv_slot == 4) {
- skip_night_no_care++;
- inv.close(player);
- set.add(skip_night_set, player_uuid);
- goto("wait");
- }
- if(inv_slot == 6) {
- skip_night_no++;
- inv.close(player);
- set.add(skip_night_set, player_uuid);
- goto("wait");
- }
- goto("wait");
- }
- if(title_string == "Skills") {
- if(item == null) {
- goto("wait");
- }
- skill_name = string.removeFormat(string.text(item.getName(item)));
- if(skill_name == "") {
- goto("wait");
- }
- tech_name = skill.getTechName(skill_name);
- //Toggle skills
- if(skill.isToggleable(tech_name)) {
- if(skill.isActivated(player, tech_name)) {
- skill.setActivated(player, tech_name, false);
- } else {
- skill.setActivated(player, tech_name, true);
- }
- inv.setItem(inv, inv_slot, skill.getSettingsItem(player, tech_name));
- goto("wait");
- }
- //Activate skill
- if(skill.isActive(tech_name)) {
- player_loc = entity.getLocation(player);
- world_name = world.getName(loc.getWorld(player_loc));
- if(!world.isSurvName(world_name)) {
- msg.prefix(player, prefix_skill, "You can´t use this in this world.");
- goto("wait");
- }
- goto("wait");
-
- if(tech_name == "skill.fire_arrow") {
- duration = data.getTimer(player, tech_name);
- if(duration > 0) {
- msg.prefix(player, prefix_skill, "Skill already active.");
- goto("wait");
- }
- amount = skill.getAmount(player, tech_name);
- if(amount > 0) {
- status.addTimed(player, 54, 1200, skill_name);
- data.setTimer(player, tech_name, 1200);
- new_amount = amount - 1;
- skill.setAmount(player, tech_name, new_amount);
- msg.prefix(player, prefix_skill, string.concat("Used ", skill_name, ". New amount: ", string.number(new_amount)));
- }
- goto("wait");
- }
- if(tech_name == "skill.fly10min") {
- duration = data.getTimer(player, "fly");
- if(duration > 0) {
- msg.prefix(player, prefix_skill, "Skill already active.");
- goto("wait");
- }
- amount = skill.getAmount(player, "skill.fly10min");
- if(amount > 0) {
- status.addTimed(player, 50, 12000, "Fly");
- data.setTimer(player, "fly", 12000);
- player.setFly(player, true);
- new_amount = amount - 1;
- skill.setAmount(player, "skill.fly10min", new_amount);
- msg.prefix(player, prefix_skill, string.concat("Used Fly 10min. New amount: ", string.number(new_amount)));
- }
- goto("wait");
- }
- if(tech_name == "skill.grow") {
- amount = skill.getAmount(player, "skill.grow");
- if(amount > 0) {
- grow(player_loc, 5);
- particle.spawnCircle(loc.mod(entity.getLocation(player), 0, 0.8, 0), composter_par, 50, 5, 1, 0, 0, 0.2, 0);
- new_amount = amount - 1;
- skill.setAmount(player, "skill.grow", new_amount);
- msg.prefix(player, prefix_skill, string.concat("Used Grow. New amount: ", string.number(new_amount)));
- }
- goto("wait");
- }
- if(tech_name == "skill.haste") {
- amount = skill.getAmount(player, "skill.haste");
- if(amount > 0) {
- entity.addEffect(player, "haste", 2400, 0);
- new_amount = amount - 1;
- skill.setAmount(player, "skill.haste", new_amount);
- msg.prefix(player, prefix_skill, string.concat("Used Haste. New amount: ", string.number(new_amount)));
- }
- goto("wait");
- }
- if(tech_name == "skill.speed") {
- amount = skill.getAmount(player, "skill.speed");
- if(amount > 0) {
- entity.addEffect(player, "speed", 2400, 0);
- new_amount = amount - 1;
- skill.setAmount(player, "skill.speed", new_amount);
- msg.prefix(player, prefix_skill, string.concat("Used Speed. New amount: ", string.number(new_amount)));
- }
- goto("wait");
- }
- if(tech_name == "skill.jump_boost") {
- amount = skill.getAmount(player, "skill.jump_boost");
- if(amount > 0) {
- entity.addEffect(player, "jump_boost", 2400, 1);
- new_amount = amount - 1;
- skill.setAmount(player, "skill.jump_boost", new_amount);
- msg.prefix(player, prefix_skill, string.concat("Used Jump Boost. New amount: ", string.number(new_amount)));
- }
- goto("wait");
- }
- if(tech_name == "skill.dolphin") {
- amount = skill.getAmount(player, "skill.dolphin");
- if(amount > 0) {
- entity.addEffect(player, "dolphins_grace", 1200, 0);
- new_amount = amount - 1;
- skill.setAmount(player, "skill.dolphin", new_amount);
- msg.prefix(player, prefix_skill, string.concat("Used Dolphin. New amount: ", string.number(new_amount)));
- }
- goto("wait");
- }
- if(tech_name == "skill.block_up") {
- duration = data.getTimer(player, "block_up");
- if(duration > 0) {
- msg.prefix(player, prefix_skill, "Skill already active.");
- goto("wait");
- }
- amount = skill.getAmount(player, "skill.block_up");
- if(amount > 0) {
- status.addTimed(player, 51, 1200, "Block Up");
- data.setTimer(player, "block_up", 1200);
- new_amount = amount - 1;
- skill.setAmount(player, "skill.block_up", new_amount);
- msg.prefix(player, prefix_skill, string.concat("Used Block Up. New amount: ", string.number(new_amount)));
- }
- goto("wait");
- }
- if(tech_name == "skill.block_down") {
- duration = data.getTimer(player, "block_down");
- if(duration > 0) {
- msg.prefix(player, prefix_skill, "Skill already active.");
- goto("wait");
- }
- amount = skill.getAmount(player, "skill.block_down");
- if(amount > 0) {
- status.addTimed(player, 52, 1200, "Block Down");
- data.setTimer(player, "block_down", 1200);
- new_amount = amount - 1;
- skill.setAmount(player, "skill.block_down", new_amount);
- msg.prefix(player, prefix_skill, string.concat("Used Block Down. New amount: ", string.number(new_amount)));
- }
- goto("wait");
- }
- }
- goto("wait");
- }
- if(title_string == "§8Settings") {
- if(inv_slot == 0) {
- new_value = !player.getAutoCloseDoor(player);
- player.setAutoCloseDoor(player, new_value);
- inv.setItem(inv, inv_slot, item.create("minecraft:oak_door", 1, "§fAutomatic Doors", item.createLore(new_value)));
- }
- elseif(inv_slot == 1) {
- new_value = !player.doesAcceptTpaRequests(player);
- player.acceptTpaRequests(player, new_value);
- inv.setItem(inv, inv_slot, item.create("minecraft:ender_pearl", 1, "§fAccept TPA-Requests", item.createLore(new_value)));
- }
- elseif(inv_slot == 2) {
- new_value = !player.getShowcoords(player);
- player.setShowcoords(player, new_value);
- inv.setItem(inv, inv_slot, item.create("minecraft:compass", 1, "§fShow Coords", item.createLore(new_value)));
- if(!new_value) {
- sb.remove(player, 2);
- sb.remove(player, 3);
- }
- }
- elseif(inv_slot == 3) {
- new_value = !player.hasSittingActivated(player);
- player.activateSitting(player, new_value);
- inv.setItem(inv, inv_slot, item.create("minecraft:oak_stairs", 1, "§fStair-Sitting", item.createLore(new_value)));
- }
- elseif(inv_slot == 4) {
- new_value = !hasPvpOn(player);
- setPvp(player, new_value);
- inv.setItem(inv, inv_slot, item.create("minecraft:iron_sword", 1, "§fPvP", item.createLore(new_value)));
- }
- elseif(inv_slot == 5) {
- new_value = !player.getNoPetDamage(player);
- player.setNoPetDamage(player, new_value);
- inv.setItem(inv, inv_slot, item.create("minecraft:bone", 1, "§fNo Pet Damage", item.createLore(new_value)));
- }
- elseif(inv_slot == 6) {
- new_value = !player.getTipLoop(player);
- player.setTipLoop(player, new_value);
- inv.setItem(inv, inv_slot, item.create("minecraft:oak_sign", 1, "§fShow tip loop", item.createLore(new_value)));
- }
- elseif(inv_slot == 7) {
- new_value = !player.usesCustomMessage(player);
- player.activateCustomMessage(player, new_value);
- inv.setItem(inv, inv_slot, item.create("minecraft:oak_sign", 1, "§fUse custom messages", item.createLore(new_value)));
- }
- }
- goto("wait");
- }
- if(event == "inv_close") {
- if(set.contains(invseeids, inv_id)) {
- set.remove(invseeids, inv_id);
- }
- goto("wait");
- }
- goto("wait");
- @block
- if(size == 0) {
- @blockhelp
- msg.prefix(player, prefix_plot, "/block ...");
- msg.string(player, "§d - info §rPrints info about a block");
- msg.string(player, "§d - public §rMakes a block public");
- msg.string(player, "§d - remove §rRemoves a block from public list");
- if(perm.has("block.fix", player)) {
- msg.string(player, "§d - fix §rRemoves all air blocks from public list");
- }
- goto("wait");
- }
- arg0 = string.toLowerCase(list.getIndex(args, 0));
- if(arg0 == "info") {
- block = player.getTargetBlock(player, 5);
- if(block == null) {
- msg.prefix(player, prefix_commands, "No block in sight.");
- goto("wait");
- }
- target_loc = block.getLocation(block);
- msg.string(player, string.getSpacer());
- x = string.number(loc.getX(target_loc));
- y = string.number(loc.getY(target_loc));
- z = string.number(loc.getZ(target_loc));
- msg.string(player, string.concat("§6W §r", world.getName(loc.getWorld(target_loc))));
- msg.string(player, string.concat("§6X §r", x, " §6Y §r", y, " §6Z §r", z));
- msg.string(player, string.concat("§6Type: §r", block.getType(block)));
- msg.string(player, string.concat("§6Public: §r", plot.hasBlock(target_loc)));
- msg.string(player, string.concat("§6Data: §r", block.getData(block)));
- goto("wait");
- }
- if(arg0 == "public") {
- if(size != 1) {
- msg.prefix(player, prefix_commands, "/block public");
- goto("wait");
- }
- block = player.getTargetBlock(player, 5);
- if(block == null) {
- msg.prefix(player, prefix_commands, "No block in sight.");
- goto("wait");
- }
- location = block.getLocation(block);
- plot.addBlock(location);
- msg.prefix(player, prefix_commands, "Block whitelisted for interaction.");
- plot.saveBlocks(loc.getWorld(location));
- goto("wait");
- }
- if(arg0 == "remove") {
- if(size != 1) {
- msg.prefix(player, prefix_commands, "/block remove");
- goto("wait");
- }
- block = player.getTargetBlock(player, 5);
- if(block == null) {
- msg.prefix(player, prefix_commands, "No block in sight.");
- goto("wait");
- }
- location = block.getLocation(block);
- plot.removeBlock(location);
- msg.prefix(player, prefix_commands, "Block no longer whitelisted for interaction.");
- plot.saveBlocks(loc.getWorld(location));
- goto("wait");
- }
- if(arg0 == "fix") {
- if(!perm.has("block.fix", player)) {
- perm.no("block.fix", player);
- goto("wait");
- }
- //temp_list verhindern concurrent modification
- temp_list = list.new();
- world = world.getOverWorld();
- c = 0;
- iter = plot.blockIterator(world);
- while(hasNext(iter)) {
- pos = next(iter);
- x = plot.position.getX(pos);
- y = plot.position.getY(pos);
- z = plot.position.getZ(pos);
- loc = loc.new(world, x, y, z);
- block = block.get(loc);
- if(block.isAir(block)) {
- c++;
- list.add(temp_list, loc);
- }
- }
- iter = iterator(temp_list);
- while(hasNext(iter)) {
- plot.removeBlock(next(iter));
- }
- msg.prefix(player, prefix_commands, string.concat("Removed ", string.number(c), " blocks."));
- goto("wait");
- }
- goto("blockhelp");
- @settings
- inv = inv.new("222222222", text.new("§8Settings"));
- inv.setItem(inv, 0, item.create("minecraft:oak_door", 1, "§fAutomatic Doors", item.createLore(player.getAutoCloseDoor(player))));
- inv.setItem(inv, 1, item.create("minecraft:ender_pearl", 1, "§fAccept TPA-Requests", item.createLore(player.doesAcceptTpaRequests(player))));
- inv.setItem(inv, 2, item.create("minecraft:compass", 1, "§fShow Coords", item.createLore(player.getShowcoords(player))));
- inv.setItem(inv, 3, item.create("minecraft:oak_stairs", 1, "§fStair-Sitting", item.createLore(player.hasSittingActivated(player))));
- inv.setItem(inv, 4, item.create("minecraft:iron_sword", 1, "§fPvP", item.createLore(hasPvpOn(player))));
- inv.setItem(inv, 5, item.create("minecraft:bone", 1, "§fNo Pet Damage", item.createLore(player.getNoPetDamage(player))));
- inv.setItem(inv, 6, item.create("minecraft:oak_sign", 1, "§fShow tip loop", item.createLore(player.getTipLoop(player))));
- inv.setItem(inv, 7, item.create("minecraft:oak_sign", 1, "§fUse custom messages", item.createLore(player.usesCustomMessage(player))));
- inv.open(inv, player);
- goto("wait");
- @loginrequests
- if(size < 2) {
- msg.prefix(sender, prefix_commands, "/loginrequests <player/all> <amount> [result]");
- goto("wait");
- }
- amount = list.getIndex(args, 1);
- if(!isDouble(amount) || amount < 0) {
- msg.prefix(player, prefix_shop, "Positive number expected.");
- goto("wait");
- }
- result = null;
- if(size == 3) {
- result = list.getIndex(args, 2);
- if(result != "ALLOWED" &&
- result != "KICK_FULL" &&
- result != "KICK_BANNED" &&
- result != "KICK_WHITELIST" &&
- result != "KICK_OTHER") {
- msg.prefix(player, prefix_shop, "No valid result.");
- goto("wait");
- }
- }
- p_name = list.getIndex(args, 0);
- if(p_name == "all") {
- list = loginrequests.getAll(amount, result);
- } else {
- p_uuid = player.getUuid(p_name);
- if(p_uuid == null) {
- msg.prefix(player, prefix_tips, "This player has never been online.");
- goto("wait");
- }
- p_id = player.getId(p_uuid);
- list = loginrequests.getPlayer(p_id, amount, result);
- }
- table = table.new("§b", 10, 11, 10);
- msg.string(player, table.getStart(table));
- msg.string(player, table.get(table, "Player", "Time", "Result"));
- msg.string(player, table.getMiddle(table));
- iter = iterator(list);
- while(hasNext(iter)) {
- a = next(iter);
- msg.string(player, table.get(table, player.getNameFromId(a[0]), time.getString(a[1]), a[2]));
- }
- msg.string(player, table.getEnd(table));
- goto("wait");
- @shop
- if(size == 0) {
- @shop_help
- msg.prefix(player, prefix_shop, "/shop ...");
- msg.string(player, "§6 - create §rCreates a shop");
- msg.string(player, "§6 - buy <amount> <price> §rSet buy settings");
- msg.string(player, "§6 - sell <amount> <price> §rSet sell settings");
- msg.string(player, "§6 - remove <buy/sell> §rRemove settings");
- if(perm.has("shop.owner", player)) {
- msg.string(player, "§6 - owner <player> §rSet shop owner");
- }
- goto("wait");
- }
- arg0 = string.toLowerCase(list.getIndex(args, 0));
- if(arg0 == "create") {
- if(size != 1) {
- msg.prefix(player, prefix_shop, "§6/shop create");
- goto("wait");
- }
- sign_block = player.getTargetBlock(player, 5, false, false);
- if(!block.isWallSign(sign_block)) {
- msg.prefix(player, prefix_shop, "Look at a wall sign.");
- goto("wait");
- }
- chest_block = block.mod(sign_block, 0, -1, 0);
- if(!block.isChest(chest_block)) {
- msg.prefix(player, prefix_shop, "No chest under sign.");
- goto("wait");
- }
- if(sign.getString(sign_block, "FRONT", 0) != "") {
- msg.prefix(player, prefix_shop, "Sign is not empty.");
- goto("wait");
- }
- sign_loc = block.getLocation(sign_block);
- sign.setString(sign_block, "FRONT", 0, "[Shop]");
- sign.setString(sign_block, "FRONT", 3, string.number(player.getId(player)));
- block.signSetWaxed(sign_block, true);
- msg.prefix(player, prefix_shop, "Created Shop.");
- goto("wait");
- }
- if(arg0 == "buy" || arg0 == "sell") {
- if(size != 3) {
- msg.prefix(player, prefix_shop, string.concat("§6/shop ", arg0, " <amount> <price>"));
- goto("wait");
- }
- amount = list.getIndex(args, 1);
- price = list.getIndex(args, 2);
- if(!isDouble(amount) || !isDouble(price)) {
- msg.prefix(player, prefix_shop, "Number expected.");
- goto("wait");
- }
- amount = math.round(amount);
- if(amount < 0) {
- msg.prefix(player, prefix_shop, "Positive number expected.");
- goto("wait");
- }
- if(price < 0) {
- msg.prefix(player, prefix_shop, "Positive number expected.");
- goto("wait");
- }
- if(price > 266304) {
- msg.prefix(player, prefix_shop, string.concat("Maximum ", money.getString(266304), " allowed."));
- goto("wait");
- }
- sign_block = player.getTargetBlock(player, 5, false, false);
- if(!block.isWallSign(sign_block)) {
- msg.prefix(player, prefix_shop, "Look at a wall sign.");
- goto("wait");
- }
- chest_block = block.mod(sign_block, 0, -1, 0);
- if(!block.isChest(chest_block)) {
- msg.prefix(player, prefix_shop, "No chest under sign.");
- goto("wait");
- }
- if(!shop.isOwner(player, sign_block)) {
- msg.prefix(player, prefix_shop, "You are not the owner.");
- goto("wait");
- }
- if(arg0 == "buy") {
- sign.setString(sign_block, "FRONT", 1, string.concat("Buy ", string.number(amount), " for ", string.number(price)));
- } else {
- sign.setString(sign_block, "FRONT", 2, string.concat("Sell ", string.number(amount), " for ", string.number(price)));
- }
- msg.prefix(player, prefix_shop, "Price set.");
- goto("wait");
- }
- if(arg0 == "remove") {
- if(size != 2) {
- msg.prefix(player, prefix_shop, "§6/shop remove <buy/sell>");
- goto("wait");
- }
- sign_block = player.getTargetBlock(player, 5, false, false);
- if(!block.isWallSign(sign_block)) {
- msg.prefix(player, prefix_shop, "Look at a wall sign.");
- goto("wait");
- }
- chest_block = block.mod(sign_block, 0, -1, 0);
- if(!block.isChest(chest_block)) {
- msg.prefix(player, prefix_shop, "No chest under sign.");
- goto("wait");
- }
- if(!shop.isOwner(player, sign_block)) {
- msg.prefix(player, prefix_shop, "You are not the owner.");
- goto("wait");
- }
- arg1 = string.toLowerCase(list.getIndex(args, 1));
- if(arg1 == "buy") {
- sign.setString(sign_block, "FRONT", 1, "");
- } elseif(arg1 == "sell") {
- sign.setString(sign_block, "FRONT", 2, "");
- } else {
- msg.prefix(player, prefix_shop, "§6/shop remove <buy/sell>");
- goto("wait");
- }
- msg.prefix(player, prefix_shop, "Price removed.");
- goto("wait");
- }
- if(arg0 == "owner") {
- if(!perm.has("shop.owner", player)) {
- perm.no("shop.owner", player);
- goto("wait");
- }
- if(size != 2) {
- msg.prefix(player, prefix_shop, "§6/shop owner <player>");
- goto("wait");
- }
- p_name = list.getIndex(args, 1);
- p_uuid = player.getUuid(p_name);
- if(p_uuid == null) {
- msg.prefix(player, prefix_shop, "This player has never been online.");
- goto("wait");
- }
- sign_block = player.getTargetBlock(player, 5, false, false);
- if(!block.isWallSign(sign_block)) {
- msg.prefix(player, prefix_shop, "Look at a wall sign.");
- goto("wait");
- }
- sign.setString(sign_block, "FRONT", 3, string.number(player.getId(p_uuid)));
- goto("wait");
- }
- goto("shop_help");
- @mailbox
- location = entity.getLocation(player);
- world_name = world.getName(loc.getWorld(entity.getLocation(player)));
- if(!world.isSurvName(world_name)) {
- msg.prefix(player, prefix_commands, "You can´t use this command in this world.");
- goto("wait");
- }
- if(player.isOnAdventure(player) && !perm.has("mailbox.other", player)) {
- msg.prefix(player, prefix_commands, "You can´t use the mailbox while on adventure.");
- goto("wait");
- }
- if(size == 0) {
- msg.prefix(player, prefix_commands, "/mailbox...");
- if(perm.has("mailbox.other", player)) {
- msg.string(player, "§6 - show [player] §rOpens a mailbox of a player.");
- } else {
- msg.string(player, "§6 - show §rOpens your mailbox.");
- }
- msg.string(player, "§6 - send <player> §rSends the item in your hand to a mailbox of a player.");
- goto("wait");
- }
- arg0 = string.toLowerCase(list.getIndex(args, 0));
- if(arg0 == "send") {
- if(size != 2) {
- msg.prefix(player, prefix_commands, "/mailbox send <player>");
- goto("wait");
- }
- item = living.getHand(player);
- if(item.isAir(item)) {
- msg.prefix(player, prefix_commands, "You have to hold an item in your mainhand.");
- goto("wait");
- }
- to_name = list.getIndex(args, 1);
- if(!checkIfEverOnline(to_name)) {
- msg.prefix(player, prefix_commands, "This player has never been online.");
- goto("wait");
- }
- to_player_id = player.getId(player.getUuid(to_name));
- if(!mailbox.sendItem(to_player_id, item)) {
- msg.prefix(player, prefix_commands, "No free space in mailbox.");
- goto("wait");
- }
- living.setEquip(player, read.slot("HAND"), null);
- msg.send(player, to_name, prefix_commands, string.concat(player.getName(player), " sent you items to your mailbox."), true);
- msg.prefix(player, prefix_commands, "Item sent to player.");
- goto("wait");
- }
- if(arg0 == "show") {
- if(size == 1) {
- player_id = player.getId(player);
- mailbox.show(player, player_id, false);
- mailbox.clear(player_id);
- goto("wait");
- }
- if(size == 2) {
- if(!perm.has("mailbox.other", player)) {
- perm.no("mailbox.other", player);
- goto("wait");
- }
- from_name = list.getIndex(args, 1);
- if(!checkIfEverOnline(from_name)) {
- msg.prefix(player, prefix_commands, "This player has never been online.");
- goto("wait");
- }
- from_player_id = player.getId(player.getUuid(from_name));
- mailbox.show(player, from_player_id, true);
- goto("wait");
- }
- if(perm.has("mailbox.other", player)) {
- msg.prefix(player, prefix_commands, "/mailbox show [player]");
- } else {
- msg.prefix(player, prefix_commands, "/mailbox show");
- }
- }
- goto("wait");
- @RickRole_play
- if(rickIndex < rick_sounds_amount) {
- pitch = list.getIndex(RickRollSounds, rickIndex);
- PlayVoteSound(pitch);
- ticks = 2 + list.getIndex(RickRollSoundDists, rickIndex);
- sgoto(ticks, "RickRole_play");
- }
- rickIndex++;
- goto("wait");
- @bobbycar_play
- if(bobbycarIndex < bcar_sounds_amount) {
- pitch = list.getIndex(bobbyCarSounds, bobbycarIndex);
- PlayVoteSound(pitch);
- ticks = list.getIndex(bobbyCarSoundDists, bobbycarIndex);
- sgoto(ticks, "bobbycar_play");
- }
- bobbycarIndex++;
- goto("wait");
- function PlayVoteSound(pitch) {
- iter = iterator(players.toList());
- while(hasNext(iter)) {
- online_player = next(iter);
- if(online_player == null) {
- continue;
- }
- sound.spawnForPlayer(online_player, $sound_flute, $sound_category_master, 1, pitch);
- sound.spawnForPlayer(online_player, $sound_harp, $sound_category_master, 1, pitch);
- sound.spawnForPlayer(online_player, $sound_pling, $sound_category_master, 1, pitch);
- }
- }
- @resetMoneyBoost
- money.setBoostFactor(1);
- online_list = players.toList();
- iter = iterator(online_list);
- while(hasNext(iter)) {
- p = next(iter);
- sb.remove(p, 5);
- }
- goto("wait");
- @skip_night_loop
- skip_night_counter--;
- if(skip_night_counter == 0) {
- msg.online(prefix_commands, "Skip night results:");
- msg("online", text.new(string.concat("§e - §rYes: §e", string.number(skip_night_yes))));
- msg("online", text.new(string.concat("§e - §rNo: §e", string.number(skip_night_no))));
- msg("online", text.new(string.concat("§e - §rI don´t care: §e", string.number(skip_night_no_care))));
- if(skip_night_yes > skip_night_no) {
- world = world.getOverWorld();
- world.setTime(world, 0);
- }
- set.clear(skip_night_set);
- last_skip_night = time.getMillis();
- iter = iterator(skip_night_yes_list);
- while(hasNext(iter)) {
- p = player.get(next(iter));
- if(p != null) {
- player.resetSleep(p);
- }
- }
- sgoto(8400, "reset_skip_night");
- goto("wait");
- }
- sgoto(20, "skip_night_loop");
- goto("wait");
- @reset_skip_night
- skip_night_started = false;
- goto("wait");
- @skills
- //skills [player]
- if(size == 0) {
- skill.showAll(player, player);
- goto("wait");
- }
- if(!perm.has("skills.other", player)) {
- perm.no("skills.other", player);
- goto("wait");
- }
- p_name = list.getIndex(args, 0);
- p_uuid = player.getUuid(p_name);
- if(p_uuid == null) {
- msg.prefix(player, prefix_tips, "This player has never been online.");
- goto("wait");
- }
- from_p_id = player.getId(p_uuid);
- skill.showAll(from_p_id, player);
- goto("wait");
- @infopoint1
- msg.string(player, string.getSpacer());
- msg.prefix(player, "§eSurvival", "§aEnjoy our modded survival feeling. New ores, items and displays, and we are still beginner friendly.");
- goto("wait");
- @infopoint2
- msg.string(player, string.getSpacer());
- msg.prefix(player, "§eAdventure", "§aSearching for a new challenge? Get teleported thousands of blocks away in the wildness with no inventory and find your way back to spawn.");
- goto("wait");
- @infopoint3
- msg.string(player, string.getSpacer());
- msg.prefix(player, "§ePlots", "§aClaim land and protect your buildings against other players. Use /plot to create and manage your plots.");
- goto("wait");
- @infopoint4
- msg.string(player, string.getSpacer());
- msg.prefix(player, "§eClans", "§aAs a well-known player on our server you can create your own community. By now as a clan you can only create cities.");
- goto("wait");
- @infopoint5
- msg.string(player, string.getSpacer());
- msg.prefix(player, "§eCities", "§aAs a clan leader you can raise your plots to big cities. Create sub-plots and sell them to other players.");
- goto("wait");
- @infopoint6
- msg.string(player, string.getSpacer());
- msg.prefix(player, "§eShops", "§aUse our admin-shop to trade, or create an own shop with /shop. We might do a YT-tutorial on this.");
- goto("wait");
- @infopoint7
- msg.string(player, string.getSpacer());
- msg.prefix(player, "§eMinigames", "§aWe offer a range of different single- and multiplayer games.");
- goto("wait");
- @infopoint8
- msg.string(player, string.getSpacer());
- msg.prefix(player, "§eQuests", "§aYou are nice and helpful? There are lots of tasks to do in the villages.");
- goto("wait");
- @infopoint9
- msg.string(player, string.getSpacer());
- msg.prefix(player, "§eRanking", "§aWanna rise in rank and be the best player in every branch? Look at our ranks.");
- goto("wait");
- @infopoint10
- msg.string(player, string.getSpacer());
- msg.prefix(player, "§eRules", "§aThere is at least one rule: Be respectful. Look at our fake rules.");
- goto("wait");
- @infopoint11
- msg.string(player, string.getSpacer());
- msg.prefix(player, "§eNote", "§aEverything is self-coded. Worldedit is the only external mod we use.");
- goto("wait");
- @infopoint12
- msg.string(player, string.getSpacer());
- msg.prefix(player, "§eNote", "§aBe Creative in our creative world.");
- goto("wait");
- @party
- if(size == 0) {
- @partyhelp
- msg.prefix(player, prefix_party, "/party ...");
- msg.string(player, "§5 - invite <player> §rInvite a player");
- msg.string(player, "§5 - accept <player> §rAccept an invitation");
- msg.string(player, "§5 - deny <player> §rDeny an invitation");
- msg.string(player, "§5 - kick <player> §rKick a player");
- msg.string(player, "§5 - leave §rLeave the party");
- msg.string(player, "§5 - promote <player> §rPromote a player");
- msg.string(player, "§5 - demote <player> §rDemote a player");
- msg.string(player, "§5 - disband §rDisband a party");
- msg.string(player, "§5 - list §rParty information");
- msg.string(player, "§5 - <message> §rSends a party message");
- goto("wait");
- }
- arg0 = string.toLowerCase(list.getIndex(args, 0));
- if(arg0 == "list") {
- if(size != 1) {
- msg.prefix(player, prefix_party, "§5/party list");
- } else {
- if(!player.isInParty(player)) {
- msg.prefix(player, prefix_party, "You are not in a party.");
- goto("wait");
- }
- list = party.getList(player.getPartyId(player));
- width = 1;
- if(list.getSize(list) > 9) {
- width = 2;
- }
- table = table.new("§5", width, 13, 7);
- msg.string(player, table.getStart(table));
- msg.string(player, table.get(table, "§d#", "§d§lName", "§d§lRole"));
- msg.string(player, table.getMiddle(table));
- iter = iterator(list);
- c = 0;
- while(hasNext(iter)) {
- c++;
- p = player.get(next(iter));
- msg.string(player, table.get(table, string.number(c), player.getName(p), player.getPartyRank(p)));
- }
- msg.string(player, table.getEnd(table));
- }
- goto("wait");
- }
- if(arg0 == "leave") {
- if(size != 1) {
- msg.prefix(player, prefix_party, "§5/party leave");
- } else {
- if(!player.isInParty(player)) {
- msg.prefix(player, prefix_party, "You are not in a party.");
- goto("wait");
- }
- party.kickPlayer(player, "leave");
- }
- goto("wait");
- }
- if(arg0 == "disband") {
- if(size != 1) {
- msg.prefix(player, prefix_party, "§5/party disband");
- } else {
- if(!player.isInParty(player)) {
- msg.prefix(player, prefix_party, "You are not in a party.");
- goto("wait");
- }
- if(!player.isPartyLeader(player)) {
- msg.prefix(player, prefix_party, "You are not the party leader.");
- goto("wait");
- }
- party.delete(player.getPartyId(player));
- }
- goto("wait");
- }
- if(arg0 == "kick") {
- if(size != 2) {
- msg.prefix(player, prefix_party, "§5/party kick <player>");
- } else {
- if(!player.isInParty(player)) {
- msg.prefix(player, prefix_party, "You are not in a party.");
- goto("wait");
- }
- if(!player.isPartyLeaderOrMod(player)) {
- msg.prefix(player, prefix_party, "You are not leader or moderator of the party.");
- goto("wait");
- }
- pname = list.getIndex(args, 1);
- if(!checkIfEverOnline(pname)) {
- msg.prefix(player, prefix_party, "This player has never been online.");
- goto("wait");
- }
- p = read.player(pname);
- if(p == null) {
- msg.prefix(player, prefix_party, "This player is not online.");
- goto("wait");
- }
- if(player == p) {
- msg.prefix(player, prefix_party, "You can´t apply that to yourself.");
- goto("wait");
- }
- if(!party.same(p, player)) {
- msg.prefix(player, prefix_party, "This player is not in your party.");
- goto("wait");
- }
- ownrank = player.getPartyRank(player);
- if(ownrank == "Moderator") {
- if(player.isPartyLeaderOrMod(p)) {
- msg.prefix(player, prefix_party, "You can´t kick this player.");
- goto("wait");
- }
- }
- party.kickPlayer(p, "kick");
- }
- goto("wait");
- }
- if(arg0 == "promote" || arg0 == "demote") {
- if(size != 2) {
- msg.prefix(player, prefix_party, string.concat("§5/party ", arg0, " <player>"));
- } else {
- pname = list.getIndex(args, 1);
- if(!player.isInParty(player)) {
- msg.prefix(player, prefix_party, "You are not in a party.");
- goto("wait");
- }
- if(!player.isPartyLeader(player)) {
- msg.prefix(player, prefix_party, "You are not the party leader.");
- goto("wait");
- }
- if(!checkIfEverOnline(pname)) {
- msg.prefix(player, prefix_party, "This player has never been online.");
- goto("wait");
- }
- p = read.player(pname);
- if(p == null) {
- msg.prefix(player, prefix_party, "This player is not online.");
- goto("wait");
- }
- if(player == p) {
- msg.prefix(player, prefix_party, "You can´t apply that to yourself.");
- goto("wait");
- }
- if(!party.same(p, player)) {
- msg.prefix(player, prefix_party, "This player is not in your party.");
- goto("wait");
- }
- partyid = player.getPartyId(player);
- rank = player.getPartyRank(p);
- if(arg0 == "promote") {
- if(rank == "Player") {
- player.setPartyRank(p, "Moderator");
- party.sendMessage(partyid, string.concat("§r", pname, " is now Moderator."));
- } elseif(rank == "Moderator") {
- player.setPartyRank(p, "Leader");
- player.setPartyRank(player, "Moderator"); //Ex-Leader degradieren
- party.sendMessage(partyid, string.concat("§r", pname, " is now Leader."));
- }
- } elseif(arg0 == "demote") {
- if(rank == "Moderator") {
- player.setPartyRank(p, "Player");
- party.sendMessage(partyid, string.concat("§r", pname, " is no longer Moderator."));
- } else {
- msg.prefix(player, prefix_party, "This player cannot be demoted.");
- }
- }
- }
- goto("wait");
- }
- if(arg0 == "invite") {
- if(size != 2) {
- msg.prefix(player, prefix_party, "§5/party invite <player>");
- } else {
- p_name = list.getIndex(args, 1);
- if(!checkIfEverOnline(p_name)) {
- msg.prefix(player, prefix_party, "This player has never been online.");
- goto("wait");
- }
- p = read.player(p_name);
- temp = party.invitePlayer(player, p);
- if(temp == "inviteeNotOnline") {
- msg.prefix(player, prefix_party, "This player is not online.");
- } elseif(temp == "inviterEqualsInvitee") {
- msg.prefix(player, prefix_party, "You can´t apply that to yourself.");
- } elseif(temp == "inviterNotPermitted") {
- msg.prefix(player, prefix_party, "You are not leader or moderator of the party.");
- } elseif(temp == "inviteeAlreadyInParty") {
- msg.prefix(player, prefix_party, "This player is already in your party.");
- } elseif(temp == "inviteeAlreadyInvited") {
- msg.prefix(player, prefix_party, "This player already has an invitation from you.");
- } else {
- msg.prefix(player, prefix_party, "Invitation sent.");
- }
- }
- goto("wait");
- }
- if(arg0 == "accept") {
- if(size != 2) {
- msg.prefix(player, prefix_party, "§5/party accept <player>");
- } else {
- if(player.isInParty(player)) {
- msg.prefix(player, prefix_party, "You are already in a party.");
- goto("wait");
- }
- pname = list.getIndex(args, 1);
- if(!checkIfEverOnline(pname)) {
- msg.prefix(player, prefix_party, "This player has never been online.");
- goto("wait");
- }
- p = read.player(pname);
- if(p == null) {
- msg.prefix(player, prefix_party, "This player is no longer online.");
- goto("wait");
- }
- player_uuid = player.getUuid(player);
- p_uuid = player.getUuid(p);
- list = map.get(party_invitations, player_uuid);
- if(list == null || !list.contains(list, p_uuid)) {
- msg.prefix(player, prefix_party, "This invitation is invalid.");
- goto("wait");
- }
- if(player.isInParty(p)) { //wenn einlader bereits in party
- partyid = player.getPartyId(p);
- if(map.get(party_invite_ids, p_uuid) == partyid) { //wenn partyid noch die gleiche ist wie bei einladung
- party.addPlayer(partyid, player);
- player.setPartyRank(player, "Player");
- } else {
- msg.prefix(player, prefix_party, "This player is already in another party.");
- goto("wait");
- }
- } else {
- partyid = map.get(party_invite_ids, p_uuid);
- party.setList(partyid, list.new());
- party.addPlayer(partyid, p);
- party.addPlayer(partyid, player);
- player.setPartyRank(p, "Leader");
- player.setPartyRank(player, "Player");
- msg.prefix(p, prefix_party, "The party was created.");
- }
- list.clear(list); //Einladungs-Liste von oben
- party.sendMessage(partyid, string.concat("§r", player.getName(player), " joined the party."));
- }
- goto("wait");
- }
- if(arg0 == "deny") {
- if(size != 2) {
- msg.prefix(player, prefix_party, "§5/party deny <player>");
- } else {
- player_uuid = player.getUuid(player);
- list = map.get(party_invitations, player_uuid);
- if(list != null) {
- pname = list.getIndex(args, 1);
- p = read.player(pname);
- if(p == null) {
- msg.prefix(player, prefix_party, "This player is no longer online.");
- goto("wait");
- }
- p_uuid = player.getUuid(p);
- if(list == null || !list.contains(list, p_uuid)) {
- msg.prefix(player, prefix_party, "This invitation is invalid.");
- goto("wait");
- }
- index = list.getIndexOf(list, p_uuid);
- list.remove(list, p_uuid);
- keytimes = map.get(delkeytimes, player_uuid);
- list.removeIndex(keytimes, index);
- p = read.player(pname);
- if(p != null) {
- msg.prefix(p, prefix_party, string.concat("§r", player.getName(player), " has denied your invitation."));
- }
- msg.prefix(player, prefix_party, string.concat("Invitation from ", pname, " denied."));
- }
- }
- goto("wait");
- }
- if(player.isInParty(player)) {
- message = string.concat(player.getName(player), " §1| §r", string.concatList(args, " ", 0, list.getSize(args) - 1));
- party.sendMessage(player.getPartyId(player), message);
- goto("wait");
- }
- goto("partyhelp");
- @setmessage
- if(size == 0) {
- @setmessagehelp
- msg.prefix(player, prefix_commands, "/setmessage ...");
- msg.string(player, "§e- join <message> §rSets your join message");
- msg.string(player, "§e- leave <message> §rSets your leave message");
- msg.string(player, "§e- death <message> §rSets your death message");
- msg.string(player, "§e- info §rShows you set messages");
- if(perm.has("setmessage.delete", player)) {
- msg.string(player, "§e- delete <player> §rDeletes a players messages");
- }
- goto("wait");
- }
- arg0 = string.toLowerCase(list.getIndex(args, 0));
- if(arg0 == "info") {
- if(player.usesCustomMessage(player)) {
- msg.prefix(player, prefix_commands, "Custom messages are activated.");
- } else {
- msg.prefix(player, prefix_commands, "Custom messages are deactivated. /settings");
- }
- fullname = player.getFullName(player);
- message = player.getJoinMessage(player);
- if(message == null) {
- msg.prefix(player, prefix_commands, "No join message set.");
- } else {
- msg.prefix(player, prefix_commands, string.concat("§a§l> §r", fullname, " §9", message));
- }
- message = player.getLeaveMessage(player);
- if(message == null) {
- msg.prefix(player, prefix_commands, "No leave message set.");
- } else {
- msg.prefix(player, prefix_commands, string.concat("§c§l> §r", fullname, " §9", message));
- }
- message = player.getDeathMessage(player);
- if(message == null) {
- msg.prefix(player, prefix_commands, "No death message set.");
- } else {
- msg.prefix(player, prefix_commands, string.concat("§0§lx §r", fullname, " §9", message));
- }
- goto("wait");
- }
- if(arg0 == "join") {
- if(size < 2) {
- goto("setmessagehelp");
- }
- message = string.concatList(args, " ", 1, size - 1);
- player.setJoinMessage(player, message);
- msg.prefix(player, prefix_commands, "Join message set.");
- goto("wait");
- }
- if(arg0 == "leave") {
- if(size < 2) {
- goto("setmessagehelp");
- }
- message = string.concatList(args, " ", 1, size - 1);
- player.setLeaveMessage(player, message);
- msg.prefix(player, prefix_commands, "Leave message set.");
- goto("wait");
- }
- if(arg0 == "death") {
- if(size < 2) {
- goto("setmessagehelp");
- }
- message = string.concatList(args, " ", 1, size - 1);
- player.setDeathMessage(player, message);
- msg.prefix(player, prefix_commands, "Death message set.");
- goto("wait");
- }
- if(arg0 == "delete") {
- if(size == 1) {
- p_uuid = player.getUuid(player);
- } elseif(size == 2) {
- if(!perm.has("setmessage.delete", player)) {
- perm.no("setmessage.delete", player);
- goto("wait");
- }
- p_name = list.getIndex(args, 1);
- if(!checkIfEverOnline(p_name)) {
- msg.prefix(player, prefix_commands, "This player has never been online.");
- goto("wait");
- }
- p_uuid = player.getUuid(p_name);
- } else {
- goto("setmessagehelp");
- }
- p_id = player.getId(p_uuid);
- player.setJoinMessage(p_id, "null");
- player.setLeaveMessage(p_id, "null");
- msg.prefix(player, prefix_commands, "Messages deleted.");
- goto("wait");
- }
- goto("wait");
- @lag
- msg.prefix(player, prefix_commands, "Lag test is performed. Please wait...");
- a = array.new(2);
- a[0] = player.getUuid(player);
- a[1] = time.getMillis();
- list.add(lag_list, a);
- sgoto(100, "do_lag_test");
- goto("wait");
- @do_lag_test
- t = time.getMillis();
- a = list.getIndex(lag_list, 0);
- list.removeIndex(lag_list, 0);
- p_uuid = a[0];
- t_old = a[1];
- t = math.roundComma((t - t_old) / 50 / 5, 2); //ms -> ticks
- t = 40 - t;
- p = player.get(p_uuid);
- if(p != null) {
- msg.prefix(p, prefix_commands, "Expected: 20 ticks/sec");
- msg.prefix(p, prefix_commands, string.concat("Measured: ", string.number(t), " ticks/sec"));
- }
- goto("wait");
- @live
- boolean = !player.isLive(player);
- player.setLive(player, boolean);
- player.setHeadName(player);
- player.setTabName(player);
- msg.prefix(player, prefix_commands, "Live toggled.");
- goto("wait");
- @lightning
- block = player.getTargetBlock(player, 50);
- if(block == null) {
- msg.prefix(player, prefix_commands, "No block in sight.");
- goto("wait");
- }
- entity.spawn(block.getLocation(block), "LIGHTNING");
- goto("wait");
- @ride
- entity = player.getTargetEntity(player, 5);
- if(entity == null) {
- msg.prefix(player, prefix_commands, "No entity found.");
- goto("wait");
- }
- world_name = world.getName(loc.getWorld(entity.getLocation(player)));
- if(world.isGamesName(world_name)) {
- if(player.hasMinigame(player) || (perm.has("ride", player) && !perm.has("isTeam", player))) {
- msg.prefix(player, prefix_commands, "You can´t use this now.");
- goto("wait");
- }
- }
- entity.mount(player, entity);
- goto("wait");
- @vanish
- //vanish [on/off] [player]
- if(size == 0) {
- if(set.contains(vanish_set, player.getUuid(player))) {
- bool = "off";
- } else {
- bool = "on";
- }
- }
- if(size >= 1) {
- bool = list.getIndex(args, 0);
- }
- if(size > 1) {
- p_name = list.getIndex(args, 1);
- p = read.player(p_name);
- if(p == null) {
- msg.prefix(player, prefix_commands, "This player is not online.");
- goto("wait");
- }
- } else {
- p = player;
- }
- p_name = player.getName(p);
- player_name = player.getName(player);
- if(bool == "on") {
- if(p != player) {
- msg.prefix(player, prefix_commands, string.concat(p_name, " has been vanished."));
- msg.prefix(p, prefix_commands, string.concat("You have been vanished by ", player_name, "."));
- } else {
- msg.prefix(p, prefix_commands, "You are vanished.");
- }
- set.add(vanish_set, player.getUuid(p));
- player.hideOnline(p);
- } elseif(bool == "off") {
- if(p != player) {
- msg.prefix(player, prefix_commands, string.concat(p_name, " is no longer vanished."));
- msg.prefix(p, prefix_commands, string.concat("You are no longer vanished caused by ", player_name, "."));
- } else {
- msg.prefix(p, prefix_commands, "You are no longer vanished.");
- }
- set.remove(vanish_set, player.getUuid(p));
- player.showOnline(p);
- } else {
- msg.prefix(player, prefix_commands, "/vanish [on/off] [player]");
- }
- goto("wait");
- @user
- if(size == 0) {
- @user_help
- msg.prefix(sender, prefix_commands, "/user ...");
- if(perm.has("user.other", player)) {
- msg.string(sender, "§6 - info [player] §rReturns info about a user");
- } else {
- msg.string(sender, "§6 - info §rReturns info about you");
- }
- if(perm.has("user.money", player)) {
- msg.string(sender, "§6 - addmoney <player> <money> §rAdds money to a player");
- msg.string(sender, "§6 - setmoney <player> <money> §rSets the money of a player");
- }
- goto("wait");
- }
- arg0 = string.toLowerCase(list.getIndex(args, 0));
- if(arg0 == "info") {
- if(size < 2) {
- if(!isPlayer(sender)) {
- msg.prefix(sender, prefix_commands, "/user info <player>");
- goto("wait");
- }
- p_name = player.getName(player);
- p_uuid = player.getUuid(p_name);
- } else {
- if(!perm.has("user.other", sender)) {
- perm.no("user.other", sender);
- goto("wait");
- }
- p_name = list.getIndex(args, 1);
- if(!checkIfEverOnline(p_name)) {
- msg.prefix(sender, prefix_commands, "This player has never been online.");
- goto("wait");
- }
- p_uuid = player.getUuid(p_name);
- p_name = player.getName(p_uuid);
- }
- p = read.player(p_name);
- p_id = player.getId(p_uuid);
- if(p == null) {
- p_or_id = p_id;
- } else {
- p_or_id = p;
- }
- table = table.new("§8", 7, 24);
- msg.string(sender, table.getStart(table));
- msg.string(sender, table.get(table, "Player", p_name));
- msg.string(sender, table.getMiddle(table));
- msg.string(sender, table.get(table, "Playtime", string.number(math.roundDown(player.getTotalPlaytime(p_or_id) / 60))));
- msg.string(sender, table.get(table, "Joins", string.number(player.getJoins(p_or_id))));
- msg.string(sender, table.get(table, "First Join", time.getDateString(player.getFirstJoin(p_or_id))));
- msg.string(sender, table.get(table, "Last Join", time.getDateString(player.getLastJoin(p_or_id))));
- if(perm.has("user.other", sender)) {
- msg.string(sender, table.get(table, "UUID", p_uuid));
- msg.string(sender, table.get(table, "ID", string.number(p_id)));
- if(player.isLive(sender)) {
- msg.string(sender, table.get(table, "IP", "§7§oHidden"));
- } else {
- msg.string(sender, table.get(table, "IP", player.getLoggedIp(p_or_id)));
- }
- snuvis = money.get(p_or_id);
- msg.string(sender, table.get(table, "Money", string.concat(money.getString(snuvis), " (",string.number(snuvis), ")")));
- }
- msg.string(sender, table.get(table, "Rank", getRank(p_or_id)));
- msg.string(sender, table.get(table, "PvP", hasPvpOn(p_or_id)));
- msg.string(sender, table.get(table, "Quests", string.number(quest.getCounter(p_or_id))));
- msg.string(sender, table.get(table, "Adventures", string.number(player.getAdventureAmounts(p_or_id))));
- msg.string(sender, table.getEnd(table));
- goto("wait");
- }
- if(arg0 == "addmoney") {
- if(!perm.has("user.money", sender)) {
- perm.no("user.money", sender);
- goto("wait");
- }
- if(size != 3) {
- msg.prefix(sender, prefix_commands, "/user addmoney <player> <money>");
- goto("wait");
- }
- p_name = list.getIndex(args, 1);
- if(!checkIfEverOnline(p_name)) {
- msg.prefix(sender, prefix_commands, "This player has never been online.");
- goto("wait");
- }
- money = list.getIndex(args, 2);
- if(!isDouble(money)) {
- msg.prefix(sender, prefix_commands, "Number expected.");
- goto("wait");
- }
- p_uuid = player.getUuid(p_name);
- p_id = player.getId(p_uuid);
- money.add(p_id, money);
- msg.prefix(sender, prefix_commands, string.concat("Added ", money.getString(money), " to ", player.getName(p_uuid), "."));
- goto("wait");
- }
- if(arg0 == "setmoney") {
- if(!perm.has("user.money", sender)) {
- perm.no("user.money", sender);
- goto("wait");
- }
- if(size != 3) {
- msg.prefix(sender, prefix_commands, "/user setmoney <player> <money>");
- goto("wait");
- }
- p_name = list.getIndex(args, 1);
- if(!checkIfEverOnline(p_name)) {
- msg.prefix(sender, prefix_commands, "This player has never been online.");
- goto("wait");
- }
- money = list.getIndex(args, 2);
- if(!isDouble(money)) {
- msg.prefix(sender, prefix_commands, "Number expected.");
- goto("wait");
- }
- p_uuid = player.getUuid(p_name);
- p_id = player.getId(p_uuid);
- setMoney(p_id, money);
- msg.prefix(sender, prefix_commands, string.concat("Set ", string.number(money), " snuvis for ", player.getName(p_uuid), "."));
- goto("wait");
- }
- goto("user_help");
- @quest
- if(size == 0) {
- @quest_syntax
- msg.prefix(player, prefix_quest, "/quest ...");
- msg.string(player, "§5 - see §rSee all active quests");
- msg.string(player, "§5 - term <player> §rTerminates a quest of a player");
- goto("wait");
- }
- arg0 = string.toLowerCase(list.getIndex(args, 0));
- if(arg0 == "see") {
- if(size != 1) {
- msg.prefix(player, prefix_quest, "/quest see");
- goto("wait");
- }
- msg.prefix(player, prefix_quest, "Active quests:");
- quest_map = quest.getIds();
- iter = map.iterator(quest_map);
- while(hasNext(iter)) {
- element = next(iter);
- key = map.getKey(element);
- value = map.getValue(element);
- script = script.getFromId(value);
- if(script == null) {
- continue;
- }
- q_name = script.getVar(script, "quest_name");
- stage = script.getVar(script, "stage");
- all_stages = script.getVar(script, "all_stages");
- msg.string(player, string.concat( "§d- §r", player.getName(key), " ", string.number(value), " ", q_name, " (", string.number(stage), "/", string.number(all_stages), ")"));
- }
- goto("wait");
- }
- if(arg0 == "term") {
- if(size != 2) {
- msg.prefix(player, prefix_quest, "/quest term <player>");
- goto("wait");
- }
- p_name = list.getIndex(args, 1);
- if(!checkIfEverOnline(p_name)) {
- msg.prefix(player, prefix_quest, "This player has never been online.");
- goto("wait");
- }
- p = read.player(p_name);
- if(p == null) {
- msg.prefix(player, prefix_quest, "This player is not online.");
- goto("wait");
- }
- script_id = quest.getFromPlayer(p);
- if(script_id == null) {
- msg.prefix(player, prefix_quest, "This player has no quest.");
- goto("wait");
- }
- script = script.getFromId(script_id);
- if(script == null) {
- quest.removePlayer(p);
- msg.prefix(player, prefix_quest, "Corrupt quest terminated.");
- goto("wait");
- }
- setScriptVar("player", p);
- modTimer.scriptCallEvent("quest_term", script);
- quest.term(script, player);
- msg.prefix(player, prefix_quest, "Quest terminated.");
- goto("wait");
- }
- goto("quest_syntax");
- @friend
- if(size == 0) {
- @friend_syntax
- msg.prefix(player, prefix_friends, "/friend ...");
- msg.string(player, "§5 - add <player> §rAdds a friend");
- msg.string(player, "§5 - remove <player> §rRemoves a friend");
- msg.string(player, "§5 - list §rLists all your friends");
- goto("wait");
- }
- arg0 = string.toLowerCase(list.getIndex(args, 0));
- if(arg0 == "add") {
- if(size != 2) {
- msg.prefix(player, prefix_friends, "/friend add <player>");
- goto("wait");
- }
- friend_name = list.getIndex(args, 1);
- player_name = player.getName(player);
- if(player_name == friend_name) {
- msg.prefix(player, prefix_friends, "You can´t invite yourself.");
- goto("wait");
- }
- player_id = player.getId(player);
- if(!checkIfEverOnline(friend_name)) {
- msg.prefix(player, prefix_friends, "This player has never been online.");
- goto("wait");
- }
- friend_id = player.getId(player.getUuid(friend_name));
- if(friend.check(player_id, friend_id)) {
- msg.prefix(player, prefix_friends, "This player is already your friend.");
- goto("wait");
- }
- if(map.contains(friend_requests, friend_id)) {
- if(map.get(friend_requests, friend_id) == player_id) {
- friend.add(player_id, friend_id);
- map.remove(friend_requests, friend_id);
- msg.prefix(player, prefix_friends, string.concat("§7", friend_name, "§r is your friend now."));
- msg.send(player, friend_name, prefix_friends, string.concat("§7", player_name, "§r is your friend now."), true);
- goto("wait");
- }
- }
- map.add(friend_requests, player_id, friend_id); //Einlader, Eingeladener
- friend = read.player(friend_name);
- msg.prefix(player, prefix_friends, string.concat("You sent an invitation to §7", friend_name, "§r."));
- if(friend != null) {
- msg(friend, text.merge(text.new(string.concat("§7", player_name, "§r wants to be your friend." )), string.getClickText("§r[§aAccept§r]", string.concat("/friend add ", player_name))));
- }
- goto("wait");
- }
- if(arg0 == "remove") {
- if(size != 2) {
- msg.prefix(player, prefix_friends, "/friend remove <player>");
- goto("wait");
- }
- friend_name = list.getIndex(args, 1);
- player_id = player.getId(player);
- if(!checkIfEverOnline(friend_name)) {
- msg.prefix(player, prefix_friends, "This player has never been online.");
- goto("wait");
- }
- friend_id = player.getId(player.getUuid(friend_name));
- if(!friend.check(player_id, friend_id)) {
- msg.prefix(player, prefix_friends, "This player isn´t your friend.");
- goto("wait");
- }
- friend.delete(player_id, friend_id);
- msg.prefix(player, prefix_friends, string.concat("§7", friend_name, "§r is no longer your friend."));
- msg.send(player, friend_name, prefix_friends, string.concat("§7", player.getName(player), "§r is no longer your friend."), true);
- goto("wait");
- }
- if(arg0 == "list") {
- if(size != 1) {
- msg.prefix(player, prefix_friends, "/friend list");
- goto("wait");
- }
- player_id = player.getId(player);
- friendlist = friend.getList(player_id);
- listsize = list.getSize(friendlist);
- if(listsize == 0) {
- msg.prefix(player, prefix_friends, "You have no friends yet.");
- goto("wait");
- }
- msg.string(player, "§5Friends:");
- for(i = 0; i <= listsize - 1; i++) {
- friend_name = player.getNameFromId(list.getIndex(friendlist, i));
- if(friend_name != null) {
- msg.string(player, string.concat("- ", friend_name));
- }
- }
- goto("wait");
- }
- goto("friend_syntax");
- @var
- if(size != 2) {
- msg.prefix(player, prefix_commands, "/var <id> <varname>");
- goto("wait");
- }
- script_id = list.getIndex(args, 0);
- script = script.getFromId(script_id);
- if(script == null) {
- msg.prefix(player, "§dScript", "Invalid id");
- goto("wait");
- }
- var_name = list.getIndex(args, 1);
- var = script.getVar(script, var_name);
- msg.prefix(player, "§dScript", string.concat(var_name, " = ", var));
- goto("wait");
- @vote
- msg.string(player, string.getSpacer());
- if(size == 0) {
- link1 = "https://minecraft-server.eu/vote/index/2227F";
- link2 = "https://minecraft-server-list.com/server/478200/vote/";
- msg(player, text.merge(text.new(string.getPrefix(prefix_vote)), text.new(" "), string.getLinkText("§r<§dminecraft-server.eu§r>", link1)));
- msg(player, text.merge(text.new(string.getPrefix(prefix_vote)), text.new(" "), string.getLinkText("§r<§dminecraft-server-list.com§r>", link2)));
- p_id = player.getId(player);
- } else {
- if(!perm.has("user.other", player)) {
- perm.no("user.other", player);
- goto("wait");
- }
- p_name = list.getIndex(args, 0);
- if(!checkIfEverOnline(p_name)) {
- msg.prefix(player, prefix_commands, "This player has never been online.");
- goto("wait");
- }
- p_id = player.getId(player.getUuid(p_name));
- }
- msg(player, text.merge(text.new(string.getPrefix(prefix_vote)), text.new(" "), text.new(string.concat("Votepoints: §6", string.number(player.getVotePoints(p_id))))));
- msg(player, text.merge(text.new(string.getPrefix(prefix_vote)), text.new(" "), text.new(string.concat("Votestreak: §6", string.number(player.getVoteStreak(p_id))))));
- last_vote_time = player.getLastVoteTime(p_id);
- if(last_vote_time == 0) {
- last_vote_time = "-";
- } else {
- last_vote_time = time.getString(last_vote_time);
- }
- msg(player, text.merge(text.new(string.getPrefix(prefix_vote)), text.new(" "), text.new(string.concat("Last vote: §6", last_vote_time))));
- goto("wait");
- @voteshop
- inv.open(vote_inv, player, string.concat("Your vote points: §6", string.number(player.getVotePoints(player))));
- goto("wait");
- @setservermessage
- if(size < 1) {
- msg.prefix(player, prefix_commands, "/setservermessage <text>");
- goto("wait");
- }
- message = string.concatList(args, " ", 0, size - 1);
- message = string.replace(message, "&", "§");
- setMOTD(message);
- msg.prefix(player, prefix_commands, "Server-Message gesetzt");
- goto("wait");
- @error
- if(size < 1) {
- msg.prefix(player, "§cError", "/error ...");
- msg.string(player, "§c - list §rLists all errors");
- msg.string(player, "§c - clear §rDeletes all errors");
- goto("wait");
- }
- arg0 = string.toLowerCase(list.getIndex(args, 0));
- if(arg0 == "list") {
- error_size = error.getSize();
- if(error_size == 0) {
- msg.prefix(player, "§cError", "No errors existing.");
- goto("wait");
- }
- for(i = 0; i < error_size; i++) {
- msg.string(player, error.getIndex(i));
- }
- goto("wait");
- }
- if(arg0 == "clear") {
- error.clear();
- msg.prefix(player, "§cError", "All errors deleted.");
- goto("wait");
- }
- goto("wait");
- @hat
- item = living.getHand(player);
- if(item.isAir(item)) {
- msg.prefix(player, prefix_commands, "You have to hold an item in hand.");
- goto("wait");
- }
- head_slot = slot.getHead();
- head_item = living.getEquip(player, head_slot);
- living.setEquip(player, head_slot, item);
- living.setEquip(player, slot.getHand(), head_item);
- goto("wait");
- @news
- if(size < 1) {
- msg.prefix(player, prefix_commands, "/news <text>");
- goto("wait");
- }
- message = string.concatList(args, " ", 0, size - 1);
- online_list = players.toList();
- iter = iterator(online_list);
- while(hasNext(iter)) {
- p = next(iter);
- title.send(p, text.new("§cNews"), text.new(string.concat("by ", player.getName(player))));
- msg.prefix(p, "§4News", string.concat("§c", message));
- }
- goto("wait");
- @skipnight
- player_loc = entity.getLocation(player);
- world_name = world.getName(loc.getWorld(player_loc));
- if(!world.isSurvName(world_name)) {
- msg.prefix(player, prefix_commands, "Not possible in this world.");
- goto("wait");
- }
- world_time = world.getTime(world.getOverWorld());
- while(world_time >= 24000) {
- world_time -= 24000;
- }
- if(world_time <= 12500) {
- msg.prefix(player, prefix_commands, "Only during night possible.");
- goto("wait");
- }
- player_uuid = player.getUuid(player);
- if(set.contains(skip_night_set, player_uuid)) {
- msg.prefix(player, prefix_commands, "Already voted.");
- goto("wait");
- }
- if(time.getMillis() - last_skip_night < 420000) {
- msg.prefix(player, prefix_commands, "Only once per night possible.");
- goto("wait");
- }
- inv.open(skip_night_inv, player);
- goto("wait");
- @spawn
- if(size == 0) {
- p = player;
- }
- if(size == 1) {
- if(!perm.has("tp.other", player)) {
- perm.no("tp.other", player);
- goto("wait");
- }
- p_name = list.getIndex(args, 0);
- p = read.player(p_name);
- if(p == null) {
- msg.prefix(player, prefix_commands, "This player is not online.");
- goto("wait");
- }
- }
- if(player.hasMinigame(p)) {
- if(size == 1) {
- msg.prefix(player, prefix_commands, "This player can´t be teleported now.");
- goto("wait");
- }
- msg.prefix(player, prefix_commands, "You can´t teleport now.");
- goto("wait");
- }
- if(player.teleport(p, world.getServerSpawn(), true)) {
- if(player == p) {
- msg.prefix(p, prefix_commands, "You have been teleported to the spawn.");
- } else {
- msg.prefix(player, prefix_commands, string.concat(player.getName(p), " was teleported to the spawn."));
- }
- }
- goto("wait");
- @rank
- msg.string(player, string.getSpacer());
- rank = getRank(player);
- msg.string(player, string.concat("§6Current rank: §r[", rank, "§r]"));
- msg.string(player, "Choose a rank:");
- rank.showAll(player);
- goto("wait");
- @setrank
- if(size < 2) {
- msg.prefix(player, prefix_commands, "/setrank <player> <rank>");
- goto("wait");
- }
- p_name = list.getIndex(args, 0);
- if(!checkIfEverOnline(p_name)) {
- msg.prefix(player, prefix_commands, "This player has never been online.");
- goto("wait");
- }
- p = read.player(p_name);
- if(p == null) {
- msg.prefix(player, prefix_commands, "This player is not online.");
- goto("wait");
- }
- p_name = player.getName(p);
- rank = string.concatList(args, " ", 1, size - 1);
- if(!perm.has("setrank.other", player)) {
- if(player.getName(player) != p_name) {
- perm.no("setrank.other", player);
- goto("wait");
- }
- colored = string.startsWith(rank, "&", 0);
- if(colored) {
- rank = string.subString(rank, 1, string.length(rank));
- }
- a = rank.getRankArray();
- a_size = array.getSize(a);
- for(i = 0; i < a_size; i++) {
- tech_name = a[i, 0];
- if(rank == a[i, 1] && !rank.checkCriteria(p, tech_name)) {
- perm.no(tech_name, p);
- goto("wait");
- }
- }
- if(colored) {
- rank = string.concat("&", rank);
- }
- }
- if(string.length(rank) >= 30) {
- msg.prefix(player, prefix_commands, "Only 30 letters allowed.");
- goto("wait");
- }
- rank = string.replace(rank, "&", "§");
- setRank(p, rank);
- player.setTabName(p);
- msg.prefix(player, prefix_commands, string.concat("Rank for ", p_name, " changed to [", rank, "§r]."));
- goto("wait");
- @nowb
- if(player.isAfk(player)) {
- player.setAfk(player, false);
- msg.prefix(player, prefix_commands, "marvinius whispers to you: Welcome back ;-)");
- player.setTabName(player);
- } else {
- msg.prefix(player, prefix_commands, "You are not afk.");
- }
- goto("wait");
- @afk
- if(player.hasMinigame(player)) {
- msg.prefix(player, prefix_commands, "No afk while in a minigame :P");
- goto("wait");
- }
- nickname = player.getNickname(player);
- if(player.isAfk(player)) {
- msg.prefix("online", prefix_commands, string.concat(nickname, "§7 is back."));
- player.setAfk(player, false);
- } else {
- msg.prefix("online", prefix_commands, string.concat(nickname, "§7 is now afk."));
- player.setAfk(player, true);
- if(!afk_loop_active) {
- afk_loop_active = true;
- sgoto(30, "afk_loop");
- }
- }
- player.setTabName(player);
- goto("wait");
- @silentjoin
- silentjoin = player.getSilentJoin(player);
- if(silentjoin) {
- player.setSilentJoin(player, false);
- msg.prefix(player, prefix_commands, "Silentjoin deactivated.");
- } else {
- player.setSilentJoin(player, true);
- msg.prefix(player, prefix_commands, "Silentjoin activated.");
- }
- goto("wait");
- @joinme
- list = players.toList();
- iter = iterator(list);
- while(hasNext(iter)) {
- invitee = next(iter);
- if(player == invitee) {
- continue;
- }
- party.invitePlayer(player, invitee);
- }
- msg.prefix(player, prefix_party, "Party invitation sent to all online players.");
- goto("wait");
- @jumpto
- block = player.getTargetBlock(player, 100);
- if(block == null) {
- msg.prefix(player, prefix_commands, "No block in sight.");
- goto("wait");
- }
- loc = block.getLocation(block);
- y = loc.getY(loc);
- while(y < 319 && !block.isAir(block.get(loc))) {
- loc.setY(loc, y);
- y++;
- }
- player.teleport(player, loc.mod(loc, 0, 1, 0), true);
- goto("wait");
- @jailloop
- size = list.getSize(jailed_list);
- for(i = 0; i < size; i++) {
- p_name = player.getName(list.getIndex(jailed_list, i));
- showJail(p_name);
- }
- if(size > 0) {
- jail_loop_active = true;
- sgoto(5, "jailloop");
- } else {
- jail_loop_active = false;
- }
- goto("wait");
- @sb_title_loop
- list = players.toList();
- iter = iterator(list);
- if(title_a == null) {
- while(hasNext(iter)) {
- p = next(iter);
- sb.setTitle(p, text.new("§c§k# §6minecraft§c.§6hammerle§c.§6me §c§k#"));
- title_a = true;
- }
- } else {
- while(hasNext(iter)) {
- p = next(iter);
- sb.setTitle(p, text.new(string.concat(icon.getHeart(), "§6Mundus §cCrassus§f", icon.getHeart())));
- title_a = null;
- }
- }
- sgoto(200, "sb_title_loop");
- goto("wait");
- @coordsloop
- list = players.toList();
- size = list.getSize(list);
- for(i = 0; i < size; i++) {
- p = list.getIndex(list, i);
- if(player.getShowcoords(p)) {
- p_loc = entity.getLocation(p);
- sb.add(p, 3, string.concat("§6X§r ", string.number(loc.getBlockX(p_loc)), " §6Y§r ", string.number(loc.getBlockY(p_loc)), " §6Z§r ", string.number(loc.getBlockZ(p_loc))));
- sb.add(p, 2, string.concat(icon.getCompass(), " ", getDirectionExact(loc.getYaw(p_loc))));
- }
- }
- sgoto(15, "coordsloop");
- goto("wait");
- @customitems
- inv = inv.new("222222222222222222222222222222222222222222222222222222", text.new("Customitems"));
- a = item.custom.getAll();
- for(i = 0; i < array.getSize(a); i++) {
- item = item.custom.new(a[i]);
- item.setAmount(item, item.getMaxAmount(item));
- inv.setItem(inv, i, item);
- if(i > 53) {
- msg.dev("More customitems than can be shown in one inv");
- break;
- }
- }
- inv.open(inv, player);
- goto("wait");
- @afk_loop
- if(!afk_loop_active) {
- goto("wait");
- }
- afk_map = getScriptVar("afk_map");
- iter = map.iterator(afk_map);
- while(hasNext(iter)) {
- element = next(iter);
- yaw = map.getValue(element);
- player = player.get(map.getKey(element));
- if(player != null) {
- if(yaw != loc.getYaw(entity.getLocation(player))) {
- nickname = player.getNickname(player);
- msg.prefix("online", prefix_commands, string.concat(nickname, "§7 is back."));
- remove(iter);
- player.setAfk(player, false);
- player.setTabName(player);
- }
- }
- }
- size = map.getSize(afk_map);
- if(size > 0) {
- afk_loop_active = true;
- sgoto(30, "afk_loop");
- } else {
- afk_loop_active = false;
- }
- goto("wait");
- @minute_loop
- cal = time.new(time.getMillis());
- timer_day = time.getDay(cal);
- if(old_timer_day == null) {
- old_timer_day = timer_day;
- }
- if(timer_day != old_timer_day) {
- old_timer_day = timer_day;
- //Tageswechsel
- decreaseHomeBoost();
- }
- sgoto(1200, "minute_loop");
- goto("wait");
- @afk_checker_loop
- online_list = players.toList();
- iter = iterator(online_list);
- while(hasNext(iter)) {
- uuid = next(iter);
- p = player.get(uuid);
- if(player.hasMinigame(p)) {
- continue;
- }
- yaw = loc.getYaw(entity.getLocation(p));
- a = map.get(afk_checker_map, uuid);
- if(a == null) {
- a = array.new(2);
- a[0] = yaw;
- a[1] = 0;
- map.add(afk_checker_map, uuid, a);
- continue;
- }
- last_yaw = a[0];
- counter = a[1];
- if(last_yaw == yaw) {
- counter++;
- } else {
- counter = 0;
- }
- a[0] = yaw;
- a[1] = counter;
- map.add(afk_checker_map, uuid, a);
- if(counter == 5) {
- nickname = player.getNickname(p);
- if(player.isAfk(p)) {
- continue;
- }
- msg.prefix("online", prefix_commands, string.concat(nickname, "§7 is now afk."));
- player.setAfk(p, true);
- player.setTabName(p);
- if(!afk_loop_active) {
- afk_loop_active = true;
- sgoto(30, "afk_loop");
- }
- }
- }
- sgoto(1200, "afk_checker_loop");
- goto("wait");
- @armorstand
- if(size == 0) {
- @armorstand_syntax
- msg.prefix(player, prefix_datatools, "/armorstand ...");
- msg.string(player, "§6 - name <name> §rSets the name");
- msg.string(player, "§6 - visible <true/false> §rSets if is visible");
- msg.string(player, "§6 - arms <true/false> §rSets if has arms");
- msg.string(player, "§6 - small <true/false> §rSets if is small");
- msg.string(player, "§6 - baseplate <true/false> §rSets if has baseplate");
- msg.string(player, "§6 - marker <true/false> §rSets if is marker");
- msg.string(player, "§6 - move <true/false> §rSets if can move");
- msg.string(player, "§6 - tick <true/false> §rSets if can tick");
- msg.string(player, "§6 - setpose <bodypart> <x> <y> <z> §rSets the pose");
- msg.string(player, "§6 - addpose <bodypart> <x> <y> <z> §rSets the pose");
- goto("wait");
- }
- as = player.getTargetEntity(player, 5);
- if(!entity.isArmorstand(entity)) {
- location = entity.getLocation(player);
- as = entity.get(location, 3, "org.bukkit.entity.ArmorStand");
- if(as == null) {
- msg.action(player, "No armorstand found.");
- goto("wait");
- }
- }
- arg0 = string.toLowerCase(list.getIndex(args, 0));
- if(arg0 == "name") {
- if(size < 2) {
- msg.prefix(player, prefix_datatools, "/armorstand name <name>");
- goto("wait");
- }
- name = string.concatList(args, " ", 1, size - 1);
- name = string.replace(name, "&", "§");
- entity.setName(as, text.new(name), true);
- msg.action(player, string.concat("Armorstand renamed to ", name, "§r."));
- goto("wait");
- }
- if(arg0 == "visible") {
- if(size < 2) {
- msg.prefix(player, prefix_datatools, "/armorstand visible <true/false>");
- goto("wait");
- }
- bool = list.getIndex(args, 1);
- if(bool != true && bool != false) {
- msg.action(player, "True/False expected.");
- goto("wait");
- }
- living.setInvisible(as, !bool);
- msg.action(player, "Visibility set.");
- goto("wait");
- }
- if(arg0 == "arms") {
- if(size < 2) {
- msg.prefix(player, prefix_datatools, "/armorstand arms <true/false>");
- goto("wait");
- }
- bool = list.getIndex(args, 1);
- if(bool != true && bool != false) {
- msg.action(player, "True/False expected.");
- goto("wait");
- }
- as.setArms(as, bool);
- msg.action(player, "Arms set.");
- goto("wait");
- }
- if(arg0 == "small") {
- if(size < 2) {
- msg.prefix(player, prefix_datatools, "/armorstand small <true/false>");
- goto("wait");
- }
- bool = list.getIndex(args, 1);
- if(bool != true && bool != false) {
- msg.action(player, "True/False expected.");
- goto("wait");
- }
- as.setSmall(as, bool);
- msg.action(player, "Small set.");
- goto("wait");
- }
- if(arg0 == "baseplate") {
- if(size < 2) {
- msg.prefix(player, prefix_datatools, "/armorstand baseplate <true/false>");
- goto("wait");
- }
- bool = list.getIndex(args, 1);
- if(bool != true && bool != false) {
- msg.action(player, "True/False expected.");
- goto("wait");
- }
- as.setBasePlate(as, bool);
- msg.action(player, "Baseplate set.");
- goto("wait");
- }
- if(arg0 == "marker") {
- if(size < 2) {
- msg.prefix(player, prefix_datatools, "/armorstand marker <true/false>");
- goto("wait");
- }
- bool = list.getIndex(args, 1);
- if(bool != true && bool != false) {
- msg.action(player, "True/False expected.");
- goto("wait");
- }
- as.setMarker(as, bool);
- msg.action(player, "Marker set.");
- goto("wait");
- }
- if(arg0 == "move") {
- if(size < 2) {
- msg.prefix(player, prefix_datatools, "/armorstand move <true/false>");
- goto("wait");
- }
- bool = list.getIndex(args, 1);
- if(bool != true && bool != false) {
- msg.action(player, "True/False expected.");
- goto("wait");
- }
- as.canMove(as, bool);
- msg.action(player, "Move set.");
- goto("wait");
- }
- if(arg0 == "tick") {
- if(size < 2) {
- msg.prefix(player, prefix_datatools, "/armorstand tick <true/false>");
- goto("wait");
- }
- bool = list.getIndex(args, 1);
- if(bool != true && bool != false) {
- msg.action(player, "True/False expected.");
- goto("wait");
- }
- as.canTick(as, bool);
- msg.action(player, "Tick set.");
- goto("wait");
- }
- if(arg0 == "setpose") {
- if(size < 5) {
- msg.prefix(player, prefix_datatools, "/armorstand setpose <bodypart> <x> <y> <z>");
- goto("wait");
- }
- x = list.getIndex(args, 2);
- if(!isDouble(x) || x < -360 || x > 360) {
- msg.action(player, "Number between -360 and 360 expected.");
- goto("wait");
- }
- x *= math.pi() / 180;
- y = list.getIndex(args, 3);
- if(!isDouble(y) || y < -360 || y > 360) {
- msg.action(player, "Number between -360 and 360 expected.");
- goto("wait");
- }
- y *= math.pi() / 180;
- z = list.getIndex(args, 4);
- if(!isDouble(z) || z < -360 || z > 360) {
- player.action(player, "Number between -360 and 360 expected.");
- goto("wait");
- }
- z *= math.pi() / 180;
- euler_angle = euler.new(x, y, z);
- bodypart = list.getIndex(args, 1);
- if(bodypart == "head") {
- as.setHeadPose(as, euler_angle);
- } elseif(bodypart == "body") {
- as.setBodyPose(as, euler_angle);
- } elseif(bodypart == "leftleg") {
- as.setLeftLegPose(as, euler_angle);
- } elseif(bodypart == "rightleg") {
- as.setRightLegPose(as, euler_angle);
- } elseif(bodypart == "leftarm") {
- as.setLeftArmPose(as, euler_angle);
- } elseif(bodypart == "rightarm") {
- as.setRightArmPose(as, euler_angle);
- } else {
- msg.action(player, "Not a legit bodypart.");
- goto("wait");
- }
- msg.action(player, "Pose set.");
- goto("wait");
- }
- if(arg0 == "addpose") {
- if(size < 5) {
- msg.prefix(player, prefix_datatools, "/armorstand addpose <bodypart> <x> <y> <z>");
- goto("wait");
- }
- x = list.getIndex(args, 2);
- if(!isDouble(x) || x < -360 || x > 360) {
- msg.action(player, "Number between -360 and 360 expected.");
- goto("wait");
- }
- x *= math.pi() / 180;
- y = list.getIndex(args, 3);
- if(!isDouble(y) || y < -360 || y > 360) {
- msg.action(player, "Number between -360 and 360 expected.");
- goto("wait");
- }
- y *= math.pi() / 180;
- z = list.getIndex(args, 4);
- if(!isDouble(z) || z < -360 || z > 360) {
- msg.action(player, "Number between -360 and 360 expected.");
- goto("wait");
- }
- z *= math.pi() / 180;
- bodypart = list.getIndex(args, 1);
- if(bodypart == "head") {
- euler_angle = as.getHeadPose(as);
- euler_angle = euler.setX(euler_angle, euler.getX(euler_angle) + x);
- euler_angle = euler.setY(euler_angle, euler.getY(euler_angle) + y);
- euler_angle = euler.setZ(euler_angle, euler.getZ(euler_angle) + z);
- as.setHeadPose(as, euler_angle);
- } elseif(bodypart == "body") {
- euler_angle = as.getBodyPose(as);
- euler_angle = euler.setX(euler_angle, euler.getX(euler_angle) + x);
- euler_angle = euler.setY(euler_angle, euler.getY(euler_angle) + y);
- euler_angle = euler.setZ(euler_angle, euler.getZ(euler_angle) + z);
- as.setBodyPose(as, euler_angle);
- } elseif(bodypart == "leftleg") {
- euler_angle = as.getLeftLegPose(as);
- euler_angle = euler.setX(euler_angle, euler.getX(euler_angle) + x);
- euler_angle = euler.setY(euler_angle, euler.getY(euler_angle) + y);
- euler_angle = euler.setZ(euler_angle, euler.getZ(euler_angle) + z);
- as.setLeftLegPose(as, euler_angle);
- } elseif(bodypart == "rightleg") {
- euler_angle = as.getRightLegPose(as);
- euler_angle = euler.setX(euler_angle, euler.getX(euler_angle) + x);
- euler_angle = euler.setY(euler_angle, euler.getY(euler_angle) + y);
- euler_angle = euler.setZ(euler_angle, euler.getZ(euler_angle) + z);
- as.setRightLegPose(as, euler_angle);
- } elseif(bodypart == "leftarm") {
- euler_angle = as.getLeftArmPose(as);
- euler_angle = euler.setX(euler_angle, euler.getX(euler_angle) + x);
- euler_angle = euler.setY(euler_angle, euler.getY(euler_angle) + y);
- euler_angle = euler.setZ(euler_angle, euler.getZ(euler_angle) + z);
- as.setLeftArmPose(as, euler_angle);
- } elseif(bodypart == "rightarm") {
- euler_angle = as.getRightArmPose(as);
- euler_angle = euler.setX(euler_angle, euler.getX(euler_angle) + x);
- euler_angle = euler.setY(euler_angle, euler.getY(euler_angle) + y);
- euler_angle = euler.setZ(euler_angle, euler.getZ(euler_angle) + z);
- as.setRightArmPose(as, euler_angle);
- } else {
- msg.action(player, "Not a legit bodypart.");
- goto("wait");
- }
- msg.action(player, "Pose set.");
- goto("wait");
- }
- goto("armorstand_syntax");
- @ass
- if(size == 0) {
- msg.prefix(player, prefix_commands, "§r/ass ...");
- msg.string(player, " - set <name>");
- msg.string(player, " - name <name>");
- msg.string(player, " - remove");
- goto("wait");
- }
- arg0 = string.toLowerCase(list.getIndex(args, 0));
- if(arg0 == "set") {
- if(size < 2) {
- msg.prefix(player, prefix_datatools, "/ass set <name>");
- goto("wait");
- }
- name = string.concatList(string_args, " ", 1, size - 1);
- name = string.replace(name, "&", "§");
- as = entity.spawn(entity.getLocation(player), "ARMOR_STAND");
- entity.setGravity(as, false);
- entity.setName(as, text.new(name), true);
- living.setInvisible(as, true);
- as.setMarker(as, true);
- as.canTick(as, false);
- goto("wait");
- }
- as = player.getTargetEntity(player, 5);
- if(!entity.isArmorstand(entity)) {
- location = entity.getLocation(player);
- as = entity.get(location, 3, "org.bukkit.entity.ArmorStand");
- if(as == null) {
- msg.action(player, "No armorstand found.");
- goto("wait");
- }
- }
- if(arg0 == "name") {
- if(size < 2) {
- msg.prefix(player, prefix_datatools, "/ass name <name>");
- goto("wait");
- }
- name = string.concatList(string_args, " ", 1, size - 1);
- name = string.replace(name, "&", "§");
- entity.setName(as, text.new(name), true);
- msg.action(player, "Armorstand renamed.");
- goto("wait");
- }
- if(arg0 == "remove") {
- entity.remove(as);
- msg.action(player, "Armorstand removed.");
- goto("wait");
- }
- goto("wait");
- @potion
- if(size != 3) {
- msg.prefix(player, prefix_perms, "/potion <potion_name> <duration> <power>");
- goto("wait");
- }
- item = living.getHand(player);
- if(item.getType(item) == null || !(item.isType(item, "POTION") || item.isType(item, "SPLASH_POTION") || item.isType(item, "LINGERING_POTION"))) {
- msg.prefix(player, prefix_commands, "You need to hold an potion in your hand.");
- goto("wait");
- }
- potion_name = list.getIndex(args, 0);
- list = getPotionTypes();
- if(!list.contains(list, potion_name)) {
- msg.prefix(player, prefix_commands, "Not an potion effect type.");
- goto("wait");
- }
- duration = list.getIndex(args, 1);
- if(!isDouble(duration) || duration < 0) {
- msg.prefix(player, prefix_commands, "Positive number expected.");
- goto("wait");
- }
- power = list.getIndex(args, 2);
- if(!isDouble(power) || power < 0) {
- msg.prefix(player, prefix_commands, "Positive number expected.");
- goto("wait");
- }
- item.addPotion(item, potion_name, duration, power);
- goto("wait");
- @pvp
- if(size == 0) {
- if(hasPvpOn(player)) {
- mode = "off";
- } else {
- mode = "on";
- }
- p = player;
- } elseif(size == 1) {
- mode = list.getIndex(args, 0);
- if(!(mode == "on" || mode == "off")) {
- goto("pvphelp");
- }
- p = player;
- } elseif(size == 2) {
- if(!perm.has("pvp.other", player)) {
- perm.no("pvp.other", player);
- goto("wait");
- }
- mode = list.getIndex(args, 0);
- if(!(mode == "on" || mode == "off")) {
- goto("pvphelp");
- }
- p_name = list.getIndex(args, 1);
- if(!checkIfEverOnline(p_name)) {
- msg.prefix(player, prefix_commands, "This player has never been online.");
- goto("wait");
- }
- p = read.player(p_name);
- if(p == null) {
- msg.prefix(player, prefix_commands, "This player is not online.");
- goto("wait");
- }
- } else {
- @pvphelp
- if(perm.has("pvp.other", player)) {
- msg.prefix(player, prefix_commands, "/pvp [on/off] [player]");
- } else {
- msg.prefix(player, prefix_commands, "/pvp [on/off]");
- }
- goto("wait");
- }
- if(mode == "on") {
- setPvp(p, true);
- msg.prefix(p, prefix_commands, "You have enabled PvP!");
- if(p != player) {
- msg.prefix(player, prefix_commands, string.concat(player.getName(p), " has now enabled PvP!"));
- }
- } else {
- setPvp(p, false);
- msg.prefix(p, prefix_commands, "You have PvP disabled!");
- if(p != player) {
- msg.prefix(player, prefix_commands, string.concat(player.getName(p), " has now disabled PvP!"));
- }
- }
- goto("wait");
- @suicide
- if(size < 0 || size > 1) {
- msg.prefix(player, prefix_commands, "/suicide [player]");
- goto("wait");
- }
- if(size == 0) {
- p = player;
- }
- if(size == 1) {
- if(!perm.has("suicide.other", player)) {
- perm.no("suicide.other", player);
- goto("wait");
- }
- p_name = list.getIndex(args, 0);
- p = read.player(p_name);
- if(p == null) {
- msg.prefix(player, prefix_commands, "This player is not online.");
- goto("wait");
- }
- }
- if(p != player) {
- msg.prefix(player, prefix_commands, string.concat(player.getName(p), " has been killed."));
- msg.prefix(p, prefix_commands, string.concat("You have been killed by ", player.getName(player), "."));
- } else {
- msg.prefix(p, prefix_commands, "You killed yourself.");
- }
- living.damage(p, 1000, damage.get("generic"));
- goto("wait");
- @nickname
- if(size < 1) {
- msg.prefix(player, "§eNickname", "/nickname ...");
- msg.string(player, string.concat("§e - <name> ", "Sets a nickname"));
- msg.string(player, string.concat("§e - remove ", "Removes a nickname"));
- goto("wait");
- }
- nickname = string.replace(string.concatList(args, " ", 0, size - 1), "&", "§");
- if(nickname == "remove") {
- player.removeNickName(player);
- msg.prefix(player, prefix_commands, string.concat("Your nickname was removed."));
- } else {
- player.setNickName(player, nickname);
- msg.prefix(player, prefix_commands, string.concat("Your nickname was changed to ", nickname, "§r."));
- }
- player.setTabName(player);
- player.setHeadName(player);
- goto("wait");
- @iteminfo
- item = living.getHand(player);
- string = string.item(item);
- string = string.replace(string, "\"", "'");
- msg(player, string.getClipBoardText(string, string));
- item_type = string(item.getType(item));
- msg(player, string.getClipBoardText(item_type, item_type));
- goto("wait");
- @perm
- if(size == 0) {
- @perm_syntax
- msg.prefix(player, prefix_perms, "/perm ...");
- if(perm.has("perm.give", player)) {
- msg.string(player, "§6 - give <player> <perm>");
- }
- if(perm.has("perm.remove", player)) {
- msg.string(player, "§6 - remove <player> <perm>");
- }
- if(perm.has("perm.removeall", player)) {
- msg.string(player, "§6 - removeall <player>");
- }
- if(perm.has("perm.list", player)) {
- msg.string(player, "§6 - list <player>");
- }
- if(perm.has("perm.toggle", player)) {
- msg.string(player, "§6 - toggle");
- }
- goto("wait");
- }
- arg0 = string.toLowerCase(list.getIndex(args, 0));
- if(arg0 == "give") {
- if(!perm.has("perm.give", player)) {
- perm.no("perm.give", player);
- goto("wait");
- }
- if(size != 3) {
- msg.prefix(player, prefix_perms, "/perm give <player> <perm>");
- goto("wait");
- }
- p_name = list.getIndex(args, 1);
- perm = list.getIndex(args, 2);
- if(!checkIfEverOnline(p_name)) {
- msg.prefix(player, prefix_perms, "This player has never been online.");
- goto("wait");
- }
- if(!perm.isGroupName(perm)) {
- msg.prefix(player, prefix_perms, "This is not a permission group.");
- goto("wait");
- }
- if(!perm.has("isOwner", player)) {
- if(perm == "owner") {
- msg.prefix(player, prefix_perms, "Only owners can give this permission group.");
- goto("wait");
- }
- }
- if(!perm.has("isAdmin", player)) {
- if(perm == "admin" || perm == "mod") {
- msg.prefix(player, prefix_perms, "Only admins can give this permission group.");
- goto("wait");
- }
- }
- p_uuid = player.getUuid(p_name);
- p_id = player.getId(p_uuid);
- p_name = player.getName(p_uuid);
- perm_id = perm.getIdFromGroupname(perm);
- if(player.hasPermGroup(p_id, perm_id)) {
- msg.prefix(player, prefix_perms, "Perm already added.");
- goto("wait");
- }
- if(isOnline(p_name)) {
- p = read.player(p_name);
- rank = perm.getRankFromGroupname(perm);
- if(rank != null) {
- offerRank(p, rank.getTechName(rank));
- }
- if(perm == "creative") {
- if(loc.isInCreativeWorld(entity.getLocation(p))) {
- player.setGamemode(p, "CREATIVE");
- }
- }
- }
- perm.addGroupToPlayer(p_id, perm_id);
- msg.prefix(player, prefix_perms, string.concat("§rPerm §7", perm, "§r added to §7", p_name, "§r."));
- goto("wait");
- }
- if(arg0 == "remove") {
- if(!perm.has("perm.remove", player)) {
- perm.no("perm.remove", player);
- goto("wait");
- }
- if(size != 3) {
- msg.prefix(player, prefix_perms, "/perm remove <player> <perm>");
- goto("wait");
- }
- p_name = list.getIndex(args, 1);
- perm = list.getIndex(args, 2);
- if(!checkIfEverOnline(p_name)) {
- msg.prefix(player, prefix_perms, "This player has never been online.");
- goto("wait");
- }
- if(!perm.isGroupName(perm)) {
- msg.prefix(player, prefix_perms, "This is not a permission group.");
- goto("wait");
- }
- if(!perm.has("isOwner", player)) {
- if(perm == "owner") {
- msg.prefix(player, prefix_perms, "Only owners can remove this permission group.");
- goto("wait");
- }
- }
- if(!perm.has("isAdmin", player)) {
- if(perm == "admin" || perm == "mod") {
- msg.prefix(player, prefix_perms, "Only admins can remove this permission group.");
- goto("wait");
- }
- }
- p_uuid = player.getUuid(p_name);
- p_id = player.getId(p_uuid);
- p_name = player.getName(p_uuid);
- perm_id = perm.getIdFromGroupname(perm);
- if(!player.hasPermGroup(p_id, perm_id)) {
- msg.prefix(player, prefix_perms, "This player doesn´t have that perm.");
- goto("wait");
- }
- perm.removeGroupFromPlayer(p_id, perm_id);
- msg.prefix(player, prefix_perms, string.concat("Perm §7", perm, "§r removed from §7", p_name, "§r."));
- goto("wait");
- }
- if(arg0 == "removeall") {
- if(!perm.has("perm.removeall", player)) {
- perm.no("perm.removeall", player);
- goto("wait");
- }
- if(size != 2) {
- msg.prefix(player, prefix_perms, "/perm removeall <player>");
- goto("wait");
- }
- p_name = list.getIndex(args, 1);
- if(!checkIfEverOnline(p_name)) {
- msg.prefix(player, prefix_perms, "This player has never been online.");
- goto("wait");
- }
- p_id = player.getId(player.getUuid(p_name));
- player.removeAllPerms(p_id);
- msg.prefix(player, prefix_perms, string.concat("All perms of §7", p_name, " §rwere removed."));
- goto("wait");
- }
- if(arg0 == "list") {
- if(!perm.has("perm.list", player)) {
- perm.no("perm.list", player);
- goto("wait");
- }
- if(size != 2) {
- msg.prefix(player, prefix_perms, "/perm list <player>");
- goto("wait");
- }
- p_name = list.getIndex(args, 1);
- if(!checkIfEverOnline(p_name)) {
- msg.prefix(player, prefix_perms, "This player has never been online.");
- goto("wait");
- }
- p_id = player.getId(player.getUuid(p_name));
- permslist = player.getPerms(p_id);
- listsize = list.getSize(permslist);
- if(listsize == 0) {
- msg.prefix(player, prefix_perms, "No permissions found.");
- } else {
- msg.prefix(player, prefix_perms, p_name);
- for(i = 0; i < listsize; i++) {
- msg.string(player, string.concat(" - ", perm.getNameFromId(list.getIndex(permslist, i))));
- }
- }
- goto("wait");
- }
- if(arg0 == "toggle") {
- if(!perm.has("perm.toggle", player)) {
- perm.no("perm.toggle", player);
- goto("wait");
- }
- if(perm.has("simuser", player)) {
- perm.initPlayer(player);
- msg.prefix(player, prefix_commands, "You have regained your permissions.");
- } else {
- perm.simUser(player);
- msg.prefix(player, prefix_commands, "Have fun as a user.");
- }
- goto("wait");
- }
- goto("perm_syntax");
- @allsounds
- if(size == 0) {
- msg.prefix(player, prefix_commands, "§r/allsounds...");
- msg.string(player, "§e - start §rStart all sounds loop");
- msg.string(player, "§e - stop §rStop all sounds loop");
- msg.string(player, "§e - play <sound> §rPlay a sound");
- msg.string(player, "§e - show [page] §rClick on a sound");
- goto("wait");
- }
- arg0 = string.toLowerCase(list.getIndex(args, 0));
- if(arg0 == "start") {
- player_uuid = player.getUuid(player);
- if(map.contains(allsounds_indizes, player_uuid)) {
- msg.prefix(player, prefix_commands, "All sounds already started.");
- goto("wait");
- }
- map.add(allsounds_indizes, player_uuid, 0);
- list.add(allsounds_uuids, player_uuid);
- list.add(allsounds_uuids_cross_check, player_uuid);
- msg.prefix(player, prefix_commands, "All sounds started.");
- goto("playallsounds");
- }
- if(arg0 == "stop") {
- player_uuid = player.getUuid(player);
- if(!list.contains(allsounds_uuids_cross_check, player_uuid)) {
- msg.prefix(player, prefix_commands, "No sounds playing.");
- goto("wait");
- }
- map.remove(allsounds_indizes, player_uuid);
- list.remove(allsounds_uuids_cross_check, player_uuid);
- msg.prefix(player, prefix_commands, "All sounds stopped.");
- goto("wait");
- }
- if(arg0 == "play") {
- if(size != 2) {
- msg.prefix(player, prefix_perms, "/allsounds player <sound>");
- goto("wait");
- }
- sound_name = list.getIndex(args, 1);
- sound_name = string.replace(sound_name, "minecraft:", "");
- sound_name = string.replace(sound_name, "[.]", "_");
- sound_name = string.toUpperCase(sound_name);
- if(!list.contains(allsounds_list, sound_name)) {
- msg.prefix(sender, prefix_commands, "Not a known sound.");
- goto("wait");
- }
- sound = sound.get(sound_name);
- sound.spawnForPlayer(player, sound, sound_category_master);
- goto("wait");
- }
- if(arg0 == "show") {
- amount_sounds = list.getSize(allsounds_list);
- max_side = amount_sounds / 10;
- if(size == 1) {
- side = 1;
- print_side = side - 1;
- } else {
- side = list.getIndex(args, 1);
- if(!isDouble(side)) {
- msg.prefix(sender, prefix_commands, "/allsounds show [side]");
- goto("wait");
- }
- print_side = side - 1;
- if(print_side < 0 || print_side > max_side) {
- msg.prefix(sender, prefix_commands, string.concat("Possible: 1 - ", string.number(math.roundDown(max_side + 1))));
- goto("wait");
- }
- }
- msg.string(sender, string.concat("§a --- All Sounds ", string.number(side), " ---"));
- for(i = print_side * 10; i < print_side * 10 + 10; i++) {
- if(i < amount_sounds) {
- sound_name = list.getIndex(allsounds_list, i);
- msg(sender, string.getClickText(string.concat(" ", sound_name), string.concat("/allsounds play ", sound_name)));
- }
- }
- if(side == 1) {
- backward = text.new("§c<<Backward<<");
- forward = string.getClickText("§b>>Forward>>", string.concat("/allsounds show ", side + 1));
- } elseif(side > max_side) {
- backward = string.getClickText("§b<<Backward<<", string.concat("/allsounds show ", side - 1));
- forward = text.new("§c>>Forward>>");
- } else {
- backward = string.getClickText("§b<<Backward<<", string.concat("/allsounds show ", side - 1));
- forward = string.getClickText("§b>>Forward>>", string.concat("/allsounds show ", side + 1));
- }
- msg(sender, text.merge(backward, text.new(" "), forward));
- goto("wait");
- }
- goto("wait");
- @playallsounds
- player_uuid = list.getIndex(allsounds_uuids, 0);
- list.removeIndex(allsounds_uuids, 0);
- if(!list.contains(allsounds_uuids_cross_check, player_uuid)) {
- goto("wait");
- }
- player = player.get(player_uuid);
- if(player == null) {
- map.remove(allsounds_indizes, player_uuid);
- goto("wait");
- }
- i = map.get(allsounds_indizes, player_uuid);
- if(i == list.getSize(allsounds_list)) {
- map.remove(allsounds_indizes, player_uuid);
- msg.prefix(player, prefix_commands, "All sounds finished.");
- goto("wait");
- }
- sound_name = list.getIndex(allsounds_list, i);
- sound = sound.get(sound_name);
- sound.spawnForPlayer(player, sound, sound_category_master);
- msg.string(player, sound_name);
- map.add(allsounds_indizes, player_uuid, i + 1);
- list.add(allsounds_uuids, player_uuid);
- sgoto(100, "playallsounds");
- goto("wait");
- @weather
- if(size == 0) {
- @weather_syntax
- msg.prefix(player, "§eWeather", "/weather ...");
- msg.string(player, "§e - clear [duration]");
- msg.string(player, "§e - rain [duration]");
- msg.string(player, "§e - thunder [duration]");
- goto("wait");
- }
- arg0 = string.toLowerCase(list.getIndex(args, 0));
- if(arg0 == "clear" || arg0 == "rain" || arg0 == "thunder") {
- if(size == 2) {
- duration = list.getIndex(args, 1);
- if(!isDouble(duration)) {
- msg.prefix(player, prefix_commands, "Number expected.");
- goto("wait");
- }
- if(duration < 0) {
- msg.prefix(player, prefix_commands, "Positive number expected.");
- goto("wait");
- }
- } else {
- duration = 12000;
- }
- world = loc.getWorld(entity.getLocation(player));
- if(arg0 == "clear") {
- if(size > 2) {
- msg.prefix(player, prefix_commands, "/weather clear [duration]");
- goto("wait");
- }
- world.clearWeather(world, duration);
- msg.prefix(player, prefix_commands, "Weather cleared.");
- goto("wait");
- }
- if(arg0 == "rain") {
- if(size > 2) {
- msg.prefix(player, prefix_commands, "/weather rain [duration]");
- goto("wait");
- }
- world.setRain(world, duration);
- msg.prefix(player, prefix_commands, "Weather set to rain.");
- goto("wait");
- }
- if(arg0 == "thunder") {
- if(size > 2) {
- msg.prefix(player, prefix_commands, "/weather thunder [duration]");
- goto("wait");
- }
- world.setThunder(world, duration);
- msg.prefix(player, prefix_commands, "Weather set to thunder.");
- goto("wait");
- }
- goto("wait");
- }
- goto("weather_syntax");
- @time
- if(size == 0) {
- @time_syntax
- msg.prefix(player, "§eTime", "/time ...");
- msg.string(player, "§e - set <time>");
- msg.string(player, "§e - add <time>");
- msg.string(player, "§e - <day / noon / night / midnight>");
- goto("wait");
- }
- arg0 = string.toLowerCase(list.getIndex(args, 0));
- if(arg0 == "set") {
- if(size != 2) {
- msg.prefix(player, prefix_commands, "/time set <time>");
- goto("wait");
- }
- setTime = list.getIndex(args, 1);
- if(!isDouble(setTime)) {
- msg.prefix(player, prefix_commands, "Number expected.");
- goto("wait");
- }
- if(setTime < 0) {
- msg.prefix(player, prefix_commands, "Positive number expected.");
- goto("wait");
- }
- world = loc.getWorld(entity.getLocation(player));
- while(setTime >= 24000) {
- setTime -= 24000;
- }
- world.setTime(world, setTime);
- msg.prefix(player, prefix_commands, string.concat("Time set to ", string.number(setTime), "."));
- goto("wait");
- }
- if(arg0 == "add") {
- if(size != 2) {
- msg.prefix(player, prefix_commands, "/time add <time>");
- goto("wait");
- }
- addTime = list.getIndex(args, 1);
- if(!isDouble(addTime)) {
- msg.prefix(player, prefix_commands, "Number expected.");
- goto("wait");
- }
- if(addTime < 0) {
- msg.prefix(player, prefix_commands, "Positive number expected.");
- goto("wait");
- }
- world = loc.getWorld(entity.getLocation(player));
- newtime = world.getTime(world) + addTime;
- while(newtime >= 24000) {
- newtime -= 24000;
- }
- world.setTime(world, newtime);
- msg.prefix(player, prefix_commands, string.concat("Time set to ", string.number(newtime), "."));
- goto("wait");
- }
- newtime = null;
- if(arg0 == "day") {
- newtime = 1000;
- } elseif(arg0 == "noon") {
- newtime = 6000;
- } elseif(arg0 == "night") {
- newtime = 13000;
- } elseif(arg0 == "midnight") {
- newtime = 18000;
- }
- if(newtime != null) {
- world = loc.getWorld(entity.getLocation(player));
- world.setTime(world, newtime);
- msg.prefix(player, prefix_commands, string.concat("Time set to ", string.number(newtime), "."));
- goto("wait");
- }
- goto("time_syntax");
- @gamerule
- world = loc.getWorld(entity.getLocation(player));
- if(size == 0) {
- msg.prefix(player, prefix_commands, "/gamerule <gamerule> [value]");
- goto("wait");
- }
- gamerule_string = list.getIndex(args, 0);
- gamerule_key = gamerule.getKey(gamerule_string);
- if(gamerule_key == null) {
- msg.prefix(player, prefix_commands, "Gamerule doesn´t exist.");
- goto("wait");
- }
- gamerule_value = gamerule.getValue(world, gamerule_key);
- if(size == 1) {
- if(isDouble(gamerule_value)) {
- gamerule_value = string.number(gamerule_value);
- }
- msg.prefix(player, prefix_commands, string.concat(gamerule_string, " ", gamerule_value));
- goto("wait");
- }
- if(size == 2) {
- if(!perm.has("gamerule.write", player)) {
- perm.no("gamerule.write", player);
- goto("wait");
- }
- value = list.getIndex(args, 1);
- if(isBool(gamerule_value)) {
- gamerule.setBool(world, gamerule_key, value);
- } elseif(isDouble(gamerule_value)) {
- gamerule.setInt(world, gamerule_key, value);
- value = string.number(value);
- } else {
- msg.prefix(player, prefix_commands, "Unknown gamerule type.");
- goto("wait");
- }
- msg.prefix(player, prefix_commands, string.concat(gamerule_string, " set to ", value, "."));
- }
- goto("wait");
- @tip
- if(size == 0) {
- msg.prefix(player, prefix_tips, "/tip ...");
- msg.string(player, "§e - list §rList all tips");
- msg.string(player, "§e - add <tip> <text> §rAdds a tip");
- msg.string(player, "§e - remove <tip> §rRemoves a tip");
- msg.string(player, "§e - loop <tip> <boolean> §rTrue shows on tip loop");
- msg.string(player, "§e - <tip> [player] §rSends a tip to all/a player");
- goto("wait");
- }
- arg0 = string.toLowerCase(list.getIndex(args, 0));
- if(arg0 == "list") {
- msg.string(player, "--==§eTipps§r==--");
- list = tip.getAll();
- if(list.getSize(list) == 0) {
- msg.prefix(player, prefix_tips, "No tips available.");
- goto("wait");
- }
- iter = iterator(list);
- while(hasNext(iter)) {
- a = next(iter);
- tipp_key = a[0];
- tipp_value = a[1];
- tipp_loop = a[2];
- if(tipp_loop) {
- tipp_loop = string.concat("§a", tipp_loop);
- } else {
- tipp_loop = string.concat("§c", tipp_loop);
- }
- msg(player, text.merge(text.new(string.concat(" ", tipp_loop, " §e", tipp_key, "§r : ")), string.getInterpretedText(tipp_value)));
- }
- goto("wait");
- }
- if(arg0 == "add") {
- if(!perm.has("tip.mod", player)) {
- perm.no("tip.mod", player);
- goto("wait");
- }
- if(size < 3) {
- msg.prefix(player, prefix_commands, "/tip add <name> <text>");
- goto("wait");
- }
- tipp_key = list.getIndex(args, 1);
- tipp_value = string.concatList(string_args, " ", 2, size - 1);
- tipp_value = string.replace(tipp_value, "&", "§");
- tipp.register(tipp_key, tipp_value);
- msg.prefix(player, prefix_tips, "Tip added.");
- goto("wait");
- }
- if(arg0 == "loop") {
- if(!perm.has("tip.mod", player)) {
- perm.no("tip.mod", player);
- goto("wait");
- }
- if(size != 3) {
- msg.prefix(player, prefix_commands, "/tip loop <tip> <boolean>");
- goto("wait");
- }
- tipp_key = list.getIndex(args, 1);
- if(!tipp.exists(tipp_key)) {
- msg.prefix(player, prefix_tips, "This tip does not exist.");
- goto("wait");
- }
- boolean = list.getIndex(args, 2);
- if(string.class(boolean) != "Boolean") {
- msg.prefix(player, prefix_tips, "True or false expected.");
- goto("wait");
- }
- if(boolean) {
- tip.setLoop(tipp_key, boolean);
- } else {
- tip.setLoop(tipp_key, boolean);
- }
- msg.prefix(player, prefix_tips, "Tip settings changed.");
- goto("wait");
- }
- if(arg0 == "remove") {
- if(!perm.has("tip.mod", player)) {
- perm.no("tip.mod", player);
- goto("wait");
- }
- if(size != 2) {
- msg.prefix(player, prefix_commands, "/tip remove <name>");
- goto("wait");
- }
- tipp_key = list.getIndex(args, 1);
- tip.remove(tipp_key);
- msg.prefix(player, prefix_tips, "Tip removed.");
- goto("wait");
- }
- tipp_key = arg0;
- if(!tipp.exists(tipp_key)) {
- msg.prefix(player, prefix_tips, "This tip does not exist.");
- goto("wait");
- }
- if(size == 1) {
- p = "online";
- } else {
- p_name = list.getIndex(args, 1);
- if(!isOnline(p_name)) {
- msg.prefix(player, prefix_tips, "This player is not online.");
- goto("wait");
- }
- p = read.player(p_name);
- msg.prefix(player, prefix_tips, string.concat("Tip sent to §7", p_name, "§r."));
- }
- tipp_value = tipp.get(tipp_key);
- msg(p, text.merge(text.new(string.concat(string.getPrefix(string.concat("§e", player.getName(player))), " ")), string.getInterpretedText(tipp_value)));
- goto("wait");
- @help
- if(size > 1) {
- msg.prefix(sender, prefix_commands, "/help [side]");
- goto("wait");
- }
- //Auf Permission überprüfen
- temp_list = list.new();
- for(i = 0; i < list.getSize(command_list); i++) {
- command = list.getIndex(command_list, i);
- if(perm.has(command, sender)) {
- list.add(temp_list, command);
- }
- }
- list.sort(temp_list);
- temp_size = list.getSize(temp_list);
- max_side = temp_size / 10;
- if(size == 0) {
- side = 1;
- print_side = side - 1;
- } else {
- side = list.getIndex(args, 0);
- if(!isDouble(side)) {
- msg.prefix(sender, prefix_commands, "/help [side]");
- goto("wait");
- }
- print_side = side - 1;
- if(print_side < 0 || print_side > max_side) {
- msg.prefix(sender, prefix_commands, string.concat("Possible: 1 - ", string.number(math.roundDown(max_side + 1))));
- goto("wait");
- }
- }
- msg.string(sender, string.concat("§a --- Help ", string.number(side), " ---"));
- for(i = print_side * 10; i < print_side * 10 + 10; i++) {
- if(i < temp_size) {
- command_string = list.getIndex(temp_list, i);
- command = string.getHoverText(command_string, map.getOrDefault(command_map, command_string, ""));
- msg(sender, text.merge(text.new(" /"), text.suggest(command, string.concat("/", command_string))));
- }
- }
- if(side == 1) {
- backward = text.new("§c<<Backward<<");
- forward = string.getClickText("§b>>Forward>>", string.concat("/help ", side + 1));
- } elseif(side > max_side) {
- backward = string.getClickText("§b<<Backward<<", string.concat("/help ", side - 1));
- forward = text.new("§c>>Forward>>");
- } else {
- backward = string.getClickText("§b<<Backward<<", string.concat("/help ", side - 1));
- forward = string.getClickText("§b>>Forward>>", string.concat("/help ", side + 1));
- }
- msg(sender, text.merge(backward, text.new(" "), forward));
- goto("wait");
- @grow
- if(size != 1) {
- msg.prefix(player, prefix_commands, "/grow <radius>");
- goto("wait");
- }
- radius = list.getIndex(args, 0);
- if(!isDouble(radius)) {
- msg.prefix(player, prefix_commands, "Number expected.");
- goto("wait");
- }
- if(radius < 0) {
- msg.prefix(player, prefix_commands, "Positive number expected.");
- goto("wait");
- }
- center_loc = getBlockLocation(entity.getLocation(player));
- grow(center_loc, radius);
- msg.prefix(player, prefix_commands, "Field grown.");
- goto("wait");
- @start
- if(size != 1) {
- @starthelp
- msg.prefix(sender, prefix_commands, "/start <name>");
- goto("wait");
- }
- arg0 = string.toLowerCase(list.getIndex(args, 0));
- modTimer(-500);
- if(arg0 == "chat") {
- script = script.get("Chat");
- if(script != null) {
- script.term(script);
- }
- script.startNamed("Chat", "utils/u_error", "system/chat", "utils/u_general");
- }
- elseif(arg0 == "challenges") {
- script = script.get("Challenges");
- if(script != null) {
- script.term(script);
- }
- script.startNamed("Challenges", "utils/u_error", "survival/challenges", "utils/u_general");
-
- script = script.get("AllDamageTypes");
- if(script != null) {
- script.term(script);
- }
- script.startNamed("AllDamageTypes", "utils/u_error", "challenges/all_damage_types", "utils/u_general");
-
- script = script.get("AllEntities");
- if(script != null) {
- script.term(script);
- }
- script.startNamed("AllEntities", "utils/u_error", "challenges/all_entities", "utils/u_general");
-
- script = script.get("AllItems");
- if(script != null) {
- script.term(script);
- }
- script.startNamed("AllItems", "utils/u_error", "challenges/all_items", "utils/u_general");
- }
- elseif(arg0 == "commands") {
- script = script.startNamed("Commands", "system/commands", "utils/u_general", "utils/u_commands", "utils/u_cmdhelp", "utils/u_skills");
- if(script == null) {
- msg.dev("Old commands script still active due to error in new script");
- goto("wait");
- }
- script.term(script.get());
- }
- elseif(arg0 == "copyisland") {
- script = script.get("Copyisland");
- if(script != null) {
- script.term(script);
- }
- script.startNamed("Copyisland", "system/copyisland", "utils/u_general");
- }
- elseif(arg0 == "creative") {
- script = script.get("Creative");
- if(script != null) {
- script.term(script);
- }
- script.startNamed("Creative", "utils/u_error", "system/creative", "utils/u_general");
- }
- elseif(arg0 == "damage") {
- script = script.get("Damage");
- if(script != null) {
- script.term(script);
- }
- script.startNamed("Damage", "utils/u_error", "system/damage", "utils/u_general");
- }
- elseif(arg0 == "doors") {
- script = script.get("Doors");
- if(script != null) {
- script.term(script);
- }
- script.startNamed("Doors", "utils/u_error", "system/doors", "utils/u_general");
- }
- elseif(arg0 == "fixitems") {
- script = script.get("Fixitems");
- if(script != null) {
- script.term(script);
- }
- script.startNamed("Fixitems", "utils/u_error", "system/fixitems", "utils/u_general");
- }
- elseif(arg0 == "games") {
- script = script.get("Gamecenter");
- if(script != null) {
- script.term(script);
- }
- script.startNamed("Gamecenter", "utils/u_error", "minigames/gamecenter", "utils/u_general", "utils/u_games");
- }
- elseif(arg0 == "gemstones") {
- script = script.get("Gemstones");
- if(script != null) {
- script.term(script);
- }
- script.startNamed("Gemstones", "utils/u_error", "survival/gemstones", "utils/u_general");
- }
- elseif(arg0 == "harvest") {
- script = script.get("Harvest");
- if(script != null) {
- script.term(script);
- }
- script.startNamed("Harvest", "utils/u_error", "survival/harvest", "utils/u_general");
- }
- elseif(arg0 == "herobrine") {
- script = script.get("Herobrine");
- if(script != null) {
- script.term(script);
- }
- script.startNamed("Herobrine", "utils/u_error", "survival/herobrine", "utils/u_general");
- }
- elseif(arg0 == "humans") {
- script = script.get("Humans");
- if(script != null) {
- script.term(script);
- }
- script.startNamed("Humans", "utils/u_error", "system/humans", "utils/u_general");
- }
- elseif(arg0 == "lectern") {
- script = script.get("Lectern");
- if(script != null) {
- script.term(script);
- }
- script.startNamed("Lectern", "utils/u_error", "survival/lectern", "utils/u_general");
- }
- elseif(arg0 == "loginrequests") {
- script = script.get("loginrequests");
- if(script != null) {
- script.term(script);
- }
- script.startNamed("LoginRequests", "system/login_requests", "utils/u_general");
- }
- elseif(arg0 == "loom") {
- script = script.get("Loom");
- if(script != null) {
- script.term(script);
- }
- script.startNamed("Loom", "utils/u_error", "survival/loom", "utils/u_general");
- }
- elseif(arg0 == "perms") {
- script = script.get("Perms");
- if(script != null) {
- script.term(script);
- }
- script.startNamed("Perms", "utils/u_error", "system/perms", "utils/u_general");
- }
- elseif(arg0 == "playerdata") {
- script = script.get("Playerdata");
- if(script != null) {
- script.term(script);
- }
- script.startNamed("Playerdata", "utils/u_error", "system/player_data", "utils/u_general");
- }
- elseif(arg0 == "playtime") {
- script = script.get("Playtime");
- if(script != null) {
- script.term(script);
- }
- script.startNamed("Playtime", "system/playtime", "utils/u_general");
- }
- elseif(arg0 == "pumpkin") {
- script = script.get("Pumpkin");
- if(script != null) {
- script.term(script);
- }
- script.startNamed("Pumpkin", "utils/u_error", "survival/pumpkin", "utils/u_general");
- }
- elseif(arg0 == "recipes") {
- script = script.get("Recipes");
- if(script != null) {
- script.term(script);
- }
- script.startNamed("Recipes", "survival/recipes");
- }
- elseif(arg0 == "stats") {
- script = script.get("Ranklist");
- if(script != null) {
- script.term(script);
- }
- script.startNamed("Ranklist", "utils/u_error", "system/ranklist", "utils/u_general", "utils/u_games");
- }
- elseif(arg0 == "scheduler") {
- script = script.get("Scheduler");
- if(script != null) {
- script.term(script);
- }
- script.startNamed("Scheduler", "utils/u_error", "system/scheduler", "utils/u_general");
- }
- elseif(arg0 == "shop") {
- script = script.get("ChestShops");
- if(script != null) {
- script.term(script);
- }
- script.startNamed("ChestShops", "utils/u_error", "system/chestshops", "utils/u_general");
- }
- elseif(arg0 == "teleporter") {
- script = script.get("Teleporter");
- if(script != null) {
- script.term(script);
- }
- script.startNamed("Teleporter", "utils/u_error", "survival/teleporter", "utils/u_general");
- }
- elseif(arg0 == "mails") {
- script = script.get("Mails");
- if(script != null) {
- script.term(script);
- }
- script.startNamed("Mails", "utils/u_error", "system/mailsystem", "utils/u_general");
- }
- elseif(arg0 == "market") {
- script = script.get("Market");
- if(script != null) {
- script.term(script);
- }
- script.startNamed("Market", "utils/u_error", "system/market", "utils/u_general");
- }
- elseif(arg0 == "mobarena") {
- script = script.get("Mobarena");
- if(script != null) {
- script.term(script);
- }
- script.startNamed("Mobarena", "utils/u_error", "survival/mobarena", "utils/u_general");
- }
- elseif(arg0 == "ticket") {
- script = script.get("Ticket");
- if(script != null) {
- script.term(script);
- }
- script.startNamed("Ticket", "utils/u_error", "system/tickets", "utils/u_general");
- }
- elseif(arg0 == "timber") {
- script = script.get("Timber");
- if(script != null) {
- script.term(script);
- }
- script.startNamed("Timber", "utils/u_error", "survival/timber", "utils/u_general", "utils/u_skills");
- }
- elseif(arg0 == "tiploop") {
- script = script.get("tiploop");
- if(script != null) {
- script.term(script);
- }
- script.startNamed("tiploop", "utils/u_error", "system/tiploop", "utils/u_general");
- }
- elseif(arg0 == "trader") {
- script = script.get("Trader");
- if(script != null) {
- script.term(script);
- }
- script.startNamed("Trader", "utils/u_error", "survival/trader", "utils/u_general");
- }
- elseif(arg0 == "skills") {
- script = script.get("Skills");
- if(script != null) {
- script.term(script);
- }
- script.startNamed("Skills", "utils/u_error", "survival/skills", "utils/u_general", "utils/u_skills", "utils/u_quest");
- }
- elseif(arg0 == "story") {
- /*script = script.get("Story");
- if(script != null) {
- script.term(script);
- }
- script.startNamed("Story", "utils/u_error", "story/story", "utils/u_general");*/
- script = script.get("QuestsAdmont");
- if(script != null) {
- script.term(script);
- }
- script.startNamed("QuestsAdmont", "utils/u_error", "story/admont/core", "utils/u_general", "utils/u_quest");
- /*script = script.get("QuestsSchiffbruch");
- if(script != null) {
- script.term(script);
- }
- script.startNamed("QuestsSchiffbruch", "utils/u_error", "story/schiffbruch/core", "utils/u_general", "utils/u_quest");*/
- }
- elseif(arg0 == "sitting") {
- script = script.get("Sitting");
- if(script != null) {
- script.term(script);
- }
- script.startNamed("Sitting", "utils/u_error", "system/sitting", "utils/u_general");
- }
- elseif(arg0 == "survival") {
- script = script.get("Survival");
- if(script != null) {
- script.term(script);
- }
- script.startNamed("Survival", "utils/u_error", "survival/survival", "utils/u_general", "utils/u_skills");
- }
- else {
- goto("starthelp");
- }
- goto("wait");
- @senditem
- if(size != 1) {
- msg.prefix(player, prefix_commands, "/senditem <player>");
- goto("wait");
- }
- item = living.getHand(player);
- if(item.isAir(item)) {
- msg.prefix(player, prefix_commands, "You need to hold an item in your hand.");
- goto("wait");
- }
- p_name = list.getIndex(args, 0);
- p_uuid = player.getUuid(p_name);
- if(p_uuid == null) {
- msg.prefix(player, prefix_commands, "This player has never been online.");
- goto("wait");
- }
- p = read.player(p_name);
- if(p == null) {
- msg.prefix(player, prefix_commands, "This player is not online.");
- goto("wait");
- }
- player.safeGiveItem(p, item);
- player.removeItem(player, item);
- goto("wait");
- @top
- player_loc = entity.getLocation(player);
- y = 319;
- loc.setY(player_loc, y);
- while(y > -64 && block.isAir(block.get(player_loc))) {
- loc.setY(player_loc, y);
- y--;
- }
- if(y == -64) {
- msg.prefix(player, prefix_commands, "No block found.");
- goto("wait");
- }
- player.teleport(player, loc.mod(player_loc, 0, 1, 0), true);
- goto("wait");
- @creative
- crea_spawn = world.getCreativeSpawn();
- world = loc.getWorld(crea_spawn);
- if(world == null) {
- msg.prefix(player, prefix_commands, "This world is not loaded.");
- goto("wait");
- }
- if(size > 1) {
- msg.prefix(player, prefix_commands, "/creative [player]");
- goto("wait");
- }
- if(size == 0) {
- p = player;
- }
- if(size == 1) {
- p_name = list.getIndex(args, 0);
- p = read.player(p_name);
- if(p == null) {
- msg.prefix(player, prefix_commands, "This player is not online.");
- goto("wait");
- }
- if(!perm.has("tp.other", player)) {
- perm.no("tp.other", player);
- goto("wait");
- }
- }
- if(player.hasMinigame(p)) {
- if(size == 1) {
- msg.prefix(player, prefix_commands, "This player can´t be teleported now.");
- goto("wait");
- }
- msg.prefix(player, prefix_commands, "You can´t teleport now.");
- goto("wait");
- }
- if(size == 1) {
- if(player != p) {
- msg.prefix(player, prefix_commands, string.concat(player.getName(p), " was teleported to the creative world."));
- }
- }
- if(player.teleport(p, crea_spawn, true)) {
- msg.prefix(p, prefix_commands, "You have been teleported to the creative world.");
- }
- goto("wait");
- @games
- world = loc.getWorld(world.getGamesSpawn());
- if(world == null) {
- msg.prefix(player, prefix_commands, "This world is not loaded.");
- goto("wait");
- }
- if(size > 1) {
- msg.prefix(player, prefix_commands, "/games [player]");
- goto("wait");
- }
- if(size == 0) {
- p = player;
- }
- if(size == 1) {
- p_name = list.getIndex(args, 0);
- p = read.player(p_name);
- if(p == null) {
- msg.prefix(player, prefix_commands, "This player is not online.");
- goto("wait");
- }
- if(!perm.has("tp.other", player)) {
- perm.no("tp.other", player);
- goto("wait");
- }
- }
- if(player.hasMinigame(p)) {
- if(size == 1) {
- msg.prefix(player, prefix_commands, "This player can´t be teleported now.");
- goto("wait");
- }
- msg.prefix(player, prefix_commands, "You can´t teleport now.");
- goto("wait");
- }
- if(size == 1) {
- if(player != p) {
- msg.prefix(player, prefix_commands, string.concat(player.getName(p), " was teleported to the games world."));
- }
- }
- if(player.teleport(p, world.getGamesSpawn(), true)) {
- msg.prefix(p, prefix_commands, "You have been teleported to the games world.");
- }
- goto("wait");
- @repair
- item = living.getHand(player);
- if(item.isAir(item)) {
- msg.prefix(player, prefix_commands, "You have to hold an item in your mainhand.");
- goto("wait");
- }
- item.setDamage(item, 0);
- msg.prefix(player, prefix_commands, "Your item has been repaired.");
- goto("wait");
- @playtime
- if(size == 0) {
- p_id = player.getId(player);
- arg0 = player.getName(player);
- } else {
- arg0 = string.toLowerCase(list.getIndex(args, 0));
- if(arg0 == "year") {
- modTimer(-20);
- if(!perm.has("playtime.year", player)) {
- perm.no("playtime.year", player);
- goto("wait");
- }
- calendar = time.new(time.getMillis());
- now_month = time.getMonth(calendar);
- now_year = time.getYear(calendar);
- if(size == 1) {
- year = now_year;
- } else {
- year = list.getIndex(args, 1);
- if(!isDouble(year)) {
- msg.prefix(player, prefix_commands, "Number expected.");
- goto("wait");
- }
- if(year > now_year) {
- year = now_year;
- }
- }
- //Von allen Online-Spielern die Onlinezeit abrufen, summieren und zur Heute-Spielzeit addieren
- since_minutes = playtime.getTotalOnlineMinutes();
- //Tabelle erstellen
- table = table.new("§8", 4, 5, 5);
- msg.string(player, table.getStart(table));
- msg.string(player, table.get(table, string.number(year), "Playtime", "Change"));
- msg.string(player, table.getMiddle(table));
- //Monats-Spielzeit berechnen
- temp_list = list.new();
- list.add(temp_list, playtime.getInterval(time.getCal(year - 1, 12, 1, 0, 0, 0), time.getCal(year, 1, 1, 0, 0, 0))); //Dezember des Vorjahres hinzufügen
- for(i = 1; i <= 12; i++) {
- midnight = time.getCal(year, i, 1, 0, 0, 0);
- midnight_2 = time.getCal(year, i + 1, 1, 0, 0, 0);
- minutes = playtime.getInterval(midnight, midnight_2);
- list.add(temp_list, minutes);
- if(i == now_month && year == now_year) {
- minutes += since_minutes;
- }
- }
- for(i = 1; i <= 12; i++) {
- minutes = list.getIndex(temp_list, i);
- hours = math.roundDown(minutes / 60);
- mod_minutes = minutes % 60;
- if(mod_minutes < 10) {
- time_string = string.concat("§6", string.number(hours), ":0", string.number(mod_minutes), " h");
- } else {
- time_string = string.concat("§6", string.number(hours), ":", string.number(mod_minutes), " h");
- }
- pre_minutes = list.getIndex(temp_list, i - 1);
- if(minutes >= pre_minutes) {
- color = "§a+";
- a = minutes;
- b = pre_minutes;
- } else {
- color = "§c-";
- a = pre_minutes;
- b = minutes;
- }
- if(b == 0) {
- change = "";
- } else {
- change = math.round(a / b * 100 - 100);
- change = string.concat(color, string.number(change), " %");
- }
- msg.string(player, table.get(table, string.concat("§6", month.getShortName(i)), time_string, change));
- if(i == now_month && year == now_year) {
- break;
- }
- }
- //Tabelle beenden
- msg.string(player, table.getEnd(table));
- goto("wait");
- }
- if(arg0 == "month") {
- modTimer(-100);
- if(!perm.has("playtime.month", player)) {
- perm.no("playtime.month", player);
- goto("wait");
- }
- calendar = time.new(time.getMillis());
- now_day = time.getDay(calendar);
- now_month = time.getMonth(calendar);
- now_year = time.getYear(calendar);
- year = now_year;
- if(size == 1) {
- month = now_month;
- } else {
- month = list.getIndex(args, 1);
- if(!isDouble(month)) {
- msg.prefix(player, prefix_commands, "Number expected.");
- goto("wait");
- }
- if(month < 1) {
- month = 1;
- } elseif(month > 12) {
- month = 12;
- }
- if(size == 3) {
- year = list.getIndex(args, 2);
- if(!isDouble(year)) {
- msg.prefix(player, prefix_commands, "Number expected.");
- goto("wait");
- }
- }
- if(year > now_year ||(year >= now_year && month > now_month)) {
- month = now_month;
- year = now_year;
- }
- }
- sum_minutes = 0;
- sum_players = 0;
- //Von allen Online-Spielern die Onlinezeit abrufen, summieren und zur Heute-Spielzeit addieren
- since_minutes = playtime.getTotalOnlineMinutes();
- //Tabelle erstellen
- table = table.new("§8", 4, 5, 5);
- msg.string(player, table.getStart(table));
- msg.string(player, table.get(table, month.getShortName(month), "Playtime", "Players"));
- msg.string(player, table.getMiddle(table));
- //Tages-Spielzeit berechnen
- month_days = time.getMonthDays(month, year);
- for(i = 1; i <= month_days; i++) {
- midnight = time.getCal(year, month, i, 0, 0, 0);
- if(i == month_days) {
- midnight_2 = time.getCal(year, month + 1, 1, 0, 0, 0);
- } else {
- midnight_2 = time.getCal(year, month, i + 1, 0, 0, 0);
- }
- players = playtime.getPlayersPerInterval(midnight, midnight_2);
- sum_players += players;
- minutes = playtime.getInterval(midnight, midnight_2);
- if(i == now_day && month == now_month && year == now_year) {
- minutes += since_minutes;
- }
- sum_minutes += minutes;
- hours = math.roundDown(minutes / 60);
- minutes = minutes % 60;
- if(minutes < 10) {
- time_string = string.concat("§6", string.number(hours), ":0", string.number(minutes), " h");
- } else {
- time_string = string.concat("§6", string.number(hours), ":", string.number(minutes), " h");
- }
- msg.string(player, table.get(table, string.concat("§6", string.number(i)), time_string, string.number(players)));
- if(i == now_day && month == now_month && year == now_year) {
- break;
- }
- }
- //Average
- avg_mins = sum_minutes / i;
- avg_hours = math.roundDown(avg_mins / 60);
- avg_mins = avg_mins % 60;
- if(avg_mins < 10) {
- avg_time_string = string.concat("§6", string.number(avg_hours), ":0", string.number(avg_mins), " h");
- } else {
- avg_time_string = string.concat("§6", string.number(avg_hours), ":", string.number(avg_mins), " h");
- }
- avg_players = sum_players / i;
- msg.string(player, table.getMiddle(table));
- msg.string(player, table.get(table, "§6Ø", avg_time_string, string.number(math.roundDown(avg_players))));
- //Tabelle beenden
- msg.string(player, table.getEnd(table));
- goto("wait");
- }
- if(arg0 == "all") {
- modTimer(-10);
- msg.string(player, string.getSpacer());
- msg.prefix(player, prefix_commands, "Server-Playtime");
- //Von allen Online-Spielern die Onlinezeit abrufen, summieren und zur Heute-Spielzeit addieren
- since_minutes = playtime.getTotalOnlineMinutes();
- //Spielzeit heute
- now_cal = time.new(time.getMillis());
- now_day = time.getDay(now_cal);
- now_month = time.getMonth(now_cal);
- now_year = time.getYear(now_cal);
- midnight = time.getCal(now_year, now_month, now_day, 0, 0, 0);
- minutes = playtime.getInterval(midnight, now_cal) + since_minutes;
- hours = string.number(math.roundDown(minutes / 60));
- minutes = string.number(minutes % 60);
- msg.string(player, string.concat("§6Today: §r", hours, " h ", minutes, " min"));
- //Spielzeit 30 Tage für alle Spieler
- year = now_year;
- month = now_month;
- day = now_day - 30;
- if(day < 1) {
- month -= 1;
- if(month < 1) {
- year -= 1;
- month = 12;
- }
- day += time.getMonthDays(month, year);
- }
- thirtyDaysAgo = time.getCal(year, month, day, time.getHour(now_cal), time.getMinute(now_cal), time.getSecond(now_cal));
- minutes = playtime.getInterval(thirtyDaysAgo, now_cal) + since_minutes;
- hours = string.number(math.roundDown(minutes / 60));
- minutes = string.number(minutes % 60);
- msg.string(player, string.concat("§630 Days: §r", hours, " h ", minutes, " min"));
- //Spielzeit gesamt
- minutes = playtime.getTotal();
- hours = string.number(math.roundDown(minutes / 60));
- minutes = string.number(minutes % 60);
- msg.string(player, string.concat("§6Total: §r", hours, " h ", minutes, " min"));
- goto("wait");
- }
- if(!perm.has("playtime.other", player)) {
- perm.no("playtime.other", player);
- goto("wait");
- }
- }
- if(!checkIfEverOnline(arg0)) {
- msg.prefix(player, prefix_commands, "This player has never been online.");
- goto("wait");
- }
- p_uuid = player.getUuid(arg0);
- arg0 = player.getName(p_uuid);
- p_id = player.getId(p_uuid);
- msg.string(player, string.getSpacer());
- msg.prefix(player, prefix_commands, string.concat("Playtime of ", player.getName(p_uuid)));
- //Online seit
- since_minutes = playtime.getPlayerOnlineMinutes(p_id);
- if(isOnline(arg0)) {
- since_hours = math.roundDown(since_minutes / 60);
- mod_minutes = since_minutes % 60;
- msg.string(player, string.concat("§aOnline since: §r", string.number(since_hours), " hours ", string.number(mod_minutes), " minutes"));
- } else {
- msg.string(player, "§6Status: §cOffline");
- }
- //Spielzeit heute
- now_cal = time.new(time.getMillis());
- now_day = time.getDay(now_cal);
- now_month = time.getMonth(now_cal);
- now_year = time.getYear(now_cal);
- midnight = time.getCal(now_year, now_month, now_day, 0, 0, 0);
- minutes = playtime.getPlayerInterval(p_id, midnight, now_cal) + since_minutes;
- hours = string.number(math.roundDown(minutes / 60));
- minutes = string.number(minutes % 60);
- msg.string(player, string.concat("§6Today: §r", hours, " h ", minutes, " min"));
- //Spielzeit 30 Tage
- year = now_year;
- month = now_month;
- day = now_day - 30;
- if(day < 1) {
- month -= 1;
- if(month < 1) {
- year -= 1;
- month = 12;
- }
- day += time.getMonthDays(month, year);
- }
- thirtyDaysAgo = time.getCal(year, month, day, time.getHour(now_cal), time.getMinute(now_cal), time.getSecond(now_cal));
- minutes = playtime.getPlayerInterval(p_id, thirtyDaysAgo, now_cal) + since_minutes;
- hours = string.number(math.roundDown(minutes / 60));
- minutes = string.number(minutes % 60);
- msg.string(player, string.concat("§630 Days: §r", hours, " h ", minutes, " min"));
- //Spielzeit gesamt
- minutes = playtime.getPlayerTotal(p_id);
- hours = string.number(math.roundDown(minutes / 60));
- minutes = string.number(minutes % 60);
- msg.string(player, string.concat("§6Total: §r", hours, " h ", minutes, " min"));
- goto("wait");
- @datatools
- if(size == 0) {
- @datatoolshelp
- msg.prefix(player, prefix_datatools, "/datatools ...");
- msg.string(player, "§6 - item-flag <name> §rAdds a flag on an item");
- msg.string(player, "§6 - item-name <name> §rRenames an item");
- msg.string(player, "§6 - item-lore <lore> §rSets an item lore");
- msg.string(player, "§6 - item-attribute <attribut> <slot> <double> <op> §rAdds an attribute to an item");
- msg.string(player, "§6 - entity-hide §rHides an entity");
- msg.string(player, "§6 - entity-show §rShows an entity");
- msg.string(player, "§6 - entity-name <name> §rRenames an entity");
- msg.string(player, "§6 - entity-print §rPrint entities nbt-tag");
- msg.string(player, "§6 - frame-hide §rHides an item frame");
- msg.string(player, "§6 - frame-show §rShows an item frame");
- msg.string(player, "§6 - name-visibility <boolean> §rShow name (not) permanent");
- goto("wait");
- }
- arg0 = string.toLowerCase(list.getIndex(args, 0));
- if(arg0 == "item-flag") {
- if(size < 2) {
- msg.prefix(player, prefix_datatools, "/datatools item-flag <name>");
- goto("wait");
- }
- item = living.getHand(player);
- if(item.isAir(item)) {
- msg.prefix(player, prefix_datatools, "Hold an item in your hand.");
- goto("wait");
- }
- name = string.concatList(args, " ", 1, size - 1);
- if(!list.contains(item_flags, name)) {
- msg.prefix(player, prefix_datatools, "You can´t add that flag.");
- goto("wait");
- }
- item.addFlag(item, name);
- msg.prefix(player, prefix_datatools, "Flag added.");
- goto("wait");
- }
- if(arg0 == "item-attribute") {
- if(size < 5) {
- msg.prefix(player, prefix_datatools, "/datatools item-attribute <attribut> <slot> <double> <op>");
- goto("wait");
- }
- item = living.getHand(player);
- if(item.isAir(item)) {
- msg.prefix(player, prefix_commands, "You have to hold an item in your mainhand.");
- goto("wait");
- }
- double = list.getIndex(args, 3);
- if(!isDouble(double) || double < 0) {
- msg.prefix(player, prefix_datatools, "Natural number expected.");
- goto("wait");
- }
- attribut = list.getIndex(args, 1);
- if(!set.contains(attribut_set, attribut)) {
- msg.prefix(player, prefix_datatools, "Unknown attribute.");
- goto("wait");
- }
- slot = read.slot(list.getIndex(args, 2));
- if(slot == null) {
- msg.prefix(player, prefix_datatools, "Incorrect slot.");
- goto("wait");
- }
- operation = list.getIndex(args, 4);
- if(!set.contains(operation_set, operation)) {
- msg.prefix(player, prefix_datatools, "Unknown operation.");
- goto("wait");
- }
- item.addAttribute(item, attribut, slot, double, operation);
- msg.prefix(player, prefix_datatools, "Attribute added.");
- goto("wait");
- }
- if(arg0 == "item-name") {
- if(size < 2) {
- msg.prefix(player, prefix_datatools, "/datatools item-name <name>");
- goto("wait");
- }
- item = living.getHand(player);
- if(item.isAir(item)) {
- msg.prefix(player, prefix_datatools, "You need to hold an item in your hand.");
- goto("wait");
- }
- name = string.concatList(args, " ", 1, size - 1);
- name = string.replace(name, "&", "§");
- name = string.replace(name, "\\n", "\n");
- item.setName(item, text.new(name));
- msg.prefix(player, prefix_datatools, string.concat("Item renamed to ", name, "§r."));
- goto("wait");
- }
- if(arg0 == "entity-print") {
- entity = player.getTargetEntity(player, 5);
- if(entity == null) {
- msg.prefix(player, prefix_commands, "No entity found.");
- goto("wait");
- }
- txt_ent = string.entity(entity);
- msg(player, string.getClipBoardText(txt_ent, txt_ent));
- goto("wait");
- }
- if(arg0 == "item-lore") {
- if(size < 2) {
- msg.prefix(player, prefix_datatools, "/datatools item-lore <lore>");
- goto("wait");
- }
- item = living.getHand(player);
- if(item.isAir(item)) {
- msg.prefix(player, prefix_datatools, "You need to hold an item in your hand.");
- goto("wait");
- }
- lore = string.concatList(args, " ", 1, size - 1);
- lore = string.replace(lore, "&", "§");
- item.addLore(item, lore);
- msg.prefix(player, prefix_datatools, "New lore added.");
- goto("wait");
- }
- if(arg0 == "entity-name") {
- if(size < 2) {
- msg.prefix(player, prefix_datatools, "/datatools entity-name <name>");
- goto("wait");
- }
- templist = living.near(player, 3);
- list.remove(templist, player);
- if(list.getSize(templist) == 0) {
- msg.prefix(player, prefix_datatools, "Too far away from an entity.");
- goto("wait");
- }
- entity = list.getIndex(templist, 0);
- name = string.concatList(args, " ", 1, size - 1);
- name = string.replace(name, "&", "§");
- entity.setName(entity, text.new(name), true);
- msg.prefix(player, prefix_datatools, string.concat("Entity renamed to ", name, "§r."));
- goto("wait");
- }
- if(arg0 == "name-visibility") {
- if(size != 2) {
- msg.prefix(player, prefix_datatools, "/datatools name-visibility <boolean>");
- goto("wait");
- }
- templist = living.near(player, 3);
- list.remove(templist, player);
- if(list.getSize(templist) == 0) {
- msg.prefix(player, prefix_datatools, "Too far away from an entity.");
- goto("wait");
- }
- entity = list.getIndex(templist, 0);
- boolean = list.getIndex(args, 1);
- name = entity.getName(entity);
- entity.setName(entity, name, boolean);
- msg.prefix(player, prefix_datatools, "Name-Visibility changed.");
- goto("wait");
- }
- if(arg0 == "frame-hide") {
- if(size != 1) {
- msg.prefix(player, prefix_datatools, "/datatools frame-hide");
- goto("wait");
- }
- entity = player.getTargetEntity(player, 5);
- if(entity == null) {
- msg.prefix(player, prefix_datatools, "Not an item frame.");
- goto("wait");
- }
- entity_type = entity.getType(entity);
- if(entity_type != "item_frame" && entity_type != "glow_item_frame") {
- msg.prefix(player, prefix_datatools, "Not an item frame.");
- goto("wait");
- }
- entity.frame.hide(entity);
- msg.prefix(player, prefix_datatools, "Item frame is now hidden.");
- goto("wait");
- }
- if(arg0 == "frame-show") {
- if(size != 1) {
- msg.prefix(player, prefix_datatools, "/datatools frame-show");
- goto("wait");
- }
- entity = player.getTargetEntity(player, 5);
- if(entity == null) {
- msg.prefix(player, prefix_datatools, "Not an item frame.");
- goto("wait");
- }
- entity_type = entity.getType(entity);
- if(entity_type != "item_frame" && entity_type != "glow_item_frame") {
- msg.prefix(player, prefix_datatools, "Not an item frame.");
- goto("wait");
- }
- entity.frame.show(entity);
- msg.prefix(player, prefix_datatools, "Item frame now shown.");
- goto("wait");
- }
- if(arg0 == "entity-hide") {
- if(size != 1) {
- msg.prefix(player, prefix_datatools, "/datatools entity-hide");
- goto("wait");
- }
- templist = living.near(player, 3);
- list.remove(templist, player);
- if(list.getSize(templist) == 0) {
- msg.prefix(player, prefix_datatools, "Too far away from an entity.");
- goto("wait");
- }
- entity = list.getIndex(templist, 0);
- living.setInvisible(entity, true);
- msg.prefix(player, prefix_datatools, "Entity is now hidden.");
- goto("wait");
- }
- if(arg0 == "entity-show") {
- if(size != 1) {
- msg.prefix(player, prefix_datatools, "/datatools entity-show");
- goto("wait");
- }
- templist = living.near(player, 3);
- list.remove(templist, player);
- if(list.getSize(templist) == 0) {
- msg.prefix(player, prefix_datatools, "Too far away from an entity.");
- goto("wait");
- }
- entity = list.getIndex(templist, 0);
- living.setInvisible(entity, false);
- msg.prefix(player, prefix_datatools, "Entity is now visible.");
- goto("wait");
- }
- goto("datatoolshelp");
- @human
- if(size == 0) {
- @humanhelp
- msg.prefix(player, prefix_human, "/human ...");
- msg.string(player, string.concat("§6 - skin <name> §rSets the skin of a citizen"));
- goto("wait");
- }
- arg0 = string.toLowerCase(list.getIndex(args, 0));
- citizen = player.getTargetCitizen(player, 5);
- if(!isCitizen(citizen)) {
- msg.prefix(player, prefix_human, "No citizen.");
- goto("wait");
- }
- elseif(arg0 == "skin") {
- if(size == 2) {
- name = string.toLowerCase(list.getIndex(args, 1));
- if(name == "farmer") {
- citizen.setSkin(citizen, "ewogICJ0aW1lc3RhbXAiIDogMTYyMDgyMDYyMjYyMiwKICAicHJvZmlsZUlkIiA6ICJkZGVkNTZlMWVmOGI0MGZlOGFkMT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aphcGoAo4txsC47MX0L19xbtnd6doQTmpLTnxivlLgaPyrzA/c1oeC5JujwsNGthq2CqHdzVPDAUQDADf8BrfYKrEd3DskWVZzGg7wzrdUfJPYPHkkqFxhPm0SAPwPOVJp33RhpzjkXLsae45QN6/UEcQaSi0tIxltSWfeAK5f6/3zixk/SES3fSpk5oHvTaJGVWs/lGRaE0AFAqwrWvp5yTW5CU4rmTrAFWu0KtkW4sI8Kur+xwKry24FQF6h+Luo26lvaXVo7zGCtl94zm4LuMBWNTq0RgLWc5Zj6VvW4vGIybPj2/fQwoJIfodqawxzJjVguSiRzF2AxwTKoMtAn2guDfQkULsRat012oU7qvyJWhi1HLm504am4PxkI=");
- } elseif(name == "mason") {
- citizen.setSkin(citizen, "ewogICJ0aW1lc3RhbXAiIDogMTYwNDQ5MjYyMzQxOCwKICAicHJvZmlsZUlkIiA6ICJlNzkzYjJjYTdhMmY0MTI2YTA5ODA5MmQ3Yzk5NDE3YiIsCiAgInByb2ZpbGVOYW1lIiA6ICJUaGVfSG9zdGVyX01hbiIsCiAgInNpZ25hdHVyZVJlcXVpcmVkIiA6IHRydWUsCiAgInRleHR1cmVzIiA6IHsKICAgICJTS0lOIiA6IHsKICAgICAgInVybCIgOiAiaHR0cDovL3RleHR1cmVzLm1pbmVjcmFmdC5uZXQvdGV4dHVyZS85ODI1ZTk3NTZjM2VhNjZjOGNjZmEyZmU4MDU4MzRmNGZhMDVhMGY0ODc0NTY3NTljMzY0MjcwODkwNTE0NzZlIgogICAgfQogIH0KfQ==", "RLLeCZVT2zj4DhvrVl4fTVy4BdjyK02tTX5u3PT0gNcbluSRDNUjwG+G/HttDVtPpyQuVOq/8aAFT/xdu+BZaiI3q3830BWqVe+CbSJuHorHPbPskJRV8+L+Ra6rJLA9LJQh5li5EZCwiAwqBSQwqycIU7032xjtoPjfOXio0gAnqKLffTEc2irDq4KzZGH9WZjYJrEfS9eCkQ1780jl96oEordJT940G/mgiB+XZdg1RQs+YuDprGvX1ILVZluoN+S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bM97Q+og7W/RtSH+kYl9vNwpLrQEG2F0bQUtulwQrWzk8T2fKgPHncZIDS2YvQjrrHjjlG0bLbiakHGvRrMrLbrVtmQrKjOjLuc5j4M/quMoZpFz98q4uftCmNOyN9ZmoEjgFv5fOdsJDGJawSaug9VEieCWhuuPnXPx19GpT1TRzGRjDW9DqO08kNeCcRxq0=");
- } else {
- msg.action(player, "Not supported name.");
- }
- goto("wait");
- }
- }
- goto("humanhelp");
- @answer
- if(player.isMuted(player)) {
- msg.prefix(player, "§6Commands", "You are muted.");
- goto("wait");
- }
- if(size < 1) {
- msg.prefix(sender, prefix_commands, "/answer <message>");
- goto("wait");
- }
- player_uuid = player.getUuid(sender);
- p_uuid = map.get(answer_map, player_uuid);
- if(p_uuid == null) {
- msg.prefix(sender, prefix_commands, "There is no one you could answer.");
- goto("wait");
- }
- string_message = string.concatList(string_args, " ", 0, size - 1);
- string_message = string.concat("§e", string_message);
- message = getMessage(string_message);
- p = player.get(p_uuid);
- if(p == null) {
- msg.prefix(sender, prefix_commands, "This player is not online.");
- goto("wait");
- }
- msg(sender, text.merge(text.new(string.concat("§6[§cme §6-> §c", player.getName(p), "§6] §r")), message));
- msg(p, text.merge(text.new(string.concat("§6[§c", player.getName(sender), " §6-> §cme§6] §r")), message));
- map.add(answer_map, p_uuid, player_uuid);
- map.add(answer_map, player_uuid, p_uuid);
- goto("wait");
- @msg
- if(player.isMuted(sender)) {
- msg.prefix(sender, "§6Commands", "You are muted.");
- goto("wait");
- }
- if(size < 2) {
- msg.prefix(sender, prefix_commands, "/msg <player> <message>");
- if(perm.has("msg.team", player)) {
- msg.prefix(sender, prefix_commands, "/msg team <message>");
- }
- goto("wait");
- }
- string_message = string.concatList(string_args, " ", 1, size - 1);
- string_message = string.concat("§e", string_message);
- message = getMessage(string_message);
- p_name = list.getIndex(args, 0);
- if(p_name == "team") {
- msg.team(player, message);
- goto("wait");
- }
- p_uuid = player.getUuid(p_name);
- if(p_uuid == null) {
- msg.prefix(sender, prefix_commands, "Unknown player.");
- goto("wait");
- }
- p = read.player(p_name);
- if(p == null) {
- msg.prefix(sender, prefix_commands, "This player is not online.");
- goto("wait");
- }
- msg(p, text.merge(text.new(string.concat("§6[§c", player.getName(sender), " §6-> §cme§6] ")), message));
- msg(sender, text.merge(text.new(string.concat("§6[§cme §6-> §c", player.getName(p), "§6] ")), message));
- player_uuid = player.getUuid(sender);
- map.add(answer_map, p_uuid, player_uuid);
- map.add(answer_map, player_uuid, p_uuid);
- goto("wait");
- @list
- list = players.toList();
- size = list.getSize(list);
- msg.string(sender, string.getSpacer());
- if(size == 1) {
- msg.string(sender, string.concat("§6There is ", string.number(size), " players online."));
- } else {
- msg.string(sender, string.concat("§6There are ", string.number(size), " players online."));
- }
- table = table.new("§f", 16, 16);
- msg.string(sender, table.getStart(table));
- for(i = 0; i < size; i++) {
- p = list.getIndex(list, i++);
- full_name = player.getFullName(p);
- if(player.isAfk(p)) {
- full_name = string.concat(full_name, " §5§o[Afk]");
- }
- if(i < size) {
- p_2 = list.getIndex(list, i);
- full_name_2 = player.getFullName(p_2);
- if(player.isAfk(p_2)) {
- full_name_2 = string.concat(full_name_2, " §5§o[Afk]");
- }
- } else {
- full_name_2 = "";
- }
- msg.string(sender, table.get(table, full_name, full_name_2));
- }
- msg.string(sender, table.getEnd(table));
- goto("wait");
- @sign
- if(size == 0) {
- msg.prefix(player, prefix_commands, "/sign ...");
- msg.string(player, "§6 - <FRONT/BACK> <row:1-4> [text] §rSet a sign line");
- if(perm.has("sign.copy", player)) {
- msg.string(player, "§6 - copy §rCopy a sign content");
- msg.string(player, "§6 - paste §rPaste a sign content");
- msg.string(player, "§6 - wax <true/false> §rWax a sign");
- }
- goto("wait");
- }
- block = player.getTargetBlock(player, 5);
- if(block == null) {
- msg.prefix(player, prefix_commands, "Look at a sign.");
- goto("wait");
- }
- if(!block.hasTag(block, all_signs_tag)) {
- msg.prefix(player, prefix_commands, "Look at a sign.");
- goto("wait");
- }
- arg0 = string.toLowerCase(list.getIndex(args, 0));
- if(arg0 == "copy") {
- a = array.new(8);
- a[0] = sign.getString(block, "FRONT", 0);
- a[1] = sign.getString(block, "FRONT", 1);
- a[2] = sign.getString(block, "FRONT", 2);
- a[3] = sign.getString(block, "FRONT", 3);
- a[4] = sign.getString(block, "BACK", 0);
- a[5] = sign.getString(block, "BACK", 1);
- a[6] = sign.getString(block, "BACK", 2);
- a[7] = sign.getString(block, "BACK", 3);
- map.add(sign_copy_map, player.getId(player), a);
- msg.prefix(player, prefix_commands, "Sign copied.");
- goto("wait");
- }
- if(arg0 == "paste") {
- a = map.get(sign_copy_map, player.getId(player));
- if(a == null) {
- msg.prefix(player, prefix_commands, "Use '/sign copy' first.");
- goto("wait");
- }
- sign.setString(block, "FRONT", 0, a[0]);
- sign.setString(block, "FRONT", 1, a[1]);
- sign.setString(block, "FRONT", 2, a[2]);
- sign.setString(block, "FRONT", 3, a[3]);
- sign.setString(block, "BACK", 0, a[4]);
- sign.setString(block, "BACK", 1, a[5]);
- sign.setString(block, "BACK", 2, a[6]);
- sign.setString(block, "BACK", 3, a[7]);
- msg.prefix(player, prefix_commands, "Sign pasted.");
- goto("wait");
- }
- if(arg0 == "wax") {
- if(size < 2) {
- msg.prefix(player, prefix_datatools, "/sign wax <true/false>");
- goto("wait");
- }
- bool = list.getIndex(args, 1);
- if(bool != true && bool != false) {
- msg.action(player, "True/False expected.");
- goto("wait");
- }
- block.signSetWaxed(block, bool);
- msg.prefix(player, prefix_commands, "Set sign wax.");
- goto("wait");
- }
- if(size < 2) {
- msg.prefix(player, prefix_datatools, "/sign <FRONT/BACK> <row:1-4> [text]");
- goto("wait");
- }
- side = list.getIndex(args, 0);
- if(side != "FRONT" && side != "BACK") {
- msg.action(player, "FRONT/BACK expected.");
- goto("wait");
- }
- line = list.getIndex(args, 1);
- if(!isDouble(line)) {
- msg.prefix(player, prefix_commands, "Number expected.");
- goto("wait");
- }
- if(!(line == 1 || line == 2 || line == 3 || line == 4)) {
- msg.prefix(player, prefix_commands, "Number between 1 and 4 expected.");
- goto("wait");
- }
- if(!player.hasBypass(player)) {
- if(!plot.check(block.getLocation(block), player, 19, true)) {
- msg.prefix(player, prefix_commands, "Not your plot.");
- goto("wait");
- }
- }
- string = "";
- if(size > 2) {
- for(i = 2; i < size; i++) {
- arg = list.getIndex(string_args, i);
- if(i == 2) {
- string = arg;
- } else {
- string = string.concat(string, " ", arg);
- }
- }
- }
- string = string.replace(string, "&", "§");
- block.setSign(block, side, line - 1, text.new(string));
- block.signSetWaxed(block, true);
- goto("wait");
- @head
- if(size != 1) {
- msg.prefix(player, prefix_commands, "/head <player>");
- goto("wait");
- }
- name = list.getIndex(args, 0);
- uuid = player.getUuid(name);
- if(uuid == null) {
- head = read.item(string.concat("{id:\"minecraft:player_head\", Count:1b, tag:{SkullOwner:\"", name, "\"}}"));
- } else {
- head = player.getHead(uuid, name);
- }
- player.giveItem(player, head);
- goto("wait");
- @mute
- if(size < 1) {
- msg.prefix(sender, prefix_commands, "/mute <player> [message]");
- goto("wait");
- }
- p_name = list.getIndex(args, 0);
- if(!isOnline(p_name)) {
- msg.prefix(sender, prefix_commands, "This player is not online.");
- goto("wait");
- }
- p = read.player(p_name);
- p_name = player.getName(p);
- if(p_name == "marvinius") {
- msg.string(sender, "§cSorry §b¯\\_(._.)_/¯");
- goto("wait");
- }
- sender_name = player.getName(sender);
- player.mute(p, true);
- if(size > 1) {
- reason = string.concatList(args, " ", 1, size - 1);
- msg.team(sender_name, string.concat("§cMuted ", p_name, ": ", reason));
- } else {
- msg.team(sender_name, string.concat("§cMuted ", p_name, "."));
- }
- goto("wait");
- @unmute
- if(size < 1) {
- msg.prefix(sender, prefix_commands, "/unmute <player>");
- goto("wait");
- }
- p_name = list.getIndex(args, 0);
- if(!isOnline(p_name)) {
- msg.prefix(sender, prefix_commands, "This player is not online.");
- goto("wait");
- }
- p = read.player(p_name);
- p_name = player.getName(p);
- if(p_name == "marvinius") {
- msg.string(sender, "§cSorry §b¯\\_(._.)_/¯");
- goto("wait");
- }
- msg.team(player.getName(sender), string.concat("§cUnmuted ", p_name, "."));
- player.mute(p, false);
- goto("wait");
- @kick
- if(size < 1) {
- msg.prefix(sender, prefix_commands, "/kick <player> [reason]");
- goto("wait");
- }
- p_name = list.getIndex(args, 0);
- if(!isOnline(p_name)) {
- msg.prefix(sender, prefix_commands, "This player is not online.");
- goto("wait");
- }
- p = read.player(p_name);
- p_name = player.getName(p);
- if(p_name == "marvinius") {
- msg.string(sender, "§cSorry §b¯\\_(._.)_/¯");
- goto("wait");
- }
- sender_name = player.getName(sender);
- if(size > 1) {
- reason = string.concatList(args, " ", 1, size - 1);
- msg.team(sender_name, string.concat("§c", p_name, " got kicked: ", reason));
- } else {
- reason = "You got kicked";
- msg.team(sender_name, string.concat("§c", p_name, " got kicked."));
- }
- ban.kick(p, text.new(reason));
- goto("wait");
- @warn
- if(size != 1) {
- msg.prefix(sender, prefix_commands, "/warn <player>");
- goto("wait");
- }
- p_name = list.getIndex(args, 0);
- if(!isOnline(p_name)) {
- msg.prefix(sender, prefix_commands, "This player is not online.");
- goto("wait");
- }
- p = read.player(p_name);
- p_name = player.getName(p);
- if(p_name == "marvinius") {
- msg.string(sender, "§cSorry §b¯\\_(._.)_/¯");
- goto("wait");
- }
- title.send(p, text.new(string.concat("§c", player.getName(sender))), text.new("is watching you"));
- msg.prefix(sender, prefix_commands, "The player got warned.");
- goto("wait");
- @ban
- if(size < 1) {
- msg.prefix(sender, prefix_commands, "/ban <player> [reason]");
- goto("wait");
- }
- p_name = list.getIndex(args, 0);
- if(!checkIfEverOnline(p_name)) {
- msg.prefix(sender, prefix_commands, "This player has never been online.");
- goto("wait");
- }
- p_name = player.getName(player.getUuid(p_name));
- if(p_name == "marvinius") {
- msg.string(sender, "§cSorry §b¯\\_(._.)_/¯");
- goto("wait");
- }
- sender_name = player.getName(sender);
- if(size > 1) {
- reason = string.concatList(args, " ", 1, size - 1);
- msg.team(sender_name, string.concat("§c", p_name, " got banned: ", reason));
- } else {
- reason = "You got banned.";
- msg.team(sender_name, string.concat("§c", p_name, " got banned."));
- }
- ban.add(player.getUuid(p_name), reason, sender_name);
- if(isOnline(p_name)) {
- p = read.player(p_name);
- ban.kick(p, text.new(reason));
- }
- goto("wait");
- @unban
- if(size != 1) {
- msg.prefix(sender, prefix_commands, "/unban <player>");
- goto("wait");
- }
- p_name = list.getIndex(args, 0);
- if(!checkIfEverOnline(p_name)) {
- msg.prefix(sender, prefix_commands, "This player has never been online.");
- goto("wait");
- }
- p_name = player.getName(player.getUuid(p_name));
- ban.remove(player.getUuid(p_name));
- msg.team(player.getName(sender), string.concat("§cUnbanned ", p_name, "."));
- goto("wait");
- @tempban
- if(size < 4) {
- msg.prefix(sender, prefix_commands, "/tempban <player> <days> <hours> <minutes> [reason]");
- goto("wait");
- }
- p_name = list.getIndex(args, 0);
- if(!checkIfEverOnline(p_name)) {
- msg.prefix(sender, prefix_commands, "This player has never been online.");
- goto("wait");
- }
- p_name = player.getName(player.getUuid(p_name));
- if(p_name == "marvinius") {
- msg.string(sender, "§cSorry §b¯\\_(._.)_/¯");
- goto("wait");
- }
- days = list.getIndex(args, 1);
- hours = list.getIndex(args, 2);
- minutes = list.getIndex(args, 3);
- if(!isDouble(days) || !isDouble(hours) || !isDouble(minutes)) {
- msg.prefix(sender, prefix_commands, "Number expected.");
- goto("wait");
- }
- if(days < 0 || hours < 0 || minutes < 0) {
- msg.prefix(sender, prefix_commands, "Positive number expected.");
- goto("wait");
- }
- endtime = time.getMillis() + minutes * 60000 + hours * 3600000 + days * 86400000;
- timestring = time.getString(endtime);
- sender_name = player.getName(sender);
- if(size > 4) {
- reason = string.concatList(args, " ", 4, size - 1);
- msg.team(sender_name, string.concat("§c", p_name, " got banned until ", timestring, ". Reason: ", reason));
- } else {
- reason = "You got banned.";
- msg.team(sender_name, string.concat("§c", p_name, " got banned until ", timestring, "."));
- }
- calendar = time.new(endtime);
- ban.add(player.getUuid(p_name), reason, sender_name, calendar);
- if(isOnline(p_name)) {
- p = read.player(p_name);
- ban.kick(p, text.new(reason));
- }
- goto("wait");
- @ping
- msg.string(player, "pong");
- goto("wait");
- @plot
- if(size == 0) {
- @plothelp
- msg.prefix(player, prefix_plot, "/plot ...");
- msg.string(player, "§d - info §rReturns info about current location");
- if(!perm.has("plot.moreinfo", player)) {
- msg.string(player, "§d - list §rLists your plots");
- }
- msg.string(player, "");
- msg.string(player, "§d - pos1/pos2 §rSet corner points");
- msg.string(player, "§d - create §rCreates a (sub-)plot (Y: -64 to 319)");
- msg.string(player, "§d - create3D §rCreates a 3D (sub-)plot");
- msg.string(player, "");
- msg.string(player, "§d - remove [id] §rRemoves a plot");
- msg.string(player, "§d - expand <value> [direction] [id] §rExpands a plot");
- msg.string(player, "§d - name [id] <name> §rRenames a plot");
- msg.string(player, "");
- msg.string(player, "§d - share <player> [id] §rAdd a player to a plot");
- msg.string(player, "§d - kick <player> [id] §rRemove a player from a plot");
- msg.string(player, "§d - leader <player> [id] §rSet a new plot leader");
- msg.string(player, "§d - mod <player> [id] §rPromote to plot mod");
- msg.string(player, "§d - chest <player> [id] §rAllows a player to open chests");
- msg.string(player, "");
- msg.string(player, "§d - raise §rRaises a plot to a city. Costs §610 gold snuvis§r.");
- msg.string(player, "§d - sell <price> §rSells a sub-plot");
- msg.string(player, "");
- if(perm.has("plot.moreinfo", player)) {
- msg.string(player, "§d - list [player] §rLists all plots from a player");
- msg.string(player, "§d - moreinfo [id] §rReturns more detailed infos");
- msg.string(player, "§d - listall §rLists all plots");
- msg.string(player, "§d - flags <flags> <boolean> §rSet all flags to the boolean");
- msg.string(player, "§d - move <value> [direction] [id] §rMoves a block");
- }
- goto("wait");
- }
- arg0 = string.toLowerCase(list.getIndex(args, 0));
- if(arg0 == "sell") {
- if(size != 2) {
- msg.prefix(player, prefix_commands, "/plot sell <price>");
- goto("wait");
- }
- block = player.getTargetBlock(player, 5);
- if(block == null) {
- msg.prefix(player, prefix_commands, "Look at a sign.");
- goto("wait");
- }
- if(!block.hasTag(block, sign_tag)) {
- msg.prefix(player, prefix_plot, "You need to look at an empty sign.");
- goto("wait");
- }
- if(sign.getString(block, "FRONT", 0) != "" || sign.getString(block, 1) != "" || sign.getString(block, 2) != "" || sign.getString(block, 3) != "") {
- msg.prefix(player, prefix_plot, "You need to look at an empty sign.");
- goto("wait");
- }
- sign_loc = block.getLocation(block);
- plot_list = plot.get(sign_loc);
- amount = list.getSize(plot_list);
- if(amount == 0 || amount == 1) {
- msg.prefix(player, prefix_plot, "You aren´t on a sub plot.");
- goto("wait");
- }
- if(amount > 2) {
- msg.prefix(player, prefix_plot, "Multiple plots present. Not possible.");
- goto("wait");
- }
- plot_1 = list.getIndex(plot_list, 0);
- plot_2 = list.getIndex(plot_list, 1);
- if(plot.isCity(plot_1)) {
- city_plot = plot_1;
- sell_plot = plot_2;
- } elseif(plot.isCity(plot_2)) {
- sell_plot = plot_1;
- city_plot = plot_2;
- } else {
- msg.prefix(player, prefix_plot, "No city found.");
- goto("wait");
- }
- if(!plot.isLeader(city_plot, player) && !plot.isMod(city_plot, player)) {
- msg.prefix(player, prefix_plot, "You aren´t a city plot leader or mod.");
- goto("wait");
- }
- snuvis = list.getIndex(args, 1);
- if(!isDouble(snuvis) || snuvis < 0) {
- msg.prefix(player, prefix_plot, "Positive number expected.");
- goto("wait");
- }
- //Sell Plot
- x1 = plot.getMinX(sell_plot);
- y1 = plot.getMinY(sell_plot);
- z1 = plot.getMinZ(sell_plot);
- x2 = plot.getMaxX(sell_plot);
- y2 = plot.getMaxY(sell_plot);
- z2 = plot.getMaxZ(sell_plot);
- length = math.abs(x1 - x2) + 1;
- width = math.abs(z1 - z2) + 1;
- high = math.abs(y1 - y2) + 1;
- //Change plot settings
- plot.setFree(sell_plot, true);
- plot.setName(sell_plot, "Free Plot");
- plot.removePlayer(sell_plot, player.getName(player));
- //Label Sign
- block.setSign(sign_loc, 0, "§3[§bFree Plot§3]");
- block.setSign(sign_loc, 1, string.concat("§2", string.number(snuvis)));
- if(high == 319) {
- block.setSign(sign_loc, 2, string.concat(string.number(length), "x", string.number(width)));
- } else {
- block.setSign(sign_loc, 2, string.concat(string.number(length), "x", string.number(width), " (Y:", string.number(high), ")"));
- }
- block.setSign(sign_loc, 3, string.number(player.getId(player)));
- msg.prefix(player, prefix_plot, "Free plot for selling created.");
- world = loc.getWorld(sign_loc);
- plot.savePlots(world);
- goto("wait");
- }
- if(arg0 == "raise") {
- location = entity.getLocation(player);
- plot_list = plot.get(location);
- amount = list.getSize(plot_list);
- if(amount == 0) {
- msg.prefix(player, prefix_plot, "You aren´t on a plot.");
- goto("wait");
- }
- plot = list.getIndex(plot_list, 0);
- if(plot.isCity(plot)) {
- msg.prefix(player, prefix_plot, "This plot is already a city.");
- goto("wait");
- }
- if(!plot.isLeader(plot, player)) {
- msg.prefix(player, prefix_plot, "Only the plot leader can do this.");
- goto("wait");
- }
- if(amount > 1) {
- msg.prefix(player, prefix_plot, "Multiple plots present. Not possible.");
- goto("wait");
- }
- x1 = plot.getMinX(plot);
- z1 = plot.getMinZ(plot);
- x2 = plot.getMaxX(plot);
- z2 = plot.getMaxZ(plot);
- length = math.abs(x1 - x2) + 1;
- width = math.abs(z1 - z2) + 1;
- plot_size = length * width;
- if(plot_size < 2500) {
- msg.prefix(player, prefix_plot, "Your plot must be over 2500m2.");
- goto("wait");
- }
- snuvis = 40960;
- if(!hasEnoughMoney(player, snuvis)) {
- msg.prefix(player, prefix_plot, string.concat("You´ll need §6", string.number(snuvis), "§r snuvis for this."));
- goto("wait");
- }
- offerRank(player, "rank.major");
- player.setPlotRaised(player, true);
- money.sub(player, snuvis);
- plot.setCity(plot, true);
- msg.prefix(player, prefix_plot, string.concat("City created. Spent §6", string.number(snuvis), "§r snuvis."));
- world = loc.getWorld(location);
- plot.savePlots(world);
- goto("wait");
- }
- if(arg0 == "leader") {
- if(size < 2) {
- msg.prefix(player, prefix_commands, "/plot leader <player> [plot_id]");
- goto("wait");
- }
- p_name = list.getIndex(args, 1);
- p_uuid = player.getUuid(p_name);
- if(p_uuid == null) {
- msg.prefix(player, prefix_plot, "This player has never been online.");
- goto("wait");
- }
- p_name = player.getName(p_uuid);
- location = entity.getLocation(player);
- world = loc.getWorld(location);
- if(size == 2) {
- plot_list = plot.get(location);
- amount = list.getSize(plot_list);
- if(amount == 0) {
- msg.prefix(player, prefix_plot, "You aren´t on a plot.");
- goto("wait");
- }
- plot = list.getIndex(plot_list, 0);
- if(amount > 1) {
- msg.prefix(player, prefix_plot, "Multiple plots present:");
- for(i = 0; i < amount; i++) {
- plot = list.getIndex(plot_list, i);
- plot_id = plot.getId(plot);
- msg(player, text.merge(string.getClickText(" [§cSelect§r] ", string.concat("/plot leader ", p_name, " ", plot_id)), text.new(string.concat("#", string.number(plot_id), " ", plot.getType(plot), " §6", plot.getName(plot), " §r", plot.getLeaderName(plot)))));
- }
- goto("wait");
- }
- } else {
- if(size != 3) {
- msg.prefix(player, prefix_commands, "/plot leader <player> [plot_id]");
- goto("wait");
- }
- plot_id = list.getIndex(args, 2);
- plot = plot.getFromId(plot_id, world);
- if(plot == null) {
- msg.prefix(player, prefix_plot, "Unknown plot or not in this world.");
- goto("wait");
- }
- }
- player_id = player.getId(player);
- if(!perm.has("plot.other", player)) {
- if(!world.canUsePlots(world)) {
- msg.prefix(player, prefix_perms, "You have no permission for this in this world.");
- goto("wait");
- }
- if(!plot.isLeader(plot, player_id)) {
- msg.prefix(player, prefix_plot, "You aren´t the plot leader.");
- goto("wait");
- }
- player_name = player.getName(player);
- if(player_name == p_name) {
- msg.prefix(player, prefix_plot, "You are already the plot leader.");
- goto("wait");
- }
- }
- p_id = player.getId(p_uuid);
- if(plot.isLeader(plot, p_id)) {
- msg.prefix(player, prefix_plot, "This player is already the plot leader.");
- goto("wait");
- }
- old_leader = plot.getLeaderId(plot);
- if(old_leader != null) {
- plot.setMod(plot, old_leader);
- }
- plot.setLeader(plot, p_id);
- plot.addPlayer(plot, p_name);
- msg.prefix(player, prefix_plot, string.concat(p_name, " promoted to plot leader."));
- plot.savePlots(world);
- goto("wait");
- }
- if(arg0 == "mod") {
- if(size < 2) {
- msg.prefix(player, prefix_commands, "/plot mod <player> [plot_id]");
- goto("wait");
- }
- p_name = list.getIndex(args, 1);
- p_uuid = player.getUuid(p_name);
- if(p_uuid == null) {
- msg.prefix(player, prefix_plot, "This player has never been online.");
- goto("wait");
- }
- p_name = player.getName(p_uuid);
- location = entity.getLocation(player);
- world = loc.getWorld(location);
- if(size == 2) {
- plot_list = plot.get(location);
- amount = list.getSize(plot_list);
- if(amount == 0) {
- msg.prefix(player, prefix_plot, "You aren´t on a plot.");
- goto("wait");
- }
- plot = list.getIndex(plot_list, 0);
- if(amount > 1) {
- msg.prefix(player, prefix_plot, "Multiple plots present:");
- for(i = 0; i < amount; i++) {
- plot = list.getIndex(plot_list, i);
- plot_id = plot.getId(plot);
- msg(player, text.merge(string.getClickText(" [§cSelect§r] ", string.concat("/plot mod ", p_name, " ", plot_id)), text.new(string.concat("#", string.number(plot_id), " ", plot.getType(plot), " §6", plot.getName(plot), " §r", plot.getLeaderName(plot)))));
- }
- goto("wait");
- }
- } else {
- if(size != 3) {
- msg.prefix(player, prefix_commands, "/plot mod <player> [plot_id]");
- goto("wait");
- }
- plot_id = list.getIndex(args, 2);
- plot = plot.getFromId(plot_id, world);
- if(plot == null) {
- msg.prefix(player, prefix_plot, "Unknown plot or not in this world.");
- goto("wait");
- }
- }
- player_id = player.getId(player);
- if(!perm.has("plot.other", player)) {
- if(!world.canUsePlots(world)) {
- msg.prefix(player, prefix_perms, "You have no permission for this in this world.");
- goto("wait");
- }
- if(!plot.isLeader(plot, player_id)) {
- msg.prefix(player, prefix_plot, "You aren´t the plot leader.");
- goto("wait");
- }
- }
- p_id = player.getId(p_uuid);
- if(plot.isLeader(plot, p_id)) {
- msg.prefix(player, prefix_plot, "Not possible. Promote another player first /plot leader <player>.");
- goto("wait");
- }
- if(plot.isMod(plot, p_id)) {
- msg.prefix(player, prefix_plot, "This player is already a plot mod.");
- goto("wait");
- }
- plot.setMod(plot, p_id);
- plot.addPlayer(plot, p_name);
- msg.prefix(player, prefix_plot, string.concat(p_name, " promoted to plot mod."));
- plot.savePlots(world);
- goto("wait");
- }
- if(arg0 == "chest") {
- if(size < 2) {
- msg.prefix(player, prefix_commands, "/plot chest <player> [plot_id]");
- goto("wait");
- }
- p_name = list.getIndex(args, 1);
- p_uuid = player.getUuid(p_name);
- if(p_uuid == null) {
- msg.prefix(player, prefix_plot, "This player has never been online.");
- goto("wait");
- }
- p_name = player.getName(p_uuid);
- location = entity.getLocation(player);
- world = loc.getWorld(location);
- if(size == 2) {
- plot_list = plot.get(location);
- amount = list.getSize(plot_list);
- if(amount == 0) {
- msg.prefix(player, prefix_plot, "You aren´t on a plot.");
- goto("wait");
- }
- plot = list.getIndex(plot_list, 0);
- if(amount > 1) {
- msg.prefix(player, prefix_plot, "Multiple plots present:");
- for(i = 0; i < amount; i++) {
- plot = list.getIndex(plot_list, i);
- plot_id = plot.getId(plot);
- msg(player, text.merge(string.getClickText(" [§cSelect§r] ", string.concat("/plot chest ", p_name, " ", plot_id)), text.new(string.concat("#", string.number(plot_id), " ", plot.getType(plot), " §6", plot.getName(plot), " §r", plot.getLeaderName(plot)))));
- }
- goto("wait");
- }
- } else {
- if(size != 3) {
- msg.prefix(player, prefix_commands, "/plot chest <player> [plot_id]");
- goto("wait");
- }
- plot_id = list.getIndex(args, 2);
- plot = plot.getFromId(plot_id, world);
- if(plot == null) {
- msg.prefix(player, prefix_plot, "Unknown plot or not in this world.");
- goto("wait");
- }
- }
- player_id = player.getId(player);
- if(!perm.has("plot.other", player)) {
- if(!world.canUsePlots(world)) {
- msg.prefix(player, prefix_perms, "You have no permission for this in this world.");
- goto("wait");
- }
- if(!plot.isLeader(plot, player_id) && !plot.isMod(plot, player_id)) {
- msg.prefix(player, prefix_plot, "You aren´t a plot leader or mod.");
- goto("wait");
- }
- }
- p_id = player.getId(p_uuid);
- if(plot.isLeader(plot, p_id) || plot.isMod(plot, p_id)) {
- msg.prefix(player, prefix_plot, "Not possible. Player has higher permissions.");
- goto("wait");
- }
- if(plot.canOpenChests(plot, p_id)) {
- msg.prefix(player, prefix_plot, "This player already can open chests.");
- goto("wait");
- }
- plot.setChest(plot, p_id);
- msg.prefix(player, prefix_plot, string.concat(p_name, " can now open chests."));
- goto("wait");
- }
- if(arg0 == "remove") {
- location = entity.getLocation(player);
- world = loc.getWorld(location);
- if(size == 1) {
- plot_list = plot.get(location);
- amount = list.getSize(plot_list);
- if(amount == 0) {
- msg.prefix(player, prefix_plot, "You aren´t on a plot.");
- goto("wait");
- }
- plot = list.getIndex(plot_list, 0);
- if(amount > 1) {
- msg.prefix(player, prefix_plot, "Multiple plots present:");
- for(i = 0; i < amount; i++) {
- plot = list.getIndex(plot_list, i);
- plot_id = plot.getId(plot);
- msg(player, text.merge(string.getClickText(" [§cSelect§r] ", string.concat("/plot remove ", plot_id)), text.new(string.concat("#", string.number(plot_id), " ", plot.getType(plot), " §6", plot.getName(plot), " §r", plot.getLeaderName(plot)))));
- }
- goto("wait");
- }
- } else {
- if(size != 2) {
- msg.prefix(player, prefix_commands, "/plot remove [plot_id]");
- goto("wait");
- }
- plot_id = list.getIndex(args, 1);
- plot = plot.getFromId(plot_id, world);
- if(plot == null) {
- msg.prefix(player, prefix_plot, "Unknown plot or not in this world.");
- goto("wait");
- }
- }
- if(!perm.has("plot.other", player)) {
- if(!world.canUsePlots(world)) {
- msg.prefix(player, prefix_perms, "You have no permission for this in this world.");
- goto("wait");
- }
- player_id = player.getId(player);
- if(!plot.isLeader(plot, player_id)) {
- msg.prefix(player, prefix_plot, "You aren´t the plot leader.");
- goto("wait");
- }
- }
- if(plot.isCity(plot)) {
- plot_list = plot.intersecting(world, plot.getMinX(plot), plot.getMinY(plot), plot.getMinZ(plot), plot.getMaxX(plot), plot.getMaxY(plot), plot.getMaxZ(plot));
- iter = iterator(plot_list);
- while(hasNext(iter)) {
- sub_plot = next(iter);
- plot.removeAllPlayers(sub_plot);
- plot.remove(sub_plot, world);
- }
- }
- //10% money back
- x1 = plot.getMinX(plot);
- z1 = plot.getMinZ(plot);
- x2 = plot.getMaxX(plot);
- z2 = plot.getMaxZ(plot);
- length = x2 - x1 + 1;
- width = z2 - z1 + 1;
- snuvis = math.round(plot.calcCost(world, length, width) / 10);
- leader_id = plot.getLeaderId(plot);
- if(leader_id != null) {
- money.add(leader_id, snuvis);
- msg.prefix(player, prefix_plot, string.concat("Returned 10% of plot costs: ", money.getString(snuvis)));
- }
- //remove plot
- plot.removeAllPlayers(plot);
- plot.delMoveEvent(plot);
- plot.remove(plot, world);
- msg.prefix(player, prefix_plot, string.concat("Plot removed. #", string.number(plot.getId(plot)), " §6", plot.getName(plot)));
- plot.savePlots(world);
- goto("wait");
- }
- if(arg0 == "expand") {
- if(size < 2) {
- msg.prefix(player, prefix_commands, "/plot expand <value> [direction] [plot_id]");
- goto("wait");
- }
- location = entity.getLocation(player);
- world = loc.getWorld(location);
- anzahl = list.getIndex(args, 1);
- if(!isDouble(anzahl) || anzahl < 0) {
- msg.prefix(player, prefix_plot, "Positive number expected.");
- goto("wait");
- }
- if(size == 2) {
- yaw = loc.getYaw(location);
- direction = getDirection(yaw);
- if(direction == null) {
- msg.prefix(player, prefix_plot, "Direction of view too imprecise.");
- goto("wait");
- }
- plot_list = plot.get(location);
- amount = list.getSize(plot_list);
- if(amount == 0) {
- msg.prefix(player, prefix_plot, "You aren´t on a plot.");
- goto("wait");
- }
- plot = list.getIndex(plot_list, 0);
- if(amount > 1) {
- msg.prefix(player, prefix_plot, "Multiple plots present:");
- for(i = 0; i < amount; i++) {
- plot = list.getIndex(plot_list, i);
- plot_id = plot.getId(plot);
- msg(player, text.merge(string.getClickText(" [§cSelect§r] ", string.concat("/plot expand ", anzahl, " ", direction, " ", plot_id)), text.new(string.concat("#", string.number(plot_id), " ", plot.getType(plot), " §6", plot.getName(plot), " §r", plot.getLeaderName(plot)))));
- }
- goto("wait");
- }
- } else {
- if(size != 4) {
- msg.prefix(player, prefix_commands, "/plot expand <value> [<direction> <plot_id>]");
- goto("wait");
- }
- direction = string.toLowerCase(list.getIndex(args, 2));
- plot_id = list.getIndex(args, 3);
- plot = plot.getFromId(plot_id, world);
- if(plot == null) {
- msg.prefix(player, prefix_plot, "Unknown plot or not in this world.");
- goto("wait");
- }
- }
- if(plot.isSub(plot)) {
- msg.prefix(player, prefix_plot, "Sub plots can´t be expanded.");
- goto("wait");
- }
- x1 = plot.getMinX(plot);
- y1 = plot.getMinY(plot);
- z1 = plot.getMinZ(plot);
- x2 = plot.getMaxX(plot);
- y2 = plot.getMaxY(plot);
- z2 = plot.getMaxZ(plot);
- old_length = math.abs(x1 - x2) + 1;
- old_width = math.abs(z1 - z2) + 1;
- if(direction == "east") {
- old_x2 = x2;
- x2 += anzahl;
- list = plot.intersecting(world, x2, y1, z1, old_x2, y2, z2);
- } elseif(direction == "south") {
- old_z2 = z2;
- z2 += anzahl;
- list = plot.intersecting(world, x1, y1, z2, x2, y2, old_z2);
- } elseif(direction == "west") {
- old_x1 = x1;
- x1 -= anzahl;
- list = plot.intersecting(world, old_x1, y1, z1, x1, y2, z2);
- } elseif(direction == "north") {
- old_z1 = z1;
- z1 -= anzahl;
- list = plot.intersecting(world, x1, y1, old_z1, x2, y2, z1);
- } else {
- msg.prefix(player, prefix_plot, "Unknown direction [north/east/south/west].");
- goto("wait");
- }
- if(!perm.has("plot.other", player)) {
- if(list.getSize(list) > 0) {
- msg.prefix(player, prefix_plot, "New area is intersecting with other plots.");
- goto("wait");
- }
- if(!world.canUsePlots(world)) {
- msg.prefix(player, prefix_perms, "You have no permission for this in this world.");
- goto("wait");
- }
- player_id = player.getId(player);
- if(!plot.isLeader(plot, player_id)) {
- msg.prefix(player, prefix_plot, "You aren´t the plot leader.");
- goto("wait");
- }
- //Calc costs
- length = math.abs(x1 - x2) + 1;
- width = math.abs(z1 - z2) + 1;
- snuvis = plot.calcCost(world, length, width) - plot.calcCost(world, old_length, old_width);
- if(!hasEnoughMoney(player, snuvis)) {
- msg.prefix(player, prefix_plot, string.concat("You´ll need §6", string.number(snuvis), "§r snuvis for this."));
- goto("wait");
- }
- money.sub(player, snuvis);
- expand_message = string.concat("The plot has been expanded. Spent §6", string.number(snuvis), "§r snuvis.");
- if(!player.hasBigPlotCreated(player)) {
- plot_size = length * width;
- if(plot_size >= 900) {
- offerRank(player, "rank.colonizer");
- player.setBigPlotCreated(player, true);
- }
- }
- } else {
- expand_message = string.concat("The plot has been expanded.");
- }
- //Expand plot
- gs_edge1 = loc.new(world, x1, y1, z1);
- gs_edge2 = loc.new(world, x2, y2, z2);
- new_plot = plot.setEdges(plot, gs_edge1, gs_edge2);
- plot.delMoveEvent(plot);
- plot.setMoveEvent(new_plot, world);
- msg.prefix(player, prefix_plot, expand_message);
- plot.savePlots(world);
- goto("wait");
- }
- if(arg0 == "move") {
- if(!perm.has("plot.move", player)) {
- perm.no("plot.move", player);
- goto("wait");
- }
- if(size < 2) {
- msg.prefix(player, prefix_commands, "/plot move <value> [direction] [plot_id]");
- goto("wait");
- }
- location = entity.getLocation(player);
- world = loc.getWorld(location);
- anzahl = list.getIndex(args, 1);
- if(!isDouble(anzahl) || anzahl < 0) {
- msg.prefix(player, prefix_plot, "Positive number expected.");
- goto("wait");
- }
- if(size == 2) {
- yaw = loc.getYaw(location);
- direction = getDirection(yaw);
- if(direction == null) {
- msg.prefix(player, prefix_plot, "Direction of view too imprecise.");
- goto("wait");
- }
- plot_list = plot.get(location);
- amount = list.getSize(plot_list);
- if(amount == 0) {
- msg.prefix(player, prefix_plot, "You aren´t on a plot.");
- goto("wait");
- }
- plot = list.getIndex(plot_list, 0);
- if(amount > 1) {
- msg.prefix(player, prefix_plot, "Multiple plots present:");
- for(i = 0; i < amount; i++) {
- plot = list.getIndex(plot_list, i);
- plot_id = plot.getId(plot);
- msg(player, text.merge(string.getClickText(" [§cSelect§r] ", string.concat("/plot move ", anzahl, " ", direction, " ", plot_id)), text.new(string.concat("#", string.number(plot_id), " ", plot.getType(plot), " §6", plot.getName(plot), " §r", plot.getLeaderName(plot)))));
- }
- goto("wait");
- }
- } else {
- if(size != 4) {
- msg.prefix(player, prefix_commands, "/plot move <value> [<direction> <plot_id>]");
- goto("wait");
- }
- direction = string.toLowerCase(list.getIndex(args, 2));
- plot_id = list.getIndex(args, 3);
- plot = plot.getFromId(plot_id, world);
- if(plot == null) {
- msg.prefix(player, prefix_plot, "Unknown plot or not in this world.");
- goto("wait");
- }
- }
- if(plot.isSub(plot)) {
- msg.prefix(player, prefix_plot, "Sub plots can´t be moved.");
- goto("wait");
- }
- x1 = plot.getMinX(plot);
- y1 = plot.getMinY(plot);
- z1 = plot.getMinZ(plot);
- x2 = plot.getMaxX(plot);
- y2 = plot.getMaxY(plot);
- z2 = plot.getMaxZ(plot);
- old_length = math.abs(x1 - x2) + 1;
- old_width = math.abs(z1 - z2) + 1;
- if(direction == "east") {
- x1 += anzahl;
- x2 += anzahl;
- } elseif(direction == "south") {
- z1 += anzahl;
- z2 += anzahl;
- } elseif(direction == "west") {
- x1 -= anzahl;
- x2 -= anzahl;
- } elseif(direction == "north") {
- z1 -= anzahl;
- z2 -= anzahl;
- } else {
- msg.prefix(player, prefix_plot, "Unknown direction [north/east/south/west].");
- goto("wait");
- }
- //Move plot
- gs_edge1 = loc.new(world, x1, y1, z1);
- gs_edge2 = loc.new(world, x2, y2, z2);
- new_plot = plot.setEdges(plot, gs_edge1, gs_edge2);
- plot.delMoveEvent(plot);
- plot.setMoveEvent(new_plot, world);
- msg.prefix(player, prefix_plot, "The plot has been moved.");
- plot.savePlots(world);
- goto("wait");
- }
- if(arg0 == "share") {
- if(size < 2) {
- msg.prefix(player, prefix_commands, "/plot share <player> [plot_id]");
- goto("wait");
- }
- p_name = list.getIndex(args, 1);
- p_uuid = player.getUuid(p_name);
- if(p_uuid == null) {
- msg.prefix(player, prefix_plot, "This player has never been online.");
- goto("wait");
- }
- p_name = player.getName(p_uuid);
- location = entity.getLocation(player);
- world = loc.getWorld(location);
- if(size == 2) {
- plot_list = plot.get(location);
- amount = list.getSize(plot_list);
- if(amount == 0) {
- msg.prefix(player, prefix_plot, "You aren´t on a plot.");
- goto("wait");
- }
- plot = list.getIndex(plot_list, 0);
- if(amount > 1) {
- msg.prefix(player, prefix_plot, "Multiple plots present:");
- for(i = 0; i < amount; i++) {
- plot = list.getIndex(plot_list, i);
- plot_id = plot.getId(plot);
- msg(player, text.merge(string.getClickText(" [§cSelect§r] ", string.concat("/plot share ", p_name, " ", plot_id)), text.new(string.concat("#", string.number(plot_id), " ", plot.getType(plot), " §6", plot.getName(plot), " §r", plot.getLeaderName(plot)))));
- }
- goto("wait");
- }
- } else {
- if(size != 3) {
- msg.prefix(player, prefix_commands, "/plot share <player> [plot_id]");
- goto("wait");
- }
- plot_id = list.getIndex(args, 2);
- plot = plot.getFromId(plot_id, world);
- if(plot == null) {
- msg.prefix(player, prefix_plot, "Unknown plot or not in this world.");
- goto("wait");
- }
- }
- if(!perm.has("plot.other", player)) {
- if(!world.canUsePlots(world)) {
- msg.prefix(player, prefix_perms, "You have no permission for this in this world.");
- goto("wait");
- }
- player_id = player.getId(player);
- if(!plot.isLeader(plot, player_id) && !plot.isMod(plot, player_id)) {
- msg.prefix(player, prefix_plot, "You aren´t a plot leader or mod.");
- goto("wait");
- }
- }
- plot.addPlayer(plot, p_name);
- msg.prefix(player, prefix_plot, string.concat(p_name, " added to the plot."));
- plot.savePlots(world);
- goto("wait");
- }
- if(arg0 == "kick") {
- if(size < 2) {
- msg.prefix(player, prefix_commands, "/plot kick <player> [plot_id]");
- goto("wait");
- }
- p_name = list.getIndex(args, 1);
- p_uuid = player.getUuid(p_name);
- if(p_uuid == null) {
- msg.prefix(player, prefix_plot, "This player has never been online.");
- goto("wait");
- }
- p_name = player.getName(p_uuid);
- location = entity.getLocation(player);
- world = loc.getWorld(location);
- if(size == 2) {
- plot_list = plot.get(location);
- amount = list.getSize(plot_list);
- if(amount == 0) {
- msg.prefix(player, prefix_plot, "You aren´t on a plot.");
- goto("wait");
- }
- plot = list.getIndex(plot_list, 0);
- if(amount > 1) {
- msg.prefix(player, prefix_plot, "Multiple plots present:");
- for(i = 0; i < amount; i++) {
- plot = list.getIndex(plot_list, i);
- plot_id = plot.getId(plot);
- msg(player, text.merge(string.getClickText(" [§cSelect§r] ", string.concat("/plot kick ", p_name, " ", plot_id)), text.new(string.concat("#", string.number(plot_id), " ", plot.getType(plot), " §6", plot.getName(plot), " §r", plot.getLeaderName(plot)))));
- }
- goto("wait");
- }
- } else {
- if(size != 3) {
- msg.prefix(player, prefix_commands, "/plot kick <player> [plot_id]");
- goto("wait");
- }
- plot_id = list.getIndex(args, 2);
- plot = plot.getFromId(plot_id, world);
- if(plot == null) {
- msg.prefix(player, prefix_plot, "Unknown plot or not in this world.");
- goto("wait");
- }
- }
- if(!perm.has("plot.other", player)) {
- if(!world.canUsePlots(world)) {
- msg.prefix(player, prefix_perms, "You have no permission for this in this world.");
- goto("wait");
- }
- if(!plot.isLeader(plot, player) && !plot.isMod(plot, player)) {
- msg.prefix(player, prefix_plot, "You aren´t a plot leader or mod.");
- goto("wait");
- }
- player_name = player.getName(player);
- if(player_name == p_name) {
- msg.prefix(player, prefix_plot, "You can´t kick yourself.");
- goto("wait");
- }
- p_id = player.getId(p_uuid);
- if(plot.isLeader(plot, p_id)) {
- msg.prefix(player, prefix_plot, "You can´t kick the plot-leader.");
- goto("wait");
- }
- }
- plot.removePlayer(plot, p_name);
- msg.prefix(player, prefix_plot, string.concat(p_name, " removed from this plot."));
- plot.savePlots(world);
- goto("wait");
- }
- if(arg0 == "name") {
- if(size < 2) {
- msg.prefix(player, prefix_commands, "/plot name [plot_id] <name>");
- goto("wait");
- }
- location = entity.getLocation(player);
- world = loc.getWorld(location);
- //Angegeben wurde ein Name aus einem Wort, ohne Plotid. Der Spieler muss auf einem Plot sein.
- if(size == 2) {
- plot_list = plot.get(location);
- amount = list.getSize(plot_list);
- if(amount == 0) {
- msg.prefix(player, prefix_plot, "You aren´t on a plot.");
- goto("wait");
- }
- plot = list.getIndex(plot_list, 0);
- name = list.getIndex(args, 1);
- if(amount > 1) {
- msg.prefix(player, prefix_plot, "Multiple plots present:");
- for(i = 0; i < amount; i++) {
- plot = list.getIndex(plot_list, i);
- plot_id = plot.getId(plot);
- msg(player, text.merge(string.getClickText(" [§cSelect§r] ", string.concat("/plot name ", plot_id, " ", name)), text.new(string.concat("#", string.number(plot_id), " ", plot.getType(plot), " §6", plot.getName(plot), " §r", plot.getLeaderName(plot)))));
- }
- goto("wait");
- }
- }
- if(size > 2) {
- plot_id = list.getIndex(args, 1);
- if(isDouble(plot_id)) {
- //Angegeben wurde eine eine Plotid mit einem Namen aus ein oder mehreren Wörtern
- plot = plot.getFromId(plot_id, world);
- if(plot == null) {
- msg.prefix(player, prefix_plot, "Unknown plot or not in this world.");
- goto("wait");
- }
- name = string.concatList(args, " ", 2, size - 1);
- } else {
- //Angegeben wurde ein Name aus mehreren Wörtern, ohne Plotid. Der Spieler muss auf einem Plot sein.
- name = string.concatList(args, " ", 1, size - 1);
- plot_list = plot.get(location);
- amount = list.getSize(plot_list);
- if(amount == 0) {
- msg.prefix(player, prefix_plot, "You aren´t on a plot.");
- goto("wait");
- }
- plot = list.getIndex(plot_list, 0);
- if(amount > 1) {
- msg.prefix(player, prefix_plot, "Multiple plots present:");
- for(i = 0; i < amount; i++) {
- plot = list.getIndex(plot_list, i);
- plot_id = plot.getId(plot);
- msg(player, text.merge(string.getClickText(" [§cSelect§r] ", string.concat("/plot name ", plot_id, " ", name)), text.new(string.concat("#", string.number(plot_id), " ", plot.getType(plot), " §6", plot.getName(plot), " §r", plot.getLeaderName(plot)))));
- }
- goto("wait");
- }
- }
- }
- if(!perm.has("plot.other", player)) {
- if(!world.canUsePlots(world)) {
- msg.prefix(player, prefix_perms, "You have no permission for this in this world.");
- goto("wait");
- }
- player_id = player.getId(player);
- if(!plot.isLeader(plot, player_id) && !plot.isMod(plot, player_id)) {
- msg.prefix(player, prefix_plot, "You aren´t a plot leader or mod.");
- goto("wait");
- }
- }
- plot.setName(plot, name);
- msg.prefix(player, prefix_plot, string.concat("Plot renamed to ", name, "."));
- plot.savePlots(world);
- goto("wait");
- }
- if(arg0 == "create" || arg0 == "create3d") {
- player_id = player.getId(player);
- loc1 = map.get(plotpos1, player_id);
- loc2 = map.get(plotpos2, player_id);
- if(loc1 == null || loc2 == null) {
- msg.prefix(player, prefix_plot, "Set corners points with §d/p pos1 §rand §d/p pos2§r.");
- goto("wait");
- }
- world1 = loc.getWorld(loc1);
- if(world1 != loc.getWorld(loc2)) {
- msg.prefix(player, prefix_plot, "Corner points have different worlds.");
- goto("wait");
- }
- x1 = loc.getX(loc1);
- z1 = loc.getZ(loc1);
- x2 = loc.getX(loc2);
- z2 = loc.getZ(loc2);
- if(arg0 == "create") {
- y1 = -64;
- y2 = 319;
- loc.setY(loc1, y1);
- loc.setY(loc2, y2);
- } else {
- y1 = loc.getY(loc1);
- y2 = loc.getY(loc2);
- }
- create_message = "Plot created.";
- sub_plot = false;
- if(!perm.has("plot.other", player)) {
- world_name = world.getName(world1);
- if(!world.canUsePlots(world1)) {
- msg.prefix(player, prefix_perms, "You have no permission in this world.");
- goto("wait");
- }
- list = plot.intersecting(world1, x1, y1, z1, x2, y2, z2);
- if(list.getSize(list) > 0) {
- city_plot = list.getIndex(list, 0);
- if(plot.isCity(city_plot)) {
- if(!plot.isLeader(city_plot, player_id) && !plot.isMod(city_plot, player_id)) {
- msg.prefix(player, prefix_plot, "You aren´t a plot leader or mod.");
- goto("wait");
- }
- city_id = plot.getId(city_plot);
- if(!loc.hasPlotId(loc1, city_id)) {
- msg.prefix(player, prefix_plot, "The sub plot needs to be surrounded by the city.");
- goto("wait");
- }
- if(!loc.hasPlotId(loc2, city_id)) {
- msg.prefix(player, prefix_plot, "The sub plot needs to be surrounded by the city.");
- goto("wait");
- }
- sub_plot = true;
- } else {
- msg.prefix(player, prefix_plot, "Intersecting plots are not allowed.");
- goto("wait");
- }
- }
- if(!sub_plot) {
- //Calc costs
- length = math.abs(x1 - x2) + 1;
- width = math.abs(z1 - z2) + 1;
- if(length < 3 || width < 3) {
- msg.prefix(player, prefix_plot, "Length and width of the plot must be at least 3.");
- goto("wait");
- }
- snuvis = plot.calcCost(world1, length, width);
- free_plot_used = player.usedHisFreePlot(player_id);
- if(!free_plot_used && world_name != "creative") {
- snuvis -= plot.calcCost(world1, 16, 16);
- if(snuvis < 0) {
- snuvis = 0;
- }
- msg.prefix(player, prefix_plot, "Free plot (16 x 16) to calculation included.");
- }
- if(!hasEnoughMoney(player, snuvis)) {
- msg.prefix(player, prefix_plot, string.concat("You´ll need ", money.getString(snuvis), " snuvis for this."));
- goto("wait");
- }
- create_message = string.concat("Plot created. Spent ", money.getString(snuvis), " snuvis.");
- money.sub(player, snuvis);
- if(!free_plot_used && world_name != "creative") {
- player.setUsedFreePlot(player_id, true);
- offerRank(player, "rank.settler");
- }
- if(!player.hasBigPlotCreated(player)) {
- plot_size = length * width;
- if(plot_size >= 900) {
- offerRank(player, "rank.colonizer");
- player.setBigPlotCreated(player, true);
- }
- }
- }
- }
- //Create plot
- map.remove(plotpos1, player_id);
- map.remove(plotpos2, player_id);
- plot = plot.add(loc1, loc2);
- if(sub_plot) {
- plot.setSub(plot, true);
- }
- plot.setMoveEvent(plot, world1);
- player_name = player.getName(player);
- plot.setName(plot, string.concat("Plot of ", player_name));
- plot.addPlayer(plot, player_name);
- plot.setLeader(plot, player_id);
- msg.prefix(player, prefix_plot, create_message);
- plot.savePlots(world1);
- goto("wait");
- }
- if(arg0 == "pos1" || arg0 == "pos2") {
- loc = entity.getLocation(player);
- loc = getBlockLocation(loc);
- player_id = player.getId(player);
- if(arg0 == "pos1") {
- map.add(plotpos1, player_id, loc);
- pos_string = "Pos1";
- } elseif(arg0 == "pos2") {
- map.add(plotpos2, player_id, loc);
- pos_string = "Pos2";
- }
- x = string.number(loc.getX(loc));
- y = string.number(loc.getY(loc));
- z = string.number(loc.getZ(loc));
- msg.prefix(player, prefix_plot, string.concat(pos_string, " (", x, "/", y, "/", z, ") set."));
- loc1 = map.get(plotpos1, player_id);
- loc2 = map.get(plotpos2, player_id);
- if(loc1 != null && loc2 != null) {
- world1 = loc.getWorld(loc1);
- snuvis = plot.calcCost(world1, loc1, loc2);
- if(!player.usedHisFreePlot(player_id) && world.getName(world1) != "creative") {
- snuvis -= plot.calcCost(world1, 16, 16);
- if(snuvis < 0) {
- snuvis = 0;
- }
- msg.prefix(player, prefix_plot, "Free plot (16 x 16) to calculation included.");
- }
- if(loc.isCity(loc1) && loc.isCity(loc2)) {
- snuvis = 0;
- }
- msg.prefix(player, prefix_plot, string.concat("This plot will cost ", money.getString(snuvis), " snuvis."));
- }
- goto("wait");
- }
- if(arg0 == "flags") {
- if(!perm.has("plot.moreinfo", player)) {
- perm.no("plot.moreinfo", player);
- goto("wait");
- }
- if(size < 3 || size > 4) {
- msg.prefix(player, prefix_commands, "/plot flags <flags> <boolean> [plot_id]");
- goto("wait");
- }
- flags = list.getIndex(args, 1);
- if(!isDouble(flags) || flags < 0) {
- msg.prefix(player, prefix_commands, "Positive number expected.");
- goto("wait");
- }
- boolean = list.getIndex(args, 2);
- if(!(boolean == true || boolean == false)) {
- msg.prefix(player, prefix_commands, "Boolean expected.");
- goto("wait");
- }
- location = entity.getLocation(player);
- world = loc.getWorld(location);
- if(size == 3) {
- plot_list = plot.get(location);
- amount = list.getSize(plot_list);
- if(amount == 0) {
- msg.prefix(player, prefix_plot, "You aren´t on a plot.");
- goto("wait");
- }
- plot = list.getIndex(plot_list, 0);
- if(amount > 1) {
- msg.prefix(player, prefix_plot, "Multiple plots present:");
- for(i = 0; i < amount; i++) {
- plot = list.getIndex(plot_list, i);
- plot_id = plot.getId(plot);
- x = loc.getX(location);
- y = loc.getY(location);
- z = loc.getZ(location);
- msg(player, text.merge(string.getClickText(" [§cSelect§r] ", string.concat("/plot flags ", flags, " ", boolean, " ", plot_id)), text.new(string.concat("#", string.number(plot_id), " ", plot.getType(plot), " §6", plot.getName(plot), " §r", plot.getLeaderName(plot)))));
- }
- goto("wait");
- }
- } else {
- plot_id = list.getIndex(args, 3);
- plot = plot.getFromId(plot_id, world);
- if(plot == null) {
- msg.prefix(player, prefix_plot, "Unknown plot or not in this world.");
- goto("wait");
- }
- }
- plot.setFlags(plot, flags, boolean);
- msg.prefix(player, prefix_plot, "Flags gesetzt.");
- plot.savePlots(world);
- goto("wait");
- }
- if(arg0 == "list") {
- if(size == 1) {
- p_name = player.getName(player);
- } else {
- if(!perm.has("plot.moreinfo", player)) {
- perm.no("plot.moreinfo", player);
- goto("wait");
- }
- p_name = list.getIndex(args, 1);
- }
- p_uuid = player.getUuid(p_name);
- if(p_uuid == null) {
- msg.prefix(player, prefix_plot, "This player has never been online.");
- goto("wait");
- }
- p_name = player.getName(p_uuid);
- msg.prefix(player, prefix_commands, string.concat("Plots of ", p_name, ":"));
- world = loc.getWorld(entity.getLocation(player));
- iter = plot.iterator(world, p_uuid);
- while(hasNext(iter)) {
- plot = next(iter);
- msg.string(player, string.concat(" - #", string.number(plot.getId(plot)), " ", plot.getType(plot), " §6", plot.getName(plot)));
- }
- goto("wait");
- }
- if(arg0 == "listall") {
- if(!perm.has("plot.moreinfo", player)) {
- perm.no("plot.moreinfo", player);
- goto("wait");
- }
- if(size != 1) {
- msg.prefix(player, prefix_commands, "/plot listall");
- goto("wait");
- }
- world = loc.getWorld(entity.getLocation(player));
- msg.prefix(player, prefix_commands, string.concat("All plots in this world: ", world.getName(world)));
- iterator = plot.iterator(world);
- while(hasNext(iterator)) {
- plot = next(iterator);
- plot_id = plot.getId(plot);
- msg.string(player, string.concat(" - #", string.number(plot_id), " ", plot.getType(plot), " §6", plot.getName(plot), " §r", plot.getLeaderName(plot)));
- }
- goto("wait");
- }
- if(arg0 == "moreinfo" || arg0 == "mi") {
- if(!perm.has("plot.moreinfo", player)) {
- perm.no("plot.moreinfo", player);
- goto("wait");
- }
- location = entity.getLocation(player);
- world = loc.getWorld(location);
- if(size == 1) {
- plot_list = plot.get(location);
- amount = list.getSize(plot_list);
- if(amount == 0) {
- msg.prefix(player, prefix_plot, "You aren´t on a plot.");
- goto("wait");
- }
- plot = list.getIndex(plot_list, 0);
- if(amount > 1) {
- msg.prefix(player, prefix_plot, "Multiple plots present:");
- for(i = 0; i < amount; i++) {
- plot = list.getIndex(plot_list, i);
- plot_id = plot.getId(plot);
- msg(player, text.merge(string.getClickText(" [§cSelect§r] ", string.concat("/plot moreinfo ", plot_id)), text.new(string.concat("#", string.number(plot_id), " ", plot.getType(plot), " §6", plot.getName(plot)))));
- }
- goto("wait");
- }
- } else {
- if(size != 2) {
- msg.prefix(player, prefix_commands, "/plot moreinfo [plot_id]");
- goto("wait");
- }
- plot_id = list.getIndex(args, 1);
- plot = plot.getFromId(plot_id, world);
- if(plot == null) {
- msg.prefix(player, prefix_plot, "Unknown plot or not in this world.");
- goto("wait");
- }
- }
- owners = "";
- owners_list = plot.getOwners(plot);
- copy_list = list.copy(owners_list);
- plot_id = plot.getId(plot);
-
- x1 = plot.getMinX(plot);
- y1 = plot.getMinY(plot);
- z1 = plot.getMinZ(plot);
- x2 = plot.getMaxX(plot);
- y2 = plot.getMaxY(plot);
- z2 = plot.getMaxZ(plot);
- length = x2 - x1 + 1;
- width = z2 - z1 + 1;
- msg.string(player, string.concat(" - #", string.number(plot_id), " ", plot.getType(plot), " §6", plot.getName(plot), " §r", string.number(length), "x", string.number(width)));
- owners_list = plot.getOwners(plot);
- copy_list = list.copy(owners_list);
- msg.string(player, string.concat(" §dW §r", world.getName(world)));
- msg.string(player, string.concat(" §dX1 §r", string.number(x1), " §dY1 §r", string.number(y1), " §dZ1 §r", string.number(z1)));
- msg.string(player, string.concat(" §dX2 §r", string.number(x2), " §dY2 §r", string.number(y2), " §dZ2 §r", string.number(z2)));
-
- leader_name = plot.getLeaderName(plot);
- if(leader_name != "") {
- msg.string(player, string.concat(" §dLeader: §r", leader_name));
- list.remove(copy_list, player.getUuid(leader_name));
- }
-
- mods_list = plot.getMods(plot);
- mods_amount = list.getSize(mods_list);
- if(mods_amount != 0) {
- iter = iterator(mods_list);
- mods_string = "";
- while(hasNext(iter)) {
- p_name = player.getNameFromId(next(iter));
- p_uuid = player.getUuid(p_name);
- list.remove(copy_list, p_uuid);
- if(mods_string == "") {
- mods_string = p_name;
- } else {
- mods_string = string.concat(mods_string, " / ", p_name);
- }
- }
- msg.string(player, string.concat(" §dMods: §r", mods_string));
- }
-
- members_amount = list.getSize(copy_list);
- if(members_amount != 0) {
- iter = iterator(copy_list);
- members_string = "";
- while(hasNext(iter)) {
- p_name = player.getName(next(iter));
- if(members_string == "") {
- members_string = p_name;
- } else {
- members_string = string.concat(members_string, " / ", p_name);
- }
- }
- msg.string(player, string.concat(" §dMembers: §r", members_string));
- }
-
- chests_list = plot.getChestRanks(plot);
- chests_amount = list.getSize(chests_list);
- if(chests_amount != 0) {
- iter = iterator(chests_list);
- chests_string = "";
- while(hasNext(iter)) {
- p_name = player.getNameFromId(next(iter));
- if(chests_string == "") {
- chests_string = p_name;
- } else {
- chests_string = string.concat(chests_string, " / ", p_name);
- }
- }
- msg.string(player, string.concat(" §dOnly chest: §r", chests_string));
- }
-
- a = getFlagLists(plot);
- flags_true = a[0];
- flags_false = a[1];
-
- x = loc.getX(location);
- y = loc.getY(location);
- z = loc.getZ(location);
- msg.string(player, " §dFlags true:");
- iter = iterator(flags_true);
- while(hasNext(iter)) {
- array = next(iter);
- flag_number = array[0];
- flag_name = array[1];
- msg(player, text.merge(text.new(" "), string.getClickText(string.concat(" §d[§r", flag_name, "§d] "), string.concat("/plot flags ", flag_number, " false ", plot_id))));
- }
- msg.string(player, " §dFlags false:");
- iter = iterator(flags_false);
- while(hasNext(iter)) {
- array = next(iter);
- flag_number = array[0];
- flag_name = array[1];
- msg(player, text.merge(text.new(" "), string.getClickText(string.concat(" §d[§r", flag_name, "§d] "), string.concat("/plot flags ", flag_number, " true ", plot_id))));
- }
- goto("wait");
- }
- if(arg0 == "info" || arg0 == "i") {
- location = entity.getLocation(player);
- list = plot.get(location);
- world = loc.getWorld(location);
- size = list.getSize(list);
- if(size == 0) {
- msg.prefix(player, prefix_plot, "No plots found.");
- goto("wait");
- }
- if(size == 1) {
- msg.prefix(player, prefix_plot, string.concat(string.number(size), " plot found:"));
- } else {
- msg.prefix(player, prefix_plot, string.concat(string.number(size), " plots found:"));
- }
- for(i = 0; i < size; i++) {
- plot = list.getIndex(list, i);
- plot_id = plot.getId(plot);
- x1 = plot.getMinX(plot);
- y1 = plot.getMinY(plot);
- z1 = plot.getMinZ(plot);
- x2 = plot.getMaxX(plot);
- y2 = plot.getMaxY(plot);
- z2 = plot.getMaxZ(plot);
- length = x2 - x1 + 1;
- width = z2 - z1 + 1;
- msg.string(player, string.concat(" - #", string.number(plot_id), " ", plot.getType(plot), " §6", plot.getName(plot), " §r", string.number(length), "x", string.number(width)));
- owners_list = plot.getOwners(plot);
- copy_list = list.copy(owners_list);
- msg.string(player, string.concat(" §dW §r", world.getName(world)));
- msg.string(player, string.concat(" §dX1 §r", string.number(x1), " §dY1 §r", string.number(y1), " §dZ1 §r", string.number(z1)));
- msg.string(player, string.concat(" §dX2 §r", string.number(x2), " §dY2 §r", string.number(y2), " §dZ2 §r", string.number(z2)));
-
- leader_name = plot.getLeaderName(plot);
- if(leader_name != "") {
- msg.string(player, string.concat(" §dLeader: §r", leader_name));
- list.remove(copy_list, player.getUuid(leader_name));
- }
-
- mods_list = plot.getMods(plot);
- mods_amount = list.getSize(mods_list);
- if(mods_amount != 0) {
- iter = iterator(mods_list);
- mods_string = "";
- while(hasNext(iter)) {
- p_name = player.getNameFromId(next(iter));
- p_uuid = player.getUuid(p_name);
- list.remove(copy_list, p_uuid);
- if(mods_string == "") {
- mods_string = p_name;
- } else {
- mods_string = string.concat(mods_string, " / ", p_name);
- }
- }
- msg.string(player, string.concat(" §dMods: §r", mods_string));
- }
-
- members_amount = list.getSize(copy_list);
- if(members_amount != 0) {
- iter = iterator(copy_list);
- members_string = "";
- while(hasNext(iter)) {
- p_name = player.getName(next(iter));
- if(members_string == "") {
- members_string = p_name;
- } else {
- members_string = string.concat(members_string, " / ", p_name);
- }
- }
- msg.string(player, string.concat(" §dMembers: §r", members_string));
- }
-
- chests_list = plot.getChestRanks(plot);
- chests_amount = list.getSize(chests_list);
- if(chests_amount != 0) {
- iter = iterator(chests_list);
- chests_string = "";
- while(hasNext(iter)) {
- p_name = player.getNameFromId(next(iter));
- if(chests_string == "") {
- chests_string = p_name;
- } else {
- chests_string = string.concat(chests_string, " / ", p_name);
- }
- }
- msg.string(player, string.concat(" §dOnly chest: §r", chests_string));
- }
- }
- goto("wait");
- }
- goto("plothelp");
- @stopadventure
- removeAdventureDisplay(player);
- player.setAdventure(player, false);
- msg.prefix(player, "§5Adventure", "Adventure canceled!");
- goto("wait");
- @speed
- if(size < 1 || size > 2) {
- if(perm.has("speed.other", player)) {
- msg.prefix(player, prefix_commands, "/speed <1-10> [player]");
- } else {
- msg.prefix(player, prefix_commands, "/speed <1-10>");
- }
- goto("wait");
- }
- speed = list.getIndex(args, 0);
- if(!isDouble(speed)) {
- msg.prefix(player, prefix_commands, "Number expected.");
- goto("wait");
- }
- if(speed < 1) {
- speed = 1;
- }
- if(speed > 10) {
- speed = 10;
- }
- if(size < 2) {
- p = player;
- }
- if(size == 2) {
- if(!perm.has("speed.other", player)) {
- perm.no("speed.other", player);
- goto("wait");
- }
- p_name = list.getIndex(args, 1);
- p = read.player(p_name);
- if(p == null) {
- msg.prefix(player, prefix_commands, "This player is not online.");
- goto("wait");
- }
- }
- player.setSpeed(p, speed);
- msg.prefix(p, prefix_commands, string.concat("Set your speed to ", string.number(speed), "."));
- if(p != player) {
- msg.prefix(player, prefix_commands, string.concat(player.getName(p), " set your speed to ", string.number(speed), "."));
- }
- goto("wait");
- @butcher
- loc = entity.getLocation(player);
- world = loc.getWorld(loc);
- list = world.getEntities(world);
- size = list.getSize(list);
- killed = 0;
- for(i = 0; i < size; i++) {
- element = list.getIndex(list, i);
- if(isLiving(element)) {
- entity_type = entity.getType(element);
- if(set.contains(butcher_set, entity_type)) {
- entity.remove(element);
- killed++;
- }
- }
- }
- msg.prefix(player, prefix_commands, string.concat(string.number(killed), " mobs killed."));
- goto("wait");
- @enchant
- if(size != 2) {
- msg.prefix(player, prefix_commands, "/enchant <enchantment> <level>");
- goto("wait");
- }
- ench_string = list.getIndex(args, 0);
- ench = enchantment.get(ench_string);
- if(ench == null) {
- msg.prefix(player, prefix_commands, "Unknown enchantment");
- goto("wait");
- }
- lvl = list.getIndex(args, 1);
- if(!isDouble(lvl) || lvl < 1 || lvl > 100) {
- msg.prefix(sender, prefix_commands, "Number greater than 0 and less than 101 expected.");
- goto("wait");
- }
- item = living.getHand(player);
- if(item.isAir(item)) {
- msg.prefix(sender, prefix_commands, "You need to hold an item in your hand.");
- goto("wait");
- }
- enchantment.add(ench, item, lvl);
- goto("wait");
- @enderchest
- if(size < 1 || size > 2) {
- msg.prefix(player, prefix_commands, "/enderchest [player] <from-player>");
- goto("wait");
- }
- if(size == 1) {
- from_name = list.getIndex(args, 0);
- p = player;
- }
- elseif(size == 2) {
- p_name = list.getIndex(args, 0);
- from_name = list.getIndex(args, 1);
- p = read.player(p_name);
- if(p == null) {
- msg.prefix(player, prefix_commands, "This player is not online.");
- goto("wait");
- }
- }
- from_player = read.player(from_name);
- if(from_player == null) {
- msg.prefix(player, prefix_commands, "This player is not online.");
- goto("wait");
- }
- ender_inv = player.getEnderInv(from_player);
- inv.open(ender_inv, p);
- goto("wait");
- @gamemode
- if(size < 1 || size > 2) {
- msg.prefix(player, prefix_commands, "/gamemode <mode> [player]");
- goto("wait");
- }
- if(size == 1) {
- p = player;
- } elseif(size == 2) {
- if(!perm.has("gamemode.other", player)) {
- perm.no("gamemode.other", player);
- goto("wait");
- }
- p_name = list.getIndex(args, 1);
- p = read.player(p_name);
- if(p == null) {
- msg.prefix(player, prefix_commands, "This player is not online.");
- goto("wait");
- }
- }
- mode = list.getIndex(args, 0);
- if(isDouble(mode)) {
- mode = string.number(mode);
- } else {
- mode = string.toLowerCase(mode);
- }
- if(mode == "s" || mode == "0" || mode == "survival") {
- mode = "SURVIVAL";
- } elseif(mode == "c" || mode == "1" || mode == "creative") {
- mode = "CREATIVE";
- } elseif(mode == "a" || mode == "2" || mode == "adventure") {
- mode = "ADVENTURE";
- } elseif(mode == "w" || mode == "3" || mode == "spectator") {
- mode = "SPECTATOR";
- } else {
- msg.prefix(player, prefix_commands, "Unknown gamemode.");
- goto("wait");
- }
- player.setGamemode(p, mode);
- if(p != player) {
- p_name = player.getName(p);
- msg.prefix(player, prefix_commands, string.concat("Gamemode of ", p_name, " set to ", mode, "."));
- }
- msg.prefix(p, prefix_commands, string.concat("Set your gamemode to ", mode, "."));
- goto("wait");
- @home
- if(size == 0) {
- @homesyntax
- msg.prefix(player, prefix_commands, "/home ...");
- msg.string(player, "§6 - set <name> §rSets a home");
- if(perm.has("home.other", player)) {
- msg.string(player, "§6 - delete <name> [player] §rDeletes a home");
- msg.string(player, "§6 - list [player] §rLists all homes");
- msg.string(player, "§6 - <name> [player] §rTeleports to a home");
- } else {
- msg.string(player, "§6 - delete <name> §rDeletes a home");
- msg.string(player, "§6 - list §rLists your homes");
- msg.string(player, "§6 - <name> §rTeleports to your home");
- }
- goto("wait");
- }
- arg0 = string.toLowerCase(list.getIndex(args, 0));
- if(arg0 == "del" || arg0 == "delete") {
- if(size < 2) {
- goto("homesyntax");
- }
- if(size == 2) {
- player_id = player.getId(player);
- } else {
- if(!perm.has("home.other", player)) {
- perm.no("home.other", player);
- goto("wait");
- }
- p_name = string.toLowerCase(list.getIndex(args, 2));
- p_uuid = player.getUuid(p_name);
- if(p_uuid == null) {
- msg.prefix(player, prefix_commands, "This player has never been online.");
- goto("wait");
- }
- player_id = player.getId(p_uuid);
- }
- name = string.toLowerCase(list.getIndex(args, 1));
- if(!home.exists(player_id, name)) {
- msg.prefix(player, prefix_commands, string.concat("Home ", name, " doesn´t exist."));
- goto("wait");
- }
- home.delete(player_id, name);
- msg.prefix(player, prefix_commands, string.concat("Home ", name, " deleted."));
- goto("wait");
- }
- if(arg0 == "list") {
- if(size < 2) {
- p_uuid = player.getUuid(player);
- }
- if(size == 2) {
- if(!perm.has("home.other", player)) {
- perm.no("home.other", player);
- goto("wait");
- }
- p_name = string.toLowerCase(list.getIndex(args, 1));
- p_uuid = player.getUuid(p_name);
- if(p_uuid == null) {
- msg.prefix(player, prefix_commands, "This player has never been online.");
- goto("wait");
- }
- }
- id = player.getId(p_uuid);
- homes_list = home.getList(id);
- home_amount = list.getSize(homes_list);
- if(home_amount == 0) {
- msg.prefix(player, prefix_commands, "No homes existing.");
- } else {
- msg.prefix(player, prefix_commands, string.concat("Homes of ", player.getName(p_uuid), ":"));
- for(i = 0; i < home_amount; i++) {
- msg.string(player, string.concat("§6 - §r", list.getIndex(homes_list, i)));
- }
- }
- goto("wait");
- }
- location = entity.getLocation(player);
- world_name = world.getName(loc.getWorld(location));
- if(!world.isSurvName(world_name)) {
- msg.prefix(player, prefix_commands, "You can´t use this command in this world.");
- goto("wait");
- }
- if(arg0 == "set") {
- if(size < 2) {
- goto("homesyntax");
- }
- player_id = player.getId(player);
- homes_list = home.getList(player_id);
- home_amount = list.getSize(homes_list);
- if(perm.has("isAdmin", player)) {
- max_homes = 100;
- } elseif(perm.has("isMod", player)) {
- max_homes = 40;
- } elseif(perm.has("isTeam", player)) {
- max_homes = 20;
- } elseif(perm.has("canTP", player)) {
- max_homes = 10;
- } else {
- max_homes = 5;
- }
- max_homes += getAdditionalVoteHomes();
- if(home_amount >= max_homes) {
- msg.prefix(player, prefix_commands, string.concat("You can only set ", string.number(max_homes), " homes."));
- goto("wait");
- }
- name = string.toLowerCase(list.getIndex(args, 1));
- if(name == "set" || name == "del" || name == "delete" || name == "list") {
- msg.prefix(player, prefix_commands, "This name ist not allowed.");
- goto("wait");
- }
- if(!string.onlyletters(name)) {
- msg.prefix(player, prefix_commands, "Only letters allowed.");
- goto("wait");
- }
- if(string.length(name) > 20) {
- msg.prefix(player, prefix_commands, "Maximum 20 letters.");
- goto("wait");
- }
- if(home.exists(player_id, name)) {
- msg.prefix(player, prefix_commands, string.concat("Home ", name, " already exists."));
- goto("wait");
- }
- home.set(player_id, name, location);
- msg.prefix(player, prefix_commands, string.concat("Home ", name, " set."));
- goto("wait");
- }
- //Teleportation
- if(size < 2) {
- p_name = player.getName(player);
- }
- if(size == 2) {
- p_name = string.toLowerCase(list.getIndex(args, 1));
- }
- p_uuid = player.getUuid(p_name);
- if(p_uuid == null) {
- msg.prefix(player, prefix_commands, "Der Spieler war noch nie online.");
- goto("wait");
- }
- player_id = player.getId(p_uuid);
- location = home.getLocation(player_id, arg0);
- if(location == null) {
- msg.prefix(player, prefix_commands, "Home doesn´t exist."); //oder die welt ist nicht geladen
- goto("wait");
- }
- player.teleport(player, location, true);
- goto("wait");
- @icon
- msg.string(player, string.getSpacer());
- msg.string(player, "Icons - Click to Copy");
- msg(player, text.merge(
- string.getClipBoardText(icon.getGoldCoin(), icon.getGoldCoin()), text.new(" "),
- string.getClipBoardText(icon.getSilverCoin(), icon.getSilverCoin()), text.new(" "),
- string.getClipBoardText(icon.getCopperCoin(), icon.getCopperCoin()), text.new(" "),
- string.getClipBoardText(icon.getExp(), icon.getExp()), text.new(" "),
- string.getClipBoardText(icon.getBookshelf(), icon.getBookshelf()), text.new(" "),
- string.getClipBoardText(icon.getCraftingTable(), icon.getCraftingTable())
- ));
- msg(player, text.merge(
- string.getClipBoardText(icon.getCompass(), icon.getCompass()), text.new(" "),
- string.getClipBoardText(icon.getCake(), icon.getCake()), text.new(" "),
- string.getClipBoardText(icon.getEnderpearl(), icon.getEnderpearl()), text.new(" "),
- string.getClipBoardText(icon.getHeart(), icon.getHeart()), text.new(" "),
- string.getClipBoardText(icon.getHalfHeart(), icon.getHalfHeart()), text.new(" "),
- string.getClipBoardText(icon.getEmptyHeart(), icon.getEmptyHeart())
- ));
- goto("wait");
- @tpa
- if(size != 1) {
- msg.prefix(player, prefix_commands, "/tpa <player>");
- goto("wait");
- }
- p_name = list.getIndex(args, 0);
- p_uuid = player.getUuid(p_name);
- if(p_uuid == null) {
- msg.prefix(player, prefix_commands, "This player has never been online.");
- goto("wait");
- }
- p_name = player.getName(p_uuid);
- p = read.player(p_name);
- if(p == null) {
- msg.prefix(player, prefix_commands, "This player is not online.");
- goto("wait");
- }
- if(!player.doesAcceptTpaRequests(p)) {
- msg.prefix(player, prefix_commands, string.concat("§c", p_name, "§r rejects teleport requests."));
- goto("wait");
- }
- if(!player.canTeleport(p)) {
- msg.prefix(player, prefix_commands, "This player can´t teleport now.");
- goto("wait");
- }
- world_name = world.getName(loc.getWorld(entity.getLocation(player)));
- if(world.isGamesName(world_name)) {
- msg.prefix(player, prefix_commands, "You can´t teleport in this world.");
- goto("wait");
- }
- world_name = world.getName(loc.getWorld(entity.getLocation(p)));
- if(world.isGamesName(world_name)) {
- msg.prefix(player, prefix_commands, "You can´t teleport to this world.");
- goto("wait");
- }
- addTpaRequest(player.getUuid(player), p_uuid);
- player_name = player.getName(player);
- msg.string(player, string.concat("§6Teleport-Request: [§c", player_name, "§6 -> §c ", p_name, "§6]"));
- msg(p, text.merge(text.new(string.concat("§6Teleport-Request: [§c", player_name, "§6 -> §c ", p_name, "§6] ")), string.getClickText("§6[§aAccept§6]", string.concat("/tpaccept ", player_name))));
- goto("wait");
- @tpahere
- if(size != 1) {
- msg.prefix(player, prefix_commands, "/tpahere <player>");
- goto("wait");
- }
- p_name = list.getIndex(args, 0);
- p_uuid = player.getUuid(p_name);
- if(p_uuid == null) {
- msg.prefix(player, prefix_commands, "This player has never been online.");
- goto("wait");
- }
- p_name = player.getName(p_uuid);
- p = read.player(p_name);
- if(p == null) {
- msg.prefix(player, prefix_commands, "This player is not online.");
- goto("wait");
- }
- if(!player.canTeleport(p)) {
- msg.prefix(player, prefix_commands, "This player can´t teleport now.");
- goto("wait");
- }
- if(!player.doesAcceptTpaRequests(p)) {
- msg.prefix(player, prefix_commands, string.concat("§c", p_name, "§r rejects teleport requests."));
- goto("wait");
- }
- world_name = world.getName(loc.getWorld(entity.getLocation(player)));
- if(world.isGamesName(world_name)) {
- msg.prefix(player, prefix_commands, string.concat("§c", p_name, "§r isn´t allowed to teleport to this world."));
- goto("wait");
- }
- world_name = world.getName(loc.getWorld(entity.getLocation(p)));
- if(world.isGamesName(world_name)) {
- msg.prefix(player, prefix_commands, string.concat("§c", p_name, "§r isn´t allowed to teleport from their world."));
- goto("wait");
- }
- addTpaRequest(p_uuid, player.getUuid(player));
- player_name = player.getName(player);
- msg.string(player, string.concat("§6Teleport-Request: [§c", p_name, "§6 -> §c ", player_name, "§6]"));
- msg(p, text.merge(text.new(string.concat("§6Teleport-Request: [§c", p_name, "§6 -> §c ", player_name, "§6] ")), string.getClickText("§6[§aAccept§6]", string.concat("/tpaccepthere ", player_name))));
- goto("wait");
- @tpaccept
- if(size != 1) {
- msg.prefix(player, prefix_commands, "/tpaccept <player>");
- goto("wait");
- }
- p_name = list.getIndex(args, 0);
- p_uuid = player.getUuid(p_name);
- if(p_uuid == null) {
- msg.prefix(player, prefix_commands, "This player has never been online.");
- goto("wait");
- }
- p_name = player.getName(p_uuid);
- p = read.player(p_name);
- if(p == null) {
- msg.prefix(player, prefix_commands, "This player is not online.");
- goto("wait");
- }
- if(!player.canTeleport(player)) {
- msg.prefix(player, prefix_commands, "This player can´t teleport to you now.");
- goto("wait");
- }
- if(!player.canTeleport(p)) {
- msg.prefix(player, prefix_commands, "This player can´t teleport to you now.");
- //Kein return. Spieler A bekommt cancel adventure und Spieler B wird informiert.
- }
- world_name = world.getName(loc.getWorld(entity.getLocation(player)));
- if(world.isGamesName(world_name)) {
- msg.prefix(player, prefix_commands, string.concat("§c", p_name, "§r isn´t allowed to teleport to your world."));
- goto("wait");
- }
- world_name = world.getName(loc.getWorld(entity.getLocation(p)));
- if(world.isGamesName(world_name)) {
- msg.prefix(player, prefix_commands, string.concat("§c", p_name, "§r isn´t allowed to teleport from their world."));
- goto("wait");
- }
- player_uuid = player.getUuid(player);
- if(!hasTpaRequest(p_uuid, player_uuid)) {
- msg.prefix(player, prefix_commands, "No outstanding teleport-request.");
- goto("wait");
- }
- location = entity.getLocation(player);
- player.teleport(p, location, true);
- goto("wait");
- @tpaccepthere
- if(size != 1) {
- msg.prefix(player, prefix_commands, "/tpaccepthere <player>");
- goto("wait");
- }
- p_name = list.getIndex(args, 0);
- p_uuid = player.getUuid(p_name);
- if(p_uuid == null) {
- msg.prefix(player, prefix_commands, "This player has never been online.");
- goto("wait");
- }
- p_name = player.getName(p_uuid);
- p = read.player(p_name);
- if(p == null) {
- msg.prefix(player, prefix_commands, "This player is not online.");
- goto("wait");
- }
- if(!player.canTeleport(player)) {
- msg.prefix(p, prefix_commands, "This player can´t teleport to you now.");
- //Kein return. Spieler A bekommt cancel adventure und Spieler B wird informiert.
- }
- if(!player.canTeleport(p)) {
- msg.prefix(player, prefix_commands, "You must not teleport to this player now.");
- goto("wait");
- }
- world_name = world.getName(loc.getWorld(entity.getLocation(player)));
- if(world.isGamesName(world_name)) {
- msg.prefix(player, prefix_commands, "You can´t teleport in this world.");
- goto("wait");
- }
- world_name = world.getName(loc.getWorld(entity.getLocation(p)));
- if(world.isGamesName(world_name)) {
- msg.prefix(player, prefix_commands, "You can´t teleport to this world.");
- goto("wait");
- }
- player_uuid = player.getUuid(player);
- if(!hasTpaRequest(player_uuid, p_uuid)) {
- msg.prefix(player, prefix_commands, "No outstanding teleport-request.");
- goto("wait");
- }
- location = entity.getLocation(p);
- player.teleport(player, location, true);
- goto("wait");
- @tp
- if(size < 1 || size > 2) {
- if(perm.has("tp.other", player)) {
- msg.prefix(player, prefix_commands, "/tp [player] <to-player>");
- } else {
- msg.prefix(player, prefix_commands, "/tp <player>");
- }
- goto("wait");
- }
- if(size == 1) {
- to_name = list.getIndex(args, 0);
- p = player;
- }
- elseif(size == 2) {
- if(!perm.has("tp.other", player)) {
- perm.no("tp.other", player);
- goto("wait");
- }
- p_name = list.getIndex(args, 0);
- p = read.player(p_name);
- //Damit der ganze Spielername und nicht nur der eingegebene angezeigt wird
- to_name = list.getIndex(args, 1);
- if(p == null) {
- msg.prefix(player, prefix_commands, "This player is not online.");
- goto("wait");
- }
- }
- if(player.hasMinigame(p)) {
- if(size == 2) {
- msg.prefix(player, prefix_commands, "This player can´t be teleported now.");
- goto("wait");
- }
- msg.prefix(player, prefix_commands, "You can´t teleport now.");
- goto("wait");
- }
- to_player = read.player(to_name);
- if(to_player == null) {
- msg.prefix(player, prefix_commands, "This player is not online.");
- goto("wait");
- }
- //Damit der ganze Spielername und nicht nur der eingegebene angezeigt wird
- to_name = player.getName(to_player);
- location = entity.getLocation(to_player);
- if(player.teleport(p, location, true)) {
- if(player != p) {
- msg.prefix(player, prefix_commands, string.concat("Teleported ", player.getName(p), " to ", to_name, "."));
- }
- msg.prefix(p, prefix_commands, string.concat("Teleported you to ", to_name, "."));
- }
- goto("wait");
- @say
- if(size == 0) {
- msg.prefix(sender, prefix_commands, "/say <text>");
- goto("wait");
- }
- msg.online("§cServer", string.concatList(args, " ", 0, size - 1));
- goto("wait");
- @warp
- if(size == 0) {
- @warpsyntax
- msg.prefix(player, prefix_commands, "/warp ...");
- if(perm.has("warp.create", player)) {
- msg.string(player, "§6 - set <warp> §rSets a warp");
- msg.string(player, "§6 - delete <warp> §rDeletes a warp");
- }
- msg.string(player, "§6 - <warp> §rTeleports to a warp");
- msg.string(player, "§6 - list §rLists all warps");
- goto("wait");
- }
- arg0 = string.toLowerCase(list.getIndex(args, 0));
- if(arg0 == "delete") {
- if(!perm.has("warp.create", player)) {
- perm.no("warp.create", player);
- goto("wait");
- }
- if(size != 2) {
- goto("warpsyntax");
- }
- warp_name = string.toLowerCase(list.getIndex(args, 1));
- if(warp.delete(warp_name)) {
- msg.prefix(player, prefix_commands, string.concat("Warp ", warp_name, " deleted."));
- } else {
- msg.prefix(player, prefix_commands, "Warpname doesn´t exist.");
- }
- goto("wait");
- }
- if(arg0 == "list") {
- warps_list = warp.getList();
- if(list.getSize(warps_list) == 0) {
- msg.prefix(player, prefix_commands, "No warps existing.");
- goto("wait");
- }
- msg.prefix(player, prefix_commands, string.concat("§6Warps:"));
- for(i = 0; i < list.getSize(warps_list); i++) {
- msg.string(player, string.concat("§6 - §r", list.getIndex(warps_list, i)));
- }
- goto("wait");
- }
- if(arg0 == "set") {
- if(!perm.has("warp.create", player)) {
- perm.no("warp.create", player);
- goto("wait");
- }
- if(size != 2) {
- goto("warpsyntax");
- }
- warp_name = string.toLowerCase(list.getIndex(args, 1));
- if(warp.exists(warp_name)) {
- msg.prefix(player, prefix_commands, "Warpname already exists.");
- goto("wait");
- }
- warp.create(warp_name, entity.getLocation(player));
- msg.prefix(player, prefix_commands, string.concat("Warp ", warp_name, " set."));
- goto("wait");
- }
- //Teleportation
- warp_name = string.toLowerCase(arg0);
- warp_loc = warp.get(warp_name);
- if(warp_loc == null) {
- msg.prefix(player, prefix_commands, "Warpname doesn´t exist.");
- goto("wait");
- }
- if(!perm.has("warp.create", player)) {
- world_name = world.getName(loc.getWorld(entity.getLocation(player)));
- if(world.isGamesName(world_name)) {
- msg.prefix(player, prefix_commands, "You can´t teleport in this world.");
- goto("wait");
- }
- world_name = world.getName(loc.getWorld(warp_loc));
- if(world.isGamesName(world_name)) {
- msg.prefix(player, prefix_commands, "You can´t teleport to this world.");
- goto("wait");
- }
- }
- if(player.teleport(player, warp_loc, true)) {
- msg.prefix(player, prefix_commands, string.concat("You have been teleported to warp §7", warp_name, "."));
- }
- goto("wait");
- @databank
- if(size == 0) {
- @databankhelp
- msg.prefix(player, prefix_commands, "/databank...");
- msg.string(player, "§6 - showtables §rShows all tables");
- msg.string(player, "§6 - showfields §rShows fields from a table");
- msg.string(player, "§6 - showdatatypes §rShows dataypes from a table");
- goto("wait");
- }
- arg0 = string.toLowerCase(list.getIndex(args, 0));
- if(arg0 == "showtables") {
- msg.string(player, string.getSpacer());
- stmt = databank.prepare("SHOW TABLES");
- result = databank.execute(stmt);
- while(databank.next(result)) {
- msg.string(player, databank.getString(result, 1));
- }
- databank.close(result);
- databank.close(stmt);
- goto("wait");
- }
- if(arg0 == "showfields") {
- if(size < 2) {
- msg.prefix(player, prefix_commands, "/databank showfields <table>");
- goto("wait");
- }
- table = list.getIndex(args, 1);
- if(!databank.isExistingTable(table)) {
- msg.prefix(player, prefix_commands, "This in no existing table.");
- goto("wait");
- }
- msg.string(player, string.getSpacer());
- fields = databank.getTableFields(table);
- iter = iterator(fields);
- while(hasNext(iter)) {
- msg.string(player, next(iter));
- }
- goto("wait");
- }
- if(arg0 == "showdatatypes") {
- if(size < 2) {
- msg.prefix(player, prefix_commands, "/databank showdatatypes <table>");
- goto("wait");
- }
- table = list.getIndex(args, 1);
- if(!databank.isExistingTable(table)) {
- msg.prefix(player, prefix_commands, "This in no existing table.");
- goto("wait");
- }
- msg.string(player, string.getSpacer());
- msg.string(player, databank.getTableDatatypes(table));
- goto("wait");
- }
- goto("databankhelp");
- @seen
- if(size != 1) {
- msg.prefix(player, prefix_commands, "/seen <player>");
- goto("wait");
- }
- seen_name = list.getIndex(args, 0);
- seen_uuid = player.getUuid(seen_name);
- if(seen_uuid == null) {
- msg.prefix(player, prefix_commands, "This player has never been online.");
- goto("wait");
- }
- if(read.player(seen_name) != null) {
- msg.prefix(player, prefix_commands, "This player is online.");
- goto("wait");
- }
- seenStatement = databank.prepare("SELECT MAX(leave_time) FROM playtime WHERE player_id = ?;");
- databank.setInt(seenStatement, 1, player.getId(seen_uuid));
- result = databank.execute(seenStatement);
- if(databank.next(result)) {
- time = databank.getLong(result, 1);
- msg.prefix(player, prefix_commands, string.concat(seen_name, " was seen at §e", time.getString(time), "."));
- } else {
- msg.prefix(player, prefix_commands, "Keine Daten vorhanden.");
- }
- databank.close(result);
- databank.close(seenStatement);
- goto("wait");
- @lastseen
- if(size != 1) {
- msg.prefix(sender, prefix_commands, "/lastseen <amount>");
- goto("wait");
- }
- amount = list.getIndex(args, 0);
- if(!isDouble(amount)) {
- msg.prefix(sender, prefix_commands, "Number expected.");
- goto("wait");
- }
- if(amount < 1) {
- msg.prefix(sender, prefix_commands, "Positive number expected.");
- goto("wait");
- }
- modTimer(-5);
- msg.prefix(sender, prefix_commands, "These players were last seen:");
- table = table.new("§f", 12, 12);
- msg.string(sender, table.getStart(table));
- msg.string(sender, table.get(table, "Player", "Date"));
- msg.string(sender, table.getMiddle(table));
- lastseenStatement = databank.prepare("SELECT player_id, MAX(leave_time) AS max_time FROM playtime GROUP BY player_id ORDER BY max_time DESC LIMIT ?;");
- databank.setInt(lastseenStatement, 1, amount);
- result = databank.execute(lastseenStatement);
- while(databank.next(result)) {
- id = databank.getInt(result, 1);
- time = databank.getLong(result, 2);
- msg.string(sender, table.get(table, string.concat("§a", player.getNameFromId(id)), string.concat("§e", time.getString(time))));
- }
- msg.string(sender, table.getEnd(table));
- databank.close(result);
- databank.close(lastseenStatement);
- goto("wait");
- @feed
- if(size > 1) {
- msg.prefix(player, prefix_commands, "/feed [player]");
- goto("wait");
- }
- if(size == 0) {
- p = player;
- }
- if(size == 1) {
- p_name = list.getIndex(args, 0);
- p = read.player(p_name);
- if(p == null) {
- msg.prefix(player, prefix_commands, "This player is not online.");
- goto("wait");
- }
- if(player != p) {
- msg.prefix(player, prefix_commands, string.concat(player.getName(p), " has been feed."));
- }
- }
- player.setHunger(p, 20);
- player.setSaturation(p, 5);
- msg.prefix(p, prefix_commands, "You have been feed.");
- goto("wait");
- @tempfly
- if(size < 2) {
- msg.prefix(sender, prefix_commands, "/tempfly <player> <sec>");
- goto("wait");
- }
- p_name = list.getIndex(args, 0);
- if(!checkIfEverOnline(p_name)) {
- msg.prefix(sender, prefix_commands, "This player has never been online.");
- goto("wait");
- }
- p = read.player(p_name);
- if(p == null) {
- msg.prefix(sender, prefix_commands, "This player is not online.");
- goto("wait");
- }
- p_name = player.getName(player.getUuid(p_name));
- if(player.hasMinigame(p)) {
- msg.prefix(player, prefix_commands, "This player can´t fly now.");
- goto("wait");
- }
- sec = list.getIndex(args, 1);
- if(!isDouble(sec) || sec < 0) {
- msg.prefix(sender, prefix_commands, "Positive number expected.");
- goto("wait");
- }
- msg.prefix(sender, prefix_commands, string.concat(p_name, " can now fly for ", string.number(sec), " seconds."));
- msg.prefix(p, prefix_commands, string.concat("You can now fly for ", string.number(sec), " seconds."));
- player.setFly(p, true);
- duration = sec * 20;
- data.setTimer(p, "fly", duration);
- //status.addTimed(player, 55, duration, "Fly");
- goto("wait");
- @fly
- if(size > 2) {
- msg.prefix(player, prefix_commands, "/fly [player] [on/off]");
- goto("wait");
- }
- if(size >= 1) {
- if(!perm.has("fly.other", player)) {
- perm.no("fly.other", player);
- goto("wait");
- }
- p_name = list.getIndex(args, 0);
- p = read.player(p_name);
- if(p == null) {
- msg.prefix(player, prefix_commands, "This player is not online.");
- goto("wait");
- }
- } else {
- p = player;
- }
- world_name = world.getName(loc.getWorld(entity.getLocation(player)));
- if(world.isGamesName(world_name)) {
- if(player.hasMinigame(p) || (perm.has("fly", p) && !perm.has("isTeam", p))) {
- if(size == 2) {
- msg.prefix(player, prefix_commands, "This player can´t fly now.");
- } else {
- msg.prefix(player, prefix_commands, "You can´t fly now.");
- }
- goto("wait");
- }
- }
- if(size < 2) {
- new_state = player.toggleFly(p);
- } else {
- new_state = false;
- if(list.getIndex(args, 1) == "on") {
- new_state = true;
- }
- player.setFly(p, new_state);
- }
- if(new_state) {
- msg.prefix(p, prefix_commands, "You can fly now.");
- if(player != p) {
- p_name = player.getName(p);
- msg.prefix(player, prefix_commands, string.concat(p_name, " can fly now."));
- }
- } else {
- msg.prefix(p, prefix_commands, "You can´t fly anymore.");
- if(player != p) {
- p_name = player.getName(p);
- msg.prefix(player, prefix_commands, string.concat(p_name, " can´t fly anymore."));
- }
- }
- goto("wait");
- @tppos
- if(size < 3 || size > 5) {
- msg.prefix(player, prefix_commands, "/tppos <x> <y> <z> [world] [player]");
- goto("wait");
- }
- x = list.getIndex(args, 0);
- y = list.getIndex(args, 1);
- z = list.getIndex(args, 2);
- if(!isDouble(x) || !isDouble(y) || !isDouble(z)) {
- msg.prefix(player, prefix_commands, "x/y/z müssen Zahlen sein.");
- goto("wait");
- }
- if(size >= 4) {
- worldname = list.getIndex(args, 3);
- world = world.get(worldname);
- if(world == null) {
- msg.prefix(player, prefix_commands, "This world is not loaded.");
- goto("wait");
- }
- } else {
- world = loc.getWorld(entity.getLocation(player));
- }
- if(x < -32000) {
- x = -32000;
- } elseif(x > 32000) {
- x = 32000;
- }
- if(y < -64) {
- y = -64;
- } elseif(y > 319) {
- y = 319;
- }
- if(z < -32000) {
- z = -32000;
- } elseif(z > 32000) {
- z = 32000;
- }
- location = loc.new(world, x, y, z);
- if(size == 5) {
- p_name = list.getIndex(args, 4);
- p = read.player(p_name);
- if(p == null) {
- msg.prefix(player, prefix_commands, "This player is not online.");
- goto("wait");
- }
- } else {
- p = player;
- }
- if(player.hasMinigame(p)) {
- if(size == 5) {
- msg.prefix(player, prefix_commands, "This player can´t be teleported now.");
- goto("wait");
- }
- msg.prefix(player, prefix_commands, "You can´t teleport now.");
- goto("wait");
- }
- if(player.teleport(p, location, true)) {
- if(player != p) {
- msg.prefix(player, prefix_commands, string.concat(player.getName(p), " was teleported."));
- }
- }
- goto("wait");
- @back
- if(size > 0) {
- msg.prefix(player, prefix_commands, "/back");
- goto("wait");
- }
- if(!player.canTeleport(player)) {
- msg.prefix(player, prefix_commands, "You can´t teleport now.");
- goto("wait");
- }
- hasPerms = perm.has("isTeam", player);
- if(!hasPerms) {
- world_name = world.getName(loc.getWorld(entity.getLocation(player)));
- if(world.isGamesName(world_name)) {
- msg.prefix(player, prefix_commands, "You can´t use /back in this world.");
- goto("wait");
- }
- }
- location = player.getBackPos(player);
- if(location == null) {
- msg.prefix(player, prefix_commands, "No back-location available.");
- goto("wait");
- }
- world = loc.getWorld(location);
- if(world == null) {
- msg.prefix(player, prefix_commands, "This world is not loaded.");
- goto("wait");
- }
- if(!hasPerms) {
- world_name = world.getName(world);
- if(world.isGamesName(world_name)) {
- msg.prefix(player, prefix_commands, "You can´t teleport to this world.");
- goto("wait");
- }
- }
- player.teleport(player, location, true);
- goto("wait");
- @clan
- if(size == 0) {
- @clanhelp
- msg.prefix(player, prefix_clan, "/clan...");
- msg.string(player, "§2 - info [id/name/tag] §rReturns info about a clan");
- msg.string(player, "§2 - list §rLists all clans");
- msg.string(player, "");
- msg.string(player, "§2 - create <name> <tag> §rCreates a clan. Costs §64096 §rsnuvis.");
- msg.string(player, "§2 - invite <name> §rInvites a player");
- msg.string(player, "§2 - accept <id/name/tag> §rAccepts an invitation");
- msg.string(player, "");
- msg.string(player, "§2 - kick <name> §rKicks a player");
- msg.string(player, "§2 - leader <name> §rPromote to clan-leader");
- msg.string(player, "§2 - mod <name> §rPromote to clan-mod");
- msg.string(player, "§2 - degrade <name> §rDemote a clan-mod");
- msg.string(player, "§2 - leave §rLeave a clan");
- msg.string(player, "");
- msg.string(player, "§2 - rename <name> <tag> §rRenames a clan. Costs §664 §rsnuvis.");
- msg.string(player, "§2 - setspawn §rSets a clan-spawn");
- msg.string(player, "§2 - spawn §rTeleports to clan-spawn");
- msg.string(player, "§2 - disband §rDisband a clan");
- msg.string(player, "");
- msg.string(player, "§2 - deposit <money> §rDeposit money to the clan account");
- msg.string(player, "§2 - withdraw <money> §rWithdraw money from the clan account");
- msg.string(player, "§2 - msg <message> §rSends a clan-message");
- msg.string(player, "§2 - mail <message> §rSends a clan-mail");
- msg.string(player, "§2 - shout <message> §rSends a message to all online players. Costs §664 §rsnuvis.");
- msg.string(player, "§2 - party §rInvites all online members to a party");
- goto("wait");
- }
- arg0 = string.toLowerCase(list.getIndex(args, 0));
- if(arg0 == "invite") {
- if(size != 2) {
- msg.prefix(player, prefix_commands, "/clan invite <name>");
- goto("wait");
- }
- if(!player.isInClan(player)) {
- msg.prefix(player, prefix_clan, "You are not in a clan.");
- goto("wait");
- }
- if(!player.isClanLeader(player) && !player.isClanMod(player)) {
- msg.prefix(player, prefix_clan, "You have no permission for this.");
- goto("wait");
- }
- p_name = list.getIndex(args, 1);
- if(string.toLowerCase(player.getName(player)) == string.toLowerCase(p_name)) {
- msg.prefix(player, prefix_clan, "You can´t invite yourself.");
- goto("wait");
- }
- if(!checkIfEverOnline(p_name)) {
- msg.prefix(sender, prefix_clan, "This player has never been online.");
- goto("wait");
- }
- if(!isOnline(p_name)) {
- msg.prefix(player, prefix_clan, "This player has to be online.");
- goto("wait");
- }
- p = read.player(p_name);
- if(player.isClanMember(player)) {
- msg.prefix(player, prefix_clan, "This player is already in a clan.");
- goto("wait");
- }
- clan_id = player.getClanId(player);
- p_id = player.getId(p);
- if(player.hasClanInvitation(p_id, clan_id)) {
- msg.prefix(player, prefix_clan, "This player already has an invitation from your clan.");
- goto("wait");
- }
- player.addClanInvitation(p_id, clan_id);
- clan_name = clan.getName(clan_id);
- msg.prefix(player, prefix_clan, string.concat("You invited §7", p_name, "§r to your clan."));
- msg.prefix(p, prefix_clan, string.concat("You got an clan invitation by §7", clan_name, "§r."));
- msg.string(p, string.getClickText("§r[§aAccept§r]", string.concat("/clan accept ", clan_id)));
- sgoto(6000, "remove_clan_invitation"); //5 Minuten
- goto("wait");
- }
- if(arg0 == "accept") {
- if(size != 2) {
- msg.prefix(player, prefix_commands, "/clan accept <id/name/tag>");
- goto("wait");
- }
- if(player.isInClan(player)) {
- msg.prefix(player, prefix_clan, "You are already in a clan.");
- goto("wait");
- }
- arg1 = list.getIndex(args, 1);
- if(isDouble(arg1)) {
- clan_id = arg1;
- clan_name = clan.getName(clan_id);
- if(clan_name == null) {
- msg.prefix(player, prefix_clan, "Unknown clan.");
- goto("wait");
- }
- } else {
- clan_id = clan.getIdFromName(arg1);
- if(clan_id == null) {
- clan_id = clan.getIdFromTag(arg1);
- if(clan_id == null) {
- msg.prefix(player, prefix_clan, "Unknown clan.");
- goto("wait");
- }
- }
- }
- player_id = player.getId(player);
- if(!player.hasClanInvitation(player_id, clan_id)) {
- msg.prefix(player, prefix_clan, "You have no invitation from this clan.");
- goto("wait");
- }
- clan.addMember(clan_id, player, "member");
- player.setHeadName(player);
- clan.msg(clan_id, string.concat("§7", player.getName(player), "§r joined the clan."));
- msg.prefix(player, prefix_clan, string.concat("You joined §7", clan_name, "§r."));
- clan_size = clan.getMembersAmount(clan_id);
- if(clan_size >= 15) {
- rank.offerClan(clan_id, "rank.lord");
- } elseif(clan_size >= 10) {
- rank.offerClan(clan_id, "rank.chief");
- } elseif(clan_size >= 5) {
- rank.offerClan(clan_id, "rank.commander");
- }
- goto("wait");
- }
- if(arg0 == "create") {
- if(size != 3) {
- msg.prefix(player, prefix_commands, "/clan create <name> <tag>");
- goto("wait");
- }
- if(player.isInClan(player)) {
- msg.prefix(player, prefix_clan, "You are already in a clan.");
- goto("wait");
- }
- clan_name = list.getIndex(args, 1);
- if(string.length(clan_name) > 20) {
- msg.prefix(player, prefix_clan, "Maximum 20 letters allowed for name.");
- goto("wait");
- }
- if(!string.onlyletters(clan_name)) {
- msg.prefix(player, prefix_clan, "Only letters are allowed.");
- goto("wait");
- }
- if(clan.isExistingName(clan_name)) {
- msg.prefix(player, prefix_clan, "This name already exists.");
- goto("wait");
- }
- clan_tag = list.getIndex(args, 2);
- tag_length = string.length(clan_tag);
- if(tag_length < 3 || tag_length > 4) {
- msg.prefix(player, prefix_clan, "3 to 4 letters allowed for tag.");
- goto("wait");
- }
- if(!string.onlyletters(clan_tag)) {
- msg.prefix(player, prefix_clan, "Only letters are allowed.");
- goto("wait");
- }
- if(clan.isExistingTag(clan_tag)) {
- msg.prefix(player, prefix_clan, "This tag already exists.");
- goto("wait");
- }
- if(!hasEnoughMoney(player, 4096)) { //1 Goldmünze
- msg.prefix(player, prefix_clan, "You need 4096 snuvis (1 gold coin).");
- goto("wait");
- }
- money.sub(player, 4096);
- clan_id = clan.create(clan_name, clan_tag);
- clan.addMember(clan_id, player, "leader");
- player.setHeadName(player);
- msg.prefix(player, prefix_clan, "Clan successful created.");
- goto("wait");
- }
- if(arg0 == "info") {
- if(size == 1) {
- if(!player.isInClan(player)) {
- msg.prefix(player, prefix_commands, "/clan info <id/name/tag>");
- goto("wait");
- }
- clan_id = player.getClanId(player);
- clan_name = clan.getName(clan_id);
- clan_tag = clan.getTag(clan_id);
- }
- if(size == 2) {
- arg1 = list.getIndex(args, 1);
- if(isDouble(arg1)) {
- clan_id = arg1;
- clan_name = clan.getName(clan_id);
- if(clan_name == null) {
- msg.prefix(player, prefix_clan, "Unknown clan.");
- goto("wait");
- }
- } else {
- clan_id = clan.getIdFromName(arg1);
- if(clan_id == null) {
- clan_id = clan.getIdFromTag(arg1);
- if(clan_id == null) {
- msg.prefix(player, prefix_clan, "Unknown clan.");
- goto("wait");
- }
- }
- clan_name = clan.getName(clan_id);
- }
- clan_tag = clan.getTag(clan_id);
- }
- list = clan.getMembersList(clan_id);
- mod_list = list.new();
- members_list = list.new();
- iter = iterator(list);
- while(hasNext(iter)) {
- player_uuid = next(iter);
- player_name = player.getName(player_uuid);
- player_id = player.getId(player_uuid);
- if(player.isClanLeader(player_id)) {
- leader = player_name;
- } else {
- if(player.isClanMod(player_id)) {
- list.add(mod_list, player_name);
- } else {
- list.add(members_list, player_name);
- }
- }
- }
- if(list.getSize(mod_list) == 0) {
- mods = "-";
- } else {
- mods = string.concatList(mod_list, ", ", 0, list.getSize(mod_list) - 1);
- }
- if(list.getSize(members_list) == 0) {
- members = "-";
- } else {
- members = string.concatList(members_list, ", ", 0, list.getSize(members_list) - 1);
- }
- msg.string(player, string.concat("§6§lClan §r", clan_name, " (", clan_tag, " #ID:", string.number(clan_id), ")"));
- msg.string(player, "§6Leader");
- msg.string(player, leader);
- msg.string(player, "§6Mods");
- msg.string(player, mods);
- msg.string(player, "§6Members");
- msg.string(player, members);
- msg.string(player, "§6Money");
- msg.string(player, string.number(clan.getMoney(clan_id)));
- goto("wait");
- }
- if(arg0 == "rename") {
- if(!player.isInClan(player)) {
- msg.prefix(player, prefix_clan, "You are not in a clan.");
- goto("wait");
- }
- if(!player.isClanLeader(player)) {
- msg.prefix(player, prefix_clan, "You are not a clan leader.");
- goto("wait");
- }
- if(size != 3) {
- msg.prefix(player, prefix_commands, "/clan rename <name> <tag>");
- goto("wait");
- }
- clan_name = list.getIndex(args, 1);
- if(string.length(clan_name) > 20) {
- msg.prefix(player, prefix_clan, "Maximum 20 letters allowed for name.");
- goto("wait");
- }
- if(!string.onlyletters(clan_name)) {
- msg.prefix(player, prefix_clan, "Only letters are allowed.");
- goto("wait");
- }
- if(clan.isExistingName(clan_name)) {
- msg.prefix(player, prefix_clan, "This name already exists.");
- goto("wait");
- }
- clan_tag = list.getIndex(args, 2);
- tag_length = string.length(clan_tag);
- if(tag_length < 3 || tag_length > 4) {
- msg.prefix(player, prefix_clan, "3 to 4 letters allowed for tag.");
- goto("wait");
- }
- if(!string.onlyletters(clan_tag)) {
- msg.prefix(player, prefix_clan, "Only letters are allowed.");
- goto("wait");
- }
- if(clan.isExistingTag(clan_tag)) {
- msg.prefix(player, prefix_clan, "This tag already exists.");
- goto("wait");
- }
- clan_id = player.getClanId(player);
- if(clan.getMoney(clan_id) < 64) {
- msg.prefix(player, prefix_clan, "Your clan needs 64 snuvis.");
- goto("wait");
- }
- clan.subMoney(clan_id, 64);
- clan.setName(clan_id, clan_name);
- clan.setTag(clan_id, clan_tag);
- clan.msg(clan_id, string.concat("Clan renamed to §7", clan_name, "§r."));
- //New tag for online players
- clan.updateHeadNames(clan_id);
- goto("wait");
- }
- if(arg0 == "msg") {
- if(!player.isInClan(player)) {
- msg.prefix(player, prefix_clan, "You are not in a clan.");
- goto("wait");
- }
- if(size < 2) {
- msg.prefix(player, prefix_commands, "/clan msg <message>");
- goto("wait");
- }
- clan_id = player.getClanId(player);
- clan.msg(clan_id, string.concat(player.getName(player), ": ", string.concatList(args, " ", 1, size - 1)));
- goto("wait");
- }
- if(arg0 == "mail") {
- if(!player.isInClan(player)) {
- msg.prefix(player, prefix_clan, "You are not in a clan.");
- goto("wait");
- }
- if(size < 2) {
- msg.prefix(player, prefix_commands, "/clan mail <message>");
- goto("wait");
- }
- if(player.isClanMember(player)) {
- msg.prefix(player, prefix_commands, "You have no permission for this.");
- goto("wait");
- }
- clan_id = player.getClanId(player);
- clan.mail(clan_id, player.getName(player), string.concatList(args, " ", 1, size - 1));
- goto("wait");
- }
- if(arg0 == "shout") {
- if(!player.isInClan(player)) {
- msg.prefix(player, prefix_clan, "You are not in a clan.");
- goto("wait");
- }
- if(size < 2) {
- msg.prefix(player, prefix_commands, "/clan shout <message>");
- goto("wait");
- }
- if(player.isClanMember(player)) {
- msg.prefix(player, prefix_commands, "You have no permission for this.");
- goto("wait");
- }
- clan_id = player.getClanId(player);
- if(clan.getMoney(clan_id) < 64) {
- msg.prefix(player, prefix_clan, "Your clan needs 64 snuvis.");
- goto("wait");
- }
- clan.subMoney(clan_id, 64);
- msg.prefix("online", prefix_clan, string.concat(clan.getTag(clan_id), ": ", string.concatList(args, " ", 1, size - 1)));
- goto("wait");
- }
- if(arg0 == "deposit") {
- if(!player.isInClan(player)) {
- msg.prefix(player, prefix_clan, "You are not in a clan.");
- goto("wait");
- }
- if(size != 2) {
- msg.prefix(player, prefix_commands, "/clan deposit <money>");
- goto("wait");
- }
- money = list.getIndex(args, 1);
- if(!isDouble(money) || money < 0) {
- msg.prefix(player, prefix_clan, "Positive number expected.");
- goto("wait");
- }
- if(!hasEnoughMoney(player, money)) {
- msg.prefix(player, prefix_clan, "You can´t transfer more money than you have.");
- goto("wait");
- }
- clan_id = player.getClanId(player);
- clan.addMoney(clan_id, money);
- money.sub(player, money);
- clan.msg(clan_id, string.concat("§7", player.getName(player), "§r transferred §7", string.number(money), "§r snuvis."));
- goto("wait");
- }
- if(arg0 == "party") {
- counter = 0;
- clan_id = player.getClanId(player);
- list = clan.getMembersList(clan_id);
- iter = iterator(list);
- while(hasNext(iter)) {
- p = player.get(next(iter));
- if(p != null) {
- temp = party.invitePlayer(player, p);
- if(temp == true) {
- counter++;
- }
- }
- }
- msg.prefix(player, prefix_clan, string.concat(string.number(counter), " online clan members invited to a party."));
- goto("wait");
- }
- if(arg0 == "withdraw") {
- if(!player.isInClan(player)) {
- msg.prefix(player, prefix_clan, "You are not in a clan.");
- goto("wait");
- }
- if(!player.isClanLeader(player)) {
- msg.prefix(player, prefix_clan, "You are not a clan leader.");
- goto("wait");
- }
- if(size != 2) {
- msg.prefix(player, prefix_commands, "/clan withdraw <money>");
- goto("wait");
- }
- money = list.getIndex(args, 1);
- if(!isDouble(money) || money < 0) {
- msg.prefix(player, prefix_clan, "Positive number expected.");
- goto("wait");
- }
- clan_id = player.getClanId(player);
- clan_money = clan.getMoney(clan_id);
- if(clan_money < money) {
- msg.prefix(player, prefix_clan, string.concat("There are only §7", string.number(clan_money), "§r snuvis on the clan account."));
- goto("wait");
- }
- clan.subMoney(clan_id, money);
- money.add(player, money);
- msg.prefix(player, prefix_clan, string.concat("You have withdrawn §7", string.number(money), "§r snuvis."));
- goto("wait");
- }
- if(arg0 == "leader") {
- if(!player.isInClan(player)) {
- msg.prefix(player, prefix_clan, "You are not in a clan.");
- goto("wait");
- }
- if(!player.isClanLeader(player)) {
- msg.prefix(player, prefix_clan, "You are not a clan leader.");
- goto("wait");
- }
- if(size != 2) {
- msg.prefix(player, prefix_commands, "/clan leader <name>");
- goto("wait");
- }
- p_name = list.getIndex(args, 1);
- if(!checkIfEverOnline(p_name)) {
- msg.prefix(player, prefix_clan, "This player has never been online.");
- goto("wait");
- }
- if(string.toLowerCase(player.getName(player)) == string.toLowerCase(p_name)) {
- msg.prefix(player, prefix_clan, "You can´t do this for yourself.");
- goto("wait");
- }
- p_uuid = player.getUuid(p_name);
- p_id = player.getId(p_uuid);
- if(!player.isSameClan(player, p_id)) {
- msg.prefix(player, prefix_clan, "This player is not in your clan.");
- goto("wait");
- }
- player.setClanRole(p_id, "leader");
- player.setClanRole(player, "mod");
- clan_id = player.getClanId(player);
- clan.msg(clan_id, string.concat("§7", p_name, "§r was set to clan leader."));
- goto("wait");
- }
- if(arg0 == "mod") {
- if(!player.isInClan(player)) {
- msg.prefix(player, prefix_clan, "You are not in a clan.");
- goto("wait");
- }
- if(!player.isClanLeader(player)) {
- msg.prefix(player, prefix_clan, "You are not a clan leader.");
- goto("wait");
- }
- if(size != 2) {
- msg.prefix(player, prefix_commands, "/clan leader <name>");
- goto("wait");
- }
- p_name = list.getIndex(args, 1);
- if(!checkIfEverOnline(p_name)) {
- msg.prefix(player, prefix_clan, "This player has never been online.");
- goto("wait");
- }
- if(string.toLowerCase(player.getName(player)) == string.toLowerCase(p_name)) {
- msg.prefix(player, prefix_clan, "You can´t do this for yourself.");
- goto("wait");
- }
- p_uuid = player.getUuid(p_name);
- p_id = player.getId(p_uuid);
- if(!player.isSameClan(player, p_id)) {
- msg.prefix(player, prefix_clan, "This player is not in your clan.");
- goto("wait");
- }
- player.setClanRole(p_id, "mod");
- clan_id = player.getClanId(player);
- clan.msg(clan_id, string.concat("§7", p_name, "§r was set to clan mod."));
- goto("wait");
- }
- if(arg0 == "degrade") {
- if(!player.isInClan(player)) {
- msg.prefix(player, prefix_clan, "You are not in a clan.");
- goto("wait");
- }
- if(!player.isClanLeader(player)) {
- msg.prefix(player, prefix_clan, "You are not a clan leader.");
- goto("wait");
- }
- if(size != 2) {
- msg.prefix(player, prefix_commands, "/clan degrade <name>");
- goto("wait");
- }
- p_name = list.getIndex(args, 1);
- if(!checkIfEverOnline(p_name)) {
- msg.prefix(player, prefix_clan, "This player has never been online.");
- goto("wait");
- }
- if(string.toLowerCase(player.getName(player)) == string.toLowerCase(p_name)) {
- msg.prefix(player, prefix_clan, "You can´t do this for yourself.");
- goto("wait");
- }
- p_uuid = player.getUuid(p_name);
- p_id = player.getId(p_uuid);
- if(!player.isSameClan(player, p_id)) {
- msg.prefix(player, prefix_clan, "This player is not in your clan.");
- goto("wait");
- }
- player.setClanRole(p_id, "member");
- clan_id = player.getClanId(player);
- clan.msg(clan_id, string.concat("§7", p_name, "§r was degraded."));
- goto("wait");
- }
- if(arg0 == "kick") {
- if(!player.isInClan(player)) {
- msg.prefix(player, prefix_clan, "You are not in a clan.");
- goto("wait");
- }
- if(!player.isClanLeader(player) && !player.isClanMod(player)) {
- msg.prefix(player, prefix_clan, "You have no permission for this.");
- goto("wait");
- }
- if(size != 2) {
- msg.prefix(player, prefix_commands, "/clan kick <name>");
- goto("wait");
- }
- p_name = list.getIndex(args, 1);
- if(!checkIfEverOnline(p_name)) {
- msg.prefix(player, prefix_clan, "This player has never been online.");
- goto("wait");
- }
- if(string.toLowerCase(player.getName(player)) == string.toLowerCase(p_name)) {
- msg.prefix(player, prefix_clan, "You can´t do this for yourself.");
- goto("wait");
- }
- p_uuid = player.getUuid(p_name);
- p_id = player.getId(p_uuid);
- if(!player.isSameClan(player, p_id)) {
- msg.prefix(player, prefix_clan, "This player is not in your clan.");
- goto("wait");
- }
- if(player.isClanLeader(p_id)) {
- msg.prefix(player, prefix_clan, "You can´t kick the leader.");
- goto("wait");
- }
- if(player.isClanMod(player) && player.isClanMod(p_id)) {
- msg.prefix(player, prefix_clan, "You can´t kick another mod.");
- goto("wait");
- }
- clan_id = player.getClanId(player);
- clan.msg(clan_id, string.concat("§7", p_name, "§r got kicked out of the clan."));
- clan.removeMember(clan_id, p_id);
- p = read.player(p_name);
- if(p_name != null) {
- player.setHeadName(p);
- }
- goto("wait");
- }
- if(arg0 == "disband") {
- if(!player.isInClan(player)) {
- msg.prefix(player, prefix_clan, "You are not in a clan.");
- goto("wait");
- }
- if(!player.isClanLeader(player)) {
- msg.prefix(player, prefix_clan, "You are not a clan leader.");
- goto("wait");
- }
- clan_id = player.getClanId(player);
- clan.msg(clan_id, "Clan disbanded.");
- list = clan.getMembersList(clan_id);
- clan.delete(clan_id);
- iter = iterator(list);
- while(hasNext(iter)) {
- p = player.get(next(iter));
- if(p != null) {
- player.setHeadName(p);
- }
- }
- goto("wait");
- }
- if(arg0 == "leave") {
- if(!player.isInClan(player)) {
- msg.prefix(player, prefix_clan, "You are not in a clan.");
- goto("wait");
- }
- if(player.isClanLeader(player)) {
- msg.prefix(player, prefix_clan, "You have to set another leader first.");
- goto("wait");
- }
- clan_id = player.getClanId(player);
- clan.msg(clan_id, string.concat("§7", player.getName(player), "§r left the clan."));
- clan.removeMember(clan_id, player);
- player.setHeadName(player);
- goto("wait");
- }
- if(arg0 == "list") {
- table = table.new("§b", 2, 6, 4, 5);
- msg.string(player, table.getStart(table));
- msg.string(player, table.get(table, "§2ID", "§2Name", "§2Tag", "§2Members"));
- msg.string(player, table.getMiddle(table));
-
- list = clan.getIdList();
- iter = iterator(list);
- while(hasNext(iter)) {
- clan_id = next(iter);
- name = clan.getName(clan_id);
- tag = clan.getTag(clan_id);
- amount = clan.getMembersAmount(clan_id);
- msg.string(player, table.get(table, string.number(clan_id), name, tag, string.number(amount)));
- }
- msg.string(player, table.getEnd(table));
- goto("wait");
- }
- if(arg0 == "setspawn") {
- if(!player.isInClan(player)) {
- msg.prefix(player, prefix_clan, "You are not in a clan.");
- goto("wait");
- }
- if(!player.isClanLeader(player) && !player.isClanMod(player)) {
- msg.prefix(player, prefix_clan, "You have no permission for this.");
- goto("wait");
- }
- clan_id = player.getClanId(player);
- clan.setSpawn(clan_id, entity.getLocation(player));
- msg.prefix(player, prefix_clan, "New clan spawn set.");
- goto("wait");
- }
- if(arg0 == "spawn") {
- if(!player.isInClan(player)) {
- msg.prefix(player, prefix_clan, "You are not in a clan.");
- goto("wait");
- }
- clan_id = player.getClanId(player);
- spawn_loc = clan.getSpawn(clan_id);
- if(spawn_loc == null) {
- msg.prefix(player, prefix_clan, "No clan spawn set.");
- goto("wait");
- }
- if(!perm.has("isTeam", player)) {
- world_name = world.getName(loc.getWorld(entity.getLocation(player)));
- if(world.isGamesName(world_name)) {
- msg.prefix(player, prefix_commands, "You can´t teleport in this world.");
- goto("wait");
- }
- }
- player.teleport(player, spawn_loc, true);
- goto("wait");
- }
- goto("clanhelp");
- @remove_clan_invitation
- list.removeIndex(clan_invitations, 0);
- goto("wait");
- @color
- msg.string(player, string.getSpacer());
- msg.string(player, " §0&0 §1&1 §2&2 §3&3 §4&4 §5&5 §6&6 §7&7");
- msg.string(player, " §8&8 §9&9 §a&a §b&b §c&c §d&d §e&e §f&f");
- msg.string(player, " &l §l(bold)");
- msg.string(player, " &m §m(strikethrough)");
- msg.string(player, " &n §n(underline)");
- msg.string(player, " &o §o(italic)");
- goto("wait");
- @comeback
- if(player.isOnAdventure(player)) {
- msg.prefix(player, prefix_skill, "Comeback not allowed during adventure.");
- goto("wait");
- }
- amount = skill.getAmount(player, "skill.comeback");
- if(amount <= 0) {
- msg.prefix(player, prefix_skill, "You have not bought that skill.");
- goto("wait");
- }
- loc = player.getDeathLoc(player);
- if(loc == null) {
- msg.prefix(player, prefix_skill, "No death location found.");
- goto("wait");
- }
- new_amount = amount - 1;
- skill.setAmount(player, "skill.comeback", new_amount);
- msg.prefix(player, prefix_skill, string.concat("Used Comeback. New amount: ", string.number(new_amount)));
- entity.teleport(player, loc);
- player.resetDeathLoc(player);
- goto("wait");
- @setspawn
- if(size != 1) {
- @setspawnhelp
- msg.prefix(player, prefix_commands, "/setspawn ...");
- msg.string(player, "§6 - server");
- msg.string(player, "§6 - games");
- msg.string(player, "§6 - creative");
- goto("wait");
- }
- arg0 = string.toLowerCase(list.getIndex(args, 0));
- new_spawn = string.location(entity.getLocation(player));
- config = getServerConfig();
- if(arg0 == "games") {
- config.set(config, "gamesspawn", new_spawn);
- msg.prefix(player, prefix_commands, "New spawn for gaming world set.");
- } elseif(arg0 == "server") {
- config.set(config, "serverspawn", new_spawn);
- msg.prefix(player, prefix_commands, "New main Spawn set.");
- } elseif(arg0 == "creative") {
- config.set(config, "creativespawn", new_spawn);
- msg.prefix(player, prefix_commands, "New spawn for creative world set.");
- } else {
- goto("setspawnhelp");
- }
- config.saveAsync(config);
- goto("wait");
- @heal
- if(size > 1) {
- msg.prefix(player, prefix_commands, "/heal [player]");
- goto("wait");
- }
- if(size == 0) {
- p = player;
- } elseif(size == 1) {
- p_name = list.getIndex(args, 0);
- p = read.player(p_name);
- if(p == null) {
- msg.prefix(player, prefix_commands, "This player is not online.");
- goto("wait");
- }
- if(player != p) {
- msg.prefix(player, prefix_commands, string.concat(player.getName(p), " was healed."));
- }
- }
- living.heal(p, 50);
- player.setHunger(p, 20);
- player.setSaturation(p, 5);
- living.clearEffects(p);
- entity.setBurning(p, 0);
- msg.prefix(p, prefix_commands, "You have been healed.");
- goto("wait");
- @inv
- if(size == 0) {
- @invhelp
- msg.prefix(player, prefix_commands, "/inv ...");
- if(perm.has("inv.backups", player)) {
- msg.string(player, "§6 - backups <player> §rLists backup invs of a player");
- }
- if(perm.has("inv.ignore", player)) {
- msg.string(player, "§6 - ignore §rToggles inventory change on world change");
- }
- if(perm.has("inv.see", player)) {
- msg.string(player, "§6 - see <player> §rOpens an inventory of a player");
- }
- if(perm.has("inv.reload", player)) {
- msg.string(player, "§6 - reload <player> §rReloads an inventory of a player");
- }
- if(perm.has("inv.saveFor", player)) {
- msg.string(player, "§6 - saveFor <player> <world> §rSaves your inventory for a player");
- }
- if(perm.has("inv.loadFrom", player)) {
- msg.string(player, "§6 - loadFrom <player> <world> §rLoads an inventory of a player for you");
- }
- goto("wait");
- }
- arg0 = string.toLowerCase(list.getIndex(args, 0));
- if(arg0 == "backups") {
- if(!perm.has("inv.backups", player)) {
- perm.no("inv.backups", player);
- goto("wait");
- }
- if(size < 2) {
- msg.prefix(player, prefix_commands, "/inv backups <player>");
- goto("wait");
- }
- p_name = list.getIndex(args, 1);
- p_uuid = player.getUuid(p_name);
- if(p_uuid == null) {
- msg.prefix(player, prefix_commands, "This player has never been online.");
- goto("wait");
- }
- player_id = player.getId(p_uuid);
- dir = file.new(string.concat("scripts/configs/inv_data/backup/", player_id));
- if(!file.exists(dir)) {
- msg.prefix(player, prefix_commands, "No backups available.");
- goto("wait");
- }
- file_list = file.getList(dir);
- if(list.getSize(file_list) == 0) {
- msg.prefix(player, prefix_commands, "No backups available.");
- goto("wait");
- }
- f_map = map.new();
- table = table.new("§b", 3, 14);
- msg.string(player, table.getStart(table));
- msg.string(player, table.get(table, "#", p_name));
- msg.string(player, table.getMiddle(table));
- iter = iterator(file_list);
- while(hasNext(iter)) {
- f = next(iter);
- f_name = file.getName(f);
- split_array = string.split("_", f_name);
- time_array = string.split("-", split_array[2]);
- year = time_array[0];
- month = time.getStringFromNumber(read.number(time_array[1]));
- day = time.getStringFromNumber(read.number(time_array[2]));
- hour = time.getStringFromNumber(read.number(time_array[3]));
- minute = time.getStringFromNumber(read.number(time_array[4]));
- second = time.getStringFromNumber(read.number(time_array[5]));
- time_string = string.concat(day, ".", month, ".", year, " ", hour, ":", minute, ":", second);
- map.add(f_map, read.number(split_array[1]), time_string);
- }
- for(i = 1; i <= 10; i++) {
- time_string = map.get(f_map, i);
- msg.string(player, table.get(table, string.number(i), time_string));
- }
- msg.string(player, table.getEnd(table));
- goto("wait");
- }
- if(arg0 == "ignore") {
- if(!perm.has("inv.ignore", player)) {
- perm.no("inv.ignore", player);
- goto("wait");
- }
- ignore = player.hasInvIgnore(player);
- if(ignore == null) {
- ignore = false;
- }
- if(ignore) {
- msg.prefix(player, prefix_commands, "Your inventory will change on joining another world.");
- } else {
- msg.prefix(player, prefix_commands, "You´ll keep your inventory on joining another world.");
- }
- player.invIgnore(player, !ignore);
- goto("wait");
- }
- if(arg0 == "see") {
- if(!perm.has("inv.see", player)) {
- perm.no("inv.see", player);
- goto("wait");
- }
- if(size < 2) {
- msg.prefix(player, prefix_commands, "/inv see <player>");
- goto("wait");
- }
- p_name = list.getIndex(args, 1);
- p_uuid = player.getUuid(p_name);
- if(p_uuid == null) {
- msg.prefix(player, prefix_commands, "This player has never been online.");
- goto("wait");
- }
- p = read.player(p_name);
- if(p == null) {
- msg.prefix(player, prefix_commands, "This player is not online.");
- goto("wait");
- }
- inv.show(p, player);
- goto("wait");
- }
- if(arg0 == "reload") {
- if(!perm.has("inv.reload", player)) {
- perm.no("inv.reload", player);
- goto("wait");
- }
- if(size < 2) {
- msg.prefix(player, prefix_commands, "/inv reload <player>");
- goto("wait");
- }
- p_name = list.getIndex(args, 1);
- p_uuid = player.getUuid(p_name);
- if(p_uuid == null) {
- msg.prefix(player, prefix_commands, "This player has never been online.");
- goto("wait");
- }
- p = read.player(p_name);
- if(p == null) {
- msg.prefix(player, prefix_commands, "This player is not online.");
- goto("wait");
- }
- world = loc.getWorld(entity.getLocation(p));
- inv.loadFromPlayer(p, p, world);
- msg.prefix(player, prefix_commands, "Inventory reloaded.");
- goto("wait");
- }
- if(arg0 == "savefor") {
- if(size != 1 && size != 3) {
- msg.prefix(player, prefix_commands, "/inv saveFor <player> <world>");
- goto("wait");
- }
- if(size == 1) {
- for_player_or_id = player.getId(player);
- world = loc.getWorld(entity.getLocation(player));
- }
- if(size == 3) {
- if(!perm.has("inv.saveFor", player)) {
- perm.no("inv.saveFor", player);
- goto("wait");
- }
- p_name = list.getIndex(args, 1);
- p_uuid = player.getUuid(p_name);
- if(p_uuid == null) {
- msg.prefix(player, prefix_commands, "This player has never been online.");
- goto("wait");
- }
- p = read.player(p_name);
- if(p != null) {
- msg.prefix(player, prefix_commands, "This player is online. Use /inv see to change this inventory.");
- goto("wait");
- }
- for_player_or_id = player.getId(p_uuid);
- world_name = list.getIndex(args, 2);
- world = world.get(world_name);
- if(world == null) {
- msg.prefix(player, prefix_world, "This world is not loaded.");
- goto("wait");
- }
- }
- inv.saveForPlayer(player, for_player_or_id, world);
- msg.prefix(player, prefix_commands, "Inventory saved.");
- goto("wait");
- }
- if(arg0 == "loadfrom") {
- if(size != 1 && size != 3) {
- msg.prefix(player, prefix_commands, "/inv loadFrom <player> <world>");
- goto("wait");
- }
- if(size == 1) {
- from_player_or_id = player.getId(player);
- world = loc.getWorld(entity.getLocation(player));
- }
- if(size == 3) {
- if(!perm.has("inv.loadFrom", player)) {
- perm.no("inv.loadFrom", player);
- goto("wait");
- }
- p_name = list.getIndex(args, 1);
- p_uuid = player.getUuid(p_name);
- if(p_uuid == null) {
- msg.prefix(player, prefix_commands, "This player has never been online.");
- goto("wait");
- }
- p = read.player(p_name);
- if(p != null) {
- msg.prefix(player, prefix_commands, "§cThis player is online. Loaded inventory can differ from /inv see!");
- }
- from_player_or_id = player.getId(p_uuid);
- world_name = list.getIndex(args, 2);
- world = world.get(world_name);
- if(world == null) {
- msg.prefix(player, prefix_world, "This world is not loaded.");
- goto("wait");
- }
- }
- inv.loadFromPlayer(player, from_player_or_id, world);
- msg.prefix(player, prefix_commands, "Inventory loaded.");
- goto("wait");
- }
- goto("wait");
- @sponsor
- msg.prefix(sender, prefix_commands, "Be a fancy sponsor and ...");
- msg.string(sender, string.concat(" §a+ §cUse §dcolors §rand §bicons§r", icon.getGoldCoin(), icon.getCraftingTable(), icon.getHeart()));
- msg.string(sender, " §a+ §rEquip your head with §b/hat");
- msg.string(sender, " §a+ §rGet all online players in a party with §b/joinme");
- msg.string(sender, " §a+ §rSet your own §bjoin, leave §rand §bdeath message");
- goto("wait");
- @dev
- if(size == 0) {
- @dev_syntax
- msg.prefix(sender, prefix_commands, "/dev ...");
- msg.string(sender, "§6 - boost §rBoosts you up to the clouds");
- msg.string(sender, "§6 - debug <list/clear> §rManages logged debug messages");
- msg.string(sender, "§6 - entities <world> §rLists all entities in a world");
- msg.string(sender, "§6 - logo §rGives the Mundus Crassus logo on a banner");
- msg.string(sender, "§6 - yeet §rThrows you in sight");
- goto("wait");
- }
- arg0 = string.toLowerCase(list.getIndex(args, 0));
- if(arg0 == "logo") {
- player.giveItem(player, logo);
- goto("wait");
- }
- if(arg0 == "boost") {
- entity.setMotion(player, 0, 5, 0);
- goto("wait");
- }
- if(arg0 == "yeet") {
- if(size != 2){
- msg.prefix(player, prefix_commands, "/dev yeet <strength>");
- goto("wait");
- }
- yeet_strength = list.getIndex(args, 1);
- yeet(player,math.abs(yeet_strength));
- msg.string(player, "§4YEET");
- goto("wait");
- }
- if(arg0 == "debug") {
- arg1 = string.toLowerCase(list.getIndex(args, 1));
- if(arg1 == "list") {
- error_size = debug.getSize();
- if(error_size == 0) {
- msg.prefix(player, prefix_commands, "No debugs logged.");
- goto("wait");
- }
- for(i = 0; i < error_size; i++) {
- msg.string(player, debug.getIndex(i));
- }
- goto("wait");
- }
- if(arg1 == "clear") {
- debug.clear();
- msg.prefix(player, prefix_commands, "All logged debugs deleted.");
- goto("wait");
- }
- goto("wait");
- }
- if(arg0 == "entities") {
- if(size != 2) {
- msg.prefix(player, prefix_commands, "/dev entities <world>");
- goto("wait");
- }
- world_name = string.toLowerCase(list.getIndex(args, 1));
- world = world.get(world_name);
- if(world == null) {
- msg.prefix(player, prefix_world, "This world is not loaded.");
- goto("wait");
- }
- list = world.getEntities(world);
- size = list.getSize(list);
- map = map.new();
- living = 0;
- for(i = 0; i < size; i++) {
- element = list.getIndex(list, i);
- if(isLiving(element)) {
- living++;
- entity_type = entity.getType(element);
- n = map.get(map, entity_type);
- if(n == null) {
- map.add(map, entity_type, 1);
- } else {
- map.add(map, entity_type, n + 1);
- }
- }
- }
- msg.string(player, "§0-------------------------------------------------");
- msg.string(player, string.concat("Living: ", living));
- iter = map.iterator(map);
- table = table.new("§b", 14, 14);
- msg.string(player, table.getStart(table));
- while(hasNext(iter)) {
- element1 = next(iter);
- if(hasNext(iter)) {
- element2 = next(iter);
- } else {
- element2 = "";
- }
- msg.string(player, table.get(table, element1, element2));
- }
- msg.string(player, table.getEnd(table));
- goto("wait");
- }
- goto("dev_syntax");
- function yeet(player, strength){
- array = entity.getLook(player);
- x = array[0] * (math.log(strength) + 1);
- y = math.abs(array[1]) * (math.log(strength) + 1);
- z = array[2] * (math.log(strength) + 1);
- entity.setMotion(player, x, y, z);
- }
- @memory
- msg.prefix(sender, prefix_commands, string.concat("Used RAM: ", string.number(usedMemory()), " / ", string.number(math.round(allocatedMemory())), " MB"));
- goto("wait");
- @world
- if(size == 0) {
- @world_syntax
- msg.prefix(sender, prefix_world, "/world ...");
- msg.string(sender, "§b - info [world] §rShows info about a world");
- msg.string(sender, "§b - tp <world> [player] §rTeleports a player to a world");
- msg.string(sender, "§b - list §rShows all loaded worlds");
- msg.string(sender, "§b - setspawn §rSets the spawn of a world");
- msg.string(sender, "§b - diffi <world> <diffi> §rSets the difficulty of a world");
- goto("wait");
- }
- arg0 = string.toLowerCase(list.getIndex(args, 0));
- if(arg0 == "info") {
- if(size == 1) {
- if(!isPlayer(sender)) {
- msg.string(sender, "Not possible on console.");
- goto("wait");
- }
- world = loc.getWorld(entity.getLocation(player));
- } else {
- worldname = list.getIndex(args, 1);
- world = world.get(worldname);
- if(world == null) {
- msg.prefix(sender, prefix_world, "This world is not loaded.");
- goto("wait");
- }
- }
- msg.string(sender, string.getSpacer());
- msg.string(sender, string.concat("§6World: §r", world.getName(world)));
- msg.string(sender, string.concat("§6Thunder: §r", world.hasThunder(world)));
- msg.string(sender, string.concat("§6Rain: §r", world.hasRain(world)));
- chunks = world.getLoadedChunks(world);
- forced = 0;
- for(i = 0; i < array.getSize(chunks); i++) {
- if(world.isForceLoadedChunk(chunks[i])) {
- forced++;
- }
- }
- msg.string(sender, string.concat("§6Chunks: §r", string.number(forced), "/", string.number(array.getSize(chunks))));
- time = world.getTime(world);
- while(time >= 24000) {
- time -= 24000;
- }
- msg.string(sender, string.concat("§6Time: §r", string.number(time)));
- goto("wait");
- }
- if(arg0 == "tp") {
- if(size < 2 || size > 3) {
- msg.prefix(sender, prefix_world, "/world tp <world> [player]");
- goto("wait");
- }
- if(size >= 2) {
- world_name = string.toLowerCase(list.getIndex(args, 1));
- world = world.get(world_name);
- if(world == null) {
- msg.prefix(sender, prefix_world, "This world is not loaded.");
- goto("wait");
- }
- }
- if(size > 2) {
- p_name = list.getIndex(args, 2);
- p = read.player(p_name);
- if(p == null) {
- msg.prefix(sender, prefix_world, "This player is not online.");
- goto("wait");
- }
- } else {
- if(!isPlayer(sender)) {
- msg.string(sender, "Not possible on console.");
- goto("wait");
- }
- p = sender;
- }
- if(!player.canTeleport(p)) {
- if(size == 3) {
- msg.prefix(sender, prefix_commands, "This player can´t be teleported now.");
- goto("wait");
- }
- msg.prefix(sender, prefix_commands, "You can´t teleport now.");
- goto("wait");
- }
- if(sender != p) {
- msg.prefix(sender, prefix_world, string.concat(player.getName(p), " was teleported to the spawn of the world ", world_name, "."));
- }
- if(world_name == "games") {
- loc = world.getGamesSpawn();
- } elseif(world_name == "creative") {
- loc = world.getCreativeSpawn();
- } else {
- loc = world.getSpawn(world);
- }
- player.teleport(p, loc, true);
- goto("wait");
- }
- if(arg0 == "list") {
- msg.prefix(sender, prefix_world, "Loaded worlds:");
- worldlist = world.getAll();
- for(i = 0; i < list.getSize(worldlist); i++) {
- msg.string(sender, string.concat(" - ", world.getName(list.getIndex(worldlist, i))));
- }
- msg.string(sender, string.getSpacer());
- goto("wait");
- }
- if(arg0 == "setspawn") {
- if(!isPlayer(sender)) {
- msg.string(sender, "Not possible on console.");
- goto("wait");
- }
- location = entity.getLocation(sender);
- world = loc.getWorld(location);
- world.setSpawn(location, world);
- msg.prefix(sender, prefix_world, string.concat("New spawn of the world ", world.getName(world), " set."));
- goto("wait");
- }
- if(arg0 == "diffi") {
- if(size != 3) {
- msg.prefix(sender, prefix_world, "/world diffi <world> <diffi>");
- goto("wait");
- }
- worldname = list.getIndex(args, 1);
- world = world.get(worldname);
- if(world == null) {
- msg.prefix(sender, prefix_world, "This world is not loaded.");
- goto("wait");
- }
- diffi_string = list.getIndex(args, 2);
- if(!(diffi_string == "PEACEFUL" || diffi_string == "EASY" || diffi_string == "NORMAL" || diffi_string == "HARD")) {
- msg.prefix(sender, prefix_world, "False input.");
- goto("wait");
- }
- world.setDifficulty(world, diffi_string);
- msg.prefix(sender, prefix_world, "Difficulty changed.");
- goto("wait");
- }
- goto("world_syntax");
- @giveup
- script_id = quest.getFromPlayer(player);
- if(script_id == null) {
- msg.prefix(player, prefix_quest, "You are not in a quest.");
- goto("wait");
- }
- script = script.getFromId(script_id);
- if(script == null) {
- msg.dev("Player used giveup on corrupt quest");
- quest.removePlayer(player); //in case of corrupt quest
- msg.prefix(player, prefix_quest, "You have no quest.");
- goto("wait");
- }
- setScriptVar("player", player);
- modTimer.scriptCallEvent("quest_term", script);
- quest.term(script, player);
- msg.prefix(player, prefix_quest, "Quest termed.");
- goto("wait");
- @leave
- set = player.getMinigameIds(player);
- iter = iterator(set);
- if(hasNext(iter)) {
- script_id = next(iter);
- script = script.getFromId(script_id);
- if(script == null) {
- msg.dev(string.concat("Player left game without existing gamescript ", set));
- msg.prefix(player, prefix_commands, "An error occured and some displays may not have been reset. So please panic and call for an admin! No, please don´t do that.");
- player.resetMinigames(player);
- entity.teleport(player, world.getGamesSpawn());
- goto("wait");
- }
- minigame.hub(script, player);
- goto("wait");
- }
- msg.prefix(player, "§dScript", "You are not in a minigame.");
- goto("wait");
- function minigame.hub(script, player) {
- script.setVar(script, "player", player);
- modTimer.scriptCallEvent("player_giveup", script);
- }
- @jail
- if(size != 1) {
- msg.prefix(player, prefix_commands, "/jail <player>");
- } else {
- p_name = list.getIndex(args, 0);
- if(!checkIfEverOnline(p_name)) {
- msg.prefix(player, prefix_jail, "This player has never been online.");
- goto("wait");
- }
- p_uuid = player.getUuid(p_name);
- if(isJailed(p_uuid)) {
- msg.prefix(player, prefix_jail, "This player is already jailed.");
- goto("wait");
- }
- player_name = player.getName(player);
- if(player_name == p_name) {
- msg.prefix(player, prefix_jail, "Self-Jailing isn´t a good idea.");
- goto("wait");
- }
- if(!isOnline(p_name)) {
- msg.prefix(player, prefix_jail, "This player is not online.");
- goto("wait");
- }
- p = read.player(p_name);
- if(perm.has("jail", p)) {
- msg.prefix(player, prefix_jail, "You can´t jail this player.");
- goto("wait");
- }
- list.add(jailed_list, p_uuid);
- msg.prefix(player, prefix_jail, string.concat(p_name, " wurde gejailt"));
- showJail(p_name);
- if(!jail_loop_active) {
- sgoto(5, "jailloop");
- }
- }
- goto("wait");
- @unjail
- if(size != 1) {
- msg.prefix(player, prefix_commands, "/unjail <player>");
- } else {
- p_name = list.getIndex(args, 0);
- if(!checkIfEverOnline(p_name)) {
- msg.prefix(player, prefix_jail, "This player has never been online.");
- goto("wait");
- }
- p_uuid = player.getUuid(p_name);
- if(!isJailed(p_uuid)) {
- msg.prefix(player, prefix_jail, "This player is not jailed.");
- goto("wait");
- }
- list.remove(jailed_list, p_uuid);
- msg.prefix(player, prefix_jail, "You freed this player from jail.");
- }
- goto("wait");
- function inv.show(from_player, to_player) {
- player_inv = player.getInv(from_player);
- inv = inv.new("222222222222222222222222222222222222222222222", text.new(string.concat("Inventory of ", player.getName(from_player))));
- set.add($invseeids, inv.getId(inv));
- setInvItem(inv, 0, living.getEquip(from_player, read.slot("HEAD")));
- setInvItem(inv, 1, living.getEquip(from_player, read.slot("CHEST")));
- setInvItem(inv, 2, living.getEquip(from_player, read.slot("LEGS")));
- setInvItem(inv, 3, living.getEquip(from_player, read.slot("FEET")));
- setInvItem(inv, 4, living.getOffHand(from_player));
- for(slot = 0; slot <= 8; slot++) {
- setInvItem(inv, slot + 36, inv.getItem(player_inv, slot));
- }
- for(slot = 9; slot <= 35; slot++) {
- setInvItem(inv, slot, inv.getItem(player_inv, slot));
- }
- inv.open(inv, to_player);
- }
- function setInvItem(inv, slot, item) {
- if(item == null || item.isAir(item)) {
- return;
- }
- inv.setItem(inv, slot, item);
- }
- function rank.add(index, tech_rank, chat_rank) {
- $rank_array[index, 0] = tech_rank;
- $rank_array[index, 1] = chat_rank;
- }
- //--------------------------------------------------
- //Vote-Utils
- //--------------------------------------------------
- function vote.register(name, time) {
- uuid = player.getUuid(name);
- if(uuid == null) {
- stmt = databank.prepare("INSERT INTO votes (name, time) VALUES(?,?);");
- databank.setString(stmt, 1, name);
- databank.setLong(stmt, 2, time);
- databank.workerExecute(stmt);
- return;
- }
- stmt = databank.prepare("INSERT INTO votes (name, player_id, time) VALUES(?,?,?);");
- id = player.getId(uuid);
- databank.setString(stmt, 1, name);
- databank.setInt(stmt, 2, id);
- databank.setLong(stmt, 3, time);
- databank.workerExecute(stmt);
- }
- //--------------------------------------------------
- //LoginRequests-Utils
- //--------------------------------------------------
- function loginrequests.getPlayer(player_id, amount, result) {
- list = list.new();
- if(result == null) {
- stmt = databank.prepare("SELECT player_id,time,result FROM login_requests WHERE player_id = ? ORDER BY TIME DESC LIMIT ?;");
- databank.setInt(stmt, 1, player_id);
- databank.setInt(stmt, 2, amount);
- } else {
- stmt = databank.prepare("SELECT player_id,time,result FROM login_requests WHERE player_id = ? AND result = ? ORDER BY TIME DESC LIMIT ?;");
- databank.setInt(stmt, 1, player_id);
- databank.setString(stmt, 2, result);
- databank.setInt(stmt, 3, amount);
- }
- result = databank.execute(stmt);
- while(databank.next(result)) {
- a = array.new(3);
- a[0] = databank.getInt(result, 1); //player_id
- a[1] = databank.getLong(result, 2); //time
- a[2] = databank.getString(result, 3); //result
- list.add(list, a);
- }
- databank.close(stmt);
- databank.close(result);
- return list;
- }
- function loginrequests.getAll(amount, result) {
- list = list.new();
- if(result == null) {
- stmt = databank.prepare("SELECT player_id,time,result FROM login_requests ORDER BY TIME DESC LIMIT ?;");
- databank.setInt(stmt, 1, amount);
- } else {
- stmt = databank.prepare("SELECT player_id,time,result FROM login_requests WHERE result = ? ORDER BY TIME DESC LIMIT ?;");
- databank.setString(stmt, 1, result);
- databank.setInt(stmt, 2, amount);
- }
-
- result = databank.execute(stmt);
- while(databank.next(result)) {
- a = array.new(3);
- a[0] = databank.getInt(result, 1); //player_id
- a[1] = databank.getLong(result, 2); //time
- a[2] = databank.getString(result, 3); //result
- list.add(list, a);
- }
- databank.close(stmt);
- databank.close(result);
- return list;
- }
- //--------------------------------------------------
- //Tip-Utils
- //--------------------------------------------------
- function tip.setLoop(tipp_key, boolean) {
- stmt = databank.prepare("UPDATE tipps SET tipp_loop = ? WHERE tipp_key = ?;");
- databank.setBool(stmt, 1, boolean);
- databank.setString(stmt, 2, tipp_key);
- databank.workerExecute(stmt);
- }
- function tip.remove(tipp_key) {
- stmt = databank.prepare("DELETE FROM tipps WHERE tipp_key = ?;");
- databank.setString(stmt, 1, tipp_key);
- databank.workerExecute(stmt);
- }
- function tip.getAll() {
- list = list.new();
- stmt = databank.prepare("SELECT * FROM tipps;");
- result = databank.execute(stmt);
- while(databank.next(result)) {
- a = array.new(3);
- a[0] = databank.getString(result, 1);
- a[1] = databank.getString(result, 2);
- a[2] = databank.getBool(result, 3);
- list.add(list, a);
- }
- databank.close(stmt);
- databank.close(result);
- return list;
- }
- //--------------------------------------------------
- //Databank-Utils
- //--------------------------------------------------
- function databank.isExistingTable(table) {
- temp = false;
- stmt = databank.prepare("SHOW TABLES");
- result = databank.execute(stmt);
- while(databank.next(result)) {
- if(table == databank.getString(result, 1)) {
- temp = true;
- break;
- }
- }
- databank.close(result);
- databank.close(stmt);
- return temp;
- }
- function databank.getTableFields(table) {
- fields = list.new();
- stmt = databank.prepare(string.concat("SHOW FIELDS FROM ", table));
- result = databank.execute(stmt);
- while(databank.next(result)) {
- list.add(fields, databank.getString(result, 1));
- }
- databank.close(result);
- databank.close(stmt);
- return fields;
- }
- function databank.getTableDatatypes(table) {
- stmt = databank.prepare(string.concat("SHOW CREATE TABLE ", table));
- result = databank.execute(stmt);
- if(databank.next(result)) {
- temp = databank.getString(result, 2);
- }
- databank.close(result);
- databank.close(stmt);
- return temp;
- }
- //--------------------------------------------------
- //Tipp-Utils
- //--------------------------------------------------
- function tipp.register(tipp_key, tipp_value) {
- stmt = databank.prepare("INSERT INTO tipps (tipp_key, tipp_value) VALUES (?,?) ON DUPLICATE KEY UPDATE tipp_value = ?");
- databank.setString(stmt, 1, tipp_key);
- databank.setString(stmt, 2, tipp_value);
- databank.setString(stmt, 3, tipp_value);
- databank.workerExecute(stmt);
- }
- function tipp.get(tipp_key) {
- tipp_value = null;
- stmt = databank.prepare("SELECT tipp_value FROM tipps WHERE tipp_key = ?;");
- databank.setString(stmt, 1, tipp_key);
- result = databank.execute(stmt);
- if(databank.next(result)) {
- tipp_value = databank.getString(result, 1);
- }
- databank.close(result);
- databank.close(stmt);
- return tipp_value;
- }
- function tipp.exists(tipp_key) {
- stmt = databank.prepare("SELECT tipp_key FROM tipps WHERE tipp_key = ?;");
- databank.setString(stmt, 1, tipp_key);
- result = databank.execute(stmt);
- temp = false;
- if(databank.next(result)) {
- temp = true;
- }
- databank.close(result);
- databank.close(stmt);
- return temp;
- }
- //--------------------------------------------------
- //Warp-Utils
- //--------------------------------------------------
- function warp.create(warp_name, location) {
- config = config.new(string.concat("scripts/configs/warps"), warp_name);
- config.set(config, "world", world.getName(loc.getWorld(location)));
- config.set(config, "x", loc.getX(location));
- config.set(config, "y", loc.getY(location));
- config.set(config, "z", loc.getZ(location));
- config.set(config, "yaw", loc.getYaw(location));
- config.set(config, "pitch", loc.getPitch(location));
- config.saveAsync(config);
- }
- function warp.exists(warp_name) {
- config = config.new(string.concat("scripts/configs/warps"), warp_name);
- return config.exists(config);
- }
- function warp.get(warp_name) {
- config = config.new(string.concat("scripts/configs/warps"), warp_name);
- if(config.exists(config)) {
- config.load(config);
- }
- world_name = config.getString(config, "world", "null");
- if(world_name == "null") {
- return null;
- }
- world = world.get(world_name);
- x = config.getDouble(config, "x", 0);
- y = config.getDouble(config, "y", 100);
- z = config.getDouble(config, "z", 0);
- yaw = config.getDouble(config, "yaw", 0);
- pitch = config.getDouble(config, "pitch", 0);
- return loc.new(world, x, y, z, yaw, pitch);
- }
- function warp.delete(warp_name) {
- config = config.new(string.concat("scripts/configs/warps"), warp_name);
- if(!config.exists(config)) {
- return false;
- }
- config.delete(config);
- return true;
- }
- function warp.getList() {
- dir = file.new(string.concat("scripts/configs/warps"));
- warps_list = list.new();
- if(file.exists(dir)) {
- file_list = file.getList(dir);
- iter = iterator(file_list);
- while(hasNext(iter)) {
- warp = file.getName(next(iter));
- warp = string.replace(warp, ".snuvic", "");
- list.add(warps_list, warp);
- }
- }
- return warps_list;
- }
- //--------------------------------------------------
- //Home-Utils
- //--------------------------------------------------
- function home.set(player_id, home_name, location) {
- stmt = databank.prepare("INSERT INTO new_homes (player_id, name, world_name, x, y, z, yaw, pitch) VALUES (?,?,?,?,?,?,?,?);");
- databank.setInt(stmt, 1, player_id);
- databank.setString(stmt, 2, home_name);
- databank.setString(stmt, 3, world.getName(loc.getWorld(location)));
- databank.setInt(stmt, 4, loc.getX(location));
- databank.setInt(stmt, 5, loc.getY(location));
- databank.setInt(stmt, 6, loc.getZ(location));
- databank.setInt(stmt, 7, loc.getYaw(location));
- databank.setInt(stmt, 8, loc.getPitch(location));
- databank.workerExecute(stmt);
- }
- function home.delete(player_id, home_name) {
- stmt = databank.prepare("DELETE FROM new_homes WHERE player_id = ? AND name = ?;");
- databank.setInt(stmt, 1, player_id);
- databank.setString(stmt, 2, home_name);
- databank.workerExecute(stmt);
- }
- function home.getLocation(player_id, home_name) {
- stmt = databank.prepare("SELECT world_name, x, y, z, yaw, pitch FROM new_homes WHERE player_id = ? AND name = ?;");
- databank.setInt(stmt, 1, player_id);
- databank.setString(stmt, 2, home_name);
- result = databank.execute(stmt);
- if(databank.next(result)) {
- world = world.get(databank.getString(result, 1));
- if(world == null) {
- return null;
- }
- x = databank.getDouble(result, 2);
- y = databank.getDouble(result, 3);
- z = databank.getDouble(result, 4);
- yaw = databank.getDouble(result, 5);
- pitch = databank.getDouble(result, 6);
- location = loc.new(world, x, y, z, yaw, pitch);
- }
- databank.close(result);
- databank.close(stmt);
- return location;
- }
- function home.exists(player_id, home_name) {
- stmt = databank.prepare("SELECT player_id FROM new_homes WHERE player_id = ? AND name = ?;");
- databank.setInt(stmt, 1, player_id);
- databank.setString(stmt, 2, home_name);
- result = databank.execute(stmt);
- if(databank.next(result)) {
- temp = true;
- } else {
- temp = false;
- }
- databank.close(result);
- databank.close(stmt);
- return temp;
- }
- function home.getList(player_id) {
- homes_list = list.new();
- stmt = databank.prepare("SELECT name FROM new_homes WHERE player_id = ?;");
- databank.setInt(stmt, 1, player_id);
- result = databank.execute(stmt);
- while(databank.next(result)) {
- list.add(homes_list, databank.getString(result, 1));
- }
- databank.close(result);
- databank.close(stmt);
- return homes_list;
- }
- function hasTpaRequest(player_uuid, aim_uuid) {
- for(i = 0; i < list.getSize($tpa_request); i++) {
- array = list.getIndex($tpa_request, i);
- if(array[0] == player_uuid && array[1] == aim_uuid) {
- list.removeIndex($tpa_request, i);
- return true;
- }
- }
- return false;
- }
- function addTpaRequest(player_uuid, aim_uuid) {
- array = array.new(2);
- array[0] = player_uuid;
- array[1] = aim_uuid;
- list.add($tpa_request, array);
- }
- function showJail(player_name) {
- if(isOnline(player_name)) {
- inv.open($jailmenu, read.player(player_name));
- }
- }
- function isJailed(player_uuid) {
- return(list.contains($jailed_list, player_uuid));
- }
- function command.register(command, description) {
- command.add(command);
- list.add($command_list, command);
- map.add($command_map, command, description);
- }
- function command.registerAlias(alias, command) {
- command.add(alias);
- map.add($alias_map, alias, command);
- }
- //--------------------------------------------------
- //Time-Utils
- //--------------------------------------------------
- //Spielzeit aller Online-Spieler
- function playtime.getTotalOnlineMinutes() {
- minutes = 0;
- iter = iterator(players.toList());
- while(hasNext(iter)) {
- minutes += playtime.getPlayerOnlineMinutes(player.getId(next(iter)));
- }
- return minutes;
- }
- //Spielzeit in einem Zeitraum exkl. der Spielzeit der Online-Spieler
- function playtime.getInterval(from_cal, to_cal) {
- stmt = databank.prepare("SELECT SUM(leave_time - join_time) FROM playtime WHERE join_time > ? AND join_time < ?;");
- databank.setLong(stmt, 1, time.from(from_cal));
- databank.setLong(stmt, 2, time.from(to_cal));
- result = databank.execute(stmt);
- if(databank.next(result)) {
- minutes = databank.getLong(result, 1) / 1000 / 60;
- } else {
- minutes = 0;
- }
- databank.close(result);
- databank.close(stmt);
- return minutes;
- }
- //Gesamte Spielzeit inkl. der Spielzeit der Online-Spieler
- function playtime.getTotal() {
- minutes = playtime.getTotalOnlineMinutes();
- stmt = databank.prepare("SELECT SUM(leave_time - join_time) FROM playtime;");
- result = databank.execute(stmt);
- if(databank.next(result)) {
- minutes += databank.getLong(result, 1) / 1000 / 60;
- }
- databank.close(result);
- databank.close(stmt);
- return minutes;
- }
- //Spielzeit eines Spielers in einem Zeitraum exkl. der Online-Spielzeit
- function playtime.getPlayerInterval(player_id, from_cal, to_cal) {
- stmt = databank.prepare("SELECT SUM(leave_time - join_time) FROM playtime WHERE player_id = ? AND join_time > ? AND join_time < ?;");
- databank.setInt(stmt, 1, player_id);
- databank.setLong(stmt, 2, time.from(from_cal));
- databank.setLong(stmt, 3, time.from(to_cal));
- result = databank.execute(stmt);
- if(databank.next(result)) {
- minutes = databank.getLong(result, 1) / 1000 / 60;
- } else {
- minutes = 0;
- }
- databank.close(result);
- databank.close(stmt);
- return minutes;
- }
- function playtime.getPlayersPerInterval(from_cal, to_cal) {
- set = set.new();
- stmt = databank.prepare("SELECT player_id FROM playtime WHERE join_time > ? AND join_time < ?;");
- databank.setLong(stmt, 1, time.from(from_cal));
- databank.setLong(stmt, 2, time.from(to_cal));
- result = databank.execute(stmt);
- while(databank.next(result)) {
- set.add(set, databank.getInt(result, 1));
- }
- databank.close(result);
- databank.close(stmt);
- return set.getSize(set);
- }
- function time.getYearDays(year) {
- days = 365;
- if(year % 4 == 0) {
- days++;
- }
- return days;
- }
- function time.getMonthDays(month, year) {
- days = month.getDays(month);
- //Schaltjahre
- if(month == 2 && year % 4 == 0) {
- days++;
- }
- return days;
- }
- function month.register(month_index, shortname, days) {
- $month_array[month_index, 0] = shortname;
- $month_array[month_index, 1] = days;
- }
- function month.getShortName(month) {
- return $month_array[month - 1, 0];
- }
- function month.getDays(month) {
- return $month_array[month - 1, 1];
- }
- //--------------------------------------------------
- //Player-Utils
- //--------------------------------------------------
- function player.hasClanInvitation(player_or_id, clan_id) {
- if(isPlayer(player_or_id)) {
- player_id = player.getId(player_or_id);
- } else {
- player_id = player_or_id;
- }
- iter = iterator($clan_invitations);
- while(hasNext(iter)) {
- invitation = next(iter);
- p_id = invitation[0];
- c_id = invitation[1];
- if(player_id == p_id && clan_id == c_id) {
- return true;
- }
- }
- return false;
- }
- function player.addClanInvitation(player_id, clan_id) {
- invitation = array.new(2);
- invitation[0] = player_id;
- invitation[1] = clan_id;
- list.add($clan_invitations, invitation);
- }
- //--------------------------------------------------
- //Party-Utils
- //--------------------------------------------------
- function party.invitePlayer(inviter, invitee) {
- //Wenn bereits ein Party besteht, diese Party-ID verwenden.
- //Ansonsten überprüfen, ob der Einlader bereits andere Spieler eingeladen hat. Dann diese Party-ID verwenden.
- //Ansonsten neue Party-ID vergeben.
- inviter_uuid = player.getUuid(inviter);
- if(player.isInParty(inviter)) {
- party_id = player.getPartyId(inviter);
- } else {
- party_id = map.get($party_invite_ids, inviter_uuid);
- if(party_id == null) {
- party_id = ++$party_counter;
- }
- }
- if(invitee == null) {
- return "inviteeNotOnline";
- }
- if(inviter == invitee) {
- return "inviterEqualsInvitee";
- }
- if(player.isInParty(inviter)) {
- if(!player.isPartyLeaderOrMod(inviter)) {
- return "inviterNotPermitted";
- }
- }
- if(player.isInParty(invitee)) {
- return "inviteeAlreadyInParty";
- }
- invitee_uuid = player.getUuid(invitee);
- list = map.get($party_invitations, invitee_uuid);
- if(list == null) {
- list = list.new();
- map.add($party_invitations, invitee_uuid, list);
- }
- if(list.contains(list, inviter_uuid)) {
- return "inviteeAlreadyInvited";
- }
- list.add(list, inviter_uuid);
- list.add($deluuid, inviter_uuid);
- list.add($delkeytime, time.getMillis());
- list = map.get($delkeytimes, invitee_uuid);
- if(list == null) {
- list = list.new();
- map.add($delkeytimes, invitee_uuid, list);
- }
- list.add(list, time.getMillis());
- map.add($party_invite_ids, inviter_uuid, party_id);
- inviter_name = player.getName(inviter);
- msg.prefix(invitee, $prefix_party, string.concat(inviter_name, " invites you to a party."));
- msg(invitee, text.merge(text.new(" §5=> §rAccept ? "), string.getClickText("[§aYes§r] ", string.concat("/party accept ", inviter_name)), string.getClickText("[§cNo§r]", string.concat("/party deny ", inviter_name))));
- sgoto(200, "deletePartyInvitation"); //Einladung bleibt 1 Minute lang erhalten
- return true;
- }
- function party.kickPlayer(player, reason) {
- party_id = player.getPartyId(player);
- //Nachrichten
- player_name = player.getName(player);
- if(reason == "kick") {
- message = string.concat("§r", player_name, " has been kicked out of the party.");
- } else {
- message = string.concat("§r", player_name, " has left the party.");
- }
- party.sendMessage(party_id, message);
- player_uuid = player.getUuid(player_name);
- //aus Partyliste entfernen
- party_list = party.getList(party_id);
- list.remove(party_list, player_uuid);
- //ID und Rang entfernen
- rank = player.getPartyRank(player);
- player.delPartyRank(player);
- player.delPartyId(player);
- //Einladungen löschen
- map.remove($party_invitations, player_uuid);
- map.remove($delkeytimes, player_uuid);
- //Wenn Party keine zwei Spieler mehr hat, dann Party auflösen
- if(list.getSize(party_list) < 2) {
- party.delete(party_id);
- return;
- }
- //Wenn Spieler Partyleiter war, neuen Partyleiter ernennen
- if(rank == "Leader") {
- new_player = player.get(list.getIndex(party_list, 0));
- player.setPartyRank(new_player, "Leader");
- party.sendMessage(party_id, string.concat("§r", player.getName(new_player), " is now Leader."));
- }
- }
- function party.sendMessage(party_id, message) {
- iter = iterator(party.getList(party_id));
- while(hasNext(iter)) {
- msg.prefix(player.get(next(iter)), $prefix_party, message);
- }
- }
- function party.delete(party_id) {
- party.sendMessage(party_id, "Party disbanded.");
- iter = iterator(party.getList(party_id));
- while(hasNext(iter)) {
- player = player.get(next(iter));
- player.delPartyRank(player);
- player.delPartyId(player);
- }
- }
- @deletePartyInvitation
- player_uuid = list.getIndex(deluuid, 0);
- invitations = map.get(party_invitations, player_uuid);
- keytimes = map.get(delkeytimes, player_uuid);
- if(invitations != null) {
- if(list.getSize(invitations) != 0) {
- keytime = list.getIndex(delkeytime, 0);
- keytime2 = list.getIndex(keytimes, 0);
- list.remove(delkeytime, keytime);
- if(keytime == keytime2) {
- index = list.getIndexOf(keytimes, keytime2);
- list.remove(keytimes, keytime2);
- list.removeIndex(invitations, index);
- }
- }
- }
- goto("wait");
- //--------------------------------------------------
- //Plot-Utils
- //--------------------------------------------------
- function plot.registerMoveEvents(world) {
- if(world == null) {
- return;
- }
- iter = plot.iterator(world);
- while(hasNext(iter)) {
- plot = next(iter);
- plot.setMoveEvent(plot, world);
- }
- }
- function plot.delMoveEvent(plot) {
- plot_id = plot.getId(plot);
- for(i = 0; i < list.getSize($plot_move_ids_list); i++) {
- a = list.getIndex($plot_move_ids_list, i);
- if(a[1] == plot_id) {
- event.removeMoveData(a[0]);
- list.removeIndex($plot_move_ids_list, i);
- break;
- }
- }
- }
- function plot.setMoveEvent(plot, world) {
- if(!plot.isCity(plot) && !plot.isPlot(plot)) {
- return;
- }
- x1 = plot.getMinX(plot);
- y1 = plot.getMinY(plot);
- z1 = plot.getMinZ(plot);
- x2 = plot.getMaxX(plot);
- y2 = plot.getMaxY(plot);
- z2 = plot.getMaxZ(plot);
- loc1 = loc.new(world, x1, y1, z1);
- loc2 = loc.new(world, x2, y2, z2);
- move_id = event.addMoveData(loc1, loc2, 100, -1);
- plot_id = plot.getId(plot);
- a = array.new(2);
- a[0] = move_id;
- a[1] = plot_id;
- list.add($plot_move_ids_list, a);
- }
- function plot.getPlotIdFromMoveId(move_id) {
- iter = iterator($plot_move_ids_list);
- while(hasNext(iter)) {
- a = next(iter);
- if(a[0] == move_id) {
- return a[1];
- }
- }
- return null;
- }
- function plot.getMoveIdFromPlotId(plot_id) {
- iter = iterator($plot_move_ids_list);
- while(hasNext(iter)) {
- a = next(iter);
- if(a[1] == plot_id) {
- return a[0];
- }
- }
- return null;
- }
- @checkForPlot
- player_uuid = list.getIndex(check_for_plot_list, 0);
- list.removeIndex(check_for_plot_list, 0);
- player = player.get(player_uuid);
- if(player == null) {
- map.remove(actual_move_id, player_uuid);
- goto("wait");
- }
- player_loc = entity.getLocation(player);
- plot_list = plot.get(player_loc);
- if(list.getSize(plot_list) == 0) {
- map.remove(actual_move_id, player_uuid);
- } else {
- list.add(check_for_plot_list, player_uuid);
- sgoto(100, "checkForPlot");
- }
- goto("wait");
- function tpBottom(player) {
- player_loc = entity.getLocation(player);
- y = loc.getY(player_loc);
- while(y > -64 && block.isAir(block.get(player_loc))) {
- loc.setY(player_loc, y);
- y--;
- }
- if(y <= 0) {
- return;
- }
- loc.addY(player_loc, 1);
- entity.teleport(player, player_loc);
- }
- //--------------------------------------------------
- //Mailbox-Utils
- //--------------------------------------------------
- function mailbox.sendItem(player_id, item) {
- index = mailbox.getFreeIndex(player_id);
- if(index == -1) {
- return false;
- }
- mailbox.setItem(player_id, index, item);
- return true;
- }
- function mailbox.clear(player_id) {
- pfad = "scripts/configs/inv_data/mailbox";
- config = config.new(pfad, player_id);
- if(config.exists(config)) {
- config.load(config);
- }
- for(index = 0; index < 27; index++) {
- config.set(config, string.concat("item-", string.number(index)), "null");
- }
- config.saveAsync(config);
- }
- function mailbox.setItem(player_id, index, item) {
- pfad = "scripts/configs/inv_data/mailbox";
- config = config.new(pfad, player_id);
- if(config.exists(config)) {
- config.load(config);
- }
- item_string = string.item(item);
- config.set(config, string.concat("item-", string.number(index)), item_string);
- config.saveAsync(config);
- }
- function mailbox.removeItem(player_id, index) {
- pfad = "scripts/configs/inv_data/mailbox";
- config = config.new(pfad, player_id);
- if(config.exists(config)) {
- config.load(config);
- }
- config.set(config, string.concat("item-", string.number(index)), "null");
- config.saveAsync(config);
- }
- function mailbox.getFreeIndex(player_id) {
- pfad = "scripts/configs/inv_data/mailbox";
- config = config.new(pfad, player_id);
- if(config.exists(config)) {
- config.load(config);
- }
- for(i = 0; i < 27; i++) {
- item_string = config.getString(config, string.concat("item-", string.number(i)), "null");
- if(item_string == "null") {
- return i;
- }
- }
- return -1;
- }
- function mailbox.show(to_player, player_id, bool) {
- pfad = "scripts/configs/inv_data/mailbox";
- config = config.new(pfad, player_id);
- if(config.exists(config)) {
- config.load(config);
- }
- if(bool) {
- inv = inv.new("222222222222222222222222222", text.new(string.concat("Mailbox from ", player.getNameFromId(player_id))));
- } else {
- inv = inv.new("111111111111111111111111111", text.new(string.concat("Mailbox from ", player.getNameFromId(player_id))));
- }
- for(i = 0; i < 27; i++) {
- item_string = config.getString(config, string.concat("item-", string.number(i)), "null");
- if(item_string == "null") {
- continue;
- }
- item = read.item(item_string);
- if(item == null) {
- continue;
- }
- setInvItem(inv, i, item);
- }
- inv.open(inv, to_player);
- }
- function updateVoteInv() {
- lore_list = list.new();
- list.add(lore_list, text.new("§fCost: §e1 VP"));
- list.add(lore_list, text.new(string.concat("§fCounter: §e", string.number(getHomeBoost()))));
- list.add(lore_list, text.new("§5Every 20 VP the possible homes increase by one."));
- list.add(lore_list, text.new("§5Counter automatically shrinks by one every day."));
- inv.setItem($vote_inv, 2, item.create("RED_BED", 1, "§aMore Homes", lore_list));
- }
- function getAdditionalVoteHomes() {
- return math.roundDown(getHomeBoost() / 20);
- }
- function getHomeBoost() {
- config = getServerConfig();
- return config.getDouble(config, "homeBoostPoints", 0);
- }
- function increaseHomeBoost() {
- config = getServerConfig();
- points = config.getDouble(config, "homeBoostPoints", 0) + 1;
- config.set(config, "homeBoostPoints", points);
- config.saveAsync(config);
- updateVoteInv();
- }
- function decreaseHomeBoost() {
- config = getServerConfig();
- points = config.getDouble(config, "homeBoostPoints", 0) - 1;
- if(points < 0) {
- points = 0;
- }
- config.set(config, "homeBoostPoints", points);
- config.saveAsync(config);
- updateVoteInv();
- }
|