commands.txt 327 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915
  1. error_counter = 0;
  2. last_error_message = null;
  3. @on_error
  4. error_counter++;
  5. if(error_counter > 1) {
  6. msg.dev("Error Handler activated");
  7. if(last_error_message == error_message) {
  8. msg.dev("Same error again");
  9. term();
  10. }
  11. last_error_message = error_message;
  12. if(event == "custom_command") {
  13. msg.dev(string.concat("Command ", command, " failed."));
  14. set.add(failed_cmds, command);
  15. goto("wait");
  16. }
  17. msg.dev("Restarting script...");
  18. error_counter++;
  19. if(error_counter >= 5) {
  20. msg.dev("Script terminated. Endless loop.");
  21. term();
  22. }
  23. }
  24. waitfor(5); //Verhindert Endlos-Schleife durch "/start commands"
  25. setCommandHelps();
  26. command.clear();
  27. //--- Register commands not shown on /help here ---
  28. //Games
  29. command.add("nextplayer");
  30. command.add("invstats");
  31. command.add("topinvstats");
  32. command.add("removeinvstats");
  33. command.add("sfstats");
  34. command.add("topsfstats");
  35. command.add("removesfstats");
  36. command.add("questanswer");
  37. //Overwrite vanilla
  38. command.add("butcher");
  39. //--- Register commands shown on /help here ---
  40. alias_map = map.new();
  41. command_list = list.new();
  42. command_map = map.new();
  43. command.register("afk", "Toggles afk");
  44. command.register("allsounds", "Plays all sounds");
  45. command.register("answer", "Answers the last private message");
  46. command.register("armorstand", "Armorstand commands");
  47. command.register("ass", "Armor Stand Signs");
  48. command.register("back", "Teleports to the last position");
  49. command.register("ban", "Bans a player");
  50. command.register("block", "Block commands");
  51. //command.register("clan", "Clan-Commands");
  52. command.register("color", "Shows all colors");
  53. command.register("comeback", "Teleports to your death location");
  54. command.register("copyisland", "Copyisland-Commands");
  55. command.register("creative", "Teleports to creative-spawn");
  56. command.register("customitems", "Shows all custom items");
  57. command.register("databank", "Databank-Commands");
  58. command.register("datatools", "Datatools-Commands");
  59. command.register("dev", "Dev-Commands");
  60. command.register("enchant", "Enchants an item in your hand");
  61. command.register("enderchest", "Shows enderchests");
  62. command.register("error", "Error-Logger");
  63. command.register("feed", "Fills hunger bar");
  64. command.register("fly", "Toggles fly");
  65. command.register("friend", "Friend-Commands");
  66. command.register("game", "marvs minigame shit");
  67. command.register("gamemode", "Change gamemode");
  68. command.register("gamerule", "Manage gamerules");
  69. command.register("games", "Teleports to games-spawn");
  70. command.register("giveup", "Giveup a quest");
  71. command.register("grow", "Grow seeds");
  72. command.register("hat", "Be fame with a new hat");
  73. command.register("head", "Gives you the head of a player");
  74. command.register("heal", "Heals, fills hunger bar and remove effects");
  75. command.register("help", "Shows this help");
  76. command.register("home", "Manage your homes");
  77. command.register("icon", "Shows all icons");
  78. command.register("live", "Toggles Live-Mode");
  79. command.register("lag", "Executes a lag test");
  80. command.register("leave", "Leaves a minigame");
  81. command.register("loginrequests", "Lists the last login requests");
  82. command.register("human", "Human-Commands");
  83. command.register("inv", "Inv-Commands");
  84. command.register("iteminfo", "Returns information about an item");
  85. command.register("jail", "Sends a player to jail");
  86. command.register("joinme", "Sends a party invitation to all online players");
  87. command.register("jumpto", "Jumps to a block in sight");
  88. command.register("kick", "Kicks a player");
  89. command.register("lastseen", "Shows the last players online");
  90. command.register("lightning", "Summons a lightning_bolt");
  91. command.register("list", "List all players online");
  92. command.register("mail", "Mail-Commands");
  93. command.register("mailbox", "Mailbox-Commands");
  94. command.register("memory", "Returns RAM-usage");
  95. command.register("msg", "Send a private message");
  96. command.register("mute", "Mutes a player");
  97. command.register("news", "Send Push-News to all players");
  98. command.register("nickname", "Set a nickname");
  99. command.register("nowb", "Sends no 'is back' message if afk");
  100. command.register("party", "Party-Commands");
  101. command.register("perm", "Manage permissions");
  102. command.register("playtime", "Shows your playtime");
  103. command.register("plot", "Plot-Commands");
  104. command.register("potion", "Adds a potion effects to an item");
  105. command.register("pvp", "Toggles pvp");
  106. command.register("quest", "Quest-Commands");
  107. command.register("rank", "Shows your available ranks");
  108. command.register("repair", "Repairs your item in mainhand");
  109. command.register("ride", "Rides an entity");
  110. command.register("say", "[Server] chat message");
  111. command.register("script", "Script-Commands");
  112. command.register("settings", "Opens settings menu");
  113. command.register("seen", "Returns the last date the player was online");
  114. //command.register("senditem", "Sends an itemstack to another player");
  115. command.register("setmessage", "Set your join/leave-message");
  116. command.register("setrank", "");
  117. command.register("setservermessage", "Sets the server-message in the serverlist");
  118. command.register("setspawn", "Changes a spawn");
  119. command.register("shop", "Shop-Commands");
  120. command.register("sign", "Edit a sign");
  121. command.register("silentjoin", "Toggles your silentjoins");
  122. command.register("skills", "Shows all skills");
  123. command.register("skipnight", "Skips the night");
  124. command.register("spawn", "Teleports to spawn");
  125. command.register("speed", "Sets your speed");
  126. command.register("sponsor", "See what a sponsor can do");
  127. command.register("start", "Starts a script");
  128. command.register("startgame", "Reduces start-countdown for a minigame");
  129. command.register("stats", "Statistics-Commands");
  130. //command.register("stopadventure", "Stops an adventure");
  131. command.register("suicide", "Kill yourself");
  132. command.register("support", "Creates a ticket for support");
  133. command.register("tempban", "Bans a player temporarly");
  134. command.register("tempfly", "Let a player temporarly fly");
  135. command.register("ticket", "Ticket-Commands");
  136. command.register("time", "Time-Commands");
  137. command.register("tip", "Tip-Commands");
  138. command.register("top", "Teleports to to highest point at the current position");
  139. command.register("tp", "Teleport command");
  140. command.register("tpa", "Sends a teleport request to a player");
  141. command.register("tpahere", "Sends a teleport request to a player");
  142. command.register("tpaccept", "Accepts a teleport request");
  143. command.register("tpaccepthere", "Accepts a teleport request");
  144. command.register("tppos", "Teleports to coordinates");
  145. command.register("unban", "Unbans a player");
  146. command.register("unjail", "Releases a player from jail");
  147. command.register("unmute", "Unmutes a player");
  148. command.register("user", "Returns infos about a user");
  149. command.register("vanish", "Vanishes a player");
  150. command.register("var", "Reads variables from a scripts");
  151. command.register("vote", "Show vote links");
  152. command.register("voteshop", "Show vote rewars");
  153. command.register("warn", "Warns a player");
  154. command.register("warp", "Warp-Commands");
  155. command.register("weather", "Weather-Commands");
  156. command.register("world", "World-Commands");
  157. command.registerAlias("as", "armorstand");
  158. command.registerAlias("h", "home");
  159. command.registerAlias("skull", "head");
  160. command.registerAlias("r", "answer");
  161. command.registerAlias("pardon", "unban");
  162. command.registerAlias("j", "jumpto");
  163. command.registerAlias("mimimi", "help");
  164. command.registerAlias("ci", "copyisland");
  165. command.registerAlias("mem", "memory");
  166. command.registerAlias("ram", "memory");
  167. command.registerAlias("colour", "color");
  168. command.registerAlias("gm", "gamemode");
  169. command.registerAlias("p", "plot");
  170. command.registerAlias("dt", "datatools");
  171. command.registerAlias("l", "leave");
  172. command.registerAlias("hub", "leave");
  173. command.registerAlias("v", "vanish");
  174. command.registerAlias("fuckit", "giveup");
  175. command.registerAlias("thor", "lightning");
  176. composter_par = particle.get("COMPOSTER");
  177. wall_signs_tag = block.getTag("minecraft:wall_signs");
  178. beds_tag = block.getTag("minecraft:beds");
  179. chest_tag = block.getTag("km:container");
  180. all_signs_tag = block.getTag("minecraft:all_signs");
  181. sign_tag = block.getTag("minecraft:signs");
  182. //dirt_tag = block.getTag("minecraft:dirt");
  183. prefix_shop = "§6Shop";
  184. prefix_clan = "§2Clan";
  185. prefix_tips = "§eTips";
  186. prefix_lock = "§eLock";
  187. prefix_commands = "§6Commands";
  188. prefix_vote = "§dVote";
  189. prefix_friends = "§5Friends";
  190. prefix_world = "§bWorld";
  191. prefix_jail = "§5Jail";
  192. prefix_quest = "§dQuest";
  193. prefix_perms = "§6Perms";
  194. prefix_datatools = "§6DataTools";
  195. prefix_human = "§6Human";
  196. prefix_plot = "§dPlots";
  197. prefix_party = "§5Party";
  198. prefix_skill = "§2Skill";
  199. initPlotFlags();
  200. initAllSounds();
  201. allsounds_list = getAllSounds();
  202. allsounds_indizes = map.new();
  203. allsounds_uuids = list.new();
  204. allsounds_uuids_cross_check = list.new();
  205. party_ids = getScriptVar("party_ids");
  206. if(party_ids == null) {
  207. party_ids = map.new();
  208. setScriptVar("party_ids", map.new()); //Player, partyid
  209. }
  210. party_lists = getScriptVar("party_lists");
  211. if(party_lists == null) {
  212. party_lists = map.new();
  213. setScriptVar("party_lists", map.new()); //partyid, Liste mit Players aller Partymitglieder
  214. }
  215. party_ranks = getScriptVar("party_ranks");
  216. if(party_ranks == null) {
  217. party_ranks = map.new();
  218. setScriptVar("party_ranks", map.new()); //Player, "leader"/"mod"/"player"
  219. }
  220. party_counter = getScriptVar("party_counter");
  221. if(party_counter == null) {
  222. party_counter = 0;
  223. setScriptVar("party_counter", party_counter); //Player, partyid
  224. }
  225. delkeytime = list.new(); //Alle Zeitpunkte zum Löschen der Einladungen (Vergleichsliste)
  226. delkeytimes = map.new(); //Player_uuid, Liste mit Zeitpunkten zum Löschen der Einladungen
  227. deluuid = list.new(); //Alle Player_uuids zum Löschen der Einladungen
  228. party_invitations = map.new(); //Player_uuid, Liste mit Player_uuids aller Einlader
  229. party_invite_ids = map.new(); //Player_uuid, partyid
  230. sign_copy_map = map.new();
  231. list = getScriptVar("block_commands_list");
  232. if(list == null) {
  233. list = list.new();
  234. setScriptVar("block_commands_list", list);
  235. }
  236. live_set = getScriptVar("live_set");
  237. if(live_set == null) {
  238. live_set = set.new();
  239. setScriptVar("live_set", live_set);
  240. } else {
  241. //Register all Live-Players again
  242. iter = iterator(live_set);
  243. while(hasNext(iter)) {
  244. player = player.get(next(iter));
  245. if(player != null) {
  246. player.setLive(player, true);
  247. }
  248. }
  249. }
  250. afk_loop_active = false;
  251. afk_map = getScriptVar("afk_map");
  252. if(afk_map == null) {
  253. afk_map = map.new();
  254. setScriptVar("afk_map", afk_map);
  255. } else {
  256. //Alle Spieler, die AFK waren, wieder als AFK registrieren
  257. iter = map.iterator(afk_map);
  258. while(hasNext(iter)) {
  259. element = next(iter);
  260. player = player.get(map.getKey(element));
  261. if(player != null) {
  262. player.setAfk(player, true);
  263. afk_loop_active = true;
  264. }
  265. }
  266. }
  267. if(afk_loop_active) {
  268. sgoto(30, "afk_loop");
  269. }
  270. setScriptVar("ha_data_lists", map.new());
  271. setScriptVar("ha_undo_lists", map.new());
  272. money.setBoostFactor(1);
  273. sgoto(200, "sb_title_loop");
  274. sgoto(100, "coordsloop");
  275. sgoto(1200, "afk_checker_loop");
  276. sgoto(1200, "minute_loop");
  277. 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}]}}}");
  278. lag_list = list.new();
  279. clan_invitations = list.new();
  280. friend_requests = map.new();
  281. lock_chests = map.new();
  282. chatbuffer = map.new();
  283. tpa_request = list.new();
  284. answer_map = map.new();
  285. plotpos1 = map.new();
  286. plotpos2 = map.new();
  287. invseeids = set.new();
  288. fields = set.new();
  289. vanish_set = set.new();
  290. failed_cmds = set.new();
  291. skip_night_set = set.new();
  292. afk_checker_map = map.new();
  293. butcher_set = set.new();
  294. set.add(butcher_set, "zombie");
  295. set.add(butcher_set, "zombie_villager");
  296. set.add(butcher_set, "husk");
  297. set.add(butcher_set, "skeleton");
  298. set.add(butcher_set, "creeper");
  299. set.add(butcher_set, "enderman");
  300. set.add(butcher_set, "pillager");
  301. set.add(butcher_set, "spider");
  302. set.add(butcher_set, "phantom");
  303. set.add(butcher_set, "witch");
  304. set.add(butcher_set, "stray");
  305. set.add(butcher_set, "drowned");
  306. set.add(butcher_set, "wither");
  307. set.add(butcher_set, "silverfish");
  308. set.add(butcher_set, "zombified_piglin");
  309. set.add(butcher_set, "cod");
  310. set.add(butcher_set, "guardian");
  311. attribut_set = set.new();
  312. set.add(attribut_set, "GENERIC_ARMOR");
  313. set.add(attribut_set, "GENERIC_ARMOR_TOUGHNESS");
  314. set.add(attribut_set, "GENERIC_ATTACK_DAMAGE");
  315. set.add(attribut_set, "GENERIC_ATTACK_KNOCKBACK");
  316. set.add(attribut_set, "GENERIC_ATTACK_SPEED");
  317. set.add(attribut_set, "GENERIC_FLYING_SPEED");
  318. set.add(attribut_set, "GENERIC_FOLLOW_RANGE");
  319. set.add(attribut_set, "GENERIC_KNOCKBACK_RESISTANCE");
  320. set.add(attribut_set, "GENERIC_LUCK");
  321. set.add(attribut_set, "GENERIC_MAX_HEALTH");
  322. set.add(attribut_set, "GENERIC_MOVEMENT_SPEED");
  323. set.add(attribut_set, "HORSE_JUMP_STRENGTH");
  324. set.add(attribut_set, "ZOMBIE_SPAWN_REINFORCEMENTS");
  325. operation_set = set.new();
  326. set.add(operation_set, "ADD_NUMBER");
  327. set.add(operation_set, "ADD_SCALAR");
  328. set.add(operation_set, "MULTIPLY_SCALAR_1");
  329. not_blocked_cmd = set.new();
  330. set.add(not_blocked_cmd, "leave");
  331. set.add(not_blocked_cmd, "ban");
  332. set.add(not_blocked_cmd, "kick");
  333. set.add(not_blocked_cmd, "warn");
  334. set.add(not_blocked_cmd, "tempban");
  335. set.add(not_blocked_cmd, "mute");
  336. set.add(not_blocked_cmd, "unmute");
  337. set.add(not_blocked_cmd, "unban");
  338. set.add(not_blocked_cmd, "tip");
  339. set.add(not_blocked_cmd, "var");
  340. set.add(not_blocked_cmd, "quest");
  341. set.add(not_blocked_cmd, "msg");
  342. set.add(not_blocked_cmd, "help");
  343. rank_array = array.new(28, 2);
  344. //Playtime
  345. rank.add(0, "rank.owner", "4Owner");
  346. rank.add(1, "rank.admin", "cAdmin");
  347. rank.add(2, "rank.moderator", "9Moderator");
  348. rank.add(3, "rank.supporter", "bSupporter");
  349. rank.add(4, "rank.dev", "5Developer");
  350. rank.add(5, "rank.builder", "5Builder");
  351. rank.add(6, "rank.vip", "dVIP");
  352. rank.add(7, "rank.influencer", "dInfluencer");
  353. rank.add(8, "rank.sponsor", "dSponsor");
  354. rank.add(9, "rank.legend", "2Legend");
  355. rank.add(10, "rank.pioneer", "2Pioneer");
  356. rank.add(11, "rank.lord", "2Lord");
  357. rank.add(12, "rank.altruist", "2Altruist");
  358. rank.add(13, "rank.major", "2Major");
  359. rank.add(14, "rank.frequenter", "6Frequenter");
  360. rank.add(15, "rank.explorer", "6Explorer");
  361. rank.add(16, "rank.chief", "6Chief");
  362. rank.add(17, "rank.friend", "6Friend");
  363. rank.add(18, "rank.colonizer", "6Colonizer");
  364. rank.add(19, "rank.newcomer", "eNewcomer");
  365. rank.add(20, "rank.adventurer", "eAdventurer");
  366. rank.add(21, "rank.commander", "eCommander");
  367. rank.add(22, "rank.volunteer", "eVolunteer");
  368. rank.add(23, "rank.settler", "eSettler");
  369. rank.add(24, "rank.user", "3User");
  370. rank.add(25, "rank.challenger", "5Challenger");
  371. rank.add(26, "rank.mobhunter", "6Mobhunter");
  372. rank.add(27, "rank.collector", "2Collector");
  373. setScriptVar("ranks", rank_array);
  374. month_array = array.new(12, 2);
  375. month.register(0, "Jan", 31);
  376. month.register(1, "Feb", 28);
  377. month.register(2, "Mar", 31);
  378. month.register(3, "Apr", 30);
  379. month.register(4, "May", 31);
  380. month.register(5, "Jun", 30);
  381. month.register(6, "Jul", 31);
  382. month.register(7, "Aug", 31);
  383. month.register(8, "Sep", 30);
  384. month.register(9, "Oct", 31);
  385. month.register(10, "Nov", 30);
  386. month.register(11, "Dec", 31);
  387. jailed_list = list.new();
  388. ironbars = item.create("minecraft:iron_bars", 1, "§r", null);
  389. jailmenu = inv.new("00000000", text.new("§8Jail"));
  390. inv.setItem(jailmenu, 0, ironbars);
  391. inv.setItem(jailmenu, 1, ironbars);
  392. inv.setItem(jailmenu, 2, ironbars);
  393. inv.setItem(jailmenu, 3, ironbars);
  394. inv.setItem(jailmenu, 4, ironbars);
  395. inv.setItem(jailmenu, 5, ironbars);
  396. inv.setItem(jailmenu, 6, ironbars);
  397. inv.setItem(jailmenu, 7, ironbars);
  398. inv.setItem(jailmenu, 8, ironbars);
  399. skip_night_inv = inv.new("002020200", text.new("Skip Night?"));
  400. inv.setItem(skip_night_inv, 2, item.custom.create("CHECK_GREEN", 1, "§fYes", null));
  401. inv.setItem(skip_night_inv, 4, item.create("clay_ball", 1, "§fI don´t care", null));
  402. inv.setItem(skip_night_inv, 6, item.custom.create("CROSS_RED", 1, "§fNo", null));
  403. skip_night_inv_id = inv.getId(skip_night_inv);
  404. vote_inv = inv.new("222222222", text.new("§8Voteshop"));
  405. lore_list = list.new();
  406. list.add(lore_list, text.new("§fCost: §e6 VP"));
  407. list.add(lore_list, text.new("§5Doubles incoming money for 10 minutes."));
  408. list.add(lore_list, text.new("§5Effects quests, minigames and mobarena."));
  409. inv.setItem(vote_inv, 0, item.custom.create("GOLD_COIN", 1, "§aMoney Booster", lore_list));
  410. lore_list = list.new();
  411. list.add(lore_list, text.new("§fCost: §e2 VP"));
  412. list.add(lore_list, text.new("§5Rickroles every player on the server."));
  413. inv.setItem(vote_inv, 1, item.create("JUKEBOX", 1, "§aRick is in the house", lore_list));
  414. updateVoteInv();
  415. lore_list = list.new();
  416. list.add(lore_list, text.new("§fCost: §e2 VP"));
  417. list.add(lore_list, text.new("§5Be a kiddie and enjoy it."));
  418. inv.setItem(vote_inv, 3, item.create("JUKEBOX", 1, "§aBi Ba Bobby Car", lore_list));
  419. lore_list = list.new();
  420. list.add(lore_list, text.new("§fCost: §e1 VP"));
  421. list.add(lore_list, text.new("§5Plays a creeper sound for each player."));
  422. inv.setItem(vote_inv, 4, item.create("JUKEBOX", 1, "§aFalse Alarm", lore_list));
  423. lore_list = list.new();
  424. list.add(lore_list, text.new("§fCost: §e1 VP"));
  425. list.add(lore_list, text.new("§5Opens your enderchest."));
  426. inv.setItem(vote_inv, 5, item.create("ENDER_CHEST", 1, "§aMobile Enderchest", lore_list));
  427. lore_list = list.new();
  428. list.add(lore_list, text.new("§fCost: §e7 VP"));
  429. list.add(lore_list, text.new("§5A sapphire for your armor."));
  430. list.add(lore_list, text.new("§5To use at jewelry smith."));
  431. inv.setItem(vote_inv, 6, item.custom.create("SAPPHIRE", 1, "§aSapphire", lore_list));
  432. vote_inv_id = inv.getId(vote_inv);
  433. consoleCommands = set.new();
  434. set.add(consoleCommands, "ban");
  435. set.add(consoleCommands, "help");
  436. set.add(consoleCommands, "kick");
  437. set.add(consoleCommands, "lastseen");
  438. set.add(consoleCommands, "list");
  439. set.add(consoleCommands, "memory");
  440. set.add(consoleCommands, "mute");
  441. set.add(consoleCommands, "say");
  442. set.add(consoleCommands, "start");
  443. set.add(consoleCommands, "tempban");
  444. set.add(consoleCommands, "tempfly");
  445. set.add(consoleCommands, "unban");
  446. set.add(consoleCommands, "unmute");
  447. set.add(consoleCommands, "user");
  448. set.add(consoleCommands, "warn");
  449. set.add(consoleCommands, "world");
  450. databank.workerExecute(databank.prepare("
  451. CREATE TABLE IF NOT EXISTS friends (
  452. player_id INT NOT NULL,
  453. friend_id INT NOT NULL,
  454. time BIGINT NOT NULL,
  455. PRIMARY KEY (player_id, friend_id)
  456. );
  457. "));
  458. databank.workerExecute(databank.prepare("
  459. CREATE TABLE IF NOT EXISTS new_plotranks (
  460. plot_id INT NOT NULL,
  461. player_id INT NOT NULL,
  462. rank VARCHAR(10),
  463. PRIMARY KEY (plot_id, player_id)
  464. );
  465. "));
  466. databank.workerExecute(databank.prepare("
  467. CREATE TABLE IF NOT EXISTS new_homes (
  468. player_id INT NOT NULL,
  469. name VARCHAR(20) NOT NULL,
  470. world_name VARCHAR(20) NOT NULL,
  471. x DOUBLE NOT NULL,
  472. y DOUBLE NOT NULL,
  473. z DOUBLE NOT NULL,
  474. yaw DOUBLE NOT NULL,
  475. pitch DOUBLE NOT NULL,
  476. PRIMARY KEY (player_id, name)
  477. );
  478. "));
  479. databank.workerExecute(databank.prepare("
  480. CREATE TABLE IF NOT EXISTS votes (
  481. id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
  482. name VARCHAR(20) NOT NULL,
  483. player_id INT,
  484. time BIGINT NOT NULL
  485. );
  486. "));
  487. databank.workerExecute(databank.prepare("
  488. CREATE TABLE IF NOT EXISTS newbies (
  489. id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
  490. player_id INT NOT NULL,
  491. time BIGINT NOT NULL
  492. );
  493. "));
  494. //plot ranks cachen
  495. plot_ranks_map = map.new();
  496. stmt = databank.prepare("SELECT plot_id, player_id, rank FROM new_plotranks");
  497. result = databank.execute(stmt);
  498. while(databank.next(result)) {
  499. plot_id = databank.getInt(result, 1);
  500. player_id = databank.getInt(result, 2);
  501. rank = databank.getString(result, 3);
  502. map = map.get(plot_ranks_map, plot_id);
  503. if(map == null) {
  504. map = map.new();
  505. }
  506. map.add(map, player_id, rank);
  507. map.add(plot_ranks_map, plot_id, map);
  508. }
  509. databank.close(result);
  510. databank.close(stmt);
  511. setScriptVar("plot_ranks", plot_ranks_map);
  512. last_skip_night = 0;
  513. skip_night_started = false;
  514. jail_loop_active = false;
  515. actual_move_id = map.new(); //Key: player_uuid, Value: move_id. Diese Map speichert das aktuell betretene Plot eines Spielers.
  516. plot_move_ids_list = list.new(); //Speichert Array mit plot_id und move_id
  517. check_for_plot_list = list.new();
  518. plot.registerMoveEvents(world.getOverworld());
  519. plot.registerMoveEvents(world.getTheNether());
  520. plot.registerMoveEvents(world.getTheEnd());
  521. plot.registerMoveEvents(world.getCreative());
  522. RickRollSounds = getRickRollSounds();
  523. RickRollSoundDists = getRickRollSoundDists();
  524. rick_sounds_amount = list.getSize(RickRollSoundDists);
  525. bobbyCarSounds = getBobbyCarSounds();
  526. bobbyCarSoundDists = getBobbyCarSoundDists();
  527. bcar_sounds_amount = list.getSize(bobbyCarSoundDists);
  528. item_flags = getItemFlags();
  529. sound_category_master = sound.getCategory("MASTER");
  530. sound_flute = sound.get("BLOCK_NOTE_BLOCK_FLUTE");
  531. sound_harp = sound.get("BLOCK_NOTE_BLOCK_HARP");
  532. sound_pling = sound.get("BLOCK_NOTE_BLOCK_PLING");
  533. creeper_primed = sound.get("ENTITY_CREEPER_PRIMED");
  534. event.load("player_move");
  535. event.load("snuvi_click");
  536. event.load("inv_close");
  537. event.load("missing_perm");
  538. event.load("missing_command");
  539. event.load("command");
  540. event.load("custom_command");
  541. event.load("block_click");
  542. event.load("player_quit");
  543. event.load("vote");
  544. msg("dev", text.new("§bCommands §rloaded."));
  545. @wait
  546. wait();
  547. if(event == "command") {
  548. if(string.startsWith(permission, "worldedit", 0)) {
  549. if(perm.has("creative.we", player)) {
  550. world_name = world.getName(loc.getWorld(entity.getLocation(player)));
  551. if(!world.isCreativeName(world_name)) {
  552. cancel = true;
  553. msg.prefix(player, prefix_commands, "You are not in the creative world.");
  554. goto("wait");
  555. }
  556. }
  557. }
  558. goto("wait");
  559. }
  560. if(event == "custom_command") {
  561. //Permission-Check
  562. command = string.toLowerCase(command);
  563. command = map.getOrDefault(alias_map, command, command);
  564. size = list.getSize(args);
  565. if(isPlayer(sender)) {
  566. player = sender;
  567. } else {
  568. if(!set.contains(consoleCommands, command)) {
  569. msg.string(sender, "Sorry. Not a console command yet. Go and tell marvinius.");
  570. goto("wait");
  571. }
  572. player = null;
  573. }
  574. if(!perm.has(command, sender)) {
  575. perm.no(command, sender);
  576. goto("wait");
  577. }
  578. if(set.contains(failed_cmds, command)) {
  579. msg.prefix(sender, prefix_commands, "§cCommand temporarly deactivated due to failure.");
  580. goto("wait");
  581. }
  582. if(player.isCommandBlocked(sender)) {
  583. if(!set.contains(not_blocked_cmd, command)) {
  584. msg.prefix(sender, prefix_commands, "The most important rule in competition: Sabotage!");
  585. goto("wait");
  586. }
  587. }
  588. ignoreGoto(command);
  589. goto("wait");
  590. }
  591. if(event == "vote") {
  592. now_time = time.getMillis();
  593. vote.register(name, now_time);
  594. p_uuid = player.getUuid(name);
  595. if(p_uuid != null) {
  596. p_id = player.getId(p_uuid);
  597. player.addVotePoints(p_id, 1);
  598. if(from == "minecraft-server.eu") {
  599. 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")));
  600. } else {
  601. 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/")));
  602. }
  603. last_vote_time = player.getLastVoteTime(p_id);
  604. new_streak = player.getVoteStreak(p_id);
  605. if(last_vote_time == 0) {
  606. new_streak++;
  607. } elseif(isFollowingDay(last_vote_time, now_time)) {
  608. new_streak++;
  609. } elseif(!isSameDay(last_vote_time, now_time)) {
  610. new_streak = 1;
  611. }
  612. if(new_streak % 7 == 0) {
  613. msg.online(prefix_vote, string.concat(player.getName(p_uuid), " reached a votestreak of 7 and gets an additional votepoint."));
  614. player.addVotePoints(p_id, 1);
  615. }
  616. player.setVoteStreak(p_id, new_streak);
  617. player.setLastVoteTime(p_id, now_time);
  618. }
  619. goto("wait");
  620. }
  621. if(event == "player_move") {
  622. player_uuid = player.getUuid(player);
  623. last_move_id = map.getOrDefault(actual_move_id, player_uuid, null);
  624. if(last_move_id == id) {
  625. goto("wait");
  626. }
  627. player_loc = entity.getLocation(player);
  628. new_plot_id = plot.getPlotIdFromMoveId(id);
  629. new_plot = plot.getFromId(new_plot_id, loc.getWorld(player_loc));
  630. if(new_plot == null) {
  631. goto("wait");
  632. }
  633. high_plot_id = plot.getHighestId(player_loc);
  634. if(new_plot_id < high_plot_id) {
  635. goto("wait");
  636. }
  637. if(plot.isCity(new_plot)) {
  638. color_code = "§c";
  639. } else {
  640. color_code = "§e";
  641. }
  642. title.send(player, text.new(""), text.new(string.concat("You entered ", color_code, plot.getName(new_plot), ".")));
  643. map.add(actual_move_id, player_uuid, id);
  644. list.add(check_for_plot_list, player_uuid);
  645. sgoto(100, "checkForPlot");
  646. goto("wait");
  647. }
  648. if(event == "block_click") {
  649. if(block == null) {
  650. goto("wait");
  651. }
  652. world_name = world.getName(loc.getWorld(entity.getLocation(player)));
  653. if(action == "RIGHT_CLICK_BLOCK" && !world.isSurvName(world_name) && block.hasTag(block, beds_tag)) {
  654. cancel = true;
  655. goto("wait");
  656. }
  657. if(player.hasBypass(player)) {
  658. goto("wait");
  659. }
  660. if(block.hasTag(block, chest_tag)) {
  661. block_loc = block.getLocation(block);
  662. if(plot.check(block_loc, player, 16, true)) {
  663. cancel = false;
  664. goto("wait");
  665. }
  666. player_id = player.getId(player);
  667. player_uuid = player.getUuid(player);
  668. list = plot.get(block_loc);
  669. if(list.getSize(list) > 0) {
  670. iter = iterator(list);
  671. access = false;
  672. while(hasNext(iter)) {
  673. plot = next(iter);
  674. canOpenChests = plot.canOpenChests(plot, player_id);
  675. if(plot.isSub(plot)) {
  676. if(canOpenChests) {
  677. cancel = false;
  678. goto("wait");
  679. }
  680. cancel = true;
  681. msg.prefix(player, prefix_plot, "This chest is locked for you.");
  682. goto("wait");
  683. }
  684. if(canOpenChests) {
  685. access = true;
  686. cancel = false;
  687. }
  688. }
  689. if(!access && !plot.hasBlock(block_loc)) {
  690. if(!world.isGamesName(world_name)) {
  691. msg.prefix(player, prefix_plot, "This chest is locked for you.");
  692. }
  693. }
  694. }
  695. goto("wait");
  696. }
  697. if(action == "RIGHT_CLICK_BLOCK" && block.hasTag(block, sign_tag)) {
  698. line0 = sign.getString(block, "FRONT", 0);
  699. if(line0 != "§3[§bFree Plot§3]") {
  700. goto("wait");
  701. }
  702. price = read.number(string.removeFormat(sign.getString(block, "FRONT", 1)));
  703. if(price == null || !isDouble(price) || price < 0) {
  704. msg.prefix(player, prefix_plot, "Positive number expected.");
  705. goto("wait");
  706. }
  707. p_id = read.number(sign.getString(block, "FRONT", 3));
  708. if(p_id == null || !isDouble(p_id)) {
  709. msg.prefix(player, prefix_plot, "Invalid city owner.");
  710. goto("wait");
  711. }
  712. if(player.getNameFromId(p_id) == null) {
  713. msg.prefix(player, prefix_plot, "Invalid city owner.");
  714. goto("wait");
  715. }
  716. if(!hasEnoughMoney(player, price)) {
  717. msg.prefix(player, prefix_plot, string.concat("You´ll need §6", string.number(price), "§r snuvis for this."));
  718. goto("wait");
  719. }
  720. block_loc = block.getLocation(block);
  721. plot_list = plot.get(block_loc);
  722. iter = iterator(plot_list);
  723. while(hasNext(iter)) {
  724. plot = next(iter);
  725. if(plot.isFree(plot)) {
  726. break;
  727. }
  728. }
  729. if(!plot.isFree(plot)) {
  730. msg.prefix(player, prefix_plot, "You aren´t on a free plot.");
  731. goto("wait");
  732. }
  733. //Plot claimen
  734. money.sub(player, price);
  735. money.add(p_id, price);
  736. plot.setSub(plot, true);
  737. plot.setLeader(plot, player.getId(player));
  738. player_name = player.getName(player);
  739. plot.addPlayer(plot, player_name);
  740. plot.setName(plot, string.concat("Plot of ", player_name));
  741. msg.prefix(player, prefix_plot, string.concat("Plot claimed. Spent §6", string.number(price), "§r snuvis."));
  742. goto("wait");
  743. }
  744. goto("wait");
  745. }
  746. if(event == "missing_command") {
  747. msg.prefix(sender, prefix_commands, string.concat("No command ", command));
  748. goto("wait");
  749. }
  750. if(event == "player_quit") {
  751. map.remove(afk_checker_map, uuid);
  752. player.setAfk(player, false);
  753. list.remove(jailed_list, player.getUuid(player));
  754. if(player.hasQuest(player)) {
  755. script_id = quest.getFromPlayer(player);
  756. script = script.getFromId(script_id);
  757. if(script == null) {
  758. msg.dev("Player logged out with corrupt quest");
  759. quest.removePlayer(player); //in case of corrupt quest
  760. goto("wait");
  761. }
  762. setScriptVar("player", player);
  763. modTimer.scriptCallEvent("quest_term", script);
  764. quest.term(script, player);
  765. }
  766. if(player.isInParty(player)) {
  767. party.kickPlayer(player, "logout");
  768. }
  769. goto("wait");
  770. }
  771. if(event == "missing_perm") {
  772. perm.no(command, sender);
  773. msg.prefix(sender, prefix_perms, string.concat("Missing Perm: §c", perm));
  774. goto("wait");
  775. }
  776. if(event == "snuvi_click") {
  777. inv_id = inv.getId(inv);
  778. item = inv.getItem(inv, inv_slot);
  779. if(item == null) {
  780. goto("wait");
  781. }
  782. title_string = string.text(inv_title);
  783. if(string.startsWith(title_string, "Mailbox", 0)) {
  784. item.removeFlag(item, "HIDE_DESTROYS");
  785. if(click == "SHIFT_LEFT") {
  786. //Clone item
  787. player.safeGiveItem(player, item);
  788. goto("wait");
  789. }
  790. //Take item
  791. player.safeGiveItem(player, item);
  792. inv.setItem(inv, inv_slot, item.create("BLACK_STAINED_GLASS_PANE", 1, "", null));
  793. split_array = string.split(" ", title_string);
  794. p_name = split_array[2];
  795. p_uuid = player.getUuid(p_name);
  796. if(p_uuid == null) {
  797. inv.close(player);
  798. msg.prefix(player, prefix_commands, "Mailbox closed. Unknown player.");
  799. goto("wait");
  800. }
  801. p_id = player.getId(p_uuid);
  802. mailbox.removeItem(p_id, inv_slot);
  803. goto("wait");
  804. }
  805. if(string.startsWith(title_string, "Customitems", 0)) {
  806. item = inv.getItem(inv, inv_slot);
  807. if(item != null) {
  808. player.safeGiveItem(player, item);
  809. }
  810. goto("wait");
  811. }
  812. if(set.contains(invseeids, inv_id)) {
  813. if(!perm.has("inv.see.plus", player)) {
  814. perm.no("inv.see.plus", player);
  815. goto("wait");
  816. }
  817. split_array = string.split(" ", title_string);
  818. p_name = split_array[2];
  819. p = read.player(p_name);
  820. if(p == null) {
  821. inv.close(player);
  822. msg.prefix(player, prefix_commands, "This player is no longer online. Use /inv to load and overwrite an inventory of a offline player.");
  823. goto("wait");
  824. }
  825. item.removeFlag(item, "HIDE_DESTROYS");
  826. if(click == "SHIFT_LEFT") {
  827. //Clone item
  828. player.safeGiveItem(player, item);
  829. goto("wait");
  830. }
  831. //Transmit item
  832. player.removeItem(p, item);
  833. player.safeGiveItem(player, item);
  834. inv.setItem(inv, inv_slot, item.create("BLACK_STAINED_GLASS_PANE", 1, "", null));
  835. goto("wait");
  836. }
  837. if(inv_id == vote_inv_id) {
  838. if(inv_slot == 0) {
  839. if(money.getBoostFactor() > 1) {
  840. msg.prefix(player, prefix_commands, "Boost already active.");
  841. goto("wait");
  842. }
  843. vp = player.getVotePoints(player);
  844. if(vp < 6) {
  845. msg.prefix(player, prefix_commands, "Not enough vote points.");
  846. goto("wait");
  847. }
  848. player.setVotePoints(player, vp - 6);
  849. msg.online(prefix_vote, string.concat(player.getName(player), " activated §dMoney Booster§r."));
  850. money.setBoostFactor(2);
  851. online_list = players.toList();
  852. iter = iterator(online_list);
  853. while(hasNext(iter)) {
  854. p = next(iter);
  855. sb.add(p, 5, "§6Money Booster +100%");
  856. }
  857. sgoto(12000, "resetMoneyBoost");
  858. goto("wait");
  859. }
  860. if(inv_slot == 1) {
  861. vp = player.getVotePoints(player);
  862. if(vp < 2) {
  863. msg.prefix(player, prefix_commands, "Not enough vote points.");
  864. goto("wait");
  865. }
  866. msg.online(prefix_vote, string.concat(player.getName(player), " activated §dRick is in the house§r."));
  867. player.setVotePoints(player, vp - 2);
  868. rickIndex = 0;
  869. goto("RickRole_play");
  870. }
  871. if(inv_slot == 2) {
  872. vp = player.getVotePoints(player);
  873. if(vp < 1) {
  874. msg.prefix(player, prefix_commands, "Not enough vote points.");
  875. goto("wait");
  876. }
  877. player.setVotePoints(player, vp - 1);
  878. increaseHomeBoost();
  879. msg.online(prefix_vote, string.concat(player.getName(player), " spend their votepoints to §dMore Homes§r."));
  880. goto("wait");
  881. }
  882. if(inv_slot == 3) {
  883. vp = player.getVotePoints(player);
  884. if(vp < 2) {
  885. msg.prefix(player, prefix_commands, "Not enough vote points.");
  886. goto("wait");
  887. }
  888. msg.online(prefix_vote, string.concat(player.getName(player), " activated §dBi Ba Bobby Car§r."));
  889. player.setVotePoints(player, vp - 2);
  890. bobbycarIndex = 0;
  891. goto("bobbycar_play");
  892. }
  893. if(inv_slot == 4) {
  894. vp = player.getVotePoints(player);
  895. if(vp < 1) {
  896. msg.prefix(player, prefix_commands, "Not enough vote points.");
  897. goto("wait");
  898. }
  899. msg.online(prefix_vote, string.concat(player.getName(player), " activated §dFalse Alarm§r."));
  900. player.setVotePoints(player, vp - 1);
  901. iter = iterator(players.toList());
  902. while(hasNext(iter)) {
  903. sound.spawnForPlayer(next(iter), creeper_primed, sound_category_master);
  904. }
  905. goto("wait");
  906. }
  907. if(inv_slot == 5) {
  908. vp = player.getVotePoints(player);
  909. if(vp < 1) {
  910. msg.prefix(player, prefix_commands, "Not enough vote points.");
  911. goto("wait");
  912. }
  913. player.setVotePoints(player, vp - 1);
  914. inv.open(player.getEnderInv(player), player);
  915. goto("wait");
  916. }
  917. if(inv_slot == 6) {
  918. vp = player.getVotePoints(player);
  919. if(vp < 7) {
  920. msg.prefix(player, prefix_commands, "Not enough vote points.");
  921. goto("wait");
  922. }
  923. msg.online(prefix_vote, string.concat(player.getName(player), " spend their votepoints to §dSapphire§r."));
  924. player.setVotePoints(player, vp - 7);
  925. player.giveItem(player, item.getSapphire());
  926. goto("wait");
  927. }
  928. goto("wait");
  929. }
  930. if(inv_id == skip_night_inv_id) {
  931. world = world.getOverWorld();
  932. world_time = world.getTime(world);
  933. while(world_time >= 24000) {
  934. world_time -= 24000;
  935. }
  936. if(world_time <= 12500) {
  937. goto("wait");
  938. }
  939. player_uuid = player.getUuid(player);
  940. if(set.contains(skip_night_set, player_uuid)) {
  941. msg.prefix(player, prefix_commands, "Already voted.");
  942. goto("wait");
  943. }
  944. if(!skip_night_started) {
  945. skip_night_yes_list = list.new();
  946. world.addTimedStatus(world, 49, 300, "Skip night?");
  947. msg("online", text.merge(text.new(string.getPrefix(prefix_commands)), text.new(" Skip night? Vote within 15 seconds. "), string.getClickText("[§cClick§r]", "/skipnight")));
  948. skip_night_counter = 15;
  949. skip_night_yes = 0;
  950. skip_night_no = 0;
  951. skip_night_no_care = 0;
  952. skip_night_started = true;
  953. sgoto(20, "skip_night_loop");
  954. }
  955. if(inv_slot == 2) {
  956. skip_night_yes++;
  957. inv.close(player);
  958. set.add(skip_night_set, player_uuid);
  959. list.add(skip_night_yes_list, player_uuid);
  960. goto("wait");
  961. }
  962. if(inv_slot == 4) {
  963. skip_night_no_care++;
  964. inv.close(player);
  965. set.add(skip_night_set, player_uuid);
  966. goto("wait");
  967. }
  968. if(inv_slot == 6) {
  969. skip_night_no++;
  970. inv.close(player);
  971. set.add(skip_night_set, player_uuid);
  972. goto("wait");
  973. }
  974. goto("wait");
  975. }
  976. if(title_string == "Skills") {
  977. if(item == null) {
  978. goto("wait");
  979. }
  980. skill_name = string.removeFormat(string.text(item.getName(item)));
  981. if(skill_name == "") {
  982. goto("wait");
  983. }
  984. tech_name = skill.getTechName(skill_name);
  985. //Toggle skills
  986. if(skill.isToggleable(tech_name)) {
  987. if(skill.isActivated(player, tech_name)) {
  988. skill.setActivated(player, tech_name, false);
  989. } else {
  990. skill.setActivated(player, tech_name, true);
  991. }
  992. inv.setItem(inv, inv_slot, skill.getSettingsItem(player, tech_name));
  993. goto("wait");
  994. }
  995. //Activate skill
  996. if(skill.isActive(tech_name)) {
  997. player_loc = entity.getLocation(player);
  998. world_name = world.getName(loc.getWorld(player_loc));
  999. if(!world.isSurvName(world_name)) {
  1000. msg.prefix(player, prefix_skill, "You can´t use this in this world.");
  1001. goto("wait");
  1002. }
  1003. goto("wait");
  1004. if(tech_name == "skill.fire_arrow") {
  1005. duration = data.getTimer(player, tech_name);
  1006. if(duration > 0) {
  1007. msg.prefix(player, prefix_skill, "Skill already active.");
  1008. goto("wait");
  1009. }
  1010. amount = skill.getAmount(player, tech_name);
  1011. if(amount > 0) {
  1012. status.addTimed(player, 54, 1200, skill_name);
  1013. data.setTimer(player, tech_name, 1200);
  1014. new_amount = amount - 1;
  1015. skill.setAmount(player, tech_name, new_amount);
  1016. msg.prefix(player, prefix_skill, string.concat("Used ", skill_name, ". New amount: ", string.number(new_amount)));
  1017. }
  1018. goto("wait");
  1019. }
  1020. if(tech_name == "skill.fly10min") {
  1021. duration = data.getTimer(player, "fly");
  1022. if(duration > 0) {
  1023. msg.prefix(player, prefix_skill, "Skill already active.");
  1024. goto("wait");
  1025. }
  1026. amount = skill.getAmount(player, "skill.fly10min");
  1027. if(amount > 0) {
  1028. status.addTimed(player, 50, 12000, "Fly");
  1029. data.setTimer(player, "fly", 12000);
  1030. player.setFly(player, true);
  1031. new_amount = amount - 1;
  1032. skill.setAmount(player, "skill.fly10min", new_amount);
  1033. msg.prefix(player, prefix_skill, string.concat("Used Fly 10min. New amount: ", string.number(new_amount)));
  1034. }
  1035. goto("wait");
  1036. }
  1037. if(tech_name == "skill.grow") {
  1038. amount = skill.getAmount(player, "skill.grow");
  1039. if(amount > 0) {
  1040. grow(player_loc, 5);
  1041. particle.spawnCircle(loc.mod(entity.getLocation(player), 0, 0.8, 0), composter_par, 50, 5, 1, 0, 0, 0.2, 0);
  1042. new_amount = amount - 1;
  1043. skill.setAmount(player, "skill.grow", new_amount);
  1044. msg.prefix(player, prefix_skill, string.concat("Used Grow. New amount: ", string.number(new_amount)));
  1045. }
  1046. goto("wait");
  1047. }
  1048. if(tech_name == "skill.haste") {
  1049. amount = skill.getAmount(player, "skill.haste");
  1050. if(amount > 0) {
  1051. entity.addEffect(player, "haste", 2400, 0);
  1052. new_amount = amount - 1;
  1053. skill.setAmount(player, "skill.haste", new_amount);
  1054. msg.prefix(player, prefix_skill, string.concat("Used Haste. New amount: ", string.number(new_amount)));
  1055. }
  1056. goto("wait");
  1057. }
  1058. if(tech_name == "skill.speed") {
  1059. amount = skill.getAmount(player, "skill.speed");
  1060. if(amount > 0) {
  1061. entity.addEffect(player, "speed", 2400, 0);
  1062. new_amount = amount - 1;
  1063. skill.setAmount(player, "skill.speed", new_amount);
  1064. msg.prefix(player, prefix_skill, string.concat("Used Speed. New amount: ", string.number(new_amount)));
  1065. }
  1066. goto("wait");
  1067. }
  1068. if(tech_name == "skill.jump_boost") {
  1069. amount = skill.getAmount(player, "skill.jump_boost");
  1070. if(amount > 0) {
  1071. entity.addEffect(player, "jump_boost", 2400, 1);
  1072. new_amount = amount - 1;
  1073. skill.setAmount(player, "skill.jump_boost", new_amount);
  1074. msg.prefix(player, prefix_skill, string.concat("Used Jump Boost. New amount: ", string.number(new_amount)));
  1075. }
  1076. goto("wait");
  1077. }
  1078. if(tech_name == "skill.dolphin") {
  1079. amount = skill.getAmount(player, "skill.dolphin");
  1080. if(amount > 0) {
  1081. entity.addEffect(player, "dolphins_grace", 1200, 0);
  1082. new_amount = amount - 1;
  1083. skill.setAmount(player, "skill.dolphin", new_amount);
  1084. msg.prefix(player, prefix_skill, string.concat("Used Dolphin. New amount: ", string.number(new_amount)));
  1085. }
  1086. goto("wait");
  1087. }
  1088. if(tech_name == "skill.block_up") {
  1089. duration = data.getTimer(player, "block_up");
  1090. if(duration > 0) {
  1091. msg.prefix(player, prefix_skill, "Skill already active.");
  1092. goto("wait");
  1093. }
  1094. amount = skill.getAmount(player, "skill.block_up");
  1095. if(amount > 0) {
  1096. status.addTimed(player, 51, 1200, "Block Up");
  1097. data.setTimer(player, "block_up", 1200);
  1098. new_amount = amount - 1;
  1099. skill.setAmount(player, "skill.block_up", new_amount);
  1100. msg.prefix(player, prefix_skill, string.concat("Used Block Up. New amount: ", string.number(new_amount)));
  1101. }
  1102. goto("wait");
  1103. }
  1104. if(tech_name == "skill.block_down") {
  1105. duration = data.getTimer(player, "block_down");
  1106. if(duration > 0) {
  1107. msg.prefix(player, prefix_skill, "Skill already active.");
  1108. goto("wait");
  1109. }
  1110. amount = skill.getAmount(player, "skill.block_down");
  1111. if(amount > 0) {
  1112. status.addTimed(player, 52, 1200, "Block Down");
  1113. data.setTimer(player, "block_down", 1200);
  1114. new_amount = amount - 1;
  1115. skill.setAmount(player, "skill.block_down", new_amount);
  1116. msg.prefix(player, prefix_skill, string.concat("Used Block Down. New amount: ", string.number(new_amount)));
  1117. }
  1118. goto("wait");
  1119. }
  1120. }
  1121. goto("wait");
  1122. }
  1123. if(title_string == "§8Settings") {
  1124. if(inv_slot == 0) {
  1125. new_value = !player.getAutoCloseDoor(player);
  1126. player.setAutoCloseDoor(player, new_value);
  1127. inv.setItem(inv, inv_slot, item.create("minecraft:oak_door", 1, "§fAutomatic Doors", item.createLore(new_value)));
  1128. }
  1129. elseif(inv_slot == 1) {
  1130. new_value = !player.doesAcceptTpaRequests(player);
  1131. player.acceptTpaRequests(player, new_value);
  1132. inv.setItem(inv, inv_slot, item.create("minecraft:ender_pearl", 1, "§fAccept TPA-Requests", item.createLore(new_value)));
  1133. }
  1134. elseif(inv_slot == 2) {
  1135. new_value = !player.getShowcoords(player);
  1136. player.setShowcoords(player, new_value);
  1137. inv.setItem(inv, inv_slot, item.create("minecraft:compass", 1, "§fShow Coords", item.createLore(new_value)));
  1138. if(!new_value) {
  1139. sb.remove(player, 2);
  1140. sb.remove(player, 3);
  1141. }
  1142. }
  1143. elseif(inv_slot == 3) {
  1144. new_value = !player.hasSittingActivated(player);
  1145. player.activateSitting(player, new_value);
  1146. inv.setItem(inv, inv_slot, item.create("minecraft:oak_stairs", 1, "§fStair-Sitting", item.createLore(new_value)));
  1147. }
  1148. elseif(inv_slot == 4) {
  1149. new_value = !hasPvpOn(player);
  1150. setPvp(player, new_value);
  1151. inv.setItem(inv, inv_slot, item.create("minecraft:iron_sword", 1, "§fPvP", item.createLore(new_value)));
  1152. }
  1153. elseif(inv_slot == 5) {
  1154. new_value = !player.getNoPetDamage(player);
  1155. player.setNoPetDamage(player, new_value);
  1156. inv.setItem(inv, inv_slot, item.create("minecraft:bone", 1, "§fNo Pet Damage", item.createLore(new_value)));
  1157. }
  1158. elseif(inv_slot == 6) {
  1159. new_value = !player.getTipLoop(player);
  1160. player.setTipLoop(player, new_value);
  1161. inv.setItem(inv, inv_slot, item.create("minecraft:oak_sign", 1, "§fShow tip loop", item.createLore(new_value)));
  1162. }
  1163. elseif(inv_slot == 7) {
  1164. new_value = !player.usesCustomMessage(player);
  1165. player.activateCustomMessage(player, new_value);
  1166. inv.setItem(inv, inv_slot, item.create("minecraft:oak_sign", 1, "§fUse custom messages", item.createLore(new_value)));
  1167. }
  1168. }
  1169. goto("wait");
  1170. }
  1171. if(event == "inv_close") {
  1172. if(set.contains(invseeids, inv_id)) {
  1173. set.remove(invseeids, inv_id);
  1174. }
  1175. goto("wait");
  1176. }
  1177. goto("wait");
  1178. @block
  1179. if(size == 0) {
  1180. @blockhelp
  1181. msg.prefix(player, prefix_plot, "/block ...");
  1182. msg.string(player, "§d - info §rPrints info about a block");
  1183. msg.string(player, "§d - public §rMakes a block public");
  1184. msg.string(player, "§d - remove §rRemoves a block from public list");
  1185. if(perm.has("block.fix", player)) {
  1186. msg.string(player, "§d - fix §rRemoves all air blocks from public list");
  1187. }
  1188. goto("wait");
  1189. }
  1190. arg0 = string.toLowerCase(list.getIndex(args, 0));
  1191. if(arg0 == "info") {
  1192. block = player.getTargetBlock(player, 5);
  1193. if(block == null) {
  1194. msg.prefix(player, prefix_commands, "No block in sight.");
  1195. goto("wait");
  1196. }
  1197. target_loc = block.getLocation(block);
  1198. msg.string(player, string.getSpacer());
  1199. x = string.number(loc.getX(target_loc));
  1200. y = string.number(loc.getY(target_loc));
  1201. z = string.number(loc.getZ(target_loc));
  1202. msg.string(player, string.concat("§6W §r", world.getName(loc.getWorld(target_loc))));
  1203. msg.string(player, string.concat("§6X §r", x, " §6Y §r", y, " §6Z §r", z));
  1204. msg.string(player, string.concat("§6Type: §r", block.getType(block)));
  1205. msg.string(player, string.concat("§6Public: §r", plot.hasBlock(target_loc)));
  1206. msg.string(player, string.concat("§6Data: §r", block.getData(block)));
  1207. goto("wait");
  1208. }
  1209. if(arg0 == "public") {
  1210. if(size != 1) {
  1211. msg.prefix(player, prefix_commands, "/block public");
  1212. goto("wait");
  1213. }
  1214. block = player.getTargetBlock(player, 5);
  1215. if(block == null) {
  1216. msg.prefix(player, prefix_commands, "No block in sight.");
  1217. goto("wait");
  1218. }
  1219. location = block.getLocation(block);
  1220. plot.addBlock(location);
  1221. msg.prefix(player, prefix_commands, "Block whitelisted for interaction.");
  1222. plot.saveBlocks(loc.getWorld(location));
  1223. goto("wait");
  1224. }
  1225. if(arg0 == "remove") {
  1226. if(size != 1) {
  1227. msg.prefix(player, prefix_commands, "/block remove");
  1228. goto("wait");
  1229. }
  1230. block = player.getTargetBlock(player, 5);
  1231. if(block == null) {
  1232. msg.prefix(player, prefix_commands, "No block in sight.");
  1233. goto("wait");
  1234. }
  1235. location = block.getLocation(block);
  1236. plot.removeBlock(location);
  1237. msg.prefix(player, prefix_commands, "Block no longer whitelisted for interaction.");
  1238. plot.saveBlocks(loc.getWorld(location));
  1239. goto("wait");
  1240. }
  1241. if(arg0 == "fix") {
  1242. if(!perm.has("block.fix", player)) {
  1243. perm.no("block.fix", player);
  1244. goto("wait");
  1245. }
  1246. //temp_list verhindern concurrent modification
  1247. temp_list = list.new();
  1248. world = world.getOverWorld();
  1249. c = 0;
  1250. iter = plot.blockIterator(world);
  1251. while(hasNext(iter)) {
  1252. pos = next(iter);
  1253. x = plot.position.getX(pos);
  1254. y = plot.position.getY(pos);
  1255. z = plot.position.getZ(pos);
  1256. loc = loc.new(world, x, y, z);
  1257. block = block.get(loc);
  1258. if(block.isAir(block)) {
  1259. c++;
  1260. list.add(temp_list, loc);
  1261. }
  1262. }
  1263. iter = iterator(temp_list);
  1264. while(hasNext(iter)) {
  1265. plot.removeBlock(next(iter));
  1266. }
  1267. msg.prefix(player, prefix_commands, string.concat("Removed ", string.number(c), " blocks."));
  1268. goto("wait");
  1269. }
  1270. goto("blockhelp");
  1271. @settings
  1272. inv = inv.new("222222222", text.new("§8Settings"));
  1273. inv.setItem(inv, 0, item.create("minecraft:oak_door", 1, "§fAutomatic Doors", item.createLore(player.getAutoCloseDoor(player))));
  1274. inv.setItem(inv, 1, item.create("minecraft:ender_pearl", 1, "§fAccept TPA-Requests", item.createLore(player.doesAcceptTpaRequests(player))));
  1275. inv.setItem(inv, 2, item.create("minecraft:compass", 1, "§fShow Coords", item.createLore(player.getShowcoords(player))));
  1276. inv.setItem(inv, 3, item.create("minecraft:oak_stairs", 1, "§fStair-Sitting", item.createLore(player.hasSittingActivated(player))));
  1277. inv.setItem(inv, 4, item.create("minecraft:iron_sword", 1, "§fPvP", item.createLore(hasPvpOn(player))));
  1278. inv.setItem(inv, 5, item.create("minecraft:bone", 1, "§fNo Pet Damage", item.createLore(player.getNoPetDamage(player))));
  1279. inv.setItem(inv, 6, item.create("minecraft:oak_sign", 1, "§fShow tip loop", item.createLore(player.getTipLoop(player))));
  1280. inv.setItem(inv, 7, item.create("minecraft:oak_sign", 1, "§fUse custom messages", item.createLore(player.usesCustomMessage(player))));
  1281. inv.open(inv, player);
  1282. goto("wait");
  1283. @loginrequests
  1284. if(size < 2) {
  1285. msg.prefix(sender, prefix_commands, "/loginrequests <player/all> <amount> [result]");
  1286. goto("wait");
  1287. }
  1288. amount = list.getIndex(args, 1);
  1289. if(!isDouble(amount) || amount < 0) {
  1290. msg.prefix(player, prefix_shop, "Positive number expected.");
  1291. goto("wait");
  1292. }
  1293. result = null;
  1294. if(size == 3) {
  1295. result = list.getIndex(args, 2);
  1296. if(result != "ALLOWED" &&
  1297. result != "KICK_FULL" &&
  1298. result != "KICK_BANNED" &&
  1299. result != "KICK_WHITELIST" &&
  1300. result != "KICK_OTHER") {
  1301. msg.prefix(player, prefix_shop, "No valid result.");
  1302. goto("wait");
  1303. }
  1304. }
  1305. p_name = list.getIndex(args, 0);
  1306. if(p_name == "all") {
  1307. list = loginrequests.getAll(amount, result);
  1308. } else {
  1309. p_uuid = player.getUuid(p_name);
  1310. if(p_uuid == null) {
  1311. msg.prefix(player, prefix_tips, "This player has never been online.");
  1312. goto("wait");
  1313. }
  1314. p_id = player.getId(p_uuid);
  1315. list = loginrequests.getPlayer(p_id, amount, result);
  1316. }
  1317. table = table.new("§b", 10, 11, 10);
  1318. msg.string(player, table.getStart(table));
  1319. msg.string(player, table.get(table, "Player", "Time", "Result"));
  1320. msg.string(player, table.getMiddle(table));
  1321. iter = iterator(list);
  1322. while(hasNext(iter)) {
  1323. a = next(iter);
  1324. msg.string(player, table.get(table, player.getNameFromId(a[0]), time.getString(a[1]), a[2]));
  1325. }
  1326. msg.string(player, table.getEnd(table));
  1327. goto("wait");
  1328. @shop
  1329. if(size == 0) {
  1330. @shop_help
  1331. msg.prefix(player, prefix_shop, "/shop ...");
  1332. msg.string(player, "§6 - create §rCreates a shop");
  1333. msg.string(player, "§6 - buy <amount> <price> §rSet buy settings");
  1334. msg.string(player, "§6 - sell <amount> <price> §rSet sell settings");
  1335. msg.string(player, "§6 - remove <buy/sell> §rRemove settings");
  1336. if(perm.has("shop.owner", player)) {
  1337. msg.string(player, "§6 - owner <player> §rSet shop owner");
  1338. }
  1339. goto("wait");
  1340. }
  1341. arg0 = string.toLowerCase(list.getIndex(args, 0));
  1342. if(arg0 == "create") {
  1343. if(size != 1) {
  1344. msg.prefix(player, prefix_shop, "§6/shop create");
  1345. goto("wait");
  1346. }
  1347. sign_block = player.getTargetBlock(player, 5, false, false);
  1348. if(!block.isWallSign(sign_block)) {
  1349. msg.prefix(player, prefix_shop, "Look at a wall sign.");
  1350. goto("wait");
  1351. }
  1352. chest_block = block.mod(sign_block, 0, -1, 0);
  1353. if(!block.isChest(chest_block)) {
  1354. msg.prefix(player, prefix_shop, "No chest under sign.");
  1355. goto("wait");
  1356. }
  1357. if(sign.getString(sign_block, "FRONT", 0) != "") {
  1358. msg.prefix(player, prefix_shop, "Sign is not empty.");
  1359. goto("wait");
  1360. }
  1361. sign_loc = block.getLocation(sign_block);
  1362. sign.setString(sign_block, "FRONT", 0, "[Shop]");
  1363. sign.setString(sign_block, "FRONT", 3, string.number(player.getId(player)));
  1364. block.signSetWaxed(sign_block, true);
  1365. msg.prefix(player, prefix_shop, "Created Shop.");
  1366. goto("wait");
  1367. }
  1368. if(arg0 == "buy" || arg0 == "sell") {
  1369. if(size != 3) {
  1370. msg.prefix(player, prefix_shop, string.concat("§6/shop ", arg0, " <amount> <price>"));
  1371. goto("wait");
  1372. }
  1373. amount = list.getIndex(args, 1);
  1374. price = list.getIndex(args, 2);
  1375. if(!isDouble(amount) || !isDouble(price)) {
  1376. msg.prefix(player, prefix_shop, "Number expected.");
  1377. goto("wait");
  1378. }
  1379. amount = math.round(amount);
  1380. if(amount < 0) {
  1381. msg.prefix(player, prefix_shop, "Positive number expected.");
  1382. goto("wait");
  1383. }
  1384. if(price < 0) {
  1385. msg.prefix(player, prefix_shop, "Positive number expected.");
  1386. goto("wait");
  1387. }
  1388. if(price > 266304) {
  1389. msg.prefix(player, prefix_shop, string.concat("Maximum ", money.getString(266304), " allowed."));
  1390. goto("wait");
  1391. }
  1392. sign_block = player.getTargetBlock(player, 5, false, false);
  1393. if(!block.isWallSign(sign_block)) {
  1394. msg.prefix(player, prefix_shop, "Look at a wall sign.");
  1395. goto("wait");
  1396. }
  1397. chest_block = block.mod(sign_block, 0, -1, 0);
  1398. if(!block.isChest(chest_block)) {
  1399. msg.prefix(player, prefix_shop, "No chest under sign.");
  1400. goto("wait");
  1401. }
  1402. if(!shop.isOwner(player, sign_block)) {
  1403. msg.prefix(player, prefix_shop, "You are not the owner.");
  1404. goto("wait");
  1405. }
  1406. if(arg0 == "buy") {
  1407. sign.setString(sign_block, "FRONT", 1, string.concat("Buy ", string.number(amount), " for ", string.number(price)));
  1408. } else {
  1409. sign.setString(sign_block, "FRONT", 2, string.concat("Sell ", string.number(amount), " for ", string.number(price)));
  1410. }
  1411. msg.prefix(player, prefix_shop, "Price set.");
  1412. goto("wait");
  1413. }
  1414. if(arg0 == "remove") {
  1415. if(size != 2) {
  1416. msg.prefix(player, prefix_shop, "§6/shop remove <buy/sell>");
  1417. goto("wait");
  1418. }
  1419. sign_block = player.getTargetBlock(player, 5, false, false);
  1420. if(!block.isWallSign(sign_block)) {
  1421. msg.prefix(player, prefix_shop, "Look at a wall sign.");
  1422. goto("wait");
  1423. }
  1424. chest_block = block.mod(sign_block, 0, -1, 0);
  1425. if(!block.isChest(chest_block)) {
  1426. msg.prefix(player, prefix_shop, "No chest under sign.");
  1427. goto("wait");
  1428. }
  1429. if(!shop.isOwner(player, sign_block)) {
  1430. msg.prefix(player, prefix_shop, "You are not the owner.");
  1431. goto("wait");
  1432. }
  1433. arg1 = string.toLowerCase(list.getIndex(args, 1));
  1434. if(arg1 == "buy") {
  1435. sign.setString(sign_block, "FRONT", 1, "");
  1436. } elseif(arg1 == "sell") {
  1437. sign.setString(sign_block, "FRONT", 2, "");
  1438. } else {
  1439. msg.prefix(player, prefix_shop, "§6/shop remove <buy/sell>");
  1440. goto("wait");
  1441. }
  1442. msg.prefix(player, prefix_shop, "Price removed.");
  1443. goto("wait");
  1444. }
  1445. if(arg0 == "owner") {
  1446. if(!perm.has("shop.owner", player)) {
  1447. perm.no("shop.owner", player);
  1448. goto("wait");
  1449. }
  1450. if(size != 2) {
  1451. msg.prefix(player, prefix_shop, "§6/shop owner <player>");
  1452. goto("wait");
  1453. }
  1454. p_name = list.getIndex(args, 1);
  1455. p_uuid = player.getUuid(p_name);
  1456. if(p_uuid == null) {
  1457. msg.prefix(player, prefix_shop, "This player has never been online.");
  1458. goto("wait");
  1459. }
  1460. sign_block = player.getTargetBlock(player, 5, false, false);
  1461. if(!block.isWallSign(sign_block)) {
  1462. msg.prefix(player, prefix_shop, "Look at a wall sign.");
  1463. goto("wait");
  1464. }
  1465. sign.setString(sign_block, "FRONT", 3, string.number(player.getId(p_uuid)));
  1466. goto("wait");
  1467. }
  1468. goto("shop_help");
  1469. @mailbox
  1470. location = entity.getLocation(player);
  1471. world_name = world.getName(loc.getWorld(entity.getLocation(player)));
  1472. if(!world.isSurvName(world_name)) {
  1473. msg.prefix(player, prefix_commands, "You can´t use this command in this world.");
  1474. goto("wait");
  1475. }
  1476. if(player.isOnAdventure(player) && !perm.has("mailbox.other", player)) {
  1477. msg.prefix(player, prefix_commands, "You can´t use the mailbox while on adventure.");
  1478. goto("wait");
  1479. }
  1480. if(size == 0) {
  1481. msg.prefix(player, prefix_commands, "/mailbox...");
  1482. if(perm.has("mailbox.other", player)) {
  1483. msg.string(player, "§6 - show [player] §rOpens a mailbox of a player.");
  1484. } else {
  1485. msg.string(player, "§6 - show §rOpens your mailbox.");
  1486. }
  1487. msg.string(player, "§6 - send <player> §rSends the item in your hand to a mailbox of a player.");
  1488. goto("wait");
  1489. }
  1490. arg0 = string.toLowerCase(list.getIndex(args, 0));
  1491. if(arg0 == "send") {
  1492. if(size != 2) {
  1493. msg.prefix(player, prefix_commands, "/mailbox send <player>");
  1494. goto("wait");
  1495. }
  1496. item = living.getHand(player);
  1497. if(item.isAir(item)) {
  1498. msg.prefix(player, prefix_commands, "You have to hold an item in your mainhand.");
  1499. goto("wait");
  1500. }
  1501. to_name = list.getIndex(args, 1);
  1502. if(!checkIfEverOnline(to_name)) {
  1503. msg.prefix(player, prefix_commands, "This player has never been online.");
  1504. goto("wait");
  1505. }
  1506. to_player_id = player.getId(player.getUuid(to_name));
  1507. if(!mailbox.sendItem(to_player_id, item)) {
  1508. msg.prefix(player, prefix_commands, "No free space in mailbox.");
  1509. goto("wait");
  1510. }
  1511. living.setEquip(player, read.slot("HAND"), null);
  1512. msg.send(player, to_name, prefix_commands, string.concat(player.getName(player), " sent you items to your mailbox."), true);
  1513. msg.prefix(player, prefix_commands, "Item sent to player.");
  1514. goto("wait");
  1515. }
  1516. if(arg0 == "show") {
  1517. if(size == 1) {
  1518. player_id = player.getId(player);
  1519. mailbox.show(player, player_id, false);
  1520. mailbox.clear(player_id);
  1521. goto("wait");
  1522. }
  1523. if(size == 2) {
  1524. if(!perm.has("mailbox.other", player)) {
  1525. perm.no("mailbox.other", player);
  1526. goto("wait");
  1527. }
  1528. from_name = list.getIndex(args, 1);
  1529. if(!checkIfEverOnline(from_name)) {
  1530. msg.prefix(player, prefix_commands, "This player has never been online.");
  1531. goto("wait");
  1532. }
  1533. from_player_id = player.getId(player.getUuid(from_name));
  1534. mailbox.show(player, from_player_id, true);
  1535. goto("wait");
  1536. }
  1537. if(perm.has("mailbox.other", player)) {
  1538. msg.prefix(player, prefix_commands, "/mailbox show [player]");
  1539. } else {
  1540. msg.prefix(player, prefix_commands, "/mailbox show");
  1541. }
  1542. }
  1543. goto("wait");
  1544. @RickRole_play
  1545. if(rickIndex < rick_sounds_amount) {
  1546. pitch = list.getIndex(RickRollSounds, rickIndex);
  1547. PlayVoteSound(pitch);
  1548. ticks = 2 + list.getIndex(RickRollSoundDists, rickIndex);
  1549. sgoto(ticks, "RickRole_play");
  1550. }
  1551. rickIndex++;
  1552. goto("wait");
  1553. @bobbycar_play
  1554. if(bobbycarIndex < bcar_sounds_amount) {
  1555. pitch = list.getIndex(bobbyCarSounds, bobbycarIndex);
  1556. PlayVoteSound(pitch);
  1557. ticks = list.getIndex(bobbyCarSoundDists, bobbycarIndex);
  1558. sgoto(ticks, "bobbycar_play");
  1559. }
  1560. bobbycarIndex++;
  1561. goto("wait");
  1562. function PlayVoteSound(pitch) {
  1563. iter = iterator(players.toList());
  1564. while(hasNext(iter)) {
  1565. online_player = next(iter);
  1566. if(online_player == null) {
  1567. continue;
  1568. }
  1569. sound.spawnForPlayer(online_player, $sound_flute, $sound_category_master, 1, pitch);
  1570. sound.spawnForPlayer(online_player, $sound_harp, $sound_category_master, 1, pitch);
  1571. sound.spawnForPlayer(online_player, $sound_pling, $sound_category_master, 1, pitch);
  1572. }
  1573. }
  1574. @resetMoneyBoost
  1575. money.setBoostFactor(1);
  1576. online_list = players.toList();
  1577. iter = iterator(online_list);
  1578. while(hasNext(iter)) {
  1579. p = next(iter);
  1580. sb.remove(p, 5);
  1581. }
  1582. goto("wait");
  1583. @skip_night_loop
  1584. skip_night_counter--;
  1585. if(skip_night_counter == 0) {
  1586. msg.online(prefix_commands, "Skip night results:");
  1587. msg("online", text.new(string.concat("§e - §rYes: §e", string.number(skip_night_yes))));
  1588. msg("online", text.new(string.concat("§e - §rNo: §e", string.number(skip_night_no))));
  1589. msg("online", text.new(string.concat("§e - §rI don´t care: §e", string.number(skip_night_no_care))));
  1590. if(skip_night_yes > skip_night_no) {
  1591. world = world.getOverWorld();
  1592. world.setTime(world, 0);
  1593. }
  1594. set.clear(skip_night_set);
  1595. last_skip_night = time.getMillis();
  1596. iter = iterator(skip_night_yes_list);
  1597. while(hasNext(iter)) {
  1598. p = player.get(next(iter));
  1599. if(p != null) {
  1600. player.resetSleep(p);
  1601. }
  1602. }
  1603. sgoto(8400, "reset_skip_night");
  1604. goto("wait");
  1605. }
  1606. sgoto(20, "skip_night_loop");
  1607. goto("wait");
  1608. @reset_skip_night
  1609. skip_night_started = false;
  1610. goto("wait");
  1611. @skills
  1612. //skills [player]
  1613. if(size == 0) {
  1614. skill.showAll(player, player);
  1615. goto("wait");
  1616. }
  1617. if(!perm.has("skills.other", player)) {
  1618. perm.no("skills.other", player);
  1619. goto("wait");
  1620. }
  1621. p_name = list.getIndex(args, 0);
  1622. p_uuid = player.getUuid(p_name);
  1623. if(p_uuid == null) {
  1624. msg.prefix(player, prefix_tips, "This player has never been online.");
  1625. goto("wait");
  1626. }
  1627. from_p_id = player.getId(p_uuid);
  1628. skill.showAll(from_p_id, player);
  1629. goto("wait");
  1630. @infopoint1
  1631. msg.string(player, string.getSpacer());
  1632. msg.prefix(player, "§eSurvival", "§aEnjoy our modded survival feeling. New ores, items and displays, and we are still beginner friendly.");
  1633. goto("wait");
  1634. @infopoint2
  1635. msg.string(player, string.getSpacer());
  1636. 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.");
  1637. goto("wait");
  1638. @infopoint3
  1639. msg.string(player, string.getSpacer());
  1640. msg.prefix(player, "§ePlots", "§aClaim land and protect your buildings against other players. Use /plot to create and manage your plots.");
  1641. goto("wait");
  1642. @infopoint4
  1643. msg.string(player, string.getSpacer());
  1644. 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.");
  1645. goto("wait");
  1646. @infopoint5
  1647. msg.string(player, string.getSpacer());
  1648. 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.");
  1649. goto("wait");
  1650. @infopoint6
  1651. msg.string(player, string.getSpacer());
  1652. 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.");
  1653. goto("wait");
  1654. @infopoint7
  1655. msg.string(player, string.getSpacer());
  1656. msg.prefix(player, "§eMinigames", "§aWe offer a range of different single- and multiplayer games.");
  1657. goto("wait");
  1658. @infopoint8
  1659. msg.string(player, string.getSpacer());
  1660. msg.prefix(player, "§eQuests", "§aYou are nice and helpful? There are lots of tasks to do in the villages.");
  1661. goto("wait");
  1662. @infopoint9
  1663. msg.string(player, string.getSpacer());
  1664. msg.prefix(player, "§eRanking", "§aWanna rise in rank and be the best player in every branch? Look at our ranks.");
  1665. goto("wait");
  1666. @infopoint10
  1667. msg.string(player, string.getSpacer());
  1668. msg.prefix(player, "§eRules", "§aThere is at least one rule: Be respectful. Look at our fake rules.");
  1669. goto("wait");
  1670. @infopoint11
  1671. msg.string(player, string.getSpacer());
  1672. msg.prefix(player, "§eNote", "§aEverything is self-coded. Worldedit is the only external mod we use.");
  1673. goto("wait");
  1674. @infopoint12
  1675. msg.string(player, string.getSpacer());
  1676. msg.prefix(player, "§eNote", "§aBe Creative in our creative world.");
  1677. goto("wait");
  1678. @party
  1679. if(size == 0) {
  1680. @partyhelp
  1681. msg.prefix(player, prefix_party, "/party ...");
  1682. msg.string(player, "§5 - invite <player> §rInvite a player");
  1683. msg.string(player, "§5 - accept <player> §rAccept an invitation");
  1684. msg.string(player, "§5 - deny <player> §rDeny an invitation");
  1685. msg.string(player, "§5 - kick <player> §rKick a player");
  1686. msg.string(player, "§5 - leave §rLeave the party");
  1687. msg.string(player, "§5 - promote <player> §rPromote a player");
  1688. msg.string(player, "§5 - demote <player> §rDemote a player");
  1689. msg.string(player, "§5 - disband §rDisband a party");
  1690. msg.string(player, "§5 - list §rParty information");
  1691. msg.string(player, "§5 - <message> §rSends a party message");
  1692. goto("wait");
  1693. }
  1694. arg0 = string.toLowerCase(list.getIndex(args, 0));
  1695. if(arg0 == "list") {
  1696. if(size != 1) {
  1697. msg.prefix(player, prefix_party, "§5/party list");
  1698. } else {
  1699. if(!player.isInParty(player)) {
  1700. msg.prefix(player, prefix_party, "You are not in a party.");
  1701. goto("wait");
  1702. }
  1703. list = party.getList(player.getPartyId(player));
  1704. width = 1;
  1705. if(list.getSize(list) > 9) {
  1706. width = 2;
  1707. }
  1708. table = table.new("§5", width, 13, 7);
  1709. msg.string(player, table.getStart(table));
  1710. msg.string(player, table.get(table, "§d#", "§d§lName", "§d§lRole"));
  1711. msg.string(player, table.getMiddle(table));
  1712. iter = iterator(list);
  1713. c = 0;
  1714. while(hasNext(iter)) {
  1715. c++;
  1716. p = player.get(next(iter));
  1717. msg.string(player, table.get(table, string.number(c), player.getName(p), player.getPartyRank(p)));
  1718. }
  1719. msg.string(player, table.getEnd(table));
  1720. }
  1721. goto("wait");
  1722. }
  1723. if(arg0 == "leave") {
  1724. if(size != 1) {
  1725. msg.prefix(player, prefix_party, "§5/party leave");
  1726. } else {
  1727. if(!player.isInParty(player)) {
  1728. msg.prefix(player, prefix_party, "You are not in a party.");
  1729. goto("wait");
  1730. }
  1731. party.kickPlayer(player, "leave");
  1732. }
  1733. goto("wait");
  1734. }
  1735. if(arg0 == "disband") {
  1736. if(size != 1) {
  1737. msg.prefix(player, prefix_party, "§5/party disband");
  1738. } else {
  1739. if(!player.isInParty(player)) {
  1740. msg.prefix(player, prefix_party, "You are not in a party.");
  1741. goto("wait");
  1742. }
  1743. if(!player.isPartyLeader(player)) {
  1744. msg.prefix(player, prefix_party, "You are not the party leader.");
  1745. goto("wait");
  1746. }
  1747. party.delete(player.getPartyId(player));
  1748. }
  1749. goto("wait");
  1750. }
  1751. if(arg0 == "kick") {
  1752. if(size != 2) {
  1753. msg.prefix(player, prefix_party, "§5/party kick <player>");
  1754. } else {
  1755. if(!player.isInParty(player)) {
  1756. msg.prefix(player, prefix_party, "You are not in a party.");
  1757. goto("wait");
  1758. }
  1759. if(!player.isPartyLeaderOrMod(player)) {
  1760. msg.prefix(player, prefix_party, "You are not leader or moderator of the party.");
  1761. goto("wait");
  1762. }
  1763. pname = list.getIndex(args, 1);
  1764. if(!checkIfEverOnline(pname)) {
  1765. msg.prefix(player, prefix_party, "This player has never been online.");
  1766. goto("wait");
  1767. }
  1768. p = read.player(pname);
  1769. if(p == null) {
  1770. msg.prefix(player, prefix_party, "This player is not online.");
  1771. goto("wait");
  1772. }
  1773. if(player == p) {
  1774. msg.prefix(player, prefix_party, "You can´t apply that to yourself.");
  1775. goto("wait");
  1776. }
  1777. if(!party.same(p, player)) {
  1778. msg.prefix(player, prefix_party, "This player is not in your party.");
  1779. goto("wait");
  1780. }
  1781. ownrank = player.getPartyRank(player);
  1782. if(ownrank == "Moderator") {
  1783. if(player.isPartyLeaderOrMod(p)) {
  1784. msg.prefix(player, prefix_party, "You can´t kick this player.");
  1785. goto("wait");
  1786. }
  1787. }
  1788. party.kickPlayer(p, "kick");
  1789. }
  1790. goto("wait");
  1791. }
  1792. if(arg0 == "promote" || arg0 == "demote") {
  1793. if(size != 2) {
  1794. msg.prefix(player, prefix_party, string.concat("§5/party ", arg0, " <player>"));
  1795. } else {
  1796. pname = list.getIndex(args, 1);
  1797. if(!player.isInParty(player)) {
  1798. msg.prefix(player, prefix_party, "You are not in a party.");
  1799. goto("wait");
  1800. }
  1801. if(!player.isPartyLeader(player)) {
  1802. msg.prefix(player, prefix_party, "You are not the party leader.");
  1803. goto("wait");
  1804. }
  1805. if(!checkIfEverOnline(pname)) {
  1806. msg.prefix(player, prefix_party, "This player has never been online.");
  1807. goto("wait");
  1808. }
  1809. p = read.player(pname);
  1810. if(p == null) {
  1811. msg.prefix(player, prefix_party, "This player is not online.");
  1812. goto("wait");
  1813. }
  1814. if(player == p) {
  1815. msg.prefix(player, prefix_party, "You can´t apply that to yourself.");
  1816. goto("wait");
  1817. }
  1818. if(!party.same(p, player)) {
  1819. msg.prefix(player, prefix_party, "This player is not in your party.");
  1820. goto("wait");
  1821. }
  1822. partyid = player.getPartyId(player);
  1823. rank = player.getPartyRank(p);
  1824. if(arg0 == "promote") {
  1825. if(rank == "Player") {
  1826. player.setPartyRank(p, "Moderator");
  1827. party.sendMessage(partyid, string.concat("§r", pname, " is now Moderator."));
  1828. } elseif(rank == "Moderator") {
  1829. player.setPartyRank(p, "Leader");
  1830. player.setPartyRank(player, "Moderator"); //Ex-Leader degradieren
  1831. party.sendMessage(partyid, string.concat("§r", pname, " is now Leader."));
  1832. }
  1833. } elseif(arg0 == "demote") {
  1834. if(rank == "Moderator") {
  1835. player.setPartyRank(p, "Player");
  1836. party.sendMessage(partyid, string.concat("§r", pname, " is no longer Moderator."));
  1837. } else {
  1838. msg.prefix(player, prefix_party, "This player cannot be demoted.");
  1839. }
  1840. }
  1841. }
  1842. goto("wait");
  1843. }
  1844. if(arg0 == "invite") {
  1845. if(size != 2) {
  1846. msg.prefix(player, prefix_party, "§5/party invite <player>");
  1847. } else {
  1848. p_name = list.getIndex(args, 1);
  1849. if(!checkIfEverOnline(p_name)) {
  1850. msg.prefix(player, prefix_party, "This player has never been online.");
  1851. goto("wait");
  1852. }
  1853. p = read.player(p_name);
  1854. temp = party.invitePlayer(player, p);
  1855. if(temp == "inviteeNotOnline") {
  1856. msg.prefix(player, prefix_party, "This player is not online.");
  1857. } elseif(temp == "inviterEqualsInvitee") {
  1858. msg.prefix(player, prefix_party, "You can´t apply that to yourself.");
  1859. } elseif(temp == "inviterNotPermitted") {
  1860. msg.prefix(player, prefix_party, "You are not leader or moderator of the party.");
  1861. } elseif(temp == "inviteeAlreadyInParty") {
  1862. msg.prefix(player, prefix_party, "This player is already in your party.");
  1863. } elseif(temp == "inviteeAlreadyInvited") {
  1864. msg.prefix(player, prefix_party, "This player already has an invitation from you.");
  1865. } else {
  1866. msg.prefix(player, prefix_party, "Invitation sent.");
  1867. }
  1868. }
  1869. goto("wait");
  1870. }
  1871. if(arg0 == "accept") {
  1872. if(size != 2) {
  1873. msg.prefix(player, prefix_party, "§5/party accept <player>");
  1874. } else {
  1875. if(player.isInParty(player)) {
  1876. msg.prefix(player, prefix_party, "You are already in a party.");
  1877. goto("wait");
  1878. }
  1879. pname = list.getIndex(args, 1);
  1880. if(!checkIfEverOnline(pname)) {
  1881. msg.prefix(player, prefix_party, "This player has never been online.");
  1882. goto("wait");
  1883. }
  1884. p = read.player(pname);
  1885. if(p == null) {
  1886. msg.prefix(player, prefix_party, "This player is no longer online.");
  1887. goto("wait");
  1888. }
  1889. player_uuid = player.getUuid(player);
  1890. p_uuid = player.getUuid(p);
  1891. list = map.get(party_invitations, player_uuid);
  1892. if(list == null || !list.contains(list, p_uuid)) {
  1893. msg.prefix(player, prefix_party, "This invitation is invalid.");
  1894. goto("wait");
  1895. }
  1896. if(player.isInParty(p)) { //wenn einlader bereits in party
  1897. partyid = player.getPartyId(p);
  1898. if(map.get(party_invite_ids, p_uuid) == partyid) { //wenn partyid noch die gleiche ist wie bei einladung
  1899. party.addPlayer(partyid, player);
  1900. player.setPartyRank(player, "Player");
  1901. } else {
  1902. msg.prefix(player, prefix_party, "This player is already in another party.");
  1903. goto("wait");
  1904. }
  1905. } else {
  1906. partyid = map.get(party_invite_ids, p_uuid);
  1907. party.setList(partyid, list.new());
  1908. party.addPlayer(partyid, p);
  1909. party.addPlayer(partyid, player);
  1910. player.setPartyRank(p, "Leader");
  1911. player.setPartyRank(player, "Player");
  1912. msg.prefix(p, prefix_party, "The party was created.");
  1913. }
  1914. list.clear(list); //Einladungs-Liste von oben
  1915. party.sendMessage(partyid, string.concat("§r", player.getName(player), " joined the party."));
  1916. }
  1917. goto("wait");
  1918. }
  1919. if(arg0 == "deny") {
  1920. if(size != 2) {
  1921. msg.prefix(player, prefix_party, "§5/party deny <player>");
  1922. } else {
  1923. player_uuid = player.getUuid(player);
  1924. list = map.get(party_invitations, player_uuid);
  1925. if(list != null) {
  1926. pname = list.getIndex(args, 1);
  1927. p = read.player(pname);
  1928. if(p == null) {
  1929. msg.prefix(player, prefix_party, "This player is no longer online.");
  1930. goto("wait");
  1931. }
  1932. p_uuid = player.getUuid(p);
  1933. if(list == null || !list.contains(list, p_uuid)) {
  1934. msg.prefix(player, prefix_party, "This invitation is invalid.");
  1935. goto("wait");
  1936. }
  1937. index = list.getIndexOf(list, p_uuid);
  1938. list.remove(list, p_uuid);
  1939. keytimes = map.get(delkeytimes, player_uuid);
  1940. list.removeIndex(keytimes, index);
  1941. p = read.player(pname);
  1942. if(p != null) {
  1943. msg.prefix(p, prefix_party, string.concat("§r", player.getName(player), " has denied your invitation."));
  1944. }
  1945. msg.prefix(player, prefix_party, string.concat("Invitation from ", pname, " denied."));
  1946. }
  1947. }
  1948. goto("wait");
  1949. }
  1950. if(player.isInParty(player)) {
  1951. message = string.concat(player.getName(player), " §1| §r", string.concatList(args, " ", 0, list.getSize(args) - 1));
  1952. party.sendMessage(player.getPartyId(player), message);
  1953. goto("wait");
  1954. }
  1955. goto("partyhelp");
  1956. @setmessage
  1957. if(size == 0) {
  1958. @setmessagehelp
  1959. msg.prefix(player, prefix_commands, "/setmessage ...");
  1960. msg.string(player, "§e- join <message> §rSets your join message");
  1961. msg.string(player, "§e- leave <message> §rSets your leave message");
  1962. msg.string(player, "§e- death <message> §rSets your death message");
  1963. msg.string(player, "§e- info §rShows you set messages");
  1964. if(perm.has("setmessage.delete", player)) {
  1965. msg.string(player, "§e- delete <player> §rDeletes a players messages");
  1966. }
  1967. goto("wait");
  1968. }
  1969. arg0 = string.toLowerCase(list.getIndex(args, 0));
  1970. if(arg0 == "info") {
  1971. if(player.usesCustomMessage(player)) {
  1972. msg.prefix(player, prefix_commands, "Custom messages are activated.");
  1973. } else {
  1974. msg.prefix(player, prefix_commands, "Custom messages are deactivated. /settings");
  1975. }
  1976. fullname = player.getFullName(player);
  1977. message = player.getJoinMessage(player);
  1978. if(message == null) {
  1979. msg.prefix(player, prefix_commands, "No join message set.");
  1980. } else {
  1981. msg.prefix(player, prefix_commands, string.concat("§a§l> §r", fullname, " §9", message));
  1982. }
  1983. message = player.getLeaveMessage(player);
  1984. if(message == null) {
  1985. msg.prefix(player, prefix_commands, "No leave message set.");
  1986. } else {
  1987. msg.prefix(player, prefix_commands, string.concat("§c§l> §r", fullname, " §9", message));
  1988. }
  1989. message = player.getDeathMessage(player);
  1990. if(message == null) {
  1991. msg.prefix(player, prefix_commands, "No death message set.");
  1992. } else {
  1993. msg.prefix(player, prefix_commands, string.concat("§0§lx §r", fullname, " §9", message));
  1994. }
  1995. goto("wait");
  1996. }
  1997. if(arg0 == "join") {
  1998. if(size < 2) {
  1999. goto("setmessagehelp");
  2000. }
  2001. message = string.concatList(args, " ", 1, size - 1);
  2002. player.setJoinMessage(player, message);
  2003. msg.prefix(player, prefix_commands, "Join message set.");
  2004. goto("wait");
  2005. }
  2006. if(arg0 == "leave") {
  2007. if(size < 2) {
  2008. goto("setmessagehelp");
  2009. }
  2010. message = string.concatList(args, " ", 1, size - 1);
  2011. player.setLeaveMessage(player, message);
  2012. msg.prefix(player, prefix_commands, "Leave message set.");
  2013. goto("wait");
  2014. }
  2015. if(arg0 == "death") {
  2016. if(size < 2) {
  2017. goto("setmessagehelp");
  2018. }
  2019. message = string.concatList(args, " ", 1, size - 1);
  2020. player.setDeathMessage(player, message);
  2021. msg.prefix(player, prefix_commands, "Death message set.");
  2022. goto("wait");
  2023. }
  2024. if(arg0 == "delete") {
  2025. if(size == 1) {
  2026. p_uuid = player.getUuid(player);
  2027. } elseif(size == 2) {
  2028. if(!perm.has("setmessage.delete", player)) {
  2029. perm.no("setmessage.delete", player);
  2030. goto("wait");
  2031. }
  2032. p_name = list.getIndex(args, 1);
  2033. if(!checkIfEverOnline(p_name)) {
  2034. msg.prefix(player, prefix_commands, "This player has never been online.");
  2035. goto("wait");
  2036. }
  2037. p_uuid = player.getUuid(p_name);
  2038. } else {
  2039. goto("setmessagehelp");
  2040. }
  2041. p_id = player.getId(p_uuid);
  2042. player.setJoinMessage(p_id, "null");
  2043. player.setLeaveMessage(p_id, "null");
  2044. msg.prefix(player, prefix_commands, "Messages deleted.");
  2045. goto("wait");
  2046. }
  2047. goto("wait");
  2048. @lag
  2049. msg.prefix(player, prefix_commands, "Lag test is performed. Please wait...");
  2050. a = array.new(2);
  2051. a[0] = player.getUuid(player);
  2052. a[1] = time.getMillis();
  2053. list.add(lag_list, a);
  2054. sgoto(100, "do_lag_test");
  2055. goto("wait");
  2056. @do_lag_test
  2057. t = time.getMillis();
  2058. a = list.getIndex(lag_list, 0);
  2059. list.removeIndex(lag_list, 0);
  2060. p_uuid = a[0];
  2061. t_old = a[1];
  2062. t = math.roundComma((t - t_old) / 50 / 5, 2); //ms -> ticks
  2063. t = 40 - t;
  2064. p = player.get(p_uuid);
  2065. if(p != null) {
  2066. msg.prefix(p, prefix_commands, "Expected: 20 ticks/sec");
  2067. msg.prefix(p, prefix_commands, string.concat("Measured: ", string.number(t), " ticks/sec"));
  2068. }
  2069. goto("wait");
  2070. @live
  2071. boolean = !player.isLive(player);
  2072. player.setLive(player, boolean);
  2073. player.setHeadName(player);
  2074. player.setTabName(player);
  2075. msg.prefix(player, prefix_commands, "Live toggled.");
  2076. goto("wait");
  2077. @lightning
  2078. block = player.getTargetBlock(player, 50);
  2079. if(block == null) {
  2080. msg.prefix(player, prefix_commands, "No block in sight.");
  2081. goto("wait");
  2082. }
  2083. entity.spawn(block.getLocation(block), "LIGHTNING");
  2084. goto("wait");
  2085. @ride
  2086. entity = player.getTargetEntity(player, 5);
  2087. if(entity == null) {
  2088. msg.prefix(player, prefix_commands, "No entity found.");
  2089. goto("wait");
  2090. }
  2091. world_name = world.getName(loc.getWorld(entity.getLocation(player)));
  2092. if(world.isGamesName(world_name)) {
  2093. if(player.hasMinigame(player) || (perm.has("ride", player) && !perm.has("isTeam", player))) {
  2094. msg.prefix(player, prefix_commands, "You can´t use this now.");
  2095. goto("wait");
  2096. }
  2097. }
  2098. entity.mount(player, entity);
  2099. goto("wait");
  2100. @vanish
  2101. //vanish [on/off] [player]
  2102. if(size == 0) {
  2103. if(set.contains(vanish_set, player.getUuid(player))) {
  2104. bool = "off";
  2105. } else {
  2106. bool = "on";
  2107. }
  2108. }
  2109. if(size >= 1) {
  2110. bool = list.getIndex(args, 0);
  2111. }
  2112. if(size > 1) {
  2113. p_name = list.getIndex(args, 1);
  2114. p = read.player(p_name);
  2115. if(p == null) {
  2116. msg.prefix(player, prefix_commands, "This player is not online.");
  2117. goto("wait");
  2118. }
  2119. } else {
  2120. p = player;
  2121. }
  2122. p_name = player.getName(p);
  2123. player_name = player.getName(player);
  2124. if(bool == "on") {
  2125. if(p != player) {
  2126. msg.prefix(player, prefix_commands, string.concat(p_name, " has been vanished."));
  2127. msg.prefix(p, prefix_commands, string.concat("You have been vanished by ", player_name, "."));
  2128. } else {
  2129. msg.prefix(p, prefix_commands, "You are vanished.");
  2130. }
  2131. set.add(vanish_set, player.getUuid(p));
  2132. player.hideOnline(p);
  2133. } elseif(bool == "off") {
  2134. if(p != player) {
  2135. msg.prefix(player, prefix_commands, string.concat(p_name, " is no longer vanished."));
  2136. msg.prefix(p, prefix_commands, string.concat("You are no longer vanished caused by ", player_name, "."));
  2137. } else {
  2138. msg.prefix(p, prefix_commands, "You are no longer vanished.");
  2139. }
  2140. set.remove(vanish_set, player.getUuid(p));
  2141. player.showOnline(p);
  2142. } else {
  2143. msg.prefix(player, prefix_commands, "/vanish [on/off] [player]");
  2144. }
  2145. goto("wait");
  2146. @user
  2147. if(size == 0) {
  2148. @user_help
  2149. msg.prefix(sender, prefix_commands, "/user ...");
  2150. if(perm.has("user.other", player)) {
  2151. msg.string(sender, "§6 - info [player] §rReturns info about a user");
  2152. } else {
  2153. msg.string(sender, "§6 - info §rReturns info about you");
  2154. }
  2155. if(perm.has("user.money", player)) {
  2156. msg.string(sender, "§6 - addmoney <player> <money> §rAdds money to a player");
  2157. msg.string(sender, "§6 - setmoney <player> <money> §rSets the money of a player");
  2158. }
  2159. goto("wait");
  2160. }
  2161. arg0 = string.toLowerCase(list.getIndex(args, 0));
  2162. if(arg0 == "info") {
  2163. if(size < 2) {
  2164. if(!isPlayer(sender)) {
  2165. msg.prefix(sender, prefix_commands, "/user info <player>");
  2166. goto("wait");
  2167. }
  2168. p_name = player.getName(player);
  2169. p_uuid = player.getUuid(p_name);
  2170. } else {
  2171. if(!perm.has("user.other", sender)) {
  2172. perm.no("user.other", sender);
  2173. goto("wait");
  2174. }
  2175. p_name = list.getIndex(args, 1);
  2176. if(!checkIfEverOnline(p_name)) {
  2177. msg.prefix(sender, prefix_commands, "This player has never been online.");
  2178. goto("wait");
  2179. }
  2180. p_uuid = player.getUuid(p_name);
  2181. p_name = player.getName(p_uuid);
  2182. }
  2183. p = read.player(p_name);
  2184. p_id = player.getId(p_uuid);
  2185. if(p == null) {
  2186. p_or_id = p_id;
  2187. } else {
  2188. p_or_id = p;
  2189. }
  2190. table = table.new("§8", 7, 24);
  2191. msg.string(sender, table.getStart(table));
  2192. msg.string(sender, table.get(table, "Player", p_name));
  2193. msg.string(sender, table.getMiddle(table));
  2194. msg.string(sender, table.get(table, "Playtime", string.number(math.roundDown(player.getTotalPlaytime(p_or_id) / 60))));
  2195. msg.string(sender, table.get(table, "Joins", string.number(player.getJoins(p_or_id))));
  2196. msg.string(sender, table.get(table, "First Join", time.getDateString(player.getFirstJoin(p_or_id))));
  2197. msg.string(sender, table.get(table, "Last Join", time.getDateString(player.getLastJoin(p_or_id))));
  2198. if(perm.has("user.other", sender)) {
  2199. msg.string(sender, table.get(table, "UUID", p_uuid));
  2200. msg.string(sender, table.get(table, "ID", string.number(p_id)));
  2201. if(player.isLive(sender)) {
  2202. msg.string(sender, table.get(table, "IP", "§7§oHidden"));
  2203. } else {
  2204. msg.string(sender, table.get(table, "IP", player.getLoggedIp(p_or_id)));
  2205. }
  2206. snuvis = money.get(p_or_id);
  2207. msg.string(sender, table.get(table, "Money", string.concat(money.getString(snuvis), " (",string.number(snuvis), ")")));
  2208. }
  2209. msg.string(sender, table.get(table, "Rank", getRank(p_or_id)));
  2210. msg.string(sender, table.get(table, "PvP", hasPvpOn(p_or_id)));
  2211. msg.string(sender, table.get(table, "Quests", string.number(quest.getCounter(p_or_id))));
  2212. msg.string(sender, table.get(table, "Adventures", string.number(player.getAdventureAmounts(p_or_id))));
  2213. msg.string(sender, table.getEnd(table));
  2214. goto("wait");
  2215. }
  2216. if(arg0 == "addmoney") {
  2217. if(!perm.has("user.money", sender)) {
  2218. perm.no("user.money", sender);
  2219. goto("wait");
  2220. }
  2221. if(size != 3) {
  2222. msg.prefix(sender, prefix_commands, "/user addmoney <player> <money>");
  2223. goto("wait");
  2224. }
  2225. p_name = list.getIndex(args, 1);
  2226. if(!checkIfEverOnline(p_name)) {
  2227. msg.prefix(sender, prefix_commands, "This player has never been online.");
  2228. goto("wait");
  2229. }
  2230. money = list.getIndex(args, 2);
  2231. if(!isDouble(money)) {
  2232. msg.prefix(sender, prefix_commands, "Number expected.");
  2233. goto("wait");
  2234. }
  2235. p_uuid = player.getUuid(p_name);
  2236. p_id = player.getId(p_uuid);
  2237. money.add(p_id, money);
  2238. msg.prefix(sender, prefix_commands, string.concat("Added ", money.getString(money), " to ", player.getName(p_uuid), "."));
  2239. goto("wait");
  2240. }
  2241. if(arg0 == "setmoney") {
  2242. if(!perm.has("user.money", sender)) {
  2243. perm.no("user.money", sender);
  2244. goto("wait");
  2245. }
  2246. if(size != 3) {
  2247. msg.prefix(sender, prefix_commands, "/user setmoney <player> <money>");
  2248. goto("wait");
  2249. }
  2250. p_name = list.getIndex(args, 1);
  2251. if(!checkIfEverOnline(p_name)) {
  2252. msg.prefix(sender, prefix_commands, "This player has never been online.");
  2253. goto("wait");
  2254. }
  2255. money = list.getIndex(args, 2);
  2256. if(!isDouble(money)) {
  2257. msg.prefix(sender, prefix_commands, "Number expected.");
  2258. goto("wait");
  2259. }
  2260. p_uuid = player.getUuid(p_name);
  2261. p_id = player.getId(p_uuid);
  2262. setMoney(p_id, money);
  2263. msg.prefix(sender, prefix_commands, string.concat("Set ", string.number(money), " snuvis for ", player.getName(p_uuid), "."));
  2264. goto("wait");
  2265. }
  2266. goto("user_help");
  2267. @quest
  2268. if(size == 0) {
  2269. @quest_syntax
  2270. msg.prefix(player, prefix_quest, "/quest ...");
  2271. msg.string(player, "§5 - see §rSee all active quests");
  2272. msg.string(player, "§5 - term <player> §rTerminates a quest of a player");
  2273. goto("wait");
  2274. }
  2275. arg0 = string.toLowerCase(list.getIndex(args, 0));
  2276. if(arg0 == "see") {
  2277. if(size != 1) {
  2278. msg.prefix(player, prefix_quest, "/quest see");
  2279. goto("wait");
  2280. }
  2281. msg.prefix(player, prefix_quest, "Active quests:");
  2282. quest_map = quest.getIds();
  2283. iter = map.iterator(quest_map);
  2284. while(hasNext(iter)) {
  2285. element = next(iter);
  2286. key = map.getKey(element);
  2287. value = map.getValue(element);
  2288. script = script.getFromId(value);
  2289. if(script == null) {
  2290. continue;
  2291. }
  2292. q_name = script.getVar(script, "quest_name");
  2293. stage = script.getVar(script, "stage");
  2294. all_stages = script.getVar(script, "all_stages");
  2295. msg.string(player, string.concat( "§d- §r", player.getName(key), " ", string.number(value), " ", q_name, " (", string.number(stage), "/", string.number(all_stages), ")"));
  2296. }
  2297. goto("wait");
  2298. }
  2299. if(arg0 == "term") {
  2300. if(size != 2) {
  2301. msg.prefix(player, prefix_quest, "/quest term <player>");
  2302. goto("wait");
  2303. }
  2304. p_name = list.getIndex(args, 1);
  2305. if(!checkIfEverOnline(p_name)) {
  2306. msg.prefix(player, prefix_quest, "This player has never been online.");
  2307. goto("wait");
  2308. }
  2309. p = read.player(p_name);
  2310. if(p == null) {
  2311. msg.prefix(player, prefix_quest, "This player is not online.");
  2312. goto("wait");
  2313. }
  2314. script_id = quest.getFromPlayer(p);
  2315. if(script_id == null) {
  2316. msg.prefix(player, prefix_quest, "This player has no quest.");
  2317. goto("wait");
  2318. }
  2319. script = script.getFromId(script_id);
  2320. if(script == null) {
  2321. quest.removePlayer(p);
  2322. msg.prefix(player, prefix_quest, "Corrupt quest terminated.");
  2323. goto("wait");
  2324. }
  2325. setScriptVar("player", p);
  2326. modTimer.scriptCallEvent("quest_term", script);
  2327. quest.term(script, player);
  2328. msg.prefix(player, prefix_quest, "Quest terminated.");
  2329. goto("wait");
  2330. }
  2331. goto("quest_syntax");
  2332. @friend
  2333. if(size == 0) {
  2334. @friend_syntax
  2335. msg.prefix(player, prefix_friends, "/friend ...");
  2336. msg.string(player, "§5 - add <player> §rAdds a friend");
  2337. msg.string(player, "§5 - remove <player> §rRemoves a friend");
  2338. msg.string(player, "§5 - list §rLists all your friends");
  2339. goto("wait");
  2340. }
  2341. arg0 = string.toLowerCase(list.getIndex(args, 0));
  2342. if(arg0 == "add") {
  2343. if(size != 2) {
  2344. msg.prefix(player, prefix_friends, "/friend add <player>");
  2345. goto("wait");
  2346. }
  2347. friend_name = list.getIndex(args, 1);
  2348. player_name = player.getName(player);
  2349. if(player_name == friend_name) {
  2350. msg.prefix(player, prefix_friends, "You can´t invite yourself.");
  2351. goto("wait");
  2352. }
  2353. player_id = player.getId(player);
  2354. if(!checkIfEverOnline(friend_name)) {
  2355. msg.prefix(player, prefix_friends, "This player has never been online.");
  2356. goto("wait");
  2357. }
  2358. friend_id = player.getId(player.getUuid(friend_name));
  2359. if(friend.check(player_id, friend_id)) {
  2360. msg.prefix(player, prefix_friends, "This player is already your friend.");
  2361. goto("wait");
  2362. }
  2363. if(map.contains(friend_requests, friend_id)) {
  2364. if(map.get(friend_requests, friend_id) == player_id) {
  2365. friend.add(player_id, friend_id);
  2366. map.remove(friend_requests, friend_id);
  2367. msg.prefix(player, prefix_friends, string.concat("§7", friend_name, "§r is your friend now."));
  2368. msg.send(player, friend_name, prefix_friends, string.concat("§7", player_name, "§r is your friend now."), true);
  2369. goto("wait");
  2370. }
  2371. }
  2372. map.add(friend_requests, player_id, friend_id); //Einlader, Eingeladener
  2373. friend = read.player(friend_name);
  2374. msg.prefix(player, prefix_friends, string.concat("You sent an invitation to §7", friend_name, "§r."));
  2375. if(friend != null) {
  2376. 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))));
  2377. }
  2378. goto("wait");
  2379. }
  2380. if(arg0 == "remove") {
  2381. if(size != 2) {
  2382. msg.prefix(player, prefix_friends, "/friend remove <player>");
  2383. goto("wait");
  2384. }
  2385. friend_name = list.getIndex(args, 1);
  2386. player_id = player.getId(player);
  2387. if(!checkIfEverOnline(friend_name)) {
  2388. msg.prefix(player, prefix_friends, "This player has never been online.");
  2389. goto("wait");
  2390. }
  2391. friend_id = player.getId(player.getUuid(friend_name));
  2392. if(!friend.check(player_id, friend_id)) {
  2393. msg.prefix(player, prefix_friends, "This player isn´t your friend.");
  2394. goto("wait");
  2395. }
  2396. friend.delete(player_id, friend_id);
  2397. msg.prefix(player, prefix_friends, string.concat("§7", friend_name, "§r is no longer your friend."));
  2398. msg.send(player, friend_name, prefix_friends, string.concat("§7", player.getName(player), "§r is no longer your friend."), true);
  2399. goto("wait");
  2400. }
  2401. if(arg0 == "list") {
  2402. if(size != 1) {
  2403. msg.prefix(player, prefix_friends, "/friend list");
  2404. goto("wait");
  2405. }
  2406. player_id = player.getId(player);
  2407. friendlist = friend.getList(player_id);
  2408. listsize = list.getSize(friendlist);
  2409. if(listsize == 0) {
  2410. msg.prefix(player, prefix_friends, "You have no friends yet.");
  2411. goto("wait");
  2412. }
  2413. msg.string(player, "§5Friends:");
  2414. for(i = 0; i <= listsize - 1; i++) {
  2415. friend_name = player.getNameFromId(list.getIndex(friendlist, i));
  2416. if(friend_name != null) {
  2417. msg.string(player, string.concat("- ", friend_name));
  2418. }
  2419. }
  2420. goto("wait");
  2421. }
  2422. goto("friend_syntax");
  2423. @var
  2424. if(size != 2) {
  2425. msg.prefix(player, prefix_commands, "/var <id> <varname>");
  2426. goto("wait");
  2427. }
  2428. script_id = list.getIndex(args, 0);
  2429. script = script.getFromId(script_id);
  2430. if(script == null) {
  2431. msg.prefix(player, "§dScript", "Invalid id");
  2432. goto("wait");
  2433. }
  2434. var_name = list.getIndex(args, 1);
  2435. var = script.getVar(script, var_name);
  2436. msg.prefix(player, "§dScript", string.concat(var_name, " = ", var));
  2437. goto("wait");
  2438. @vote
  2439. msg.string(player, string.getSpacer());
  2440. if(size == 0) {
  2441. link1 = "https://minecraft-server.eu/vote/index/2227F";
  2442. link2 = "https://minecraft-server-list.com/server/478200/vote/";
  2443. msg(player, text.merge(text.new(string.getPrefix(prefix_vote)), text.new(" "), string.getLinkText("§r<§dminecraft-server.eu§r>", link1)));
  2444. msg(player, text.merge(text.new(string.getPrefix(prefix_vote)), text.new(" "), string.getLinkText("§r<§dminecraft-server-list.com§r>", link2)));
  2445. p_id = player.getId(player);
  2446. } else {
  2447. if(!perm.has("user.other", player)) {
  2448. perm.no("user.other", player);
  2449. goto("wait");
  2450. }
  2451. p_name = list.getIndex(args, 0);
  2452. if(!checkIfEverOnline(p_name)) {
  2453. msg.prefix(player, prefix_commands, "This player has never been online.");
  2454. goto("wait");
  2455. }
  2456. p_id = player.getId(player.getUuid(p_name));
  2457. }
  2458. msg(player, text.merge(text.new(string.getPrefix(prefix_vote)), text.new(" "), text.new(string.concat("Votepoints: §6", string.number(player.getVotePoints(p_id))))));
  2459. msg(player, text.merge(text.new(string.getPrefix(prefix_vote)), text.new(" "), text.new(string.concat("Votestreak: §6", string.number(player.getVoteStreak(p_id))))));
  2460. last_vote_time = player.getLastVoteTime(p_id);
  2461. if(last_vote_time == 0) {
  2462. last_vote_time = "-";
  2463. } else {
  2464. last_vote_time = time.getString(last_vote_time);
  2465. }
  2466. msg(player, text.merge(text.new(string.getPrefix(prefix_vote)), text.new(" "), text.new(string.concat("Last vote: §6", last_vote_time))));
  2467. goto("wait");
  2468. @voteshop
  2469. inv.open(vote_inv, player, string.concat("Your vote points: §6", string.number(player.getVotePoints(player))));
  2470. goto("wait");
  2471. @setservermessage
  2472. if(size < 1) {
  2473. msg.prefix(player, prefix_commands, "/setservermessage <text>");
  2474. goto("wait");
  2475. }
  2476. message = string.concatList(args, " ", 0, size - 1);
  2477. message = string.replace(message, "&", "§");
  2478. setMOTD(message);
  2479. msg.prefix(player, prefix_commands, "Server-Message gesetzt");
  2480. goto("wait");
  2481. @error
  2482. if(size < 1) {
  2483. msg.prefix(player, "§cError", "/error ...");
  2484. msg.string(player, "§c - list §rLists all errors");
  2485. msg.string(player, "§c - clear §rDeletes all errors");
  2486. goto("wait");
  2487. }
  2488. arg0 = string.toLowerCase(list.getIndex(args, 0));
  2489. if(arg0 == "list") {
  2490. error_size = error.getSize();
  2491. if(error_size == 0) {
  2492. msg.prefix(player, "§cError", "No errors existing.");
  2493. goto("wait");
  2494. }
  2495. for(i = 0; i < error_size; i++) {
  2496. msg.string(player, error.getIndex(i));
  2497. }
  2498. goto("wait");
  2499. }
  2500. if(arg0 == "clear") {
  2501. error.clear();
  2502. msg.prefix(player, "§cError", "All errors deleted.");
  2503. goto("wait");
  2504. }
  2505. goto("wait");
  2506. @hat
  2507. item = living.getHand(player);
  2508. if(item.isAir(item)) {
  2509. msg.prefix(player, prefix_commands, "You have to hold an item in hand.");
  2510. goto("wait");
  2511. }
  2512. head_slot = slot.getHead();
  2513. head_item = living.getEquip(player, head_slot);
  2514. living.setEquip(player, head_slot, item);
  2515. living.setEquip(player, slot.getHand(), head_item);
  2516. goto("wait");
  2517. @news
  2518. if(size < 1) {
  2519. msg.prefix(player, prefix_commands, "/news <text>");
  2520. goto("wait");
  2521. }
  2522. message = string.concatList(args, " ", 0, size - 1);
  2523. online_list = players.toList();
  2524. iter = iterator(online_list);
  2525. while(hasNext(iter)) {
  2526. p = next(iter);
  2527. title.send(p, text.new("§cNews"), text.new(string.concat("by ", player.getName(player))));
  2528. msg.prefix(p, "§4News", string.concat("§c", message));
  2529. }
  2530. goto("wait");
  2531. @skipnight
  2532. player_loc = entity.getLocation(player);
  2533. world_name = world.getName(loc.getWorld(player_loc));
  2534. if(!world.isSurvName(world_name)) {
  2535. msg.prefix(player, prefix_commands, "Not possible in this world.");
  2536. goto("wait");
  2537. }
  2538. world_time = world.getTime(world.getOverWorld());
  2539. while(world_time >= 24000) {
  2540. world_time -= 24000;
  2541. }
  2542. if(world_time <= 12500) {
  2543. msg.prefix(player, prefix_commands, "Only during night possible.");
  2544. goto("wait");
  2545. }
  2546. player_uuid = player.getUuid(player);
  2547. if(set.contains(skip_night_set, player_uuid)) {
  2548. msg.prefix(player, prefix_commands, "Already voted.");
  2549. goto("wait");
  2550. }
  2551. if(time.getMillis() - last_skip_night < 420000) {
  2552. msg.prefix(player, prefix_commands, "Only once per night possible.");
  2553. goto("wait");
  2554. }
  2555. inv.open(skip_night_inv, player);
  2556. goto("wait");
  2557. @spawn
  2558. if(size == 0) {
  2559. p = player;
  2560. }
  2561. if(size == 1) {
  2562. if(!perm.has("tp.other", player)) {
  2563. perm.no("tp.other", player);
  2564. goto("wait");
  2565. }
  2566. p_name = list.getIndex(args, 0);
  2567. p = read.player(p_name);
  2568. if(p == null) {
  2569. msg.prefix(player, prefix_commands, "This player is not online.");
  2570. goto("wait");
  2571. }
  2572. }
  2573. if(player.hasMinigame(p)) {
  2574. if(size == 1) {
  2575. msg.prefix(player, prefix_commands, "This player can´t be teleported now.");
  2576. goto("wait");
  2577. }
  2578. msg.prefix(player, prefix_commands, "You can´t teleport now.");
  2579. goto("wait");
  2580. }
  2581. if(player.teleport(p, world.getServerSpawn(), true)) {
  2582. if(player == p) {
  2583. msg.prefix(p, prefix_commands, "You have been teleported to the spawn.");
  2584. } else {
  2585. msg.prefix(player, prefix_commands, string.concat(player.getName(p), " was teleported to the spawn."));
  2586. }
  2587. }
  2588. goto("wait");
  2589. @rank
  2590. msg.string(player, string.getSpacer());
  2591. rank = getRank(player);
  2592. msg.string(player, string.concat("§6Current rank: §r[", rank, "§r]"));
  2593. msg.string(player, "Choose a rank:");
  2594. rank.showAll(player);
  2595. goto("wait");
  2596. @setrank
  2597. if(size < 2) {
  2598. msg.prefix(player, prefix_commands, "/setrank <player> <rank>");
  2599. goto("wait");
  2600. }
  2601. p_name = list.getIndex(args, 0);
  2602. if(!checkIfEverOnline(p_name)) {
  2603. msg.prefix(player, prefix_commands, "This player has never been online.");
  2604. goto("wait");
  2605. }
  2606. p = read.player(p_name);
  2607. if(p == null) {
  2608. msg.prefix(player, prefix_commands, "This player is not online.");
  2609. goto("wait");
  2610. }
  2611. p_name = player.getName(p);
  2612. rank = string.concatList(args, " ", 1, size - 1);
  2613. if(!perm.has("setrank.other", player)) {
  2614. if(player.getName(player) != p_name) {
  2615. perm.no("setrank.other", player);
  2616. goto("wait");
  2617. }
  2618. colored = string.startsWith(rank, "&", 0);
  2619. if(colored) {
  2620. rank = string.subString(rank, 1, string.length(rank));
  2621. }
  2622. a = rank.getRankArray();
  2623. a_size = array.getSize(a);
  2624. for(i = 0; i < a_size; i++) {
  2625. tech_name = a[i, 0];
  2626. if(rank == a[i, 1] && !rank.checkCriteria(p, tech_name)) {
  2627. perm.no(tech_name, p);
  2628. goto("wait");
  2629. }
  2630. }
  2631. if(colored) {
  2632. rank = string.concat("&", rank);
  2633. }
  2634. }
  2635. if(string.length(rank) >= 30) {
  2636. msg.prefix(player, prefix_commands, "Only 30 letters allowed.");
  2637. goto("wait");
  2638. }
  2639. rank = string.replace(rank, "&", "§");
  2640. setRank(p, rank);
  2641. player.setTabName(p);
  2642. msg.prefix(player, prefix_commands, string.concat("Rank for ", p_name, " changed to [", rank, "§r]."));
  2643. goto("wait");
  2644. @nowb
  2645. if(player.isAfk(player)) {
  2646. player.setAfk(player, false);
  2647. msg.prefix(player, prefix_commands, "marvinius whispers to you: Welcome back ;-)");
  2648. player.setTabName(player);
  2649. } else {
  2650. msg.prefix(player, prefix_commands, "You are not afk.");
  2651. }
  2652. goto("wait");
  2653. @afk
  2654. if(player.hasMinigame(player)) {
  2655. msg.prefix(player, prefix_commands, "No afk while in a minigame :P");
  2656. goto("wait");
  2657. }
  2658. nickname = player.getNickname(player);
  2659. if(player.isAfk(player)) {
  2660. msg.prefix("online", prefix_commands, string.concat(nickname, "§7 is back."));
  2661. player.setAfk(player, false);
  2662. } else {
  2663. msg.prefix("online", prefix_commands, string.concat(nickname, "§7 is now afk."));
  2664. player.setAfk(player, true);
  2665. if(!afk_loop_active) {
  2666. afk_loop_active = true;
  2667. sgoto(30, "afk_loop");
  2668. }
  2669. }
  2670. player.setTabName(player);
  2671. goto("wait");
  2672. @silentjoin
  2673. silentjoin = player.getSilentJoin(player);
  2674. if(silentjoin) {
  2675. player.setSilentJoin(player, false);
  2676. msg.prefix(player, prefix_commands, "Silentjoin deactivated.");
  2677. } else {
  2678. player.setSilentJoin(player, true);
  2679. msg.prefix(player, prefix_commands, "Silentjoin activated.");
  2680. }
  2681. goto("wait");
  2682. @joinme
  2683. list = players.toList();
  2684. iter = iterator(list);
  2685. while(hasNext(iter)) {
  2686. invitee = next(iter);
  2687. if(player == invitee) {
  2688. continue;
  2689. }
  2690. party.invitePlayer(player, invitee);
  2691. }
  2692. msg.prefix(player, prefix_party, "Party invitation sent to all online players.");
  2693. goto("wait");
  2694. @jumpto
  2695. block = player.getTargetBlock(player, 100);
  2696. if(block == null) {
  2697. msg.prefix(player, prefix_commands, "No block in sight.");
  2698. goto("wait");
  2699. }
  2700. loc = block.getLocation(block);
  2701. y = loc.getY(loc);
  2702. while(y < 319 && !block.isAir(block.get(loc))) {
  2703. loc.setY(loc, y);
  2704. y++;
  2705. }
  2706. player.teleport(player, loc.mod(loc, 0, 1, 0), true);
  2707. goto("wait");
  2708. @jailloop
  2709. size = list.getSize(jailed_list);
  2710. for(i = 0; i < size; i++) {
  2711. p_name = player.getName(list.getIndex(jailed_list, i));
  2712. showJail(p_name);
  2713. }
  2714. if(size > 0) {
  2715. jail_loop_active = true;
  2716. sgoto(5, "jailloop");
  2717. } else {
  2718. jail_loop_active = false;
  2719. }
  2720. goto("wait");
  2721. @sb_title_loop
  2722. list = players.toList();
  2723. iter = iterator(list);
  2724. if(title_a == null) {
  2725. while(hasNext(iter)) {
  2726. p = next(iter);
  2727. sb.setTitle(p, text.new("§c§k# §6minecraft§c.§6hammerle§c.§6me §c§k#"));
  2728. title_a = true;
  2729. }
  2730. } else {
  2731. while(hasNext(iter)) {
  2732. p = next(iter);
  2733. sb.setTitle(p, text.new(string.concat(icon.getHeart(), "§6Mundus §cCrassus§f", icon.getHeart())));
  2734. title_a = null;
  2735. }
  2736. }
  2737. sgoto(200, "sb_title_loop");
  2738. goto("wait");
  2739. @coordsloop
  2740. list = players.toList();
  2741. size = list.getSize(list);
  2742. for(i = 0; i < size; i++) {
  2743. p = list.getIndex(list, i);
  2744. if(player.getShowcoords(p)) {
  2745. p_loc = entity.getLocation(p);
  2746. 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))));
  2747. sb.add(p, 2, string.concat(icon.getCompass(), " ", getDirectionExact(loc.getYaw(p_loc))));
  2748. }
  2749. }
  2750. sgoto(15, "coordsloop");
  2751. goto("wait");
  2752. @customitems
  2753. inv = inv.new("222222222222222222222222222222222222222222222222222222", text.new("Customitems"));
  2754. a = item.custom.getAll();
  2755. for(i = 0; i < array.getSize(a); i++) {
  2756. item = item.custom.new(a[i]);
  2757. item.setAmount(item, item.getMaxAmount(item));
  2758. inv.setItem(inv, i, item);
  2759. if(i > 53) {
  2760. msg.dev("More customitems than can be shown in one inv");
  2761. break;
  2762. }
  2763. }
  2764. inv.open(inv, player);
  2765. goto("wait");
  2766. @afk_loop
  2767. if(!afk_loop_active) {
  2768. goto("wait");
  2769. }
  2770. afk_map = getScriptVar("afk_map");
  2771. iter = map.iterator(afk_map);
  2772. while(hasNext(iter)) {
  2773. element = next(iter);
  2774. yaw = map.getValue(element);
  2775. player = player.get(map.getKey(element));
  2776. if(player != null) {
  2777. if(yaw != loc.getYaw(entity.getLocation(player))) {
  2778. nickname = player.getNickname(player);
  2779. msg.prefix("online", prefix_commands, string.concat(nickname, "§7 is back."));
  2780. remove(iter);
  2781. player.setAfk(player, false);
  2782. player.setTabName(player);
  2783. }
  2784. }
  2785. }
  2786. size = map.getSize(afk_map);
  2787. if(size > 0) {
  2788. afk_loop_active = true;
  2789. sgoto(30, "afk_loop");
  2790. } else {
  2791. afk_loop_active = false;
  2792. }
  2793. goto("wait");
  2794. @minute_loop
  2795. cal = time.new(time.getMillis());
  2796. timer_day = time.getDay(cal);
  2797. if(old_timer_day == null) {
  2798. old_timer_day = timer_day;
  2799. }
  2800. if(timer_day != old_timer_day) {
  2801. old_timer_day = timer_day;
  2802. //Tageswechsel
  2803. decreaseHomeBoost();
  2804. }
  2805. sgoto(1200, "minute_loop");
  2806. goto("wait");
  2807. @afk_checker_loop
  2808. online_list = players.toList();
  2809. iter = iterator(online_list);
  2810. while(hasNext(iter)) {
  2811. uuid = next(iter);
  2812. p = player.get(uuid);
  2813. if(player.hasMinigame(p)) {
  2814. continue;
  2815. }
  2816. yaw = loc.getYaw(entity.getLocation(p));
  2817. a = map.get(afk_checker_map, uuid);
  2818. if(a == null) {
  2819. a = array.new(2);
  2820. a[0] = yaw;
  2821. a[1] = 0;
  2822. map.add(afk_checker_map, uuid, a);
  2823. continue;
  2824. }
  2825. last_yaw = a[0];
  2826. counter = a[1];
  2827. if(last_yaw == yaw) {
  2828. counter++;
  2829. } else {
  2830. counter = 0;
  2831. }
  2832. a[0] = yaw;
  2833. a[1] = counter;
  2834. map.add(afk_checker_map, uuid, a);
  2835. if(counter == 5) {
  2836. nickname = player.getNickname(p);
  2837. if(player.isAfk(p)) {
  2838. continue;
  2839. }
  2840. msg.prefix("online", prefix_commands, string.concat(nickname, "§7 is now afk."));
  2841. player.setAfk(p, true);
  2842. player.setTabName(p);
  2843. if(!afk_loop_active) {
  2844. afk_loop_active = true;
  2845. sgoto(30, "afk_loop");
  2846. }
  2847. }
  2848. }
  2849. sgoto(1200, "afk_checker_loop");
  2850. goto("wait");
  2851. @armorstand
  2852. if(size == 0) {
  2853. @armorstand_syntax
  2854. msg.prefix(player, prefix_datatools, "/armorstand ...");
  2855. msg.string(player, "§6 - name <name> §rSets the name");
  2856. msg.string(player, "§6 - visible <true/false> §rSets if is visible");
  2857. msg.string(player, "§6 - arms <true/false> §rSets if has arms");
  2858. msg.string(player, "§6 - small <true/false> §rSets if is small");
  2859. msg.string(player, "§6 - baseplate <true/false> §rSets if has baseplate");
  2860. msg.string(player, "§6 - marker <true/false> §rSets if is marker");
  2861. msg.string(player, "§6 - move <true/false> §rSets if can move");
  2862. msg.string(player, "§6 - tick <true/false> §rSets if can tick");
  2863. msg.string(player, "§6 - setpose <bodypart> <x> <y> <z> §rSets the pose");
  2864. msg.string(player, "§6 - addpose <bodypart> <x> <y> <z> §rSets the pose");
  2865. goto("wait");
  2866. }
  2867. as = player.getTargetEntity(player, 5);
  2868. if(!entity.isArmorstand(entity)) {
  2869. location = entity.getLocation(player);
  2870. as = entity.get(location, 3, "org.bukkit.entity.ArmorStand");
  2871. if(as == null) {
  2872. msg.action(player, "No armorstand found.");
  2873. goto("wait");
  2874. }
  2875. }
  2876. arg0 = string.toLowerCase(list.getIndex(args, 0));
  2877. if(arg0 == "name") {
  2878. if(size < 2) {
  2879. msg.prefix(player, prefix_datatools, "/armorstand name <name>");
  2880. goto("wait");
  2881. }
  2882. name = string.concatList(args, " ", 1, size - 1);
  2883. name = string.replace(name, "&", "§");
  2884. entity.setName(as, text.new(name), true);
  2885. msg.action(player, string.concat("Armorstand renamed to ", name, "§r."));
  2886. goto("wait");
  2887. }
  2888. if(arg0 == "visible") {
  2889. if(size < 2) {
  2890. msg.prefix(player, prefix_datatools, "/armorstand visible <true/false>");
  2891. goto("wait");
  2892. }
  2893. bool = list.getIndex(args, 1);
  2894. if(bool != true && bool != false) {
  2895. msg.action(player, "True/False expected.");
  2896. goto("wait");
  2897. }
  2898. living.setInvisible(as, !bool);
  2899. msg.action(player, "Visibility set.");
  2900. goto("wait");
  2901. }
  2902. if(arg0 == "arms") {
  2903. if(size < 2) {
  2904. msg.prefix(player, prefix_datatools, "/armorstand arms <true/false>");
  2905. goto("wait");
  2906. }
  2907. bool = list.getIndex(args, 1);
  2908. if(bool != true && bool != false) {
  2909. msg.action(player, "True/False expected.");
  2910. goto("wait");
  2911. }
  2912. as.setArms(as, bool);
  2913. msg.action(player, "Arms set.");
  2914. goto("wait");
  2915. }
  2916. if(arg0 == "small") {
  2917. if(size < 2) {
  2918. msg.prefix(player, prefix_datatools, "/armorstand small <true/false>");
  2919. goto("wait");
  2920. }
  2921. bool = list.getIndex(args, 1);
  2922. if(bool != true && bool != false) {
  2923. msg.action(player, "True/False expected.");
  2924. goto("wait");
  2925. }
  2926. as.setSmall(as, bool);
  2927. msg.action(player, "Small set.");
  2928. goto("wait");
  2929. }
  2930. if(arg0 == "baseplate") {
  2931. if(size < 2) {
  2932. msg.prefix(player, prefix_datatools, "/armorstand baseplate <true/false>");
  2933. goto("wait");
  2934. }
  2935. bool = list.getIndex(args, 1);
  2936. if(bool != true && bool != false) {
  2937. msg.action(player, "True/False expected.");
  2938. goto("wait");
  2939. }
  2940. as.setBasePlate(as, bool);
  2941. msg.action(player, "Baseplate set.");
  2942. goto("wait");
  2943. }
  2944. if(arg0 == "marker") {
  2945. if(size < 2) {
  2946. msg.prefix(player, prefix_datatools, "/armorstand marker <true/false>");
  2947. goto("wait");
  2948. }
  2949. bool = list.getIndex(args, 1);
  2950. if(bool != true && bool != false) {
  2951. msg.action(player, "True/False expected.");
  2952. goto("wait");
  2953. }
  2954. as.setMarker(as, bool);
  2955. msg.action(player, "Marker set.");
  2956. goto("wait");
  2957. }
  2958. if(arg0 == "move") {
  2959. if(size < 2) {
  2960. msg.prefix(player, prefix_datatools, "/armorstand move <true/false>");
  2961. goto("wait");
  2962. }
  2963. bool = list.getIndex(args, 1);
  2964. if(bool != true && bool != false) {
  2965. msg.action(player, "True/False expected.");
  2966. goto("wait");
  2967. }
  2968. as.canMove(as, bool);
  2969. msg.action(player, "Move set.");
  2970. goto("wait");
  2971. }
  2972. if(arg0 == "tick") {
  2973. if(size < 2) {
  2974. msg.prefix(player, prefix_datatools, "/armorstand tick <true/false>");
  2975. goto("wait");
  2976. }
  2977. bool = list.getIndex(args, 1);
  2978. if(bool != true && bool != false) {
  2979. msg.action(player, "True/False expected.");
  2980. goto("wait");
  2981. }
  2982. as.canTick(as, bool);
  2983. msg.action(player, "Tick set.");
  2984. goto("wait");
  2985. }
  2986. if(arg0 == "setpose") {
  2987. if(size < 5) {
  2988. msg.prefix(player, prefix_datatools, "/armorstand setpose <bodypart> <x> <y> <z>");
  2989. goto("wait");
  2990. }
  2991. x = list.getIndex(args, 2);
  2992. if(!isDouble(x) || x < -360 || x > 360) {
  2993. msg.action(player, "Number between -360 and 360 expected.");
  2994. goto("wait");
  2995. }
  2996. x *= math.pi() / 180;
  2997. y = list.getIndex(args, 3);
  2998. if(!isDouble(y) || y < -360 || y > 360) {
  2999. msg.action(player, "Number between -360 and 360 expected.");
  3000. goto("wait");
  3001. }
  3002. y *= math.pi() / 180;
  3003. z = list.getIndex(args, 4);
  3004. if(!isDouble(z) || z < -360 || z > 360) {
  3005. player.action(player, "Number between -360 and 360 expected.");
  3006. goto("wait");
  3007. }
  3008. z *= math.pi() / 180;
  3009. euler_angle = euler.new(x, y, z);
  3010. bodypart = list.getIndex(args, 1);
  3011. if(bodypart == "head") {
  3012. as.setHeadPose(as, euler_angle);
  3013. } elseif(bodypart == "body") {
  3014. as.setBodyPose(as, euler_angle);
  3015. } elseif(bodypart == "leftleg") {
  3016. as.setLeftLegPose(as, euler_angle);
  3017. } elseif(bodypart == "rightleg") {
  3018. as.setRightLegPose(as, euler_angle);
  3019. } elseif(bodypart == "leftarm") {
  3020. as.setLeftArmPose(as, euler_angle);
  3021. } elseif(bodypart == "rightarm") {
  3022. as.setRightArmPose(as, euler_angle);
  3023. } else {
  3024. msg.action(player, "Not a legit bodypart.");
  3025. goto("wait");
  3026. }
  3027. msg.action(player, "Pose set.");
  3028. goto("wait");
  3029. }
  3030. if(arg0 == "addpose") {
  3031. if(size < 5) {
  3032. msg.prefix(player, prefix_datatools, "/armorstand addpose <bodypart> <x> <y> <z>");
  3033. goto("wait");
  3034. }
  3035. x = list.getIndex(args, 2);
  3036. if(!isDouble(x) || x < -360 || x > 360) {
  3037. msg.action(player, "Number between -360 and 360 expected.");
  3038. goto("wait");
  3039. }
  3040. x *= math.pi() / 180;
  3041. y = list.getIndex(args, 3);
  3042. if(!isDouble(y) || y < -360 || y > 360) {
  3043. msg.action(player, "Number between -360 and 360 expected.");
  3044. goto("wait");
  3045. }
  3046. y *= math.pi() / 180;
  3047. z = list.getIndex(args, 4);
  3048. if(!isDouble(z) || z < -360 || z > 360) {
  3049. msg.action(player, "Number between -360 and 360 expected.");
  3050. goto("wait");
  3051. }
  3052. z *= math.pi() / 180;
  3053. bodypart = list.getIndex(args, 1);
  3054. if(bodypart == "head") {
  3055. euler_angle = as.getHeadPose(as);
  3056. euler_angle = euler.setX(euler_angle, euler.getX(euler_angle) + x);
  3057. euler_angle = euler.setY(euler_angle, euler.getY(euler_angle) + y);
  3058. euler_angle = euler.setZ(euler_angle, euler.getZ(euler_angle) + z);
  3059. as.setHeadPose(as, euler_angle);
  3060. } elseif(bodypart == "body") {
  3061. euler_angle = as.getBodyPose(as);
  3062. euler_angle = euler.setX(euler_angle, euler.getX(euler_angle) + x);
  3063. euler_angle = euler.setY(euler_angle, euler.getY(euler_angle) + y);
  3064. euler_angle = euler.setZ(euler_angle, euler.getZ(euler_angle) + z);
  3065. as.setBodyPose(as, euler_angle);
  3066. } elseif(bodypart == "leftleg") {
  3067. euler_angle = as.getLeftLegPose(as);
  3068. euler_angle = euler.setX(euler_angle, euler.getX(euler_angle) + x);
  3069. euler_angle = euler.setY(euler_angle, euler.getY(euler_angle) + y);
  3070. euler_angle = euler.setZ(euler_angle, euler.getZ(euler_angle) + z);
  3071. as.setLeftLegPose(as, euler_angle);
  3072. } elseif(bodypart == "rightleg") {
  3073. euler_angle = as.getRightLegPose(as);
  3074. euler_angle = euler.setX(euler_angle, euler.getX(euler_angle) + x);
  3075. euler_angle = euler.setY(euler_angle, euler.getY(euler_angle) + y);
  3076. euler_angle = euler.setZ(euler_angle, euler.getZ(euler_angle) + z);
  3077. as.setRightLegPose(as, euler_angle);
  3078. } elseif(bodypart == "leftarm") {
  3079. euler_angle = as.getLeftArmPose(as);
  3080. euler_angle = euler.setX(euler_angle, euler.getX(euler_angle) + x);
  3081. euler_angle = euler.setY(euler_angle, euler.getY(euler_angle) + y);
  3082. euler_angle = euler.setZ(euler_angle, euler.getZ(euler_angle) + z);
  3083. as.setLeftArmPose(as, euler_angle);
  3084. } elseif(bodypart == "rightarm") {
  3085. euler_angle = as.getRightArmPose(as);
  3086. euler_angle = euler.setX(euler_angle, euler.getX(euler_angle) + x);
  3087. euler_angle = euler.setY(euler_angle, euler.getY(euler_angle) + y);
  3088. euler_angle = euler.setZ(euler_angle, euler.getZ(euler_angle) + z);
  3089. as.setRightArmPose(as, euler_angle);
  3090. } else {
  3091. msg.action(player, "Not a legit bodypart.");
  3092. goto("wait");
  3093. }
  3094. msg.action(player, "Pose set.");
  3095. goto("wait");
  3096. }
  3097. goto("armorstand_syntax");
  3098. @ass
  3099. if(size == 0) {
  3100. msg.prefix(player, prefix_commands, "§r/ass ...");
  3101. msg.string(player, " - set <name>");
  3102. msg.string(player, " - name <name>");
  3103. msg.string(player, " - remove");
  3104. goto("wait");
  3105. }
  3106. arg0 = string.toLowerCase(list.getIndex(args, 0));
  3107. if(arg0 == "set") {
  3108. if(size < 2) {
  3109. msg.prefix(player, prefix_datatools, "/ass set <name>");
  3110. goto("wait");
  3111. }
  3112. name = string.concatList(string_args, " ", 1, size - 1);
  3113. name = string.replace(name, "&", "§");
  3114. as = entity.spawn(entity.getLocation(player), "ARMOR_STAND");
  3115. entity.setGravity(as, false);
  3116. entity.setName(as, text.new(name), true);
  3117. living.setInvisible(as, true);
  3118. as.setMarker(as, true);
  3119. as.canTick(as, false);
  3120. goto("wait");
  3121. }
  3122. as = player.getTargetEntity(player, 5);
  3123. if(!entity.isArmorstand(entity)) {
  3124. location = entity.getLocation(player);
  3125. as = entity.get(location, 3, "org.bukkit.entity.ArmorStand");
  3126. if(as == null) {
  3127. msg.action(player, "No armorstand found.");
  3128. goto("wait");
  3129. }
  3130. }
  3131. if(arg0 == "name") {
  3132. if(size < 2) {
  3133. msg.prefix(player, prefix_datatools, "/ass name <name>");
  3134. goto("wait");
  3135. }
  3136. name = string.concatList(string_args, " ", 1, size - 1);
  3137. name = string.replace(name, "&", "§");
  3138. entity.setName(as, text.new(name), true);
  3139. msg.action(player, "Armorstand renamed.");
  3140. goto("wait");
  3141. }
  3142. if(arg0 == "remove") {
  3143. entity.remove(as);
  3144. msg.action(player, "Armorstand removed.");
  3145. goto("wait");
  3146. }
  3147. goto("wait");
  3148. @potion
  3149. if(size != 3) {
  3150. msg.prefix(player, prefix_perms, "/potion <potion_name> <duration> <power>");
  3151. goto("wait");
  3152. }
  3153. item = living.getHand(player);
  3154. if(item.getType(item) == null || !(item.isType(item, "POTION") || item.isType(item, "SPLASH_POTION") || item.isType(item, "LINGERING_POTION"))) {
  3155. msg.prefix(player, prefix_commands, "You need to hold an potion in your hand.");
  3156. goto("wait");
  3157. }
  3158. potion_name = list.getIndex(args, 0);
  3159. list = getPotionTypes();
  3160. if(!list.contains(list, potion_name)) {
  3161. msg.prefix(player, prefix_commands, "Not an potion effect type.");
  3162. goto("wait");
  3163. }
  3164. duration = list.getIndex(args, 1);
  3165. if(!isDouble(duration) || duration < 0) {
  3166. msg.prefix(player, prefix_commands, "Positive number expected.");
  3167. goto("wait");
  3168. }
  3169. power = list.getIndex(args, 2);
  3170. if(!isDouble(power) || power < 0) {
  3171. msg.prefix(player, prefix_commands, "Positive number expected.");
  3172. goto("wait");
  3173. }
  3174. item.addPotion(item, potion_name, duration, power);
  3175. goto("wait");
  3176. @pvp
  3177. if(size == 0) {
  3178. if(hasPvpOn(player)) {
  3179. mode = "off";
  3180. } else {
  3181. mode = "on";
  3182. }
  3183. p = player;
  3184. } elseif(size == 1) {
  3185. mode = list.getIndex(args, 0);
  3186. if(!(mode == "on" || mode == "off")) {
  3187. goto("pvphelp");
  3188. }
  3189. p = player;
  3190. } elseif(size == 2) {
  3191. if(!perm.has("pvp.other", player)) {
  3192. perm.no("pvp.other", player);
  3193. goto("wait");
  3194. }
  3195. mode = list.getIndex(args, 0);
  3196. if(!(mode == "on" || mode == "off")) {
  3197. goto("pvphelp");
  3198. }
  3199. p_name = list.getIndex(args, 1);
  3200. if(!checkIfEverOnline(p_name)) {
  3201. msg.prefix(player, prefix_commands, "This player has never been online.");
  3202. goto("wait");
  3203. }
  3204. p = read.player(p_name);
  3205. if(p == null) {
  3206. msg.prefix(player, prefix_commands, "This player is not online.");
  3207. goto("wait");
  3208. }
  3209. } else {
  3210. @pvphelp
  3211. if(perm.has("pvp.other", player)) {
  3212. msg.prefix(player, prefix_commands, "/pvp [on/off] [player]");
  3213. } else {
  3214. msg.prefix(player, prefix_commands, "/pvp [on/off]");
  3215. }
  3216. goto("wait");
  3217. }
  3218. if(mode == "on") {
  3219. setPvp(p, true);
  3220. msg.prefix(p, prefix_commands, "You have enabled PvP!");
  3221. if(p != player) {
  3222. msg.prefix(player, prefix_commands, string.concat(player.getName(p), " has now enabled PvP!"));
  3223. }
  3224. } else {
  3225. setPvp(p, false);
  3226. msg.prefix(p, prefix_commands, "You have PvP disabled!");
  3227. if(p != player) {
  3228. msg.prefix(player, prefix_commands, string.concat(player.getName(p), " has now disabled PvP!"));
  3229. }
  3230. }
  3231. goto("wait");
  3232. @suicide
  3233. if(size < 0 || size > 1) {
  3234. msg.prefix(player, prefix_commands, "/suicide [player]");
  3235. goto("wait");
  3236. }
  3237. if(size == 0) {
  3238. p = player;
  3239. }
  3240. if(size == 1) {
  3241. if(!perm.has("suicide.other", player)) {
  3242. perm.no("suicide.other", player);
  3243. goto("wait");
  3244. }
  3245. p_name = list.getIndex(args, 0);
  3246. p = read.player(p_name);
  3247. if(p == null) {
  3248. msg.prefix(player, prefix_commands, "This player is not online.");
  3249. goto("wait");
  3250. }
  3251. }
  3252. if(p != player) {
  3253. msg.prefix(player, prefix_commands, string.concat(player.getName(p), " has been killed."));
  3254. msg.prefix(p, prefix_commands, string.concat("You have been killed by ", player.getName(player), "."));
  3255. } else {
  3256. msg.prefix(p, prefix_commands, "You killed yourself.");
  3257. }
  3258. living.damage(p, 1000, damage.get("generic"));
  3259. goto("wait");
  3260. @nickname
  3261. if(size < 1) {
  3262. msg.prefix(player, "§eNickname", "/nickname ...");
  3263. msg.string(player, string.concat("§e - <name> ", "Sets a nickname"));
  3264. msg.string(player, string.concat("§e - remove ", "Removes a nickname"));
  3265. goto("wait");
  3266. }
  3267. nickname = string.replace(string.concatList(args, " ", 0, size - 1), "&", "§");
  3268. if(nickname == "remove") {
  3269. player.removeNickName(player);
  3270. msg.prefix(player, prefix_commands, string.concat("Your nickname was removed."));
  3271. } else {
  3272. player.setNickName(player, nickname);
  3273. msg.prefix(player, prefix_commands, string.concat("Your nickname was changed to ", nickname, "§r."));
  3274. }
  3275. player.setTabName(player);
  3276. player.setHeadName(player);
  3277. goto("wait");
  3278. @iteminfo
  3279. item = living.getHand(player);
  3280. string = string.item(item);
  3281. string = string.replace(string, "\"", "'");
  3282. msg(player, string.getClipBoardText(string, string));
  3283. item_type = string(item.getType(item));
  3284. msg(player, string.getClipBoardText(item_type, item_type));
  3285. goto("wait");
  3286. @perm
  3287. if(size == 0) {
  3288. @perm_syntax
  3289. msg.prefix(player, prefix_perms, "/perm ...");
  3290. if(perm.has("perm.give", player)) {
  3291. msg.string(player, "§6 - give <player> <perm>");
  3292. }
  3293. if(perm.has("perm.remove", player)) {
  3294. msg.string(player, "§6 - remove <player> <perm>");
  3295. }
  3296. if(perm.has("perm.removeall", player)) {
  3297. msg.string(player, "§6 - removeall <player>");
  3298. }
  3299. if(perm.has("perm.list", player)) {
  3300. msg.string(player, "§6 - list <player>");
  3301. }
  3302. if(perm.has("perm.toggle", player)) {
  3303. msg.string(player, "§6 - toggle");
  3304. }
  3305. goto("wait");
  3306. }
  3307. arg0 = string.toLowerCase(list.getIndex(args, 0));
  3308. if(arg0 == "give") {
  3309. if(!perm.has("perm.give", player)) {
  3310. perm.no("perm.give", player);
  3311. goto("wait");
  3312. }
  3313. if(size != 3) {
  3314. msg.prefix(player, prefix_perms, "/perm give <player> <perm>");
  3315. goto("wait");
  3316. }
  3317. p_name = list.getIndex(args, 1);
  3318. perm = list.getIndex(args, 2);
  3319. if(!checkIfEverOnline(p_name)) {
  3320. msg.prefix(player, prefix_perms, "This player has never been online.");
  3321. goto("wait");
  3322. }
  3323. if(!perm.isGroupName(perm)) {
  3324. msg.prefix(player, prefix_perms, "This is not a permission group.");
  3325. goto("wait");
  3326. }
  3327. if(!perm.has("isOwner", player)) {
  3328. if(perm == "owner") {
  3329. msg.prefix(player, prefix_perms, "Only owners can give this permission group.");
  3330. goto("wait");
  3331. }
  3332. }
  3333. if(!perm.has("isAdmin", player)) {
  3334. if(perm == "admin" || perm == "mod") {
  3335. msg.prefix(player, prefix_perms, "Only admins can give this permission group.");
  3336. goto("wait");
  3337. }
  3338. }
  3339. p_uuid = player.getUuid(p_name);
  3340. p_id = player.getId(p_uuid);
  3341. p_name = player.getName(p_uuid);
  3342. perm_id = perm.getIdFromGroupname(perm);
  3343. if(player.hasPermGroup(p_id, perm_id)) {
  3344. msg.prefix(player, prefix_perms, "Perm already added.");
  3345. goto("wait");
  3346. }
  3347. if(isOnline(p_name)) {
  3348. p = read.player(p_name);
  3349. rank = perm.getRankFromGroupname(perm);
  3350. if(rank != null) {
  3351. offerRank(p, rank.getTechName(rank));
  3352. }
  3353. if(perm == "creative") {
  3354. if(loc.isInCreativeWorld(entity.getLocation(p))) {
  3355. player.setGamemode(p, "CREATIVE");
  3356. }
  3357. }
  3358. }
  3359. perm.addGroupToPlayer(p_id, perm_id);
  3360. msg.prefix(player, prefix_perms, string.concat("§rPerm §7", perm, "§r added to §7", p_name, "§r."));
  3361. goto("wait");
  3362. }
  3363. if(arg0 == "remove") {
  3364. if(!perm.has("perm.remove", player)) {
  3365. perm.no("perm.remove", player);
  3366. goto("wait");
  3367. }
  3368. if(size != 3) {
  3369. msg.prefix(player, prefix_perms, "/perm remove <player> <perm>");
  3370. goto("wait");
  3371. }
  3372. p_name = list.getIndex(args, 1);
  3373. perm = list.getIndex(args, 2);
  3374. if(!checkIfEverOnline(p_name)) {
  3375. msg.prefix(player, prefix_perms, "This player has never been online.");
  3376. goto("wait");
  3377. }
  3378. if(!perm.isGroupName(perm)) {
  3379. msg.prefix(player, prefix_perms, "This is not a permission group.");
  3380. goto("wait");
  3381. }
  3382. if(!perm.has("isOwner", player)) {
  3383. if(perm == "owner") {
  3384. msg.prefix(player, prefix_perms, "Only owners can remove this permission group.");
  3385. goto("wait");
  3386. }
  3387. }
  3388. if(!perm.has("isAdmin", player)) {
  3389. if(perm == "admin" || perm == "mod") {
  3390. msg.prefix(player, prefix_perms, "Only admins can remove this permission group.");
  3391. goto("wait");
  3392. }
  3393. }
  3394. p_uuid = player.getUuid(p_name);
  3395. p_id = player.getId(p_uuid);
  3396. p_name = player.getName(p_uuid);
  3397. perm_id = perm.getIdFromGroupname(perm);
  3398. if(!player.hasPermGroup(p_id, perm_id)) {
  3399. msg.prefix(player, prefix_perms, "This player doesn´t have that perm.");
  3400. goto("wait");
  3401. }
  3402. perm.removeGroupFromPlayer(p_id, perm_id);
  3403. msg.prefix(player, prefix_perms, string.concat("Perm §7", perm, "§r removed from §7", p_name, "§r."));
  3404. goto("wait");
  3405. }
  3406. if(arg0 == "removeall") {
  3407. if(!perm.has("perm.removeall", player)) {
  3408. perm.no("perm.removeall", player);
  3409. goto("wait");
  3410. }
  3411. if(size != 2) {
  3412. msg.prefix(player, prefix_perms, "/perm removeall <player>");
  3413. goto("wait");
  3414. }
  3415. p_name = list.getIndex(args, 1);
  3416. if(!checkIfEverOnline(p_name)) {
  3417. msg.prefix(player, prefix_perms, "This player has never been online.");
  3418. goto("wait");
  3419. }
  3420. p_id = player.getId(player.getUuid(p_name));
  3421. player.removeAllPerms(p_id);
  3422. msg.prefix(player, prefix_perms, string.concat("All perms of §7", p_name, " §rwere removed."));
  3423. goto("wait");
  3424. }
  3425. if(arg0 == "list") {
  3426. if(!perm.has("perm.list", player)) {
  3427. perm.no("perm.list", player);
  3428. goto("wait");
  3429. }
  3430. if(size != 2) {
  3431. msg.prefix(player, prefix_perms, "/perm list <player>");
  3432. goto("wait");
  3433. }
  3434. p_name = list.getIndex(args, 1);
  3435. if(!checkIfEverOnline(p_name)) {
  3436. msg.prefix(player, prefix_perms, "This player has never been online.");
  3437. goto("wait");
  3438. }
  3439. p_id = player.getId(player.getUuid(p_name));
  3440. permslist = player.getPerms(p_id);
  3441. listsize = list.getSize(permslist);
  3442. if(listsize == 0) {
  3443. msg.prefix(player, prefix_perms, "No permissions found.");
  3444. } else {
  3445. msg.prefix(player, prefix_perms, p_name);
  3446. for(i = 0; i < listsize; i++) {
  3447. msg.string(player, string.concat(" - ", perm.getNameFromId(list.getIndex(permslist, i))));
  3448. }
  3449. }
  3450. goto("wait");
  3451. }
  3452. if(arg0 == "toggle") {
  3453. if(!perm.has("perm.toggle", player)) {
  3454. perm.no("perm.toggle", player);
  3455. goto("wait");
  3456. }
  3457. if(perm.has("simuser", player)) {
  3458. perm.initPlayer(player);
  3459. msg.prefix(player, prefix_commands, "You have regained your permissions.");
  3460. } else {
  3461. perm.simUser(player);
  3462. msg.prefix(player, prefix_commands, "Have fun as a user.");
  3463. }
  3464. goto("wait");
  3465. }
  3466. goto("perm_syntax");
  3467. @allsounds
  3468. if(size == 0) {
  3469. msg.prefix(player, prefix_commands, "§r/allsounds...");
  3470. msg.string(player, "§e - start §rStart all sounds loop");
  3471. msg.string(player, "§e - stop §rStop all sounds loop");
  3472. msg.string(player, "§e - play <sound> §rPlay a sound");
  3473. msg.string(player, "§e - show [page] §rClick on a sound");
  3474. goto("wait");
  3475. }
  3476. arg0 = string.toLowerCase(list.getIndex(args, 0));
  3477. if(arg0 == "start") {
  3478. player_uuid = player.getUuid(player);
  3479. if(map.contains(allsounds_indizes, player_uuid)) {
  3480. msg.prefix(player, prefix_commands, "All sounds already started.");
  3481. goto("wait");
  3482. }
  3483. map.add(allsounds_indizes, player_uuid, 0);
  3484. list.add(allsounds_uuids, player_uuid);
  3485. list.add(allsounds_uuids_cross_check, player_uuid);
  3486. msg.prefix(player, prefix_commands, "All sounds started.");
  3487. goto("playallsounds");
  3488. }
  3489. if(arg0 == "stop") {
  3490. player_uuid = player.getUuid(player);
  3491. if(!list.contains(allsounds_uuids_cross_check, player_uuid)) {
  3492. msg.prefix(player, prefix_commands, "No sounds playing.");
  3493. goto("wait");
  3494. }
  3495. map.remove(allsounds_indizes, player_uuid);
  3496. list.remove(allsounds_uuids_cross_check, player_uuid);
  3497. msg.prefix(player, prefix_commands, "All sounds stopped.");
  3498. goto("wait");
  3499. }
  3500. if(arg0 == "play") {
  3501. if(size != 2) {
  3502. msg.prefix(player, prefix_perms, "/allsounds player <sound>");
  3503. goto("wait");
  3504. }
  3505. sound_name = list.getIndex(args, 1);
  3506. sound_name = string.replace(sound_name, "minecraft:", "");
  3507. sound_name = string.replace(sound_name, "[.]", "_");
  3508. sound_name = string.toUpperCase(sound_name);
  3509. if(!list.contains(allsounds_list, sound_name)) {
  3510. msg.prefix(sender, prefix_commands, "Not a known sound.");
  3511. goto("wait");
  3512. }
  3513. sound = sound.get(sound_name);
  3514. sound.spawnForPlayer(player, sound, sound_category_master);
  3515. goto("wait");
  3516. }
  3517. if(arg0 == "show") {
  3518. amount_sounds = list.getSize(allsounds_list);
  3519. max_side = amount_sounds / 10;
  3520. if(size == 1) {
  3521. side = 1;
  3522. print_side = side - 1;
  3523. } else {
  3524. side = list.getIndex(args, 1);
  3525. if(!isDouble(side)) {
  3526. msg.prefix(sender, prefix_commands, "/allsounds show [side]");
  3527. goto("wait");
  3528. }
  3529. print_side = side - 1;
  3530. if(print_side < 0 || print_side > max_side) {
  3531. msg.prefix(sender, prefix_commands, string.concat("Possible: 1 - ", string.number(math.roundDown(max_side + 1))));
  3532. goto("wait");
  3533. }
  3534. }
  3535. msg.string(sender, string.concat("§a --- All Sounds ", string.number(side), " ---"));
  3536. for(i = print_side * 10; i < print_side * 10 + 10; i++) {
  3537. if(i < amount_sounds) {
  3538. sound_name = list.getIndex(allsounds_list, i);
  3539. msg(sender, string.getClickText(string.concat(" ", sound_name), string.concat("/allsounds play ", sound_name)));
  3540. }
  3541. }
  3542. if(side == 1) {
  3543. backward = text.new("§c<<Backward<<");
  3544. forward = string.getClickText("§b>>Forward>>", string.concat("/allsounds show ", side + 1));
  3545. } elseif(side > max_side) {
  3546. backward = string.getClickText("§b<<Backward<<", string.concat("/allsounds show ", side - 1));
  3547. forward = text.new("§c>>Forward>>");
  3548. } else {
  3549. backward = string.getClickText("§b<<Backward<<", string.concat("/allsounds show ", side - 1));
  3550. forward = string.getClickText("§b>>Forward>>", string.concat("/allsounds show ", side + 1));
  3551. }
  3552. msg(sender, text.merge(backward, text.new(" "), forward));
  3553. goto("wait");
  3554. }
  3555. goto("wait");
  3556. @playallsounds
  3557. player_uuid = list.getIndex(allsounds_uuids, 0);
  3558. list.removeIndex(allsounds_uuids, 0);
  3559. if(!list.contains(allsounds_uuids_cross_check, player_uuid)) {
  3560. goto("wait");
  3561. }
  3562. player = player.get(player_uuid);
  3563. if(player == null) {
  3564. map.remove(allsounds_indizes, player_uuid);
  3565. goto("wait");
  3566. }
  3567. i = map.get(allsounds_indizes, player_uuid);
  3568. if(i == list.getSize(allsounds_list)) {
  3569. map.remove(allsounds_indizes, player_uuid);
  3570. msg.prefix(player, prefix_commands, "All sounds finished.");
  3571. goto("wait");
  3572. }
  3573. sound_name = list.getIndex(allsounds_list, i);
  3574. sound = sound.get(sound_name);
  3575. sound.spawnForPlayer(player, sound, sound_category_master);
  3576. msg.string(player, sound_name);
  3577. map.add(allsounds_indizes, player_uuid, i + 1);
  3578. list.add(allsounds_uuids, player_uuid);
  3579. sgoto(100, "playallsounds");
  3580. goto("wait");
  3581. @weather
  3582. if(size == 0) {
  3583. @weather_syntax
  3584. msg.prefix(player, "§eWeather", "/weather ...");
  3585. msg.string(player, "§e - clear [duration]");
  3586. msg.string(player, "§e - rain [duration]");
  3587. msg.string(player, "§e - thunder [duration]");
  3588. goto("wait");
  3589. }
  3590. arg0 = string.toLowerCase(list.getIndex(args, 0));
  3591. if(arg0 == "clear" || arg0 == "rain" || arg0 == "thunder") {
  3592. if(size == 2) {
  3593. duration = list.getIndex(args, 1);
  3594. if(!isDouble(duration)) {
  3595. msg.prefix(player, prefix_commands, "Number expected.");
  3596. goto("wait");
  3597. }
  3598. if(duration < 0) {
  3599. msg.prefix(player, prefix_commands, "Positive number expected.");
  3600. goto("wait");
  3601. }
  3602. } else {
  3603. duration = 12000;
  3604. }
  3605. world = loc.getWorld(entity.getLocation(player));
  3606. if(arg0 == "clear") {
  3607. if(size > 2) {
  3608. msg.prefix(player, prefix_commands, "/weather clear [duration]");
  3609. goto("wait");
  3610. }
  3611. world.clearWeather(world, duration);
  3612. msg.prefix(player, prefix_commands, "Weather cleared.");
  3613. goto("wait");
  3614. }
  3615. if(arg0 == "rain") {
  3616. if(size > 2) {
  3617. msg.prefix(player, prefix_commands, "/weather rain [duration]");
  3618. goto("wait");
  3619. }
  3620. world.setRain(world, duration);
  3621. msg.prefix(player, prefix_commands, "Weather set to rain.");
  3622. goto("wait");
  3623. }
  3624. if(arg0 == "thunder") {
  3625. if(size > 2) {
  3626. msg.prefix(player, prefix_commands, "/weather thunder [duration]");
  3627. goto("wait");
  3628. }
  3629. world.setThunder(world, duration);
  3630. msg.prefix(player, prefix_commands, "Weather set to thunder.");
  3631. goto("wait");
  3632. }
  3633. goto("wait");
  3634. }
  3635. goto("weather_syntax");
  3636. @time
  3637. if(size == 0) {
  3638. @time_syntax
  3639. msg.prefix(player, "§eTime", "/time ...");
  3640. msg.string(player, "§e - set <time>");
  3641. msg.string(player, "§e - add <time>");
  3642. msg.string(player, "§e - <day / noon / night / midnight>");
  3643. goto("wait");
  3644. }
  3645. arg0 = string.toLowerCase(list.getIndex(args, 0));
  3646. if(arg0 == "set") {
  3647. if(size != 2) {
  3648. msg.prefix(player, prefix_commands, "/time set <time>");
  3649. goto("wait");
  3650. }
  3651. setTime = list.getIndex(args, 1);
  3652. if(!isDouble(setTime)) {
  3653. msg.prefix(player, prefix_commands, "Number expected.");
  3654. goto("wait");
  3655. }
  3656. if(setTime < 0) {
  3657. msg.prefix(player, prefix_commands, "Positive number expected.");
  3658. goto("wait");
  3659. }
  3660. world = loc.getWorld(entity.getLocation(player));
  3661. while(setTime >= 24000) {
  3662. setTime -= 24000;
  3663. }
  3664. world.setTime(world, setTime);
  3665. msg.prefix(player, prefix_commands, string.concat("Time set to ", string.number(setTime), "."));
  3666. goto("wait");
  3667. }
  3668. if(arg0 == "add") {
  3669. if(size != 2) {
  3670. msg.prefix(player, prefix_commands, "/time add <time>");
  3671. goto("wait");
  3672. }
  3673. addTime = list.getIndex(args, 1);
  3674. if(!isDouble(addTime)) {
  3675. msg.prefix(player, prefix_commands, "Number expected.");
  3676. goto("wait");
  3677. }
  3678. if(addTime < 0) {
  3679. msg.prefix(player, prefix_commands, "Positive number expected.");
  3680. goto("wait");
  3681. }
  3682. world = loc.getWorld(entity.getLocation(player));
  3683. newtime = world.getTime(world) + addTime;
  3684. while(newtime >= 24000) {
  3685. newtime -= 24000;
  3686. }
  3687. world.setTime(world, newtime);
  3688. msg.prefix(player, prefix_commands, string.concat("Time set to ", string.number(newtime), "."));
  3689. goto("wait");
  3690. }
  3691. newtime = null;
  3692. if(arg0 == "day") {
  3693. newtime = 1000;
  3694. } elseif(arg0 == "noon") {
  3695. newtime = 6000;
  3696. } elseif(arg0 == "night") {
  3697. newtime = 13000;
  3698. } elseif(arg0 == "midnight") {
  3699. newtime = 18000;
  3700. }
  3701. if(newtime != null) {
  3702. world = loc.getWorld(entity.getLocation(player));
  3703. world.setTime(world, newtime);
  3704. msg.prefix(player, prefix_commands, string.concat("Time set to ", string.number(newtime), "."));
  3705. goto("wait");
  3706. }
  3707. goto("time_syntax");
  3708. @gamerule
  3709. world = loc.getWorld(entity.getLocation(player));
  3710. if(size == 0) {
  3711. msg.prefix(player, prefix_commands, "/gamerule <gamerule> [value]");
  3712. goto("wait");
  3713. }
  3714. gamerule_string = list.getIndex(args, 0);
  3715. gamerule_key = gamerule.getKey(gamerule_string);
  3716. if(gamerule_key == null) {
  3717. msg.prefix(player, prefix_commands, "Gamerule doesn´t exist.");
  3718. goto("wait");
  3719. }
  3720. gamerule_value = gamerule.getValue(world, gamerule_key);
  3721. if(size == 1) {
  3722. if(isDouble(gamerule_value)) {
  3723. gamerule_value = string.number(gamerule_value);
  3724. }
  3725. msg.prefix(player, prefix_commands, string.concat(gamerule_string, " ", gamerule_value));
  3726. goto("wait");
  3727. }
  3728. if(size == 2) {
  3729. if(!perm.has("gamerule.write", player)) {
  3730. perm.no("gamerule.write", player);
  3731. goto("wait");
  3732. }
  3733. value = list.getIndex(args, 1);
  3734. if(isBool(gamerule_value)) {
  3735. gamerule.setBool(world, gamerule_key, value);
  3736. } elseif(isDouble(gamerule_value)) {
  3737. gamerule.setInt(world, gamerule_key, value);
  3738. value = string.number(value);
  3739. } else {
  3740. msg.prefix(player, prefix_commands, "Unknown gamerule type.");
  3741. goto("wait");
  3742. }
  3743. msg.prefix(player, prefix_commands, string.concat(gamerule_string, " set to ", value, "."));
  3744. }
  3745. goto("wait");
  3746. @tip
  3747. if(size == 0) {
  3748. msg.prefix(player, prefix_tips, "/tip ...");
  3749. msg.string(player, "§e - list §rList all tips");
  3750. msg.string(player, "§e - add <tip> <text> §rAdds a tip");
  3751. msg.string(player, "§e - remove <tip> §rRemoves a tip");
  3752. msg.string(player, "§e - loop <tip> <boolean> §rTrue shows on tip loop");
  3753. msg.string(player, "§e - <tip> [player] §rSends a tip to all/a player");
  3754. goto("wait");
  3755. }
  3756. arg0 = string.toLowerCase(list.getIndex(args, 0));
  3757. if(arg0 == "list") {
  3758. msg.string(player, "--==§eTipps§r==--");
  3759. list = tip.getAll();
  3760. if(list.getSize(list) == 0) {
  3761. msg.prefix(player, prefix_tips, "No tips available.");
  3762. goto("wait");
  3763. }
  3764. iter = iterator(list);
  3765. while(hasNext(iter)) {
  3766. a = next(iter);
  3767. tipp_key = a[0];
  3768. tipp_value = a[1];
  3769. tipp_loop = a[2];
  3770. if(tipp_loop) {
  3771. tipp_loop = string.concat("§a", tipp_loop);
  3772. } else {
  3773. tipp_loop = string.concat("§c", tipp_loop);
  3774. }
  3775. msg(player, text.merge(text.new(string.concat(" ", tipp_loop, " §e", tipp_key, "§r : ")), string.getInterpretedText(tipp_value)));
  3776. }
  3777. goto("wait");
  3778. }
  3779. if(arg0 == "add") {
  3780. if(!perm.has("tip.mod", player)) {
  3781. perm.no("tip.mod", player);
  3782. goto("wait");
  3783. }
  3784. if(size < 3) {
  3785. msg.prefix(player, prefix_commands, "/tip add <name> <text>");
  3786. goto("wait");
  3787. }
  3788. tipp_key = list.getIndex(args, 1);
  3789. tipp_value = string.concatList(string_args, " ", 2, size - 1);
  3790. tipp_value = string.replace(tipp_value, "&", "§");
  3791. tipp.register(tipp_key, tipp_value);
  3792. msg.prefix(player, prefix_tips, "Tip added.");
  3793. goto("wait");
  3794. }
  3795. if(arg0 == "loop") {
  3796. if(!perm.has("tip.mod", player)) {
  3797. perm.no("tip.mod", player);
  3798. goto("wait");
  3799. }
  3800. if(size != 3) {
  3801. msg.prefix(player, prefix_commands, "/tip loop <tip> <boolean>");
  3802. goto("wait");
  3803. }
  3804. tipp_key = list.getIndex(args, 1);
  3805. if(!tipp.exists(tipp_key)) {
  3806. msg.prefix(player, prefix_tips, "This tip does not exist.");
  3807. goto("wait");
  3808. }
  3809. boolean = list.getIndex(args, 2);
  3810. if(string.class(boolean) != "Boolean") {
  3811. msg.prefix(player, prefix_tips, "True or false expected.");
  3812. goto("wait");
  3813. }
  3814. if(boolean) {
  3815. tip.setLoop(tipp_key, boolean);
  3816. } else {
  3817. tip.setLoop(tipp_key, boolean);
  3818. }
  3819. msg.prefix(player, prefix_tips, "Tip settings changed.");
  3820. goto("wait");
  3821. }
  3822. if(arg0 == "remove") {
  3823. if(!perm.has("tip.mod", player)) {
  3824. perm.no("tip.mod", player);
  3825. goto("wait");
  3826. }
  3827. if(size != 2) {
  3828. msg.prefix(player, prefix_commands, "/tip remove <name>");
  3829. goto("wait");
  3830. }
  3831. tipp_key = list.getIndex(args, 1);
  3832. tip.remove(tipp_key);
  3833. msg.prefix(player, prefix_tips, "Tip removed.");
  3834. goto("wait");
  3835. }
  3836. tipp_key = arg0;
  3837. if(!tipp.exists(tipp_key)) {
  3838. msg.prefix(player, prefix_tips, "This tip does not exist.");
  3839. goto("wait");
  3840. }
  3841. if(size == 1) {
  3842. p = "online";
  3843. } else {
  3844. p_name = list.getIndex(args, 1);
  3845. if(!isOnline(p_name)) {
  3846. msg.prefix(player, prefix_tips, "This player is not online.");
  3847. goto("wait");
  3848. }
  3849. p = read.player(p_name);
  3850. msg.prefix(player, prefix_tips, string.concat("Tip sent to §7", p_name, "§r."));
  3851. }
  3852. tipp_value = tipp.get(tipp_key);
  3853. msg(p, text.merge(text.new(string.concat(string.getPrefix(string.concat("§e", player.getName(player))), " ")), string.getInterpretedText(tipp_value)));
  3854. goto("wait");
  3855. @help
  3856. if(size > 1) {
  3857. msg.prefix(sender, prefix_commands, "/help [side]");
  3858. goto("wait");
  3859. }
  3860. //Auf Permission überprüfen
  3861. temp_list = list.new();
  3862. for(i = 0; i < list.getSize(command_list); i++) {
  3863. command = list.getIndex(command_list, i);
  3864. if(perm.has(command, sender)) {
  3865. list.add(temp_list, command);
  3866. }
  3867. }
  3868. list.sort(temp_list);
  3869. temp_size = list.getSize(temp_list);
  3870. max_side = temp_size / 10;
  3871. if(size == 0) {
  3872. side = 1;
  3873. print_side = side - 1;
  3874. } else {
  3875. side = list.getIndex(args, 0);
  3876. if(!isDouble(side)) {
  3877. msg.prefix(sender, prefix_commands, "/help [side]");
  3878. goto("wait");
  3879. }
  3880. print_side = side - 1;
  3881. if(print_side < 0 || print_side > max_side) {
  3882. msg.prefix(sender, prefix_commands, string.concat("Possible: 1 - ", string.number(math.roundDown(max_side + 1))));
  3883. goto("wait");
  3884. }
  3885. }
  3886. msg.string(sender, string.concat("§a --- Help ", string.number(side), " ---"));
  3887. for(i = print_side * 10; i < print_side * 10 + 10; i++) {
  3888. if(i < temp_size) {
  3889. command_string = list.getIndex(temp_list, i);
  3890. command = string.getHoverText(command_string, map.getOrDefault(command_map, command_string, ""));
  3891. msg(sender, text.merge(text.new(" /"), text.suggest(command, string.concat("/", command_string))));
  3892. }
  3893. }
  3894. if(side == 1) {
  3895. backward = text.new("§c<<Backward<<");
  3896. forward = string.getClickText("§b>>Forward>>", string.concat("/help ", side + 1));
  3897. } elseif(side > max_side) {
  3898. backward = string.getClickText("§b<<Backward<<", string.concat("/help ", side - 1));
  3899. forward = text.new("§c>>Forward>>");
  3900. } else {
  3901. backward = string.getClickText("§b<<Backward<<", string.concat("/help ", side - 1));
  3902. forward = string.getClickText("§b>>Forward>>", string.concat("/help ", side + 1));
  3903. }
  3904. msg(sender, text.merge(backward, text.new(" "), forward));
  3905. goto("wait");
  3906. @grow
  3907. if(size != 1) {
  3908. msg.prefix(player, prefix_commands, "/grow <radius>");
  3909. goto("wait");
  3910. }
  3911. radius = list.getIndex(args, 0);
  3912. if(!isDouble(radius)) {
  3913. msg.prefix(player, prefix_commands, "Number expected.");
  3914. goto("wait");
  3915. }
  3916. if(radius < 0) {
  3917. msg.prefix(player, prefix_commands, "Positive number expected.");
  3918. goto("wait");
  3919. }
  3920. center_loc = getBlockLocation(entity.getLocation(player));
  3921. grow(center_loc, radius);
  3922. msg.prefix(player, prefix_commands, "Field grown.");
  3923. goto("wait");
  3924. @start
  3925. if(size != 1) {
  3926. @starthelp
  3927. msg.prefix(sender, prefix_commands, "/start <name>");
  3928. goto("wait");
  3929. }
  3930. arg0 = string.toLowerCase(list.getIndex(args, 0));
  3931. modTimer(-500);
  3932. if(arg0 == "chat") {
  3933. script = script.get("Chat");
  3934. if(script != null) {
  3935. script.term(script);
  3936. }
  3937. script.startNamed("Chat", "utils/u_error", "system/chat", "utils/u_general");
  3938. }
  3939. elseif(arg0 == "challenges") {
  3940. script = script.get("Challenges");
  3941. if(script != null) {
  3942. script.term(script);
  3943. }
  3944. script.startNamed("Challenges", "utils/u_error", "survival/challenges", "utils/u_general");
  3945. script = script.get("AllDamageTypes");
  3946. if(script != null) {
  3947. script.term(script);
  3948. }
  3949. script.startNamed("AllDamageTypes", "utils/u_error", "challenges/all_damage_types", "utils/u_general");
  3950. script = script.get("AllEntities");
  3951. if(script != null) {
  3952. script.term(script);
  3953. }
  3954. script.startNamed("AllEntities", "utils/u_error", "challenges/all_entities", "utils/u_general");
  3955. script = script.get("AllItems");
  3956. if(script != null) {
  3957. script.term(script);
  3958. }
  3959. script.startNamed("AllItems", "utils/u_error", "challenges/all_items", "utils/u_general");
  3960. }
  3961. elseif(arg0 == "commands") {
  3962. script = script.startNamed("Commands", "system/commands", "utils/u_general", "utils/u_commands", "utils/u_cmdhelp", "utils/u_skills");
  3963. if(script == null) {
  3964. msg.dev("Old commands script still active due to error in new script");
  3965. goto("wait");
  3966. }
  3967. script.term(script.get());
  3968. }
  3969. elseif(arg0 == "copyisland") {
  3970. script = script.get("Copyisland");
  3971. if(script != null) {
  3972. script.term(script);
  3973. }
  3974. script.startNamed("Copyisland", "system/copyisland", "utils/u_general");
  3975. }
  3976. elseif(arg0 == "creative") {
  3977. script = script.get("Creative");
  3978. if(script != null) {
  3979. script.term(script);
  3980. }
  3981. script.startNamed("Creative", "utils/u_error", "system/creative", "utils/u_general");
  3982. }
  3983. elseif(arg0 == "damage") {
  3984. script = script.get("Damage");
  3985. if(script != null) {
  3986. script.term(script);
  3987. }
  3988. script.startNamed("Damage", "utils/u_error", "system/damage", "utils/u_general");
  3989. }
  3990. elseif(arg0 == "doors") {
  3991. script = script.get("Doors");
  3992. if(script != null) {
  3993. script.term(script);
  3994. }
  3995. script.startNamed("Doors", "utils/u_error", "system/doors", "utils/u_general");
  3996. }
  3997. elseif(arg0 == "fixitems") {
  3998. script = script.get("Fixitems");
  3999. if(script != null) {
  4000. script.term(script);
  4001. }
  4002. script.startNamed("Fixitems", "utils/u_error", "system/fixitems", "utils/u_general");
  4003. }
  4004. elseif(arg0 == "games") {
  4005. script = script.get("Gamecenter");
  4006. if(script != null) {
  4007. script.term(script);
  4008. }
  4009. script.startNamed("Gamecenter", "utils/u_error", "minigames/gamecenter", "utils/u_general", "utils/u_games");
  4010. }
  4011. elseif(arg0 == "gemstones") {
  4012. script = script.get("Gemstones");
  4013. if(script != null) {
  4014. script.term(script);
  4015. }
  4016. script.startNamed("Gemstones", "utils/u_error", "survival/gemstones", "utils/u_general");
  4017. }
  4018. elseif(arg0 == "harvest") {
  4019. script = script.get("Harvest");
  4020. if(script != null) {
  4021. script.term(script);
  4022. }
  4023. script.startNamed("Harvest", "utils/u_error", "survival/harvest", "utils/u_general");
  4024. }
  4025. elseif(arg0 == "herobrine") {
  4026. script = script.get("Herobrine");
  4027. if(script != null) {
  4028. script.term(script);
  4029. }
  4030. script.startNamed("Herobrine", "utils/u_error", "survival/herobrine", "utils/u_general");
  4031. }
  4032. elseif(arg0 == "humans") {
  4033. script = script.get("Humans");
  4034. if(script != null) {
  4035. script.term(script);
  4036. }
  4037. script.startNamed("Humans", "utils/u_error", "system/humans", "utils/u_general");
  4038. }
  4039. elseif(arg0 == "lectern") {
  4040. script = script.get("Lectern");
  4041. if(script != null) {
  4042. script.term(script);
  4043. }
  4044. script.startNamed("Lectern", "utils/u_error", "survival/lectern", "utils/u_general");
  4045. }
  4046. elseif(arg0 == "loginrequests") {
  4047. script = script.get("loginrequests");
  4048. if(script != null) {
  4049. script.term(script);
  4050. }
  4051. script.startNamed("LoginRequests", "system/login_requests", "utils/u_general");
  4052. }
  4053. elseif(arg0 == "loom") {
  4054. script = script.get("Loom");
  4055. if(script != null) {
  4056. script.term(script);
  4057. }
  4058. script.startNamed("Loom", "utils/u_error", "survival/loom", "utils/u_general");
  4059. }
  4060. elseif(arg0 == "perms") {
  4061. script = script.get("Perms");
  4062. if(script != null) {
  4063. script.term(script);
  4064. }
  4065. script.startNamed("Perms", "utils/u_error", "system/perms", "utils/u_general");
  4066. }
  4067. elseif(arg0 == "playerdata") {
  4068. script = script.get("Playerdata");
  4069. if(script != null) {
  4070. script.term(script);
  4071. }
  4072. script.startNamed("Playerdata", "utils/u_error", "system/player_data", "utils/u_general");
  4073. }
  4074. elseif(arg0 == "playtime") {
  4075. script = script.get("Playtime");
  4076. if(script != null) {
  4077. script.term(script);
  4078. }
  4079. script.startNamed("Playtime", "system/playtime", "utils/u_general");
  4080. }
  4081. elseif(arg0 == "pumpkin") {
  4082. script = script.get("Pumpkin");
  4083. if(script != null) {
  4084. script.term(script);
  4085. }
  4086. script.startNamed("Pumpkin", "utils/u_error", "survival/pumpkin", "utils/u_general");
  4087. }
  4088. elseif(arg0 == "recipes") {
  4089. script = script.get("Recipes");
  4090. if(script != null) {
  4091. script.term(script);
  4092. }
  4093. script.startNamed("Recipes", "survival/recipes");
  4094. }
  4095. elseif(arg0 == "stats") {
  4096. script = script.get("Ranklist");
  4097. if(script != null) {
  4098. script.term(script);
  4099. }
  4100. script.startNamed("Ranklist", "utils/u_error", "system/ranklist", "utils/u_general", "utils/u_games");
  4101. }
  4102. elseif(arg0 == "scheduler") {
  4103. script = script.get("Scheduler");
  4104. if(script != null) {
  4105. script.term(script);
  4106. }
  4107. script.startNamed("Scheduler", "utils/u_error", "system/scheduler", "utils/u_general");
  4108. }
  4109. elseif(arg0 == "shop") {
  4110. script = script.get("ChestShops");
  4111. if(script != null) {
  4112. script.term(script);
  4113. }
  4114. script.startNamed("ChestShops", "utils/u_error", "system/chestshops", "utils/u_general");
  4115. }
  4116. elseif(arg0 == "teleporter") {
  4117. script = script.get("Teleporter");
  4118. if(script != null) {
  4119. script.term(script);
  4120. }
  4121. script.startNamed("Teleporter", "utils/u_error", "survival/teleporter", "utils/u_general");
  4122. }
  4123. elseif(arg0 == "mails") {
  4124. script = script.get("Mails");
  4125. if(script != null) {
  4126. script.term(script);
  4127. }
  4128. script.startNamed("Mails", "utils/u_error", "system/mailsystem", "utils/u_general");
  4129. }
  4130. elseif(arg0 == "market") {
  4131. script = script.get("Market");
  4132. if(script != null) {
  4133. script.term(script);
  4134. }
  4135. script.startNamed("Market", "utils/u_error", "system/market", "utils/u_general");
  4136. }
  4137. elseif(arg0 == "mobarena") {
  4138. script = script.get("Mobarena");
  4139. if(script != null) {
  4140. script.term(script);
  4141. }
  4142. script.startNamed("Mobarena", "utils/u_error", "survival/mobarena", "utils/u_general");
  4143. }
  4144. elseif(arg0 == "ticket") {
  4145. script = script.get("Ticket");
  4146. if(script != null) {
  4147. script.term(script);
  4148. }
  4149. script.startNamed("Ticket", "utils/u_error", "system/tickets", "utils/u_general");
  4150. }
  4151. elseif(arg0 == "timber") {
  4152. script = script.get("Timber");
  4153. if(script != null) {
  4154. script.term(script);
  4155. }
  4156. script.startNamed("Timber", "utils/u_error", "survival/timber", "utils/u_general", "utils/u_skills");
  4157. }
  4158. elseif(arg0 == "tiploop") {
  4159. script = script.get("tiploop");
  4160. if(script != null) {
  4161. script.term(script);
  4162. }
  4163. script.startNamed("tiploop", "utils/u_error", "system/tiploop", "utils/u_general");
  4164. }
  4165. elseif(arg0 == "trader") {
  4166. script = script.get("Trader");
  4167. if(script != null) {
  4168. script.term(script);
  4169. }
  4170. script.startNamed("Trader", "utils/u_error", "survival/trader", "utils/u_general");
  4171. }
  4172. elseif(arg0 == "skills") {
  4173. script = script.get("Skills");
  4174. if(script != null) {
  4175. script.term(script);
  4176. }
  4177. script.startNamed("Skills", "utils/u_error", "survival/skills", "utils/u_general", "utils/u_skills", "utils/u_quest");
  4178. }
  4179. elseif(arg0 == "story") {
  4180. /*script = script.get("Story");
  4181. if(script != null) {
  4182. script.term(script);
  4183. }
  4184. script.startNamed("Story", "utils/u_error", "story/story", "utils/u_general");*/
  4185. script = script.get("QuestsAdmont");
  4186. if(script != null) {
  4187. script.term(script);
  4188. }
  4189. script.startNamed("QuestsAdmont", "utils/u_error", "story/admont/core", "utils/u_general", "utils/u_quest");
  4190. /*script = script.get("QuestsSchiffbruch");
  4191. if(script != null) {
  4192. script.term(script);
  4193. }
  4194. script.startNamed("QuestsSchiffbruch", "utils/u_error", "story/schiffbruch/core", "utils/u_general", "utils/u_quest");*/
  4195. }
  4196. elseif(arg0 == "sitting") {
  4197. script = script.get("Sitting");
  4198. if(script != null) {
  4199. script.term(script);
  4200. }
  4201. script.startNamed("Sitting", "utils/u_error", "system/sitting", "utils/u_general");
  4202. }
  4203. elseif(arg0 == "survival") {
  4204. script = script.get("Survival");
  4205. if(script != null) {
  4206. script.term(script);
  4207. }
  4208. script.startNamed("Survival", "utils/u_error", "survival/survival", "utils/u_general", "utils/u_skills");
  4209. }
  4210. else {
  4211. goto("starthelp");
  4212. }
  4213. goto("wait");
  4214. @senditem
  4215. if(size != 1) {
  4216. msg.prefix(player, prefix_commands, "/senditem <player>");
  4217. goto("wait");
  4218. }
  4219. item = living.getHand(player);
  4220. if(item.isAir(item)) {
  4221. msg.prefix(player, prefix_commands, "You need to hold an item in your hand.");
  4222. goto("wait");
  4223. }
  4224. p_name = list.getIndex(args, 0);
  4225. p_uuid = player.getUuid(p_name);
  4226. if(p_uuid == null) {
  4227. msg.prefix(player, prefix_commands, "This player has never been online.");
  4228. goto("wait");
  4229. }
  4230. p = read.player(p_name);
  4231. if(p == null) {
  4232. msg.prefix(player, prefix_commands, "This player is not online.");
  4233. goto("wait");
  4234. }
  4235. player.safeGiveItem(p, item);
  4236. player.removeItem(player, item);
  4237. goto("wait");
  4238. @top
  4239. player_loc = entity.getLocation(player);
  4240. y = 319;
  4241. loc.setY(player_loc, y);
  4242. while(y > -64 && block.isAir(block.get(player_loc))) {
  4243. loc.setY(player_loc, y);
  4244. y--;
  4245. }
  4246. if(y == -64) {
  4247. msg.prefix(player, prefix_commands, "No block found.");
  4248. goto("wait");
  4249. }
  4250. player.teleport(player, loc.mod(player_loc, 0, 1, 0), true);
  4251. goto("wait");
  4252. @creative
  4253. crea_spawn = world.getCreativeSpawn();
  4254. world = loc.getWorld(crea_spawn);
  4255. if(world == null) {
  4256. msg.prefix(player, prefix_commands, "This world is not loaded.");
  4257. goto("wait");
  4258. }
  4259. if(size > 1) {
  4260. msg.prefix(player, prefix_commands, "/creative [player]");
  4261. goto("wait");
  4262. }
  4263. if(size == 0) {
  4264. p = player;
  4265. }
  4266. if(size == 1) {
  4267. p_name = list.getIndex(args, 0);
  4268. p = read.player(p_name);
  4269. if(p == null) {
  4270. msg.prefix(player, prefix_commands, "This player is not online.");
  4271. goto("wait");
  4272. }
  4273. if(!perm.has("tp.other", player)) {
  4274. perm.no("tp.other", player);
  4275. goto("wait");
  4276. }
  4277. }
  4278. if(player.hasMinigame(p)) {
  4279. if(size == 1) {
  4280. msg.prefix(player, prefix_commands, "This player can´t be teleported now.");
  4281. goto("wait");
  4282. }
  4283. msg.prefix(player, prefix_commands, "You can´t teleport now.");
  4284. goto("wait");
  4285. }
  4286. if(size == 1) {
  4287. if(player != p) {
  4288. msg.prefix(player, prefix_commands, string.concat(player.getName(p), " was teleported to the creative world."));
  4289. }
  4290. }
  4291. if(player.teleport(p, crea_spawn, true)) {
  4292. msg.prefix(p, prefix_commands, "You have been teleported to the creative world.");
  4293. }
  4294. goto("wait");
  4295. @games
  4296. world = loc.getWorld(world.getGamesSpawn());
  4297. if(world == null) {
  4298. msg.prefix(player, prefix_commands, "This world is not loaded.");
  4299. goto("wait");
  4300. }
  4301. if(size > 1) {
  4302. msg.prefix(player, prefix_commands, "/games [player]");
  4303. goto("wait");
  4304. }
  4305. if(size == 0) {
  4306. p = player;
  4307. }
  4308. if(size == 1) {
  4309. p_name = list.getIndex(args, 0);
  4310. p = read.player(p_name);
  4311. if(p == null) {
  4312. msg.prefix(player, prefix_commands, "This player is not online.");
  4313. goto("wait");
  4314. }
  4315. if(!perm.has("tp.other", player)) {
  4316. perm.no("tp.other", player);
  4317. goto("wait");
  4318. }
  4319. }
  4320. if(player.hasMinigame(p)) {
  4321. if(size == 1) {
  4322. msg.prefix(player, prefix_commands, "This player can´t be teleported now.");
  4323. goto("wait");
  4324. }
  4325. msg.prefix(player, prefix_commands, "You can´t teleport now.");
  4326. goto("wait");
  4327. }
  4328. if(size == 1) {
  4329. if(player != p) {
  4330. msg.prefix(player, prefix_commands, string.concat(player.getName(p), " was teleported to the games world."));
  4331. }
  4332. }
  4333. if(player.teleport(p, world.getGamesSpawn(), true)) {
  4334. msg.prefix(p, prefix_commands, "You have been teleported to the games world.");
  4335. }
  4336. goto("wait");
  4337. @repair
  4338. item = living.getHand(player);
  4339. if(item.isAir(item)) {
  4340. msg.prefix(player, prefix_commands, "You have to hold an item in your mainhand.");
  4341. goto("wait");
  4342. }
  4343. item.setDamage(item, 0);
  4344. msg.prefix(player, prefix_commands, "Your item has been repaired.");
  4345. goto("wait");
  4346. @playtime
  4347. if(size == 0) {
  4348. p_id = player.getId(player);
  4349. arg0 = player.getName(player);
  4350. } else {
  4351. arg0 = string.toLowerCase(list.getIndex(args, 0));
  4352. if(arg0 == "year") {
  4353. modTimer(-20);
  4354. if(!perm.has("playtime.year", player)) {
  4355. perm.no("playtime.year", player);
  4356. goto("wait");
  4357. }
  4358. calendar = time.new(time.getMillis());
  4359. now_month = time.getMonth(calendar);
  4360. now_year = time.getYear(calendar);
  4361. if(size == 1) {
  4362. year = now_year;
  4363. } else {
  4364. year = list.getIndex(args, 1);
  4365. if(!isDouble(year)) {
  4366. msg.prefix(player, prefix_commands, "Number expected.");
  4367. goto("wait");
  4368. }
  4369. if(year > now_year) {
  4370. year = now_year;
  4371. }
  4372. }
  4373. //Von allen Online-Spielern die Onlinezeit abrufen, summieren und zur Heute-Spielzeit addieren
  4374. since_minutes = playtime.getTotalOnlineMinutes();
  4375. //Tabelle erstellen
  4376. table = table.new("§8", 4, 5, 5);
  4377. msg.string(player, table.getStart(table));
  4378. msg.string(player, table.get(table, string.number(year), "Playtime", "Change"));
  4379. msg.string(player, table.getMiddle(table));
  4380. //Monats-Spielzeit berechnen
  4381. temp_list = list.new();
  4382. 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
  4383. for(i = 1; i <= 12; i++) {
  4384. midnight = time.getCal(year, i, 1, 0, 0, 0);
  4385. midnight_2 = time.getCal(year, i + 1, 1, 0, 0, 0);
  4386. minutes = playtime.getInterval(midnight, midnight_2);
  4387. list.add(temp_list, minutes);
  4388. if(i == now_month && year == now_year) {
  4389. minutes += since_minutes;
  4390. }
  4391. }
  4392. for(i = 1; i <= 12; i++) {
  4393. minutes = list.getIndex(temp_list, i);
  4394. hours = math.roundDown(minutes / 60);
  4395. mod_minutes = minutes % 60;
  4396. if(mod_minutes < 10) {
  4397. time_string = string.concat("§6", string.number(hours), ":0", string.number(mod_minutes), " h");
  4398. } else {
  4399. time_string = string.concat("§6", string.number(hours), ":", string.number(mod_minutes), " h");
  4400. }
  4401. pre_minutes = list.getIndex(temp_list, i - 1);
  4402. if(minutes >= pre_minutes) {
  4403. color = "§a+";
  4404. a = minutes;
  4405. b = pre_minutes;
  4406. } else {
  4407. color = "§c-";
  4408. a = pre_minutes;
  4409. b = minutes;
  4410. }
  4411. if(b == 0) {
  4412. change = "";
  4413. } else {
  4414. change = math.round(a / b * 100 - 100);
  4415. change = string.concat(color, string.number(change), " %");
  4416. }
  4417. msg.string(player, table.get(table, string.concat("§6", month.getShortName(i)), time_string, change));
  4418. if(i == now_month && year == now_year) {
  4419. break;
  4420. }
  4421. }
  4422. //Tabelle beenden
  4423. msg.string(player, table.getEnd(table));
  4424. goto("wait");
  4425. }
  4426. if(arg0 == "month") {
  4427. modTimer(-100);
  4428. if(!perm.has("playtime.month", player)) {
  4429. perm.no("playtime.month", player);
  4430. goto("wait");
  4431. }
  4432. calendar = time.new(time.getMillis());
  4433. now_day = time.getDay(calendar);
  4434. now_month = time.getMonth(calendar);
  4435. now_year = time.getYear(calendar);
  4436. year = now_year;
  4437. if(size == 1) {
  4438. month = now_month;
  4439. } else {
  4440. month = list.getIndex(args, 1);
  4441. if(!isDouble(month)) {
  4442. msg.prefix(player, prefix_commands, "Number expected.");
  4443. goto("wait");
  4444. }
  4445. if(month < 1) {
  4446. month = 1;
  4447. } elseif(month > 12) {
  4448. month = 12;
  4449. }
  4450. if(size == 3) {
  4451. year = list.getIndex(args, 2);
  4452. if(!isDouble(year)) {
  4453. msg.prefix(player, prefix_commands, "Number expected.");
  4454. goto("wait");
  4455. }
  4456. }
  4457. if(year > now_year ||(year >= now_year && month > now_month)) {
  4458. month = now_month;
  4459. year = now_year;
  4460. }
  4461. }
  4462. sum_minutes = 0;
  4463. sum_players = 0;
  4464. //Von allen Online-Spielern die Onlinezeit abrufen, summieren und zur Heute-Spielzeit addieren
  4465. since_minutes = playtime.getTotalOnlineMinutes();
  4466. //Tabelle erstellen
  4467. table = table.new("§8", 4, 5, 5);
  4468. msg.string(player, table.getStart(table));
  4469. msg.string(player, table.get(table, month.getShortName(month), "Playtime", "Players"));
  4470. msg.string(player, table.getMiddle(table));
  4471. //Tages-Spielzeit berechnen
  4472. month_days = time.getMonthDays(month, year);
  4473. for(i = 1; i <= month_days; i++) {
  4474. midnight = time.getCal(year, month, i, 0, 0, 0);
  4475. if(i == month_days) {
  4476. midnight_2 = time.getCal(year, month + 1, 1, 0, 0, 0);
  4477. } else {
  4478. midnight_2 = time.getCal(year, month, i + 1, 0, 0, 0);
  4479. }
  4480. players = playtime.getPlayersPerInterval(midnight, midnight_2);
  4481. sum_players += players;
  4482. minutes = playtime.getInterval(midnight, midnight_2);
  4483. if(i == now_day && month == now_month && year == now_year) {
  4484. minutes += since_minutes;
  4485. }
  4486. sum_minutes += minutes;
  4487. hours = math.roundDown(minutes / 60);
  4488. minutes = minutes % 60;
  4489. if(minutes < 10) {
  4490. time_string = string.concat("§6", string.number(hours), ":0", string.number(minutes), " h");
  4491. } else {
  4492. time_string = string.concat("§6", string.number(hours), ":", string.number(minutes), " h");
  4493. }
  4494. msg.string(player, table.get(table, string.concat("§6", string.number(i)), time_string, string.number(players)));
  4495. if(i == now_day && month == now_month && year == now_year) {
  4496. break;
  4497. }
  4498. }
  4499. //Average
  4500. avg_mins = sum_minutes / i;
  4501. avg_hours = math.roundDown(avg_mins / 60);
  4502. avg_mins = avg_mins % 60;
  4503. if(avg_mins < 10) {
  4504. avg_time_string = string.concat("§6", string.number(avg_hours), ":0", string.number(avg_mins), " h");
  4505. } else {
  4506. avg_time_string = string.concat("§6", string.number(avg_hours), ":", string.number(avg_mins), " h");
  4507. }
  4508. avg_players = sum_players / i;
  4509. msg.string(player, table.getMiddle(table));
  4510. msg.string(player, table.get(table, "§6Ø", avg_time_string, string.number(math.roundDown(avg_players))));
  4511. //Tabelle beenden
  4512. msg.string(player, table.getEnd(table));
  4513. goto("wait");
  4514. }
  4515. if(arg0 == "all") {
  4516. modTimer(-10);
  4517. msg.string(player, string.getSpacer());
  4518. msg.prefix(player, prefix_commands, "Server-Playtime");
  4519. //Von allen Online-Spielern die Onlinezeit abrufen, summieren und zur Heute-Spielzeit addieren
  4520. since_minutes = playtime.getTotalOnlineMinutes();
  4521. //Spielzeit heute
  4522. now_cal = time.new(time.getMillis());
  4523. now_day = time.getDay(now_cal);
  4524. now_month = time.getMonth(now_cal);
  4525. now_year = time.getYear(now_cal);
  4526. midnight = time.getCal(now_year, now_month, now_day, 0, 0, 0);
  4527. minutes = playtime.getInterval(midnight, now_cal) + since_minutes;
  4528. hours = string.number(math.roundDown(minutes / 60));
  4529. minutes = string.number(minutes % 60);
  4530. msg.string(player, string.concat("§6Today: §r", hours, " h ", minutes, " min"));
  4531. //Spielzeit 30 Tage für alle Spieler
  4532. year = now_year;
  4533. month = now_month;
  4534. day = now_day - 30;
  4535. if(day < 1) {
  4536. month -= 1;
  4537. if(month < 1) {
  4538. year -= 1;
  4539. month = 12;
  4540. }
  4541. day += time.getMonthDays(month, year);
  4542. }
  4543. thirtyDaysAgo = time.getCal(year, month, day, time.getHour(now_cal), time.getMinute(now_cal), time.getSecond(now_cal));
  4544. minutes = playtime.getInterval(thirtyDaysAgo, now_cal) + since_minutes;
  4545. hours = string.number(math.roundDown(minutes / 60));
  4546. minutes = string.number(minutes % 60);
  4547. msg.string(player, string.concat("§630 Days: §r", hours, " h ", minutes, " min"));
  4548. //Spielzeit gesamt
  4549. minutes = playtime.getTotal();
  4550. hours = string.number(math.roundDown(minutes / 60));
  4551. minutes = string.number(minutes % 60);
  4552. msg.string(player, string.concat("§6Total: §r", hours, " h ", minutes, " min"));
  4553. goto("wait");
  4554. }
  4555. if(!perm.has("playtime.other", player)) {
  4556. perm.no("playtime.other", player);
  4557. goto("wait");
  4558. }
  4559. }
  4560. if(!checkIfEverOnline(arg0)) {
  4561. msg.prefix(player, prefix_commands, "This player has never been online.");
  4562. goto("wait");
  4563. }
  4564. p_uuid = player.getUuid(arg0);
  4565. arg0 = player.getName(p_uuid);
  4566. p_id = player.getId(p_uuid);
  4567. msg.string(player, string.getSpacer());
  4568. msg.prefix(player, prefix_commands, string.concat("Playtime of ", player.getName(p_uuid)));
  4569. //Online seit
  4570. since_minutes = playtime.getPlayerOnlineMinutes(p_id);
  4571. if(isOnline(arg0)) {
  4572. since_hours = math.roundDown(since_minutes / 60);
  4573. mod_minutes = since_minutes % 60;
  4574. msg.string(player, string.concat("§aOnline since: §r", string.number(since_hours), " hours ", string.number(mod_minutes), " minutes"));
  4575. } else {
  4576. msg.string(player, "§6Status: §cOffline");
  4577. }
  4578. //Spielzeit heute
  4579. now_cal = time.new(time.getMillis());
  4580. now_day = time.getDay(now_cal);
  4581. now_month = time.getMonth(now_cal);
  4582. now_year = time.getYear(now_cal);
  4583. midnight = time.getCal(now_year, now_month, now_day, 0, 0, 0);
  4584. minutes = playtime.getPlayerInterval(p_id, midnight, now_cal) + since_minutes;
  4585. hours = string.number(math.roundDown(minutes / 60));
  4586. minutes = string.number(minutes % 60);
  4587. msg.string(player, string.concat("§6Today: §r", hours, " h ", minutes, " min"));
  4588. //Spielzeit 30 Tage
  4589. year = now_year;
  4590. month = now_month;
  4591. day = now_day - 30;
  4592. if(day < 1) {
  4593. month -= 1;
  4594. if(month < 1) {
  4595. year -= 1;
  4596. month = 12;
  4597. }
  4598. day += time.getMonthDays(month, year);
  4599. }
  4600. thirtyDaysAgo = time.getCal(year, month, day, time.getHour(now_cal), time.getMinute(now_cal), time.getSecond(now_cal));
  4601. minutes = playtime.getPlayerInterval(p_id, thirtyDaysAgo, now_cal) + since_minutes;
  4602. hours = string.number(math.roundDown(minutes / 60));
  4603. minutes = string.number(minutes % 60);
  4604. msg.string(player, string.concat("§630 Days: §r", hours, " h ", minutes, " min"));
  4605. //Spielzeit gesamt
  4606. minutes = playtime.getPlayerTotal(p_id);
  4607. hours = string.number(math.roundDown(minutes / 60));
  4608. minutes = string.number(minutes % 60);
  4609. msg.string(player, string.concat("§6Total: §r", hours, " h ", minutes, " min"));
  4610. goto("wait");
  4611. @datatools
  4612. if(size == 0) {
  4613. @datatoolshelp
  4614. msg.prefix(player, prefix_datatools, "/datatools ...");
  4615. msg.string(player, "§6 - item-flag <name> §rAdds a flag on an item");
  4616. msg.string(player, "§6 - item-name <name> §rRenames an item");
  4617. msg.string(player, "§6 - item-lore <lore> §rSets an item lore");
  4618. msg.string(player, "§6 - item-attribute <attribut> <slot> <double> <op> §rAdds an attribute to an item");
  4619. msg.string(player, "§6 - entity-hide §rHides an entity");
  4620. msg.string(player, "§6 - entity-show §rShows an entity");
  4621. msg.string(player, "§6 - entity-name <name> §rRenames an entity");
  4622. msg.string(player, "§6 - entity-print §rPrint entities nbt-tag");
  4623. msg.string(player, "§6 - frame-hide §rHides an item frame");
  4624. msg.string(player, "§6 - frame-show §rShows an item frame");
  4625. msg.string(player, "§6 - name-visibility <boolean> §rShow name (not) permanent");
  4626. goto("wait");
  4627. }
  4628. arg0 = string.toLowerCase(list.getIndex(args, 0));
  4629. if(arg0 == "item-flag") {
  4630. if(size < 2) {
  4631. msg.prefix(player, prefix_datatools, "/datatools item-flag <name>");
  4632. goto("wait");
  4633. }
  4634. item = living.getHand(player);
  4635. if(item.isAir(item)) {
  4636. msg.prefix(player, prefix_datatools, "Hold an item in your hand.");
  4637. goto("wait");
  4638. }
  4639. name = string.concatList(args, " ", 1, size - 1);
  4640. if(!list.contains(item_flags, name)) {
  4641. msg.prefix(player, prefix_datatools, "You can´t add that flag.");
  4642. goto("wait");
  4643. }
  4644. item.addFlag(item, name);
  4645. msg.prefix(player, prefix_datatools, "Flag added.");
  4646. goto("wait");
  4647. }
  4648. if(arg0 == "item-attribute") {
  4649. if(size < 5) {
  4650. msg.prefix(player, prefix_datatools, "/datatools item-attribute <attribut> <slot> <double> <op>");
  4651. goto("wait");
  4652. }
  4653. item = living.getHand(player);
  4654. if(item.isAir(item)) {
  4655. msg.prefix(player, prefix_commands, "You have to hold an item in your mainhand.");
  4656. goto("wait");
  4657. }
  4658. double = list.getIndex(args, 3);
  4659. if(!isDouble(double) || double < 0) {
  4660. msg.prefix(player, prefix_datatools, "Natural number expected.");
  4661. goto("wait");
  4662. }
  4663. attribut = list.getIndex(args, 1);
  4664. if(!set.contains(attribut_set, attribut)) {
  4665. msg.prefix(player, prefix_datatools, "Unknown attribute.");
  4666. goto("wait");
  4667. }
  4668. slot = read.slot(list.getIndex(args, 2));
  4669. if(slot == null) {
  4670. msg.prefix(player, prefix_datatools, "Incorrect slot.");
  4671. goto("wait");
  4672. }
  4673. operation = list.getIndex(args, 4);
  4674. if(!set.contains(operation_set, operation)) {
  4675. msg.prefix(player, prefix_datatools, "Unknown operation.");
  4676. goto("wait");
  4677. }
  4678. item.addAttribute(item, attribut, slot, double, operation);
  4679. msg.prefix(player, prefix_datatools, "Attribute added.");
  4680. goto("wait");
  4681. }
  4682. if(arg0 == "item-name") {
  4683. if(size < 2) {
  4684. msg.prefix(player, prefix_datatools, "/datatools item-name <name>");
  4685. goto("wait");
  4686. }
  4687. item = living.getHand(player);
  4688. if(item.isAir(item)) {
  4689. msg.prefix(player, prefix_datatools, "You need to hold an item in your hand.");
  4690. goto("wait");
  4691. }
  4692. name = string.concatList(args, " ", 1, size - 1);
  4693. name = string.replace(name, "&", "§");
  4694. name = string.replace(name, "\\n", "\n");
  4695. item.setName(item, text.new(name));
  4696. msg.prefix(player, prefix_datatools, string.concat("Item renamed to ", name, "§r."));
  4697. goto("wait");
  4698. }
  4699. if(arg0 == "entity-print") {
  4700. entity = player.getTargetEntity(player, 5);
  4701. if(entity == null) {
  4702. msg.prefix(player, prefix_commands, "No entity found.");
  4703. goto("wait");
  4704. }
  4705. txt_ent = string.entity(entity);
  4706. msg(player, string.getClipBoardText(txt_ent, txt_ent));
  4707. goto("wait");
  4708. }
  4709. if(arg0 == "item-lore") {
  4710. if(size < 2) {
  4711. msg.prefix(player, prefix_datatools, "/datatools item-lore <lore>");
  4712. goto("wait");
  4713. }
  4714. item = living.getHand(player);
  4715. if(item.isAir(item)) {
  4716. msg.prefix(player, prefix_datatools, "You need to hold an item in your hand.");
  4717. goto("wait");
  4718. }
  4719. lore = string.concatList(args, " ", 1, size - 1);
  4720. lore = string.replace(lore, "&", "§");
  4721. item.addLore(item, lore);
  4722. msg.prefix(player, prefix_datatools, "New lore added.");
  4723. goto("wait");
  4724. }
  4725. if(arg0 == "entity-name") {
  4726. if(size < 2) {
  4727. msg.prefix(player, prefix_datatools, "/datatools entity-name <name>");
  4728. goto("wait");
  4729. }
  4730. templist = living.near(player, 3);
  4731. list.remove(templist, player);
  4732. if(list.getSize(templist) == 0) {
  4733. msg.prefix(player, prefix_datatools, "Too far away from an entity.");
  4734. goto("wait");
  4735. }
  4736. entity = list.getIndex(templist, 0);
  4737. name = string.concatList(args, " ", 1, size - 1);
  4738. name = string.replace(name, "&", "§");
  4739. entity.setName(entity, text.new(name), true);
  4740. msg.prefix(player, prefix_datatools, string.concat("Entity renamed to ", name, "§r."));
  4741. goto("wait");
  4742. }
  4743. if(arg0 == "name-visibility") {
  4744. if(size != 2) {
  4745. msg.prefix(player, prefix_datatools, "/datatools name-visibility <boolean>");
  4746. goto("wait");
  4747. }
  4748. templist = living.near(player, 3);
  4749. list.remove(templist, player);
  4750. if(list.getSize(templist) == 0) {
  4751. msg.prefix(player, prefix_datatools, "Too far away from an entity.");
  4752. goto("wait");
  4753. }
  4754. entity = list.getIndex(templist, 0);
  4755. boolean = list.getIndex(args, 1);
  4756. name = entity.getName(entity);
  4757. entity.setName(entity, name, boolean);
  4758. msg.prefix(player, prefix_datatools, "Name-Visibility changed.");
  4759. goto("wait");
  4760. }
  4761. if(arg0 == "frame-hide") {
  4762. if(size != 1) {
  4763. msg.prefix(player, prefix_datatools, "/datatools frame-hide");
  4764. goto("wait");
  4765. }
  4766. entity = player.getTargetEntity(player, 5);
  4767. if(entity == null) {
  4768. msg.prefix(player, prefix_datatools, "Not an item frame.");
  4769. goto("wait");
  4770. }
  4771. entity_type = entity.getType(entity);
  4772. if(entity_type != "item_frame" && entity_type != "glow_item_frame") {
  4773. msg.prefix(player, prefix_datatools, "Not an item frame.");
  4774. goto("wait");
  4775. }
  4776. entity.frame.hide(entity);
  4777. msg.prefix(player, prefix_datatools, "Item frame is now hidden.");
  4778. goto("wait");
  4779. }
  4780. if(arg0 == "frame-show") {
  4781. if(size != 1) {
  4782. msg.prefix(player, prefix_datatools, "/datatools frame-show");
  4783. goto("wait");
  4784. }
  4785. entity = player.getTargetEntity(player, 5);
  4786. if(entity == null) {
  4787. msg.prefix(player, prefix_datatools, "Not an item frame.");
  4788. goto("wait");
  4789. }
  4790. entity_type = entity.getType(entity);
  4791. if(entity_type != "item_frame" && entity_type != "glow_item_frame") {
  4792. msg.prefix(player, prefix_datatools, "Not an item frame.");
  4793. goto("wait");
  4794. }
  4795. entity.frame.show(entity);
  4796. msg.prefix(player, prefix_datatools, "Item frame now shown.");
  4797. goto("wait");
  4798. }
  4799. if(arg0 == "entity-hide") {
  4800. if(size != 1) {
  4801. msg.prefix(player, prefix_datatools, "/datatools entity-hide");
  4802. goto("wait");
  4803. }
  4804. templist = living.near(player, 3);
  4805. list.remove(templist, player);
  4806. if(list.getSize(templist) == 0) {
  4807. msg.prefix(player, prefix_datatools, "Too far away from an entity.");
  4808. goto("wait");
  4809. }
  4810. entity = list.getIndex(templist, 0);
  4811. living.setInvisible(entity, true);
  4812. msg.prefix(player, prefix_datatools, "Entity is now hidden.");
  4813. goto("wait");
  4814. }
  4815. if(arg0 == "entity-show") {
  4816. if(size != 1) {
  4817. msg.prefix(player, prefix_datatools, "/datatools entity-show");
  4818. goto("wait");
  4819. }
  4820. templist = living.near(player, 3);
  4821. list.remove(templist, player);
  4822. if(list.getSize(templist) == 0) {
  4823. msg.prefix(player, prefix_datatools, "Too far away from an entity.");
  4824. goto("wait");
  4825. }
  4826. entity = list.getIndex(templist, 0);
  4827. living.setInvisible(entity, false);
  4828. msg.prefix(player, prefix_datatools, "Entity is now visible.");
  4829. goto("wait");
  4830. }
  4831. goto("datatoolshelp");
  4832. @human
  4833. if(size == 0) {
  4834. @humanhelp
  4835. msg.prefix(player, prefix_human, "/human ...");
  4836. msg.string(player, string.concat("§6 - skin <name> §rSets the skin of a citizen"));
  4837. goto("wait");
  4838. }
  4839. arg0 = string.toLowerCase(list.getIndex(args, 0));
  4840. citizen = player.getTargetCitizen(player, 5);
  4841. if(!isCitizen(citizen)) {
  4842. msg.prefix(player, prefix_human, "No citizen.");
  4843. goto("wait");
  4844. }
  4845. elseif(arg0 == "skin") {
  4846. if(size == 2) {
  4847. name = string.toLowerCase(list.getIndex(args, 1));
  4848. if(name == "farmer") {
  4849. citizen.setSkin(citizen, "ewogICJ0aW1lc3RhbXAiIDogMTYyMDgyMDYyMjYyMiwKICAicHJvZmlsZUlkIiA6ICJkZGVkNTZlMWVmOGI0MGZlOGFkMTYyOTIwZjdhZWNkYSIsCiAgInByb2ZpbGVOYW1lIiA6ICJEaXNjb3JkQXBwIiwKICAic2lnbmF0dXJlUmVxdWlyZWQiIDogdHJ1ZSwKICAidGV4dHVyZXMiIDogewogICAgIlNLSU4iIDogewogICAgICAidXJsIiA6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzEzMTA0MWI1MTlkZmIyNGQ1MDU0ZDRkMzViZjQ4NTlkNmQ0ZjJlNzczMTZjMjM0YWM1YjhlNWE3MDJkY2FiNGEiCiAgICB9CiAgfQp9", "rww+2EGM/HewD/19pK8Z3DdkJZm1rbzTWTuEfUvthK0pxNDPrZ+vQ1z4ilCuw4kHiLGedq65CQg1LKfE4mbTC5y/iHoqiVFz23slu69PNp8w2g0atH3/NmpUI1DGHv2DCxZReNtaHR9pAU8wVAafdk4bK+qlcoYCVEjQGfG7QvrHpD+T+HoWOzdmr3Wd4Hcr4c8NSwNSpJev5MtqZSE4KJFvv9W6/gFRy7jDvHY/W/XDz4mj9S34jrUirfslDJSnmEPhazNlPFXiUvTKftD+GLDbGSar2QAi+9iuPX2iKOkleGpzO3zfKXcvwF69fWIxFBx+6GR4mbA+dCCpxOgk5XVgr/swlzbeIL62+so61r2bvLEsvTGfkhv66yZP5hKAtHgbCyuqNP6l3FOfrOsQms42uqAkzPuKpYA5tjLH1FLL/zFr9f0VkPTrqyADJDbpV8MhxuAYwzaUsO5p2UI5AbA+ZQDSj9hBVC6ULGfiG89kExEvPGF3DXuBbboZN/nYw4oycnL0yYcaIS2CGQPJrs3pioFF/lhCJtCcP0nPfChapQyWu9/x++1pZOzLwe8cV+5bzFy17HNBYI9MyjbWm1vDaFWatZn4VGijSbJYYhuLhu59oBjCuWmDp7r6l3iASMyyHWhCajsPTxxI5eOzbhGJ1VBZ1GKvRzDMg5W6VGM=");
  4850. } elseif(name == "fisher") {
  4851. citizen.setSkin(citizen, "eyJ0aW1lc3RhbXAiOjE1NjA2MTExODU0ODcsInByb2ZpbGVJZCI6IjkxZmUxOTY4N2M5MDQ2NTZhYTFmYzA1OTg2ZGQzZmU3IiwicHJvZmlsZU5hbWUiOiJoaGphYnJpcyIsInNpZ25hdHVyZVJlcXVpcmVkIjp0cnVlLCJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYTBlMzdjOThhNGNkNGQ5ZDQ4ZDliZmEzNDU2ZWI5ZjliOGM4ZjU3OThhMWVhODc4MDljZTc2MWM4YTk3OGJjOCJ9fX0=", "gPKKLdqtSrO9EbjX3CfJA/wPUlWZq4Jtuvq7ha/BhHMoMOPFUmS44EtpUjeQXvV/d3lDWtYdWZnFgaKdpTu8EC59/pwuWixw702ZdN0ZwXonN37gZuBQgVkhIw+C5Zi5ZPPMVGvxDmA1rQ/ThDgC0SXkRdICi7Cq91oUiKd92wMd/ZEczhUuId2nQeilSybB8+P4+412j3XzZLZi3jwo1yCXQwtVWF7WGNnxudkwY+B1CI649tGntAgOKIlvF+gsLUBv7+fte6q9kS9USZ0FRK8ymH72JoE6bFUHG4+cEmKr8IpDny570GBl5ZUiy+vbTyOI+JIuYeix4o4xmUyeYunw0+RsQiZ5+NF59QAdtTpP2XUbh9G3GaZTT/5t82AQFrKCMg5EF/znNhLO5U6c0lYrCTEYkmKhL4scJwjxgbhrKVQqosrrKx4LnM65HI+6bJK/6l+7Q4aQxzCYeUfmWEVZDxf//Na5+kKX+fibGx8+xYjR+YuevkHw25Pf9NJk1489eRPrUp0WMt7AJNvbR4rbFpH/FZVOZ1RF/jKcNh1cS8JFvgnUSo2ues3riJ5A5WtHhb8C+PwqypCnLvgb6EMh3PnXObpWo6M28JZOhW/BrF4Q0tAnx6XLvTcGecKaVI6rVjxRUQET5xW6BMdNCRsva9BC5yVDTVHvatv1M5M=");
  4852. } elseif(name == "baker") {
  4853. citizen.setSkin(citizen, "ewogICJ0aW1lc3RhbXAiIDogMTYxNDcyMzU0NDIwNSwKICAicHJvZmlsZUlkIiA6ICI4NDMwMDNlM2JlNTY0M2Q5OTQxMTBkMzJhMzU2MTk2MCIsCiAgInByb2ZpbGVOYW1lIiA6ICJHYWJvTWNHYW1lciIsCiAgInNpZ25hdHVyZVJlcXVpcmVkIiA6IHRydWUsCiAgInRleHR1cmVzIiA6IHsKICAgICJTS0lOIiA6IHsKICAgICAgInVybCIgOiAiaHR0cDovL3RleHR1cmVzLm1pbmVjcmFmdC5uZXQvdGV4dHVyZS8zZjVkZTQ4ODJiYzBlZDNjOWY5N2RjNDBiN2RkZjdmMGQxMDk3MzM3ODUzZjQwOTFjMmYwZjUwNWE3ZjZkM2E4IiwKICAgICAgIm1ldGFkYXRhIiA6IHsKICAgICAgICAibW9kZWwiIDogInNsaW0iCiAgICAgIH0KICAgIH0KICB9Cn0=", "K42itRnrloSmCnA4JkVbRMpd1SK11xVjERFyDnDzE3fo+vnhfqumXv1bLFfgDbm6M1pHpSnB3nIHVGiFfHAnPAzScqgr3cvE9QTZRB81utbXZKfs1AyavpbikkoGgwv8zplxVJvBTrYBtFkt1TbNgndkqM7iJY+Q9OquL+WCa1LPJfquXI+0oRMlhJ7pTw7VddxFLPvuqHtGOXiaBi2da0pfM3M9sfZXXerlIpAC6I2oijo8psOJ+/gcdLMlzriCRkB//iEJTYP9fSsZYBWKSN4j4WEW+yvyMZZND0FZBVy5Ee11AEAbEgxUekvsyT3kiE2du9MXErG4URY4Mwvp7AtBZ0y0l4OR4dP23O2ioOqFTTV7DBuHPQmYvaugkSWwDMbiuY2a1N7m6X4wZPSWUTXqvHd2VO12Y+1T285AizxC4qZ7r1oNbpwpUZvZ+x3QF7cGhcqA53WJvYtypr9BYqvzrGduql/kei1I5kyynlSoTExjgwKN+j0g6TDdXf6ty9gzdDN0Y1DyUmk4xlCniSm7HaoSUKkk5fF1brApC216MzB5v9/cZDQAXDnjpWFbtmWALx5ueMhrTlEMnfbIIJfFnhRgmqYiS3ilCsG7I9ObRTR2+4eTlGnInR2TBcSHv8PcIW/vSIN0sOPTX3VHrlpc5kmW8+gc8J4dEt7yYqc=");
  4854. } elseif(name == "priest") {
  4855. citizen.setSkin(citizen, "eyJ0aW1lc3RhbXAiOjE1MDcxNzUzMjgzMjksInByb2ZpbGVJZCI6IjcwOTU2NDU0NTJkOTRiYTI5YzcwZDFmYTY3YjhkYTQyIiwicHJvZmlsZU5hbWUiOiJIaWRkdXMiLCJzaWduYXR1cmVSZXF1aXJlZCI6dHJ1ZSwidGV4dHVyZXMiOnsiU0tJTiI6eyJ1cmwiOiJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzU4MzgxOTdkNzBhNmQ2ZmYzODk3NGExYmEyZTM1NTJiOTBjNjRjZmE0ZGFlMjI5NGNmMmRjMTgwMTY5YzVlOCJ9fX0=", "ryT6EeGTuOOtYW0XiBszxWTI+CxwfVrkBfB4YlnPwjGyPjHAXzOmnZh8HKsBMHD5APd7zOEkU829E8uL8wJLmRjiVHKldOphQee44ZgNN1Y/8RymneghYEs7HNLyB2g4hEzHl7HWOCq1R9sNUUlWRAkREpHo4LzzGSP6+hcBHjS7Y+SYm/QTnwmUoSnhakijBWi8/dA9Uf37g5hyXdRUKbLtySoD/bMWkZlUgkmcl2ErPYl3E87Zt+4VGCP9lfoWE9zhP+SrXgdilXFbGYECpkDMyXqcVx1VjFmqG1zpdalfimWeJ8gwRwWmJWxU3g97UGJ7g/Wg7Kn2Ar0rkwx660pf4syESRJKx1MmrAICUxoj1CpLlZOcDhoDvFTqvcGSmo7gdrTk1qEdTq0oHfMuaJRFjBwophK+z0YOO4vzyFadB6nvtmBvT8TDSfp0hxsIzzPpIQ7B0BBdpqwklavktDPMT7qcR1pXpbh/7EhN0OcJtOXjzNH9Bjmd10UWb5XZmtO65ICr7Q947Wd5JezabLMR3L3CNSXPerSCcvxFMdx5s0Io7SNjvk38rranOEHdsG7Z950DclmbftIr0JlySSZt+PmKVOlvMFulOo9oagHial6S807sd5tziQ9Y/tuNpAYpWbtyEYSBmp8+ydhUyTsbVW0qSS8uY4Mqr0aNaWk=");
  4856. } elseif(name == "alena") {
  4857. citizen.setSkin(citizen, "ewogICJ0aW1lc3RhbXAiIDogMTU5NjIyODQ5NDI0NiwKICAicHJvZmlsZUlkIiA6ICJhMjk1ODZmYmU1ZDk0Nzk2OWZjOGQ4ZGE0NzlhNDNlZSIsCiAgInByb2ZpbGVOYW1lIiA6ICJWaWVydGVsdG9hc3RpaWUiLAogICJzaWduYXR1cmVSZXF1aXJlZCIgOiB0cnVlLAogICJ0ZXh0dXJlcyIgOiB7CiAgICAiU0tJTiIgOiB7CiAgICAgICJ1cmwiIDogImh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOWUwYjJmNzg5NDZkZThmZjg4YzFkYzI2OTkwMTgxNTEzMjE1NzQ3NDZmZjg1ZjQ1Y2U5Nzk1YzZmMjc4NDNiNyIsCiAgICAgICJtZXRhZGF0YSIgOiB7CiAgICAgICAgIm1vZGVsIiA6ICJzbGltIgogICAgICB9CiAgICB9CiAgfQp9", "kDLavxU1Et/E6Gak3MaUHsqrH91LcQyxNUy1hG8Vr/0CL4uqWXMYFT1SP9VDrkPbfnzpqQIDG7uTfEsIwrMS0fpsMugdEmlwXv4Omcc+4j6VYT1BNvchNrxyvc4otsY9fTjMHfyxvmTB2yjUQdlJEjHPKw17cbH2lpFgEiNi1SM+V+IVHfg/gXnEufjYaTek+3uNd6UUiukc6S6MTeGcstJ3qJh5DUk/PJKWqapgoVqBGFmFoyqPgb0Ns2LEqvKPJc+uGvB6FpUPLYkqC+8HokYnBTxAFOF0803Xh4y0E17I+GckFGJsa2EP40g0oj2aFnua+lchAU1d0B8RkN2u0yD4bqELQjjxLj26qnDvl6V3aJ00KD/BCIiaPMxfyYKI5BFceFRYU2qwNX83LorkFIzuFDhRtn1jyYn5fDGN3CtSdQ60q733N3jXA14sUntrKiIEUrwu+HN2Qo2765skEiXoBMc7blHfgh0RFt4g/S021xd1gyid7ZqftG5TXeyvGZQH3XuQcdZ6o1nB8g2mnT1w36wGaIcUdCV5VWD9YxI1zjbNKeAONpHOFmgZxgJpJGaaYqJeJe4KgtPlxM6WTQ6g6U60bG14IZ5ZRfbAggb3jOaTYAH0tIahOaKO9/2POR+hRVIQ2lpQE7iOsPWQOoBIV8fy8pQMhsvWuqKcrww=");
  4858. } elseif(name == "butcher") {
  4859. citizen.setSkin(citizen, "ewogICJ0aW1lc3RhbXAiIDogMTYxNDYzNjQ4NDU1NCwKICAicHJvZmlsZUlkIiA6ICJiNWRkZTVmODJlYjM0OTkzYmMwN2Q0MGFiNWY2ODYyMyIsCiAgInByb2ZpbGVOYW1lIiA6ICJsdXhlbWFuIiwKICAic2lnbmF0dXJlUmVxdWlyZWQiIDogdHJ1ZSwKICAidGV4dHVyZXMiIDogewogICAgIlNLSU4iIDogewogICAgICAidXJsIiA6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlL2YzYjU5ZDQ0MDNiNGU3ZTk2YmYwMWY3NDY1OTQwNGI4MzcwYjI2ODE1M2M5ZTExZDRiZGY3MzIyMGMyZDk2MTYiCiAgICB9CiAgfQp9", "KZdn6The3tg9YLOu7uiZxrHLqL+K7IIFmP00b4F4qrKMu3AGqZ4NuFDN0ckWkrAyAyj/NwK2nQLDHVwvqNdmr9QRgdZcvV8PIj+tHZL7wAi+wgPVcaYQRUo0uHpNUKxVj4qe+FjChw5DnW8tl0me2t5TbsG6qEaKhXnBMZfI7mFNZZ8/rC+vBgvTm3VgZ2stb2hsdH+eCnQH2iOVvg8iwG9xvMBGKyRZ/8ORYYO5V8EEu4xpMsjQvw6/sjGg0ceeJTBBnN++7App1CiRh0iAkbeJcxolllNiNfdk8kLkrApHMwdTbs7y+8N8DxoBZ+WauvZxmEuYpR5TMSde9EDJMRtS/kESqVEdmjblJDMbBhNSB+io/16tq5EgxDwu2RPqaze33rCB/9tJtP8h6/MTWAXDirSxqFV/5sPtOaDy+QHfkZlsGfRW4nXFxLh3DRBI/SE8CGN8FQ4/6rj/Np8KLcgLFBGwyqNRo+o0jBVBGIISzhCIp5XeYmn876mYGU8bCBOJX0ICPJxsirsSbLwZ/CoN/zR1Zc/LpkSRi0loQbprFkQTJ2qqkPAyI30x/eo7XMBXZGNeX6LeYcp2WJsDaHtqRbLszfSwFnePB06Qz77rg+7RJ3Ef/H6bx4Rp8eLwLfz6gguo+3zwEth3Kovo9Lu/AhGM8CMT+oykH9g6a0c=");
  4860. } elseif(name == "girl") {
  4861. citizen.setSkin(citizen, "ewogICJ0aW1lc3RhbXAiIDogMTcwOTA5MTI1MTkyMiwKICAicHJvZmlsZUlkIiA6ICI5ZTA5YzM4ZGUzZTY0MDA2OTAwYzAwZTJiOTQ3ZTQwMyIsCiAgInByb2ZpbGVOYW1lIiA6ICJ4RFRPTUFTX1lUIiwKICAic2lnbmF0dXJlUmVxdWlyZWQiIDogdHJ1ZSwKICAidGV4dHVyZXMiIDogewogICAgIlNLSU4iIDogewogICAgICAidXJsIiA6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzdjODRhMjE4YTMwZGY2MjUwNzM0NmI2NmJkMzRmMjIyMzZkZjkxYjE5ZGM5YmRjZTdhNGQ0MjhmODY0OGJhYzYiLAogICAgICAibWV0YWRhdGEiIDogewogICAgICAgICJtb2RlbCIgOiAic2xpbSIKICAgICAgfQogICAgfQogIH0KfQ==", "h3c7bg2JO7gacUy8hc0iZOcs9z29xbYokKGnH6JyPwQ2JXDa1jFWmsIm/lC2SKJpKknvUNzXuNHBavjF4j0PVHpu0iVTkSruIjoMn1H20jN7vVqaTsojZGWk2050d8+zctWg7gUMx33pa1VwP+4DKU6QQ7/yaxdZKnIPW80UAm73eukiLx9B+GIlcHPfRcVHs4ee471l1d5pupSv7VAUI2ZSkzYarUfhZnXshaqIgD7LuS4PkdtiBNS2Qm/9vZ6fkpIGLIQrAlT0fE4j9T6qLwqtff43x6YfsVMpDL9Lo5MCaphcGoAo4txsC47MX0L19xbtnd6doQTmpLTnxivlLgaPyrzA/c1oeC5JujwsNGthq2CqHdzVPDAUQDADf8BrfYKrEd3DskWVZzGg7wzrdUfJPYPHkkqFxhPm0SAPwPOVJp33RhpzjkXLsae45QN6/UEcQaSi0tIxltSWfeAK5f6/3zixk/SES3fSpk5oHvTaJGVWs/lGRaE0AFAqwrWvp5yTW5CU4rmTrAFWu0KtkW4sI8Kur+xwKry24FQF6h+Luo26lvaXVo7zGCtl94zm4LuMBWNTq0RgLWc5Zj6VvW4vGIybPj2/fQwoJIfodqawxzJjVguSiRzF2AxwTKoMtAn2guDfQkULsRat012oU7qvyJWhi1HLm504am4PxkI=");
  4862. } elseif(name == "mason") {
  4863. citizen.setSkin(citizen, "ewogICJ0aW1lc3RhbXAiIDogMTYwNDQ5MjYyMzQxOCwKICAicHJvZmlsZUlkIiA6ICJlNzkzYjJjYTdhMmY0MTI2YTA5ODA5MmQ3Yzk5NDE3YiIsCiAgInByb2ZpbGVOYW1lIiA6ICJUaGVfSG9zdGVyX01hbiIsCiAgInNpZ25hdHVyZVJlcXVpcmVkIiA6IHRydWUsCiAgInRleHR1cmVzIiA6IHsKICAgICJTS0lOIiA6IHsKICAgICAgInVybCIgOiAiaHR0cDovL3RleHR1cmVzLm1pbmVjcmFmdC5uZXQvdGV4dHVyZS85ODI1ZTk3NTZjM2VhNjZjOGNjZmEyZmU4MDU4MzRmNGZhMDVhMGY0ODc0NTY3NTljMzY0MjcwODkwNTE0NzZlIgogICAgfQogIH0KfQ==", "RLLeCZVT2zj4DhvrVl4fTVy4BdjyK02tTX5u3PT0gNcbluSRDNUjwG+G/HttDVtPpyQuVOq/8aAFT/xdu+BZaiI3q3830BWqVe+CbSJuHorHPbPskJRV8+L+Ra6rJLA9LJQh5li5EZCwiAwqBSQwqycIU7032xjtoPjfOXio0gAnqKLffTEc2irDq4KzZGH9WZjYJrEfS9eCkQ1780jl96oEordJT940G/mgiB+XZdg1RQs+YuDprGvX1ILVZluoN+SFWji9l3aPmktwGoP9K5NDJr1Yjqqtr0QcXUvB3bqs4EDeYe7+NXCtE4eW1bupr22dKO9EERyrL4oOm8K1lgmFRupeSH66R0Ny5Io8NrscZSSH1XZncnj6SZfYskJWRNN//F9BxM86hL0MEPtloAB9o0oJWLyoaXszMb1iJC9RKbvK3c2nAdyjWtcWijRA5muEZszzOX5XngHlFPAYWDI33EuTvqbth3GqZ7kid24Zly6TQbSCrd30EiNTeXYTJ1T5Fx1GRIzEYW+60qf3f2e59SlcBf4D7eA4btIaCAvfx2bKxbZQsdsHKDphpxsr7nizA8iRroo37nBiJ97gYUF2GsL03bLuge4cFLROpb4oaKGyldPZ4cHq33b8sbFs0eQUiS9selDsyx8G8MrvKfhYACpjyBv+ZLlWa+QMF4s=");
  4864. } elseif(name == "mage") {
  4865. citizen.setSkin(citizen, "ewogICJ0aW1lc3RhbXAiIDogMTU5NjMzNjk5OTgwMSwKICAicHJvZmlsZUlkIiA6ICI5MWYwNGZlOTBmMzY0M2I1OGYyMGUzMzc1Zjg2ZDM5ZSIsCiAgInByb2ZpbGVOYW1lIiA6ICJTdG9ybVN0b3JteSIsCiAgInNpZ25hdHVyZVJlcXVpcmVkIiA6IHRydWUsCiAgInRleHR1cmVzIiA6IHsKICAgICJTS0lOIiA6IHsKICAgICAgInVybCIgOiAiaHR0cDovL3RleHR1cmVzLm1pbmVjcmFmdC5uZXQvdGV4dHVyZS9kZjBiNzBmZmQ3NDE4N2Q5MTE2NmUzYmMxMTQzNTI2NTZmODVlNDdlYTNhYjcwNWI5MzUxMTkyMzJhMDA4Yzk2IgogICAgfQogIH0KfQ==", "eUzFSAiEth5qG5VV7uqbbfQln2QLJ6hurw4RARJ7qFHZaRqUbJLiqmkplcuCcb0ViZgBlU/zn+GIdJlZHGeifO7CdH+R3JX8d9F7gbg1Xg6eNWCGeadirjTi9haSBoK97pqAOsYRNd8FNKTIr3OGuQYXPgapgIt2A0W8N/vR8bKhdnHYV47UyzqEVEdMKYTN8w5Uq7Zhj8ZTvzWgrg83BX1WqaVpkdZN5xRcE5MQzuCL7s9ZsgSXeKbrWBXdn/yNqRbcdK6ymy1rCqWXdUkHVKOpJMBLu9NIjeUTm/bwsEufNZ6wvaNHoJWg7jFgDCzy0s/7xvxicbyxbFZHjABOtqu2kUNSMfSD4DZYiMrO3DesIQU59t/XFI4cfnDkR5OEcInkjg5XOJaU/h6kpsDqcP559wnqvnPjqSZTgVuKPR0sLi20mDeOqVyK2ZxEV26ihnknofVrObLPmE0yyzgb540/BPAtqNVKHKLZUb2bv3BG5CLbOPqxut+X3LcDZNICdj8jzGeTNcndPzPn/a9n+Jqd2+iqjVa8tTeh+2VodK5j5XBl5/Ym1tTiD3ZPDOd+6AQfDrvDJBJN9t+MczXldHON9pMvjZgODGsKIJ1KzRplXYjdsftNdi/SUv6xV/iG4+qRJqmkbYCEl7oQvELljAbkcUVIViTOSNgFNX2CVD8=");
  4866. } elseif(name == "banker") {
  4867. citizen.setSkin(citizen, "ewogICJ0aW1lc3RhbXAiIDogMTU5NzMyNzk4Njk0MCwKICAicHJvZmlsZUlkIiA6ICI5MThhMDI5NTU5ZGQ0Y2U2YjE2ZjdhNWQ1M2VmYjQxMiIsCiAgInByb2ZpbGVOYW1lIiA6ICJCZWV2ZWxvcGVyIiwKICAic2lnbmF0dXJlUmVxdWlyZWQiIDogdHJ1ZSwKICAidGV4dHVyZXMiIDogewogICAgIlNLSU4iIDogewogICAgICAidXJsIiA6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlL2RlODk0Zjk5NGVlYjQyMjU0OWE2NTE2YjYyODg1MGQ4MmY3OTJhZmNkNzVlY2U1YmQzYmQ3ZGE4M2M1YzkyMjYiCiAgICB9CiAgfQp9", "WhygM8rofUCUv4GVMrSl7tGxMUx/jczsz7lixaGhZbDJtEzKTAQFY25TZBjMvxpFqLvwOfbEWDRn1wOjof5dt7CwYcwnBfrksHj1lkpp7oh8omUbdnA0TDZFLdSAvmvtViRFaH+neH08jFfl+XLx5BnfY/6XimxKwxPKBZnvAc1DlpubiBgHXmPKYigRFAKCPgHCf9cDRm6jDNyZTYgPUJElBN5TIHREponJhE4pMDm8qOkidiUsrfqjHYZvl767sLA1QA3HPHZKtvug6xSve9X/2n6Fr3dvhNUI0dqj4EtbJkSPD7uCUgIvtx5nN1iQXjXWgEEVZ0JnA1KMCfjfjQRx2nEOqe9OVwADvIIbE+Asc0qw+Zas1Ys+AP5rBH5qT8Lmh5Wi2Bn0yj6zEk/iluTbkmnzMVdICnBKVUF4wdLY/5vvxe1+abZM2xVQ5eoPoyyEsD1wYc9c4Uticpe3A+jy8p8+a7FfAPVILfV6MOhkQ0S5FCpEIj0DbSbBoNnDBODmTYpBKrouYNI/IZPnwBsKluy0zAgTJ5lMM7bptda1BQaJKpA2kSkCTvADQ72kwFoBlfhOluwvfvgTBgI8rnVNAfSu2sEIC6BhdaOG9iqocKRYL474zbYMPWW1Z7fF3jrsEWWTa3+swN+8K89XeLv/jHUqwfx+3Gb5YG8ZGX0=");
  4868. } elseif(name == "lumberjack") {
  4869. citizen.setSkin(citizen, "ewogICJ0aW1lc3RhbXAiIDogMTYxNzE4MjYwMDgxMSwKICAicHJvZmlsZUlkIiA6ICI5MWYwNGZlOTBmMzY0M2I1OGYyMGUzMzc1Zjg2ZDM5ZSIsCiAgInByb2ZpbGVOYW1lIiA6ICJTdG9ybVN0b3JteSIsCiAgInNpZ25hdHVyZVJlcXVpcmVkIiA6IHRydWUsCiAgInRleHR1cmVzIiA6IHsKICAgICJTS0lOIiA6IHsKICAgICAgInVybCIgOiAiaHR0cDovL3RleHR1cmVzLm1pbmVjcmFmdC5uZXQvdGV4dHVyZS8yNDlkNmMxMjk2NmYzYmM5NjA1MGM3MDgwYWNiY2JmNWI4MmZlN2JmNzA0MzdiZTU2NzJhZjk1ZmVhOTA1ZWJlIgogICAgfQogIH0KfQ==", "ChHGtuNconaz4zViNV1NAcq5xlpyaQ9aiiXVj5h55yE9LOtSCIjLmq/xIDZIlAdno8kg6mXQ1RYF6E1yJ3rpCWh0KocHQT/WQHcr9v3I8k70+XGyF+Ad0U0cIww954PM5gznSeWD4XrDQxaKf9IgsCNTl9tI46NvaMUxW/2L4/VR46lU00cowlgS7u3JNWueIsKrMjgfj5pt7YVqiE8DZ3DHlc7VCpdZk6Ku1HIGDLoPziawtgrJUVppFumAPpfSxwz4Gr2OnnH1nd2aS1E7oYtU7+dw8BzDMjNRNiyQm3o1SYcVTyUf9/0TVeYfD0KqvFhF/9Yf2c8hQBB4qQ8VmEH1wlLrAjNsBVE92UwZ6D7lI0MZs3F8WwbQh+d/jKtJxcZi+GzAPTIt8A+pVNee+/mAM3VDg/6tJtK2jQtgYZYRa/RyTumAAxb9OxsxDg/j2Li0DNGFHue1oEAySmKwQg+wOWT9kujDLGMje6bYLqO2+S3wGAyskcVp3snt5LihYDNsXVtp7ZkD6Awgs6YptmTa23o2+XvB8vO64QqmMuBX/KyPJtv6T0ZxR4KTFKeCXe21Za0boEdolMVYRHjXsCZJ8m/zqIu8/3r1ALuSpbVApMv7PoGtfGaXWtSkHKu8LjY+btgfnooeLyjaLHn6ltJzTdEoooUzsj7JqKK19no=");
  4870. } elseif(name == "miner") {
  4871. citizen.setSkin(citizen, "eyJ0aW1lc3RhbXAiOjE1NjQ2ODc5NzM1MjUsInByb2ZpbGVJZCI6IjVkZTZlMTg0YWY4ZDQ5OGFiYmRlMDU1ZTUwNjUzMzE2IiwicHJvZmlsZU5hbWUiOiJBc3Nhc2luSmlhbmVyMjUiLCJzaWduYXR1cmVSZXF1aXJlZCI6dHJ1ZSwidGV4dHVyZXMiOnsiU0tJTiI6eyJ1cmwiOiJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzViMzcwNDljYWEyYWQxMWE2YmYyZDNlMWE1OGZhNGZkN2FmMGRmOWVjMWI0YzE3MGJhNzkxOTE2OWI1ZmE4NTYifX19", "dKh3/RXSPIFbC2l9yucxL/qtZXiDyTvir+xoNCHsDkR/SUr89oocDtRALXdnjhG/P9Je0nppU6UOpwlKl3o56nX8v8up6pqM95Z2KXMP+9/zq2ty/8k9zqVMlFX2HOVYbuTBFG6xmNTPWqELdfN46spCiIYAhhLLI7g4wpMtTw6mOuG6R9Kn7odGXKawUSBuVByNy8yG1mKCQdUvq+Crp/BU75fdFOARRlFgCiu5m4HPrN3o0bLgiRqHohHxGgt+8qF6t/7RGpDJCXN0gLy5Vt8qdYLGk6ZHCgmNEAUATX9QSGhU80dwTGgpENRt/hyyTUnGI8yT1OpbrLErs3SSiAJ9DnmMsMpfV8aNUQOG0t7Ki1WH3TcSqfWgD6kV6EDJNf1rMCiTvrcUYP5Bkm/K+QdNARuac/VIaFlmno16E/i+fy5uhNWU5MjAjCzcp7A7HWIqqkPAjX3GyFMNUSyBB56kcz+4/er3W7+4eykKE5K1xURqPIy6MPnuJtAhvXh2sea+nsggdpe8PXbFqmifcmo+7w7pxOt3aPuv3hsQXZi8LtwjaPAm1v442jQqg/VBFSZ6OV1Me49PWp1fieRNj/wniCuBjSdwQ6DKVfPKBFzjhxo4yXq4tdGkpZfSPn0JWlSGi0rjq49fVbK7ZasqIBGGvBL8igXE3OCR0I2nuw0=");
  4872. } elseif(name == "librarian") {
  4873. citizen.setSkin(citizen, "ewogICJ0aW1lc3RhbXAiIDogMTYwNDUzNTM2MTcxMywKICAicHJvZmlsZUlkIiA6ICJjNTBhZmE4YWJlYjk0ZTQ1OTRiZjFiNDI1YTk4MGYwMiIsCiAgInByb2ZpbGVOYW1lIiA6ICJUd29FQmFlIiwKICAic2lnbmF0dXJlUmVxdWlyZWQiIDogdHJ1ZSwKICAidGV4dHVyZXMiIDogewogICAgIlNLSU4iIDogewogICAgICAidXJsIiA6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlL2Q1ODA2MWRhMGVjMjk0MTcyNGZhNWVhOTMwMDBhYmQzMWMzZDhmOWM0MTZkOWI0MmJkYTRkODEwZGZiNmZjNGQiCiAgICB9CiAgfQp9", "jLahDHyLmgUsNIWuIG53/xh71HcEPWVTA6tNH+cBFy02GZIbtwZHMKaVmOf6BIt/V+gvZlPyspcEpgDxlRmBrv55dahoHBw3UwfD4B3L9rmaSchazltaRYzH4e2AZcs/NJ5VOwI0+uBu6MPqqjg/3uv4dZ/GZ8zG0wcbNr990EIlTa6Nz6tG/x4XTQNBvQjlDoacxe9uqfiunhckTQmuVbS+aHzmvQY86pU7kDs1+ZZsjSj4Q1iTHj5qTOjSTltB7DKBWaBlcWc8/GfT2T8nWjyvgC6cHoS8z1XbsiHRpsOEppqQfi1sgZV3LzbJxNVrokQQKtZTHIreS+HVsGkmM+4giBRxsqvJE3sXw2xKTtwW3W74/K+sCJkAHJSdZ/v//n6TInqVhYVRzKXVz62qMNYpZo2LWt0jCTfIcfK8Z4o1sp/+6ec4s5Z2WC6F7Qk4WClQWhRzBsHT3UyXMoodLdP6G/WN2G6ENGdUViplM+IAMQL16FbIvjLZXICbjL1CIbnwn+4e0eO4EbVIuUxex7wGziWLx4EdXilZkrDNOZv6pU4qkflBjG6hxP+6OvhSQYQzJ6GTEorScFDdyGnEE5NxPXFjbBC1368yh8ukSvw4znfVnNV3UrwnuFMASc8FHw4WWwJqZ8xibwbq2TQnvpsuuZC/bRgXruM+QBm84MY=");
  4874. } elseif(name == "dark_mage") {
  4875. citizen.setSkin(citizen, "ewogICJ0aW1lc3RhbXAiIDogMTYxMzg4NDI0MjQxMCwKICAicHJvZmlsZUlkIiA6ICJkNGY1ZGQ2YzVhYjE0NTNlYmJiNTg2ZTU2NzVkMDUyZSIsCiAgInByb2ZpbGVOYW1lIiA6ICIwMDAwMDAwMDAwMDAwMDBQIiwKICAic2lnbmF0dXJlUmVxdWlyZWQiIDogdHJ1ZSwKICAidGV4dHVyZXMiIDogewogICAgIlNLSU4iIDogewogICAgICAidXJsIiA6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlL2M2NmQ3N2ExZTlkMDk0ZDI4MThkYjI1YTViMmQ1ZWIzZWYwOGQ4NTBhOGUxNGNiZWE5MjZlMDNhYTI1MTFiNjgiCiAgICB9CiAgfQp9", "nwOMBhB4wmZq0aQXOe38+ekT716r1YSIMVs60F/OrrNQa+vIWlDPSRZFeTjIkAQr5d1pYl7YlVmiXxgIzJGLcZC5LyvihVgEwseAU8CZdTXSfQBu7OJjC/qrhGZnfDuw0fliSBx6S/hFaOjNWsMTbuESqNRbYUzSx0BjuGDeicrbXHme9tsI2/wTfERLuWnXoeruKyHKNy+j7cQ+/76Bpk1KoQmt2pqxv+o7KGYP7EFl1FpsPDZY5/nWT37r2KrFj0e6+kPy1w4nth80dgBN0da8KceW/ykoHXIDkgVr0xZu3eXpI0bl9LT3rROf1/W1YAiA5gABLU22sZTuBBZYMAbUVuXiwUBlbF2T5mEBNKHQF/1wO+q7oNR9mojVgBggBE4aqMrgNWpx5Vdc1cEmlPVmgt/27w880uPuWW51Ri2JCOdLg28ZY0RqLAIHL28j6rqoum3HLDTWLpEZ+9iAMNJ1toJgN34Ni5C2hSzo7SCLn5I4K5Z/jKfvFJKhF1mkt4yc/Rezl+T9z4FT9qTLfvSFTwsAbQRefnCTqYkiDs7I8WFdL1wymjkqgK75oOE3VWb7fASqpHBMpX9hz09nemx7x4lsHxquj0mctidNhDcrIMiCe0BMqbEoDCgil7iUaiMtGqz8U6KBaWR457XIABL8xThhOw0unNknoau7q0k=");
  4876. } elseif(name == "santa_marv") {
  4877. citizen.setSkin(citizen, "ewogICJ0aW1lc3RhbXAiIDogMTYzNzI4NTI1MTMwMiwKICAicHJvZmlsZUlkIiA6ICJmYzUwMjkzYTVkMGI0NzViYWYwNDJhNzIwMWJhMzBkMiIsCiAgInByb2ZpbGVOYW1lIiA6ICJDVUNGTDE3IiwKICAic2lnbmF0dXJlUmVxdWlyZWQiIDogdHJ1ZSwKICAidGV4dHVyZXMiIDogewogICAgIlNLSU4iIDogewogICAgICAidXJsIiA6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzYzYmMzNzczODg5YmRlNWFlZDA0NTliMWE5MWM5OWI1MTI4MDI1YzVmNTEwNDZjZjcxYjAxOWZhMTY2NWEyYTYiCiAgICB9CiAgfQp9", "r4SGS/TGW7tlibNTq4+uKg/v6oNc5eDD3BLbxIzcppll2tA9P4Za+16X968sgXQhrddNfdAh1zDui43WoON2Jrer797S1JzkddddISMiBq8CpjlUX77N6GvBOr5pBGgMKd0qLsDJUQF5Xa5FNun+ymwh1D57d0pb9eD0zNPIfD4V3REC1a9in1SHkoLfic11f8vCqBZ/oQ72eZ51GMYK1HWNSelCPGC1YQOEYI4WOD8suy44jRTrKO68cvmiizRBYykhJPP7Oqmcy2dOwXnDncif2vEEvTQVFp+uHolguIUOvKXy5lX7JIrZXsEgDaUHIAkQtMjO+9mH+qtkg2tniVTAUDFxQSdkbUY7kDfv40NipbiYgLyA4p+WPXr6BJyWGX6CCI8I71u7yUjOTH8pUt4OPVnGYUG0mT9kQO8P+vJIdW+Thg63/cTDHXmf8v+TDEdB2lyvjSdVeFD21C+MXXeM9yAWoZ370P1aLUar7dVUCRREpSBNpLFCo0wqpy1uiNYkO107LXD5wduxQJL1nQHVlym8+cvc7TyoRwEk7z6fL8NU+K8ijG/i9YhEUVPusCNhsbD33vJe2huroYMFx2DKHm9NeyTsTPsUmTu23bO4fZqttTdQohngbWYiDx0y8rDxakErF/gV4Ms38GVM80dAOde3dQpu0txYqGnPHxw=");
  4878. } elseif(name == "smith") {
  4879. citizen.setSkin(citizen, "eyJ0aW1lc3RhbXAiOjE1ODM1NTQzMTAxOTQsInByb2ZpbGVJZCI6IjIzZjFhNTlmNDY5YjQzZGRiZGI1MzdiZmVjMTA0NzFmIiwicHJvZmlsZU5hbWUiOiIyODA3Iiwic2lnbmF0dXJlUmVxdWlyZWQiOnRydWUsInRleHR1cmVzIjp7IlNLSU4iOnsidXJsIjoiaHR0cDovL3RleHR1cmVzLm1pbmVjcmFmdC5uZXQvdGV4dHVyZS84NDQ0NDQzMjlhZWM0OTYxYTJmMWYzZWNiYTBmYjJkZTE1NDU1Mzk5MTFmYjFlODA4ZmM4NzQ2NDNlNTRkZTY2In19fQ==", "qBm2/mxwTcJIEu8r13WohKEiByJQAx1K+5ciGEZQ08PRHbA0hWvuJfLWcAdOERsPARFCAhfzUZOjhOlKr28CNwTYnP7gTf6njP8Q9roSkwGSAH5PDH4mkiS9zmZQwYUJVyzn//srq6XsASNzGFq2ChgRZV+yGAVJFeSFpHAEnhQxhsSM3xltUo37aRjWNI4wlVSqzzQh+oJvB6IDWR6evrK1sNHByhX8/UNcx+XYL6PqN/51g16gJNmhppTu3YFj25dIBSiUTFFGViNMf7eAYrRS36ZkyUHlvAiC8leIOvC6cwtGGngOG6Vun2DtVI+9xyxqQhQURYIl+DrFt1cqSLDfEDVosKsfh3f5ynxaZ61fBZIz0hWxHmWw40SV+1wgfh0XD6jsusdXk/rf9zuRInhAvx/9cBnUNELfDfTeFmpkaZFo2LYwBawcKePVj7yqNborJ30mcyApO68mSIVzYLxO0aKfjRQYzrJx452iBRu4K87DbwvyLPowTzWrBh3HDUXdG4/Qn+W7eR3n7UYTFDeZUXURq6tDX8NEEj2giiBzonlkqpTECAXufabpHo+JvST4L97WKLP5omsKWyzVYTVILBn1On54gra6ZZwga7j+r3o67CQfOh8qDL6ZRoNRA9nBkUZzgjzHcfUAbUsqhYgkBpb/iEkqU6VU2Nc/+tA=");
  4880. } elseif(name == "casino") {
  4881. citizen.setSkin(citizen, "ewogICJ0aW1lc3RhbXAiIDogMTY0MjkwMTQ3NDQ4OCwKICAicHJvZmlsZUlkIiA6ICJjNTZlMjI0MmNiZWY0MWE2ODdlMzI2MGRjMGNmOTM2MSIsCiAgInByb2ZpbGVOYW1lIiA6ICJMSlI3MzEwMCIsCiAgInNpZ25hdHVyZVJlcXVpcmVkIiA6IHRydWUsCiAgInRleHR1cmVzIiA6IHsKICAgICJTS0lOIiA6IHsKICAgICAgInVybCIgOiAiaHR0cDovL3RleHR1cmVzLm1pbmVjcmFmdC5uZXQvdGV4dHVyZS8zZTA3OTQ3ZTRhMmNkOGQ1NGVjZGE4N2ZiNTQxNTViODQ4Zjk4ZTE5ZDE1ZTBiOTVhYjAyOTAyNjEyM2JkODM5IgogICAgfQogIH0KfQ==", "H5PIINevEBYikUEDiKw388RE5pxSp07y1LidOW/uZJbBUXFCQoUWZTh3faR5uL51T5EXxyVWbiZD1LA14S3vIrtruW7yR+keJYGw5PCQDWaPi8Qq41wwtQ01GXnGviWIqrJ5CGjHBbSQ0jpfZ+wSs48rByKfoS35SFeYdPvJeAODj9Sz1BBrJ8D9hW+n6w721RkAMGtYHSDgjcjzB1on+li78RvSKa3kUm2jqU5jNdLURHoDJe5Yg3i2vfXGtHdspC6isgH5KVe2prwYlosanun0XIYc6L99u2deN88rF55IXWsE+12cVTzaMDj4/oQqFvyfd92TgCNmuTJvwQKG9bLyt8IXgb/E0sRLN5ymZ0gUIju1ZXeRYDppnxWiZlLV9KK1zpGQ82gLTtamfjpj7z3Sg9N51t3BhGCZ98Y2Rn6UDGJ//v/h0qm/tNP4trQEFp2qGpYW4hM/0sSHA8KvJlfGrHv22JboVNyOlXMEENpcp8KTpJfAD5mpYoLKM3CWFFN/yReTkdTFs3L/qvv1DtNsvunNqAd0NTwD5hzQoigt3Diq9ZyLgnmzCj6OISw6RQLMkdNNpeBgxorXpCJM+mqV5RmPQwU0EhTlnJD0RC8HfqTOmIREJ/aczd3DJ7rMiJpDaPqOpMnNetQR6m85k90pcDHY08UqB4ZfItChL9I=");
  4882. } elseif(name == "anna") {
  4883. citizen.setSkin(citizen, "ewogICJ0aW1lc3RhbXAiIDogMTYwODY0MTkwMTQwNCwKICAicHJvZmlsZUlkIiA6ICI5MzZmMTA3MTEzOGM0YjMyYTg0OGY2NmE5Nzc2NDJhMiIsCiAgInByb2ZpbGVOYW1lIiA6ICIwMDAwMDAwMDAwMDAwMDB4IiwKICAic2lnbmF0dXJlUmVxdWlyZWQiIDogdHJ1ZSwKICAidGV4dHVyZXMiIDogewogICAgIlNLSU4iIDogewogICAgICAidXJsIiA6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzg1ZjVjZjBhYjIzMjBjYzYzNWRlMzk0ZjI5MGQxOGRiMjQ0OTQxMjE1NzgzM2I4MjBlNTBlNWI5ZGY2ZjAxOWIiLAogICAgICAibWV0YWRhdGEiIDogewogICAgICAgICJtb2RlbCIgOiAic2xpbSIKICAgICAgfQogICAgfQogIH0KfQ==", "EqWlrWpzfw/O8/Z5Lzw46lfSoEXERZT02R44zMSHr/2zzKBOmCt4kkl3COwNfO5Fjpc7el/4YbJya3ZBpmiLuJzPgYVtCt0cWmbxK7NXA2662yFq2Gsr6JX7NweQ2B6vZ573nFIOf7o/bMp2VI0BRRqPDsAlV61A1QS/aGYLJo7Yoz4njBRVYqVnAOXxUz8ETTSSfwxRHZSzXsvJVlci2yCalGcbM8dlGqgC9jRvZ4RjEFivCM7ICZGP9pJy555yOdMQvjkvxhslDNMvgpBR1hHBZA93yhjcTIGjErhIy/YwU9X0rpT9VEVjhQuPP+DBmJDrxj2IkyAESKvrRTG6ziZw8XlbCcDz9Q0Ao9GWp+wRMzntNNeFkMi/oVmDgh2pKFgdD2OGlhpl01286Ixcvw3XU4pQYmkq9khqomwvwjxomE0H52IjHAiFn+fEdVEw5n1ZdKJsvHHs/brqgohpKE5s8C+Lh5KDy76IfCOeiQcbBgpDdm2P9XeiuVkjZX8Sht+e05/ctPQpNXh5jgyjvREbKzbisztkZWzEnYI+uCa15dIIVkS0gTc8kJYX9ZQ6Q5IMUPPVo3R0etWfJ2jVI+M947rtEeJ9tRKslVA1H5MmAh9mndYkbFrMwzS7BLWbp4lhU4L9EsoUpHvf2IxInuLD1sauhGjJmTLtibs9tu4=");
  4884. } elseif(name == "diver") {
  4885. citizen.setSkin(citizen, "ewogICJ0aW1lc3RhbXAiIDogMTYxOTQ3NjExNDAyNCwKICAicHJvZmlsZUlkIiA6ICI5MzZmMTA3MTEzOGM0YjMyYTg0OGY2NmE5Nzc2NDJhMiIsCiAgInByb2ZpbGVOYW1lIiA6ICIwMDAwMDAwMDAwMDAwMDB4IiwKICAic2lnbmF0dXJlUmVxdWlyZWQiIDogdHJ1ZSwKICAidGV4dHVyZXMiIDogewogICAgIlNLSU4iIDogewogICAgICAidXJsIiA6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzJjM2VmZDUwOWY0N2YxYjk1ODdkZGNlOGNiODU1NTY4Njg2Y2ZhZDc0Y2I4ZWU3YzUxNjEwMjllMDRjZWU0ZSIsCiAgICAgICJtZXRhZGF0YSIgOiB7CiAgICAgICAgIm1vZGVsIiA6ICJzbGltIgogICAgICB9CiAgICB9CiAgfQp9", "qjH2cxOet5xXuYr6lBX9f/2oXrDez4UcYiMoxo45Ocjd6xqwncH2hfHESmQBtUtfv7pOIf+dW901N6B5qWuA1uxuDLeTC5dTG/AQ3NJUTJQ6AtiRZ49EVJ1OkexYFD3G31+USLGSrqhvsMzHN6a9gtRD3xbLCezCivMsVA02FXNaHjYylTgOc0vPs4+YdMi1pR4NGgcTxxsE1g6felZCxBeh3oy5DIOSdDjFq8xl6y6Kejo/kIyppl7dzK3DDcC0KxR7A3ukfMcDc/OA84kZlqqYf9or9MoztJIA+W3AIAH0vwnG+2feNjojHab/Z2jptqS3tlgnEV3j3cjbiB6LeRDQEsfg8/V/y/agzIZbTfJx92QRyfEPsoIXgYfb5OtOLuU9G9q+EIVALo9KRXXJLCpeOWj+/sgoDtLnG6rMdx0jyStwstTjCgV3kAvVfpvS5gTXrQl5qAIAepB04I9XgdVIxQppK+ZmLTCKRPbXj5P5NUc/f+BjsAFPmxP+0X9sWkamHbahyjj1tatlaMJhLAPzxLYSH8d7/91ZOGzcQL61d21w4Hn0nOCSI7y5HXo/O/tvJYFSEWj6DP5ZOayI14csnEfTAGS4kOCOCedabqBJjJuGfGlTatJWAdqJIBcEtXvun1oN4f7b42wvtwv/vmpuIVH4aAeUXdGKhOi5G/c=");
  4886. } elseif(name == "mage_assistant") {
  4887. citizen.setSkin(citizen, "ewogICJ0aW1lc3RhbXAiIDogMTU5OTc0MzgxODcxMSwKICAicHJvZmlsZUlkIiA6ICJhMjk1ODZmYmU1ZDk0Nzk2OWZjOGQ4ZGE0NzlhNDNlZSIsCiAgInByb2ZpbGVOYW1lIiA6ICJWaWVydGVsdG9hc3RpaWUiLAogICJzaWduYXR1cmVSZXF1aXJlZCIgOiB0cnVlLAogICJ0ZXh0dXJlcyIgOiB7CiAgICAiU0tJTiIgOiB7CiAgICAgICJ1cmwiIDogImh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZmE3ODc4MjIxYWQ4MDg3ODkzNjlmMmVkZjRkZmJlNWU5N2UzODJiNzZjODVmZWIzZmQyY2FkODgyYzk1NTJhNyIsCiAgICAgICJtZXRhZGF0YSIgOiB7CiAgICAgICAgIm1vZGVsIiA6ICJzbGltIgogICAgICB9CiAgICB9CiAgfQp9", "g3Ik0BT6M5jeFf7dHJ4hlLSJdiC5ivPcAb7gFP9+tlzH72N3eYrz+irExxpGQUsiro0NVEmlNt1R8aSBcY/wQDdLBOy9LHHt5MNpja72DDlFJUAW2fpXwJgfnCmqHDXzmVu3dfwyE0efZKOscFQzJQ5zbIGrEXjA2tOqEI/ZZMNehF5pNJZnusjGIpE/Abn9PxafnX/rvZAWr0BCip4wCUGbnfbDHlcn561HW50CAE8k3siqc+RJXXbnC24kYmblzuSBcHw33nCHRmlUiddyhzOE6NoWiZu9kNecOAapZmSZXCGMxyfwdy2n2Yg7ydxM8WTO7LOG1/o+ft/Ag24YxtHFkE6T2R03LvVYCTdodLzVQbXLqqMvGYcM7A6b6TPaHkMZhyumfH+GRoCI8kmyDEIqHrDbZOYhTyrpFBdz8WOOj1e5oz8nXQODMAC4ZEccj/5JishwPXxRdc9YFBkPJ63lJNN4boetMTdhDe3xe8tp8CoeNH3CaMn8eN0hkwmzXKx4I2qQPIO4NxW+bhJ1U6+qp8M0yllI2mRpZrTmTIhGHfq3nxJtUU+JcLMIaYiItnKlENH8vRP2UZrGq6SxiK0tE4A4wKGitXK/BAljLoUFLx8a+B/rbnmK8lqpWofaMeTeFw1W7m497ZaT7d3HLL0Jb/OR1vhP1NpJKZYhaLU=");
  4888. } elseif(name == "mage_guard") {
  4889. citizen.setSkin(citizen, "eyJ0aW1lc3RhbXAiOjE1MzEyODIzODEyNTMsInByb2ZpbGVJZCI6ImNhYjI4ODVkMTUxNjQ1OTNhZmI2MDkwODJlOTE2NmU3IiwicHJvZmlsZU5hbWUiOiJGYW5jeV9MdWR3aWciLCJzaWduYXR1cmVSZXF1aXJlZCI6dHJ1ZSwidGV4dHVyZXMiOnsiU0tJTiI6eyJ1cmwiOiJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlL2M0M2JmYTY1NTMyNWI3ZjFhMTE5YmQwZTYxNGM2NWI4NzFiMmFiZWFlNmI5YWZjOTRmNzJkZTRkMjRiYTAxODgifX19", "XkwrwdctRApUCGLH+sLKu85AlcL+hpNicYzKdjGhlUVuZ+qR4K5q3hdL0K5sivm2iwWXRQfGizgwOqyBEORJ4V0/EnTYBy/NheE4/Y4Kp1Fy/5+fVrktCRRzb2ha1GFUiq0VL0KvBo5zGeQTcibVn+KSw9mK01SQJK7zN/Rz9SSHIdJvj6D2Ckmqodrxo8LOgdrzkP9iKdgpAebG2fii90Uw38M5RMG/n0JcmnGFS1qKeQHIxNvdzqi12DJzLUoZ7FL+DS4JyX2fAZwEajCfS18zXZRNZ15b6Ba7hW35D+nEHtNM6AlHz0fHevaAnFpWsA3Q02sw29/2mUUSYkEVSbBz/Yf2EYOhlzzpCQnrHW9qqotS3bOcolezr6NEgmDp96THd6h1sIKrctVINzAUgBA+3EQbFVscTLkQEtcXkImuB9zJuErEJTrpzfYVZR72zSLZq0pElBFYs5mwArEGsDlqmWWKL0rHZ68rXMNdMYcZx7NjAjdQ6TTTVGxGngp/KwY3B65sUMqk57jQYSdvbaNnFUoBgJsO2SxQwO989O64WhuQcMRgLQ90pksgQXLnCUnZ2Er5uQGDGZndQF/EPpS8xNCsNu2iOHw9VbrpSDmYmTjBF0SOgNyV7k0xcYydksIv/rrDhWF/A073hKBkvnSpPqKIdJtYR0bmHUFGP68=");
  4890. } elseif(name == "notch") {
  4891. citizen.setSkin(citizen, "ewogICJ0aW1lc3RhbXAiIDogMTYyNDUyNjI0NjM2MywKICAicHJvZmlsZUlkIiA6ICIwNjlhNzlmNDQ0ZTk0NzI2YTViZWZjYTkwZTM4YWFmNSIsCiAgInByb2ZpbGVOYW1lIiA6ICJOb3RjaCIsCiAgInNpZ25hdHVyZVJlcXVpcmVkIiA6IHRydWUsCiAgInRleHR1cmVzIiA6IHsKICAgICJTS0lOIiA6IHsKICAgICAgInVybCIgOiAiaHR0cDovL3RleHR1cmVzLm1pbmVjcmFmdC5uZXQvdGV4dHVyZS8yOTIwMDlhNDkyNWI1OGYwMmM3N2RhZGMzZWNlZjA3ZWE0Yzc0NzJmNjRlMGZkYzMyY2U1NTIyNDg5MzYyNjgwIgogICAgfQogIH0KfQ==", "K76X+5wYgbcKhUxr5ZJuF4MXquYNPM5ypUf6DdNz2k0+XaJlobLVVdETe2LotlHyj6ABoU3//8mGZnfwhdj2BiulOErpB6cQR4pMmIrW6T3TLCt4L8d9juQy7xy7Dw9sQngXWm2h3Cazm+205qa0apnvA/i+IGv+WeutP52kfGhJBAN7uBUQaut0NWBfFPL8Jo7DhwBvWf/KWVpcT9UcVQuS/dVP/VE0rrTTSf3x2/jGI0ksBEdOz5lROARCHwOA1sRDvP1nQHhZD1Uekj4Bmo6rsAjJCrzr++nK2IcaPMv1uTLv0sbsGe4JF884rqWHYzs7/Cc5lGv8FNy+QjHmTcISfjnlxwJIkI48KOmAjuaova+tU1gBHRFHqJR186Vw8gtIGHusitFr6rUuutODaHyJ1C9VnItyk5RF3eznsh+uUHSkT9NOCTAhx11UhaFjlIHgqHG3rRVmeFWyEKHE8Pk2yEAlROGPedp+oYEwMFbM97Q+og7W/RtSH+kYl9vNwpLrQEG2F0bQUtulwQrWzk8T2fKgPHncZIDS2YvQjrrHjjlG0bLbiakHGvRrMrLbrVtmQrKjOjLuc5j4M/quMoZpFz98q4uftCmNOyN9ZmoEjgFv5fOdsJDGJawSaug9VEieCWhuuPnXPx19GpT1TRzGRjDW9DqO08kNeCcRxq0=");
  4892. } else {
  4893. msg.action(player, "Not supported name.");
  4894. }
  4895. goto("wait");
  4896. }
  4897. }
  4898. goto("humanhelp");
  4899. @answer
  4900. if(player.isMuted(player)) {
  4901. msg.prefix(player, "§6Commands", "You are muted.");
  4902. goto("wait");
  4903. }
  4904. if(size < 1) {
  4905. msg.prefix(sender, prefix_commands, "/answer <message>");
  4906. goto("wait");
  4907. }
  4908. player_uuid = player.getUuid(sender);
  4909. p_uuid = map.get(answer_map, player_uuid);
  4910. if(p_uuid == null) {
  4911. msg.prefix(sender, prefix_commands, "There is no one you could answer.");
  4912. goto("wait");
  4913. }
  4914. string_message = string.concatList(string_args, " ", 0, size - 1);
  4915. string_message = string.concat("§e", string_message);
  4916. message = getMessage(string_message);
  4917. p = player.get(p_uuid);
  4918. if(p == null) {
  4919. msg.prefix(sender, prefix_commands, "This player is not online.");
  4920. goto("wait");
  4921. }
  4922. msg(sender, text.merge(text.new(string.concat("§6[§cme §6-> §c", player.getName(p), "§6] §r")), message));
  4923. msg(p, text.merge(text.new(string.concat("§6[§c", player.getName(sender), " §6-> §cme§6] §r")), message));
  4924. map.add(answer_map, p_uuid, player_uuid);
  4925. map.add(answer_map, player_uuid, p_uuid);
  4926. goto("wait");
  4927. @msg
  4928. if(player.isMuted(sender)) {
  4929. msg.prefix(sender, "§6Commands", "You are muted.");
  4930. goto("wait");
  4931. }
  4932. if(size < 2) {
  4933. msg.prefix(sender, prefix_commands, "/msg <player> <message>");
  4934. if(perm.has("msg.team", player)) {
  4935. msg.prefix(sender, prefix_commands, "/msg team <message>");
  4936. }
  4937. goto("wait");
  4938. }
  4939. string_message = string.concatList(string_args, " ", 1, size - 1);
  4940. string_message = string.concat("§e", string_message);
  4941. message = getMessage(string_message);
  4942. p_name = list.getIndex(args, 0);
  4943. if(p_name == "team") {
  4944. msg.team(player, message);
  4945. goto("wait");
  4946. }
  4947. p_uuid = player.getUuid(p_name);
  4948. if(p_uuid == null) {
  4949. msg.prefix(sender, prefix_commands, "Unknown player.");
  4950. goto("wait");
  4951. }
  4952. p = read.player(p_name);
  4953. if(p == null) {
  4954. msg.prefix(sender, prefix_commands, "This player is not online.");
  4955. goto("wait");
  4956. }
  4957. msg(p, text.merge(text.new(string.concat("§6[§c", player.getName(sender), " §6-> §cme§6] ")), message));
  4958. msg(sender, text.merge(text.new(string.concat("§6[§cme §6-> §c", player.getName(p), "§6] ")), message));
  4959. player_uuid = player.getUuid(sender);
  4960. map.add(answer_map, p_uuid, player_uuid);
  4961. map.add(answer_map, player_uuid, p_uuid);
  4962. goto("wait");
  4963. @list
  4964. list = players.toList();
  4965. size = list.getSize(list);
  4966. msg.string(sender, string.getSpacer());
  4967. if(size == 1) {
  4968. msg.string(sender, string.concat("§6There is ", string.number(size), " players online."));
  4969. } else {
  4970. msg.string(sender, string.concat("§6There are ", string.number(size), " players online."));
  4971. }
  4972. table = table.new("§f", 16, 16);
  4973. msg.string(sender, table.getStart(table));
  4974. for(i = 0; i < size; i++) {
  4975. p = list.getIndex(list, i++);
  4976. full_name = player.getFullName(p);
  4977. if(player.isAfk(p)) {
  4978. full_name = string.concat(full_name, " §5§o[Afk]");
  4979. }
  4980. if(i < size) {
  4981. p_2 = list.getIndex(list, i);
  4982. full_name_2 = player.getFullName(p_2);
  4983. if(player.isAfk(p_2)) {
  4984. full_name_2 = string.concat(full_name_2, " §5§o[Afk]");
  4985. }
  4986. } else {
  4987. full_name_2 = "";
  4988. }
  4989. msg.string(sender, table.get(table, full_name, full_name_2));
  4990. }
  4991. msg.string(sender, table.getEnd(table));
  4992. goto("wait");
  4993. @sign
  4994. if(size == 0) {
  4995. msg.prefix(player, prefix_commands, "/sign ...");
  4996. msg.string(player, "§6 - <FRONT/BACK> <row:1-4> [text] §rSet a sign line");
  4997. if(perm.has("sign.copy", player)) {
  4998. msg.string(player, "§6 - copy §rCopy a sign content");
  4999. msg.string(player, "§6 - paste §rPaste a sign content");
  5000. msg.string(player, "§6 - wax <true/false> §rWax a sign");
  5001. }
  5002. goto("wait");
  5003. }
  5004. block = player.getTargetBlock(player, 5);
  5005. if(block == null) {
  5006. msg.prefix(player, prefix_commands, "Look at a sign.");
  5007. goto("wait");
  5008. }
  5009. if(!block.hasTag(block, all_signs_tag)) {
  5010. msg.prefix(player, prefix_commands, "Look at a sign.");
  5011. goto("wait");
  5012. }
  5013. arg0 = string.toLowerCase(list.getIndex(args, 0));
  5014. if(arg0 == "copy") {
  5015. a = array.new(8);
  5016. a[0] = sign.getString(block, "FRONT", 0);
  5017. a[1] = sign.getString(block, "FRONT", 1);
  5018. a[2] = sign.getString(block, "FRONT", 2);
  5019. a[3] = sign.getString(block, "FRONT", 3);
  5020. a[4] = sign.getString(block, "BACK", 0);
  5021. a[5] = sign.getString(block, "BACK", 1);
  5022. a[6] = sign.getString(block, "BACK", 2);
  5023. a[7] = sign.getString(block, "BACK", 3);
  5024. map.add(sign_copy_map, player.getId(player), a);
  5025. msg.prefix(player, prefix_commands, "Sign copied.");
  5026. goto("wait");
  5027. }
  5028. if(arg0 == "paste") {
  5029. a = map.get(sign_copy_map, player.getId(player));
  5030. if(a == null) {
  5031. msg.prefix(player, prefix_commands, "Use '/sign copy' first.");
  5032. goto("wait");
  5033. }
  5034. sign.setString(block, "FRONT", 0, a[0]);
  5035. sign.setString(block, "FRONT", 1, a[1]);
  5036. sign.setString(block, "FRONT", 2, a[2]);
  5037. sign.setString(block, "FRONT", 3, a[3]);
  5038. sign.setString(block, "BACK", 0, a[4]);
  5039. sign.setString(block, "BACK", 1, a[5]);
  5040. sign.setString(block, "BACK", 2, a[6]);
  5041. sign.setString(block, "BACK", 3, a[7]);
  5042. msg.prefix(player, prefix_commands, "Sign pasted.");
  5043. goto("wait");
  5044. }
  5045. if(arg0 == "wax") {
  5046. if(size < 2) {
  5047. msg.prefix(player, prefix_datatools, "/sign wax <true/false>");
  5048. goto("wait");
  5049. }
  5050. bool = list.getIndex(args, 1);
  5051. if(bool != true && bool != false) {
  5052. msg.action(player, "True/False expected.");
  5053. goto("wait");
  5054. }
  5055. block.signSetWaxed(block, bool);
  5056. msg.prefix(player, prefix_commands, "Set sign wax.");
  5057. goto("wait");
  5058. }
  5059. if(size < 2) {
  5060. msg.prefix(player, prefix_datatools, "/sign <FRONT/BACK> <row:1-4> [text]");
  5061. goto("wait");
  5062. }
  5063. side = list.getIndex(args, 0);
  5064. if(side != "FRONT" && side != "BACK") {
  5065. msg.action(player, "FRONT/BACK expected.");
  5066. goto("wait");
  5067. }
  5068. line = list.getIndex(args, 1);
  5069. if(!isDouble(line)) {
  5070. msg.prefix(player, prefix_commands, "Number expected.");
  5071. goto("wait");
  5072. }
  5073. if(!(line == 1 || line == 2 || line == 3 || line == 4)) {
  5074. msg.prefix(player, prefix_commands, "Number between 1 and 4 expected.");
  5075. goto("wait");
  5076. }
  5077. if(!player.hasBypass(player)) {
  5078. if(!plot.check(block.getLocation(block), player, 19, true)) {
  5079. msg.prefix(player, prefix_commands, "Not your plot.");
  5080. goto("wait");
  5081. }
  5082. }
  5083. string = "";
  5084. if(size > 2) {
  5085. for(i = 2; i < size; i++) {
  5086. arg = list.getIndex(string_args, i);
  5087. if(i == 2) {
  5088. string = arg;
  5089. } else {
  5090. string = string.concat(string, " ", arg);
  5091. }
  5092. }
  5093. }
  5094. string = string.replace(string, "&", "§");
  5095. block.setSign(block, side, line - 1, text.new(string));
  5096. block.signSetWaxed(block, true);
  5097. goto("wait");
  5098. @head
  5099. if(size != 1) {
  5100. msg.prefix(player, prefix_commands, "/head <player>");
  5101. goto("wait");
  5102. }
  5103. name = list.getIndex(args, 0);
  5104. uuid = player.getUuid(name);
  5105. if(uuid == null) {
  5106. head = read.item(string.concat("{id:\"minecraft:player_head\", Count:1b, tag:{SkullOwner:\"", name, "\"}}"));
  5107. } else {
  5108. head = player.getHead(uuid, name);
  5109. }
  5110. player.giveItem(player, head);
  5111. goto("wait");
  5112. @mute
  5113. if(size < 1) {
  5114. msg.prefix(sender, prefix_commands, "/mute <player> [message]");
  5115. goto("wait");
  5116. }
  5117. p_name = list.getIndex(args, 0);
  5118. if(!isOnline(p_name)) {
  5119. msg.prefix(sender, prefix_commands, "This player is not online.");
  5120. goto("wait");
  5121. }
  5122. p = read.player(p_name);
  5123. p_name = player.getName(p);
  5124. if(p_name == "marvinius") {
  5125. msg.string(sender, "§cSorry §b¯\\_(._.)_/¯");
  5126. goto("wait");
  5127. }
  5128. sender_name = player.getName(sender);
  5129. player.mute(p, true);
  5130. if(size > 1) {
  5131. reason = string.concatList(args, " ", 1, size - 1);
  5132. msg.team(sender_name, string.concat("§cMuted ", p_name, ": ", reason));
  5133. } else {
  5134. msg.team(sender_name, string.concat("§cMuted ", p_name, "."));
  5135. }
  5136. goto("wait");
  5137. @unmute
  5138. if(size < 1) {
  5139. msg.prefix(sender, prefix_commands, "/unmute <player>");
  5140. goto("wait");
  5141. }
  5142. p_name = list.getIndex(args, 0);
  5143. if(!isOnline(p_name)) {
  5144. msg.prefix(sender, prefix_commands, "This player is not online.");
  5145. goto("wait");
  5146. }
  5147. p = read.player(p_name);
  5148. p_name = player.getName(p);
  5149. if(p_name == "marvinius") {
  5150. msg.string(sender, "§cSorry §b¯\\_(._.)_/¯");
  5151. goto("wait");
  5152. }
  5153. msg.team(player.getName(sender), string.concat("§cUnmuted ", p_name, "."));
  5154. player.mute(p, false);
  5155. goto("wait");
  5156. @kick
  5157. if(size < 1) {
  5158. msg.prefix(sender, prefix_commands, "/kick <player> [reason]");
  5159. goto("wait");
  5160. }
  5161. p_name = list.getIndex(args, 0);
  5162. if(!isOnline(p_name)) {
  5163. msg.prefix(sender, prefix_commands, "This player is not online.");
  5164. goto("wait");
  5165. }
  5166. p = read.player(p_name);
  5167. p_name = player.getName(p);
  5168. if(p_name == "marvinius") {
  5169. msg.string(sender, "§cSorry §b¯\\_(._.)_/¯");
  5170. goto("wait");
  5171. }
  5172. sender_name = player.getName(sender);
  5173. if(size > 1) {
  5174. reason = string.concatList(args, " ", 1, size - 1);
  5175. msg.team(sender_name, string.concat("§c", p_name, " got kicked: ", reason));
  5176. } else {
  5177. reason = "You got kicked";
  5178. msg.team(sender_name, string.concat("§c", p_name, " got kicked."));
  5179. }
  5180. ban.kick(p, text.new(reason));
  5181. goto("wait");
  5182. @warn
  5183. if(size != 1) {
  5184. msg.prefix(sender, prefix_commands, "/warn <player>");
  5185. goto("wait");
  5186. }
  5187. p_name = list.getIndex(args, 0);
  5188. if(!isOnline(p_name)) {
  5189. msg.prefix(sender, prefix_commands, "This player is not online.");
  5190. goto("wait");
  5191. }
  5192. p = read.player(p_name);
  5193. p_name = player.getName(p);
  5194. if(p_name == "marvinius") {
  5195. msg.string(sender, "§cSorry §b¯\\_(._.)_/¯");
  5196. goto("wait");
  5197. }
  5198. title.send(p, text.new(string.concat("§c", player.getName(sender))), text.new("is watching you"));
  5199. msg.prefix(sender, prefix_commands, "The player got warned.");
  5200. goto("wait");
  5201. @ban
  5202. if(size < 1) {
  5203. msg.prefix(sender, prefix_commands, "/ban <player> [reason]");
  5204. goto("wait");
  5205. }
  5206. p_name = list.getIndex(args, 0);
  5207. if(!checkIfEverOnline(p_name)) {
  5208. msg.prefix(sender, prefix_commands, "This player has never been online.");
  5209. goto("wait");
  5210. }
  5211. p_name = player.getName(player.getUuid(p_name));
  5212. if(p_name == "marvinius") {
  5213. msg.string(sender, "§cSorry §b¯\\_(._.)_/¯");
  5214. goto("wait");
  5215. }
  5216. sender_name = player.getName(sender);
  5217. if(size > 1) {
  5218. reason = string.concatList(args, " ", 1, size - 1);
  5219. msg.team(sender_name, string.concat("§c", p_name, " got banned: ", reason));
  5220. } else {
  5221. reason = "You got banned.";
  5222. msg.team(sender_name, string.concat("§c", p_name, " got banned."));
  5223. }
  5224. ban.add(player.getUuid(p_name), reason, sender_name);
  5225. if(isOnline(p_name)) {
  5226. p = read.player(p_name);
  5227. ban.kick(p, text.new(reason));
  5228. }
  5229. goto("wait");
  5230. @unban
  5231. if(size != 1) {
  5232. msg.prefix(sender, prefix_commands, "/unban <player>");
  5233. goto("wait");
  5234. }
  5235. p_name = list.getIndex(args, 0);
  5236. if(!checkIfEverOnline(p_name)) {
  5237. msg.prefix(sender, prefix_commands, "This player has never been online.");
  5238. goto("wait");
  5239. }
  5240. p_name = player.getName(player.getUuid(p_name));
  5241. ban.remove(player.getUuid(p_name));
  5242. msg.team(player.getName(sender), string.concat("§cUnbanned ", p_name, "."));
  5243. goto("wait");
  5244. @tempban
  5245. if(size < 4) {
  5246. msg.prefix(sender, prefix_commands, "/tempban <player> <days> <hours> <minutes> [reason]");
  5247. goto("wait");
  5248. }
  5249. p_name = list.getIndex(args, 0);
  5250. if(!checkIfEverOnline(p_name)) {
  5251. msg.prefix(sender, prefix_commands, "This player has never been online.");
  5252. goto("wait");
  5253. }
  5254. p_name = player.getName(player.getUuid(p_name));
  5255. if(p_name == "marvinius") {
  5256. msg.string(sender, "§cSorry §b¯\\_(._.)_/¯");
  5257. goto("wait");
  5258. }
  5259. days = list.getIndex(args, 1);
  5260. hours = list.getIndex(args, 2);
  5261. minutes = list.getIndex(args, 3);
  5262. if(!isDouble(days) || !isDouble(hours) || !isDouble(minutes)) {
  5263. msg.prefix(sender, prefix_commands, "Number expected.");
  5264. goto("wait");
  5265. }
  5266. if(days < 0 || hours < 0 || minutes < 0) {
  5267. msg.prefix(sender, prefix_commands, "Positive number expected.");
  5268. goto("wait");
  5269. }
  5270. endtime = time.getMillis() + minutes * 60000 + hours * 3600000 + days * 86400000;
  5271. timestring = time.getString(endtime);
  5272. sender_name = player.getName(sender);
  5273. if(size > 4) {
  5274. reason = string.concatList(args, " ", 4, size - 1);
  5275. msg.team(sender_name, string.concat("§c", p_name, " got banned until ", timestring, ". Reason: ", reason));
  5276. } else {
  5277. reason = "You got banned.";
  5278. msg.team(sender_name, string.concat("§c", p_name, " got banned until ", timestring, "."));
  5279. }
  5280. calendar = time.new(endtime);
  5281. ban.add(player.getUuid(p_name), reason, sender_name, calendar);
  5282. if(isOnline(p_name)) {
  5283. p = read.player(p_name);
  5284. ban.kick(p, text.new(reason));
  5285. }
  5286. goto("wait");
  5287. @ping
  5288. msg.string(player, "pong");
  5289. goto("wait");
  5290. @plot
  5291. if(size == 0) {
  5292. @plothelp
  5293. msg.prefix(player, prefix_plot, "/plot ...");
  5294. msg.string(player, "§d - info §rReturns info about current location");
  5295. if(!perm.has("plot.moreinfo", player)) {
  5296. msg.string(player, "§d - list §rLists your plots");
  5297. }
  5298. msg.string(player, "");
  5299. msg.string(player, "§d - pos1/pos2 §rSet corner points");
  5300. msg.string(player, "§d - create §rCreates a (sub-)plot (Y: -64 to 319)");
  5301. msg.string(player, "§d - create3D §rCreates a 3D (sub-)plot");
  5302. msg.string(player, "");
  5303. msg.string(player, "§d - remove [id] §rRemoves a plot");
  5304. msg.string(player, "§d - expand <value> [direction] [id] §rExpands a plot");
  5305. msg.string(player, "§d - name [id] <name> §rRenames a plot");
  5306. msg.string(player, "");
  5307. msg.string(player, "§d - share <player> [id] §rAdd a player to a plot");
  5308. msg.string(player, "§d - kick <player> [id] §rRemove a player from a plot");
  5309. msg.string(player, "§d - leader <player> [id] §rSet a new plot leader");
  5310. msg.string(player, "§d - mod <player> [id] §rPromote to plot mod");
  5311. msg.string(player, "§d - chest <player> [id] §rAllows a player to open chests");
  5312. msg.string(player, "");
  5313. msg.string(player, "§d - raise §rRaises a plot to a city. Costs §610 gold snuvis§r.");
  5314. msg.string(player, "§d - sell <price> §rSells a sub-plot");
  5315. msg.string(player, "");
  5316. if(perm.has("plot.moreinfo", player)) {
  5317. msg.string(player, "§d - list [player] §rLists all plots from a player");
  5318. msg.string(player, "§d - moreinfo [id] §rReturns more detailed infos");
  5319. msg.string(player, "§d - listall §rLists all plots");
  5320. msg.string(player, "§d - flags <flags> <boolean> §rSet all flags to the boolean");
  5321. msg.string(player, "§d - move <value> [direction] [id] §rMoves a block");
  5322. }
  5323. goto("wait");
  5324. }
  5325. arg0 = string.toLowerCase(list.getIndex(args, 0));
  5326. if(arg0 == "sell") {
  5327. if(size != 2) {
  5328. msg.prefix(player, prefix_commands, "/plot sell <price>");
  5329. goto("wait");
  5330. }
  5331. block = player.getTargetBlock(player, 5);
  5332. if(block == null) {
  5333. msg.prefix(player, prefix_commands, "Look at a sign.");
  5334. goto("wait");
  5335. }
  5336. if(!block.hasTag(block, sign_tag)) {
  5337. msg.prefix(player, prefix_plot, "You need to look at an empty sign.");
  5338. goto("wait");
  5339. }
  5340. if(sign.getString(block, "FRONT", 0) != "" || sign.getString(block, 1) != "" || sign.getString(block, 2) != "" || sign.getString(block, 3) != "") {
  5341. msg.prefix(player, prefix_plot, "You need to look at an empty sign.");
  5342. goto("wait");
  5343. }
  5344. sign_loc = block.getLocation(block);
  5345. plot_list = plot.get(sign_loc);
  5346. amount = list.getSize(plot_list);
  5347. if(amount == 0 || amount == 1) {
  5348. msg.prefix(player, prefix_plot, "You aren´t on a sub plot.");
  5349. goto("wait");
  5350. }
  5351. if(amount > 2) {
  5352. msg.prefix(player, prefix_plot, "Multiple plots present. Not possible.");
  5353. goto("wait");
  5354. }
  5355. plot_1 = list.getIndex(plot_list, 0);
  5356. plot_2 = list.getIndex(plot_list, 1);
  5357. if(plot.isCity(plot_1)) {
  5358. city_plot = plot_1;
  5359. sell_plot = plot_2;
  5360. } elseif(plot.isCity(plot_2)) {
  5361. sell_plot = plot_1;
  5362. city_plot = plot_2;
  5363. } else {
  5364. msg.prefix(player, prefix_plot, "No city found.");
  5365. goto("wait");
  5366. }
  5367. if(!plot.isLeader(city_plot, player) && !plot.isMod(city_plot, player)) {
  5368. msg.prefix(player, prefix_plot, "You aren´t a city plot leader or mod.");
  5369. goto("wait");
  5370. }
  5371. snuvis = list.getIndex(args, 1);
  5372. if(!isDouble(snuvis) || snuvis < 0) {
  5373. msg.prefix(player, prefix_plot, "Positive number expected.");
  5374. goto("wait");
  5375. }
  5376. //Sell Plot
  5377. x1 = plot.getMinX(sell_plot);
  5378. y1 = plot.getMinY(sell_plot);
  5379. z1 = plot.getMinZ(sell_plot);
  5380. x2 = plot.getMaxX(sell_plot);
  5381. y2 = plot.getMaxY(sell_plot);
  5382. z2 = plot.getMaxZ(sell_plot);
  5383. length = math.abs(x1 - x2) + 1;
  5384. width = math.abs(z1 - z2) + 1;
  5385. high = math.abs(y1 - y2) + 1;
  5386. //Change plot settings
  5387. plot.setFree(sell_plot, true);
  5388. plot.setName(sell_plot, "Free Plot");
  5389. plot.removePlayer(sell_plot, player.getName(player));
  5390. //Label Sign
  5391. block.setSign(sign_loc, 0, "§3[§bFree Plot§3]");
  5392. block.setSign(sign_loc, 1, string.concat("§2", string.number(snuvis)));
  5393. if(high == 319) {
  5394. block.setSign(sign_loc, 2, string.concat(string.number(length), "x", string.number(width)));
  5395. } else {
  5396. block.setSign(sign_loc, 2, string.concat(string.number(length), "x", string.number(width), " (Y:", string.number(high), ")"));
  5397. }
  5398. block.setSign(sign_loc, 3, string.number(player.getId(player)));
  5399. msg.prefix(player, prefix_plot, "Free plot for selling created.");
  5400. world = loc.getWorld(sign_loc);
  5401. plot.savePlots(world);
  5402. goto("wait");
  5403. }
  5404. if(arg0 == "raise") {
  5405. location = entity.getLocation(player);
  5406. plot_list = plot.get(location);
  5407. amount = list.getSize(plot_list);
  5408. if(amount == 0) {
  5409. msg.prefix(player, prefix_plot, "You aren´t on a plot.");
  5410. goto("wait");
  5411. }
  5412. plot = list.getIndex(plot_list, 0);
  5413. if(plot.isCity(plot)) {
  5414. msg.prefix(player, prefix_plot, "This plot is already a city.");
  5415. goto("wait");
  5416. }
  5417. if(!plot.isLeader(plot, player)) {
  5418. msg.prefix(player, prefix_plot, "Only the plot leader can do this.");
  5419. goto("wait");
  5420. }
  5421. if(amount > 1) {
  5422. msg.prefix(player, prefix_plot, "Multiple plots present. Not possible.");
  5423. goto("wait");
  5424. }
  5425. x1 = plot.getMinX(plot);
  5426. z1 = plot.getMinZ(plot);
  5427. x2 = plot.getMaxX(plot);
  5428. z2 = plot.getMaxZ(plot);
  5429. length = math.abs(x1 - x2) + 1;
  5430. width = math.abs(z1 - z2) + 1;
  5431. plot_size = length * width;
  5432. if(plot_size < 2500) {
  5433. msg.prefix(player, prefix_plot, "Your plot must be over 2500m2.");
  5434. goto("wait");
  5435. }
  5436. snuvis = 40960;
  5437. if(!hasEnoughMoney(player, snuvis)) {
  5438. msg.prefix(player, prefix_plot, string.concat("You´ll need §6", string.number(snuvis), "§r snuvis for this."));
  5439. goto("wait");
  5440. }
  5441. offerRank(player, "rank.major");
  5442. player.setPlotRaised(player, true);
  5443. money.sub(player, snuvis);
  5444. plot.setCity(plot, true);
  5445. msg.prefix(player, prefix_plot, string.concat("City created. Spent §6", string.number(snuvis), "§r snuvis."));
  5446. world = loc.getWorld(location);
  5447. plot.savePlots(world);
  5448. goto("wait");
  5449. }
  5450. if(arg0 == "leader") {
  5451. if(size < 2) {
  5452. msg.prefix(player, prefix_commands, "/plot leader <player> [plot_id]");
  5453. goto("wait");
  5454. }
  5455. p_name = list.getIndex(args, 1);
  5456. p_uuid = player.getUuid(p_name);
  5457. if(p_uuid == null) {
  5458. msg.prefix(player, prefix_plot, "This player has never been online.");
  5459. goto("wait");
  5460. }
  5461. p_name = player.getName(p_uuid);
  5462. location = entity.getLocation(player);
  5463. world = loc.getWorld(location);
  5464. if(size == 2) {
  5465. plot_list = plot.get(location);
  5466. amount = list.getSize(plot_list);
  5467. if(amount == 0) {
  5468. msg.prefix(player, prefix_plot, "You aren´t on a plot.");
  5469. goto("wait");
  5470. }
  5471. plot = list.getIndex(plot_list, 0);
  5472. if(amount > 1) {
  5473. msg.prefix(player, prefix_plot, "Multiple plots present:");
  5474. for(i = 0; i < amount; i++) {
  5475. plot = list.getIndex(plot_list, i);
  5476. plot_id = plot.getId(plot);
  5477. 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)))));
  5478. }
  5479. goto("wait");
  5480. }
  5481. } else {
  5482. if(size != 3) {
  5483. msg.prefix(player, prefix_commands, "/plot leader <player> [plot_id]");
  5484. goto("wait");
  5485. }
  5486. plot_id = list.getIndex(args, 2);
  5487. plot = plot.getFromId(plot_id, world);
  5488. if(plot == null) {
  5489. msg.prefix(player, prefix_plot, "Unknown plot or not in this world.");
  5490. goto("wait");
  5491. }
  5492. }
  5493. player_id = player.getId(player);
  5494. if(!perm.has("plot.other", player)) {
  5495. if(!world.canUsePlots(world)) {
  5496. msg.prefix(player, prefix_perms, "You have no permission for this in this world.");
  5497. goto("wait");
  5498. }
  5499. if(!plot.isLeader(plot, player_id)) {
  5500. msg.prefix(player, prefix_plot, "You aren´t the plot leader.");
  5501. goto("wait");
  5502. }
  5503. player_name = player.getName(player);
  5504. if(player_name == p_name) {
  5505. msg.prefix(player, prefix_plot, "You are already the plot leader.");
  5506. goto("wait");
  5507. }
  5508. }
  5509. p_id = player.getId(p_uuid);
  5510. if(plot.isLeader(plot, p_id)) {
  5511. msg.prefix(player, prefix_plot, "This player is already the plot leader.");
  5512. goto("wait");
  5513. }
  5514. old_leader = plot.getLeaderId(plot);
  5515. if(old_leader != null) {
  5516. plot.setMod(plot, old_leader);
  5517. }
  5518. plot.setLeader(plot, p_id);
  5519. plot.addPlayer(plot, p_name);
  5520. msg.prefix(player, prefix_plot, string.concat(p_name, " promoted to plot leader."));
  5521. plot.savePlots(world);
  5522. goto("wait");
  5523. }
  5524. if(arg0 == "mod") {
  5525. if(size < 2) {
  5526. msg.prefix(player, prefix_commands, "/plot mod <player> [plot_id]");
  5527. goto("wait");
  5528. }
  5529. p_name = list.getIndex(args, 1);
  5530. p_uuid = player.getUuid(p_name);
  5531. if(p_uuid == null) {
  5532. msg.prefix(player, prefix_plot, "This player has never been online.");
  5533. goto("wait");
  5534. }
  5535. p_name = player.getName(p_uuid);
  5536. location = entity.getLocation(player);
  5537. world = loc.getWorld(location);
  5538. if(size == 2) {
  5539. plot_list = plot.get(location);
  5540. amount = list.getSize(plot_list);
  5541. if(amount == 0) {
  5542. msg.prefix(player, prefix_plot, "You aren´t on a plot.");
  5543. goto("wait");
  5544. }
  5545. plot = list.getIndex(plot_list, 0);
  5546. if(amount > 1) {
  5547. msg.prefix(player, prefix_plot, "Multiple plots present:");
  5548. for(i = 0; i < amount; i++) {
  5549. plot = list.getIndex(plot_list, i);
  5550. plot_id = plot.getId(plot);
  5551. 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)))));
  5552. }
  5553. goto("wait");
  5554. }
  5555. } else {
  5556. if(size != 3) {
  5557. msg.prefix(player, prefix_commands, "/plot mod <player> [plot_id]");
  5558. goto("wait");
  5559. }
  5560. plot_id = list.getIndex(args, 2);
  5561. plot = plot.getFromId(plot_id, world);
  5562. if(plot == null) {
  5563. msg.prefix(player, prefix_plot, "Unknown plot or not in this world.");
  5564. goto("wait");
  5565. }
  5566. }
  5567. player_id = player.getId(player);
  5568. if(!perm.has("plot.other", player)) {
  5569. if(!world.canUsePlots(world)) {
  5570. msg.prefix(player, prefix_perms, "You have no permission for this in this world.");
  5571. goto("wait");
  5572. }
  5573. if(!plot.isLeader(plot, player_id)) {
  5574. msg.prefix(player, prefix_plot, "You aren´t the plot leader.");
  5575. goto("wait");
  5576. }
  5577. }
  5578. p_id = player.getId(p_uuid);
  5579. if(plot.isLeader(plot, p_id)) {
  5580. msg.prefix(player, prefix_plot, "Not possible. Promote another player first /plot leader <player>.");
  5581. goto("wait");
  5582. }
  5583. if(plot.isMod(plot, p_id)) {
  5584. msg.prefix(player, prefix_plot, "This player is already a plot mod.");
  5585. goto("wait");
  5586. }
  5587. plot.setMod(plot, p_id);
  5588. plot.addPlayer(plot, p_name);
  5589. msg.prefix(player, prefix_plot, string.concat(p_name, " promoted to plot mod."));
  5590. plot.savePlots(world);
  5591. goto("wait");
  5592. }
  5593. if(arg0 == "chest") {
  5594. if(size < 2) {
  5595. msg.prefix(player, prefix_commands, "/plot chest <player> [plot_id]");
  5596. goto("wait");
  5597. }
  5598. p_name = list.getIndex(args, 1);
  5599. p_uuid = player.getUuid(p_name);
  5600. if(p_uuid == null) {
  5601. msg.prefix(player, prefix_plot, "This player has never been online.");
  5602. goto("wait");
  5603. }
  5604. p_name = player.getName(p_uuid);
  5605. location = entity.getLocation(player);
  5606. world = loc.getWorld(location);
  5607. if(size == 2) {
  5608. plot_list = plot.get(location);
  5609. amount = list.getSize(plot_list);
  5610. if(amount == 0) {
  5611. msg.prefix(player, prefix_plot, "You aren´t on a plot.");
  5612. goto("wait");
  5613. }
  5614. plot = list.getIndex(plot_list, 0);
  5615. if(amount > 1) {
  5616. msg.prefix(player, prefix_plot, "Multiple plots present:");
  5617. for(i = 0; i < amount; i++) {
  5618. plot = list.getIndex(plot_list, i);
  5619. plot_id = plot.getId(plot);
  5620. 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)))));
  5621. }
  5622. goto("wait");
  5623. }
  5624. } else {
  5625. if(size != 3) {
  5626. msg.prefix(player, prefix_commands, "/plot chest <player> [plot_id]");
  5627. goto("wait");
  5628. }
  5629. plot_id = list.getIndex(args, 2);
  5630. plot = plot.getFromId(plot_id, world);
  5631. if(plot == null) {
  5632. msg.prefix(player, prefix_plot, "Unknown plot or not in this world.");
  5633. goto("wait");
  5634. }
  5635. }
  5636. player_id = player.getId(player);
  5637. if(!perm.has("plot.other", player)) {
  5638. if(!world.canUsePlots(world)) {
  5639. msg.prefix(player, prefix_perms, "You have no permission for this in this world.");
  5640. goto("wait");
  5641. }
  5642. if(!plot.isLeader(plot, player_id) && !plot.isMod(plot, player_id)) {
  5643. msg.prefix(player, prefix_plot, "You aren´t a plot leader or mod.");
  5644. goto("wait");
  5645. }
  5646. }
  5647. p_id = player.getId(p_uuid);
  5648. if(plot.isLeader(plot, p_id) || plot.isMod(plot, p_id)) {
  5649. msg.prefix(player, prefix_plot, "Not possible. Player has higher permissions.");
  5650. goto("wait");
  5651. }
  5652. if(plot.canOpenChests(plot, p_id)) {
  5653. msg.prefix(player, prefix_plot, "This player already can open chests.");
  5654. goto("wait");
  5655. }
  5656. plot.setChest(plot, p_id);
  5657. msg.prefix(player, prefix_plot, string.concat(p_name, " can now open chests."));
  5658. goto("wait");
  5659. }
  5660. if(arg0 == "remove") {
  5661. location = entity.getLocation(player);
  5662. world = loc.getWorld(location);
  5663. if(size == 1) {
  5664. plot_list = plot.get(location);
  5665. amount = list.getSize(plot_list);
  5666. if(amount == 0) {
  5667. msg.prefix(player, prefix_plot, "You aren´t on a plot.");
  5668. goto("wait");
  5669. }
  5670. plot = list.getIndex(plot_list, 0);
  5671. if(amount > 1) {
  5672. msg.prefix(player, prefix_plot, "Multiple plots present:");
  5673. for(i = 0; i < amount; i++) {
  5674. plot = list.getIndex(plot_list, i);
  5675. plot_id = plot.getId(plot);
  5676. 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)))));
  5677. }
  5678. goto("wait");
  5679. }
  5680. } else {
  5681. if(size != 2) {
  5682. msg.prefix(player, prefix_commands, "/plot remove [plot_id]");
  5683. goto("wait");
  5684. }
  5685. plot_id = list.getIndex(args, 1);
  5686. plot = plot.getFromId(plot_id, world);
  5687. if(plot == null) {
  5688. msg.prefix(player, prefix_plot, "Unknown plot or not in this world.");
  5689. goto("wait");
  5690. }
  5691. }
  5692. if(!perm.has("plot.other", player)) {
  5693. if(!world.canUsePlots(world)) {
  5694. msg.prefix(player, prefix_perms, "You have no permission for this in this world.");
  5695. goto("wait");
  5696. }
  5697. player_id = player.getId(player);
  5698. if(!plot.isLeader(plot, player_id)) {
  5699. msg.prefix(player, prefix_plot, "You aren´t the plot leader.");
  5700. goto("wait");
  5701. }
  5702. }
  5703. if(plot.isCity(plot)) {
  5704. plot_list = plot.intersecting(world, plot.getMinX(plot), plot.getMinY(plot), plot.getMinZ(plot), plot.getMaxX(plot), plot.getMaxY(plot), plot.getMaxZ(plot));
  5705. iter = iterator(plot_list);
  5706. while(hasNext(iter)) {
  5707. sub_plot = next(iter);
  5708. plot.removeAllPlayers(sub_plot);
  5709. plot.remove(sub_plot, world);
  5710. }
  5711. }
  5712. //10% money back
  5713. x1 = plot.getMinX(plot);
  5714. z1 = plot.getMinZ(plot);
  5715. x2 = plot.getMaxX(plot);
  5716. z2 = plot.getMaxZ(plot);
  5717. length = x2 - x1 + 1;
  5718. width = z2 - z1 + 1;
  5719. snuvis = math.round(plot.calcCost(world, length, width) / 10);
  5720. leader_id = plot.getLeaderId(plot);
  5721. if(leader_id != null) {
  5722. money.add(leader_id, snuvis);
  5723. msg.prefix(player, prefix_plot, string.concat("Returned 10% of plot costs: ", money.getString(snuvis)));
  5724. }
  5725. //remove plot
  5726. plot.removeAllPlayers(plot);
  5727. plot.delMoveEvent(plot);
  5728. plot.remove(plot, world);
  5729. msg.prefix(player, prefix_plot, string.concat("Plot removed. #", string.number(plot.getId(plot)), " §6", plot.getName(plot)));
  5730. plot.savePlots(world);
  5731. goto("wait");
  5732. }
  5733. if(arg0 == "expand") {
  5734. if(size < 2) {
  5735. msg.prefix(player, prefix_commands, "/plot expand <value> [direction] [plot_id]");
  5736. goto("wait");
  5737. }
  5738. location = entity.getLocation(player);
  5739. world = loc.getWorld(location);
  5740. anzahl = list.getIndex(args, 1);
  5741. if(!isDouble(anzahl) || anzahl < 0) {
  5742. msg.prefix(player, prefix_plot, "Positive number expected.");
  5743. goto("wait");
  5744. }
  5745. if(size == 2) {
  5746. yaw = loc.getYaw(location);
  5747. direction = getDirection(yaw);
  5748. if(direction == null) {
  5749. msg.prefix(player, prefix_plot, "Direction of view too imprecise.");
  5750. goto("wait");
  5751. }
  5752. plot_list = plot.get(location);
  5753. amount = list.getSize(plot_list);
  5754. if(amount == 0) {
  5755. msg.prefix(player, prefix_plot, "You aren´t on a plot.");
  5756. goto("wait");
  5757. }
  5758. plot = list.getIndex(plot_list, 0);
  5759. if(amount > 1) {
  5760. msg.prefix(player, prefix_plot, "Multiple plots present:");
  5761. for(i = 0; i < amount; i++) {
  5762. plot = list.getIndex(plot_list, i);
  5763. plot_id = plot.getId(plot);
  5764. 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)))));
  5765. }
  5766. goto("wait");
  5767. }
  5768. } else {
  5769. if(size != 4) {
  5770. msg.prefix(player, prefix_commands, "/plot expand <value> [<direction> <plot_id>]");
  5771. goto("wait");
  5772. }
  5773. direction = string.toLowerCase(list.getIndex(args, 2));
  5774. plot_id = list.getIndex(args, 3);
  5775. plot = plot.getFromId(plot_id, world);
  5776. if(plot == null) {
  5777. msg.prefix(player, prefix_plot, "Unknown plot or not in this world.");
  5778. goto("wait");
  5779. }
  5780. }
  5781. if(plot.isSub(plot)) {
  5782. msg.prefix(player, prefix_plot, "Sub plots can´t be expanded.");
  5783. goto("wait");
  5784. }
  5785. x1 = plot.getMinX(plot);
  5786. y1 = plot.getMinY(plot);
  5787. z1 = plot.getMinZ(plot);
  5788. x2 = plot.getMaxX(plot);
  5789. y2 = plot.getMaxY(plot);
  5790. z2 = plot.getMaxZ(plot);
  5791. old_length = math.abs(x1 - x2) + 1;
  5792. old_width = math.abs(z1 - z2) + 1;
  5793. if(direction == "east") {
  5794. old_x2 = x2;
  5795. x2 += anzahl;
  5796. list = plot.intersecting(world, x2, y1, z1, old_x2, y2, z2);
  5797. } elseif(direction == "south") {
  5798. old_z2 = z2;
  5799. z2 += anzahl;
  5800. list = plot.intersecting(world, x1, y1, z2, x2, y2, old_z2);
  5801. } elseif(direction == "west") {
  5802. old_x1 = x1;
  5803. x1 -= anzahl;
  5804. list = plot.intersecting(world, old_x1, y1, z1, x1, y2, z2);
  5805. } elseif(direction == "north") {
  5806. old_z1 = z1;
  5807. z1 -= anzahl;
  5808. list = plot.intersecting(world, x1, y1, old_z1, x2, y2, z1);
  5809. } else {
  5810. msg.prefix(player, prefix_plot, "Unknown direction [north/east/south/west].");
  5811. goto("wait");
  5812. }
  5813. if(!perm.has("plot.other", player)) {
  5814. if(list.getSize(list) > 0) {
  5815. msg.prefix(player, prefix_plot, "New area is intersecting with other plots.");
  5816. goto("wait");
  5817. }
  5818. if(!world.canUsePlots(world)) {
  5819. msg.prefix(player, prefix_perms, "You have no permission for this in this world.");
  5820. goto("wait");
  5821. }
  5822. player_id = player.getId(player);
  5823. if(!plot.isLeader(plot, player_id)) {
  5824. msg.prefix(player, prefix_plot, "You aren´t the plot leader.");
  5825. goto("wait");
  5826. }
  5827. //Calc costs
  5828. length = math.abs(x1 - x2) + 1;
  5829. width = math.abs(z1 - z2) + 1;
  5830. snuvis = plot.calcCost(world, length, width) - plot.calcCost(world, old_length, old_width);
  5831. if(!hasEnoughMoney(player, snuvis)) {
  5832. msg.prefix(player, prefix_plot, string.concat("You´ll need §6", string.number(snuvis), "§r snuvis for this."));
  5833. goto("wait");
  5834. }
  5835. money.sub(player, snuvis);
  5836. expand_message = string.concat("The plot has been expanded. Spent §6", string.number(snuvis), "§r snuvis.");
  5837. if(!player.hasBigPlotCreated(player)) {
  5838. plot_size = length * width;
  5839. if(plot_size >= 900) {
  5840. offerRank(player, "rank.colonizer");
  5841. player.setBigPlotCreated(player, true);
  5842. }
  5843. }
  5844. } else {
  5845. expand_message = string.concat("The plot has been expanded.");
  5846. }
  5847. //Expand plot
  5848. gs_edge1 = loc.new(world, x1, y1, z1);
  5849. gs_edge2 = loc.new(world, x2, y2, z2);
  5850. new_plot = plot.setEdges(plot, gs_edge1, gs_edge2);
  5851. plot.delMoveEvent(plot);
  5852. plot.setMoveEvent(new_plot, world);
  5853. msg.prefix(player, prefix_plot, expand_message);
  5854. plot.savePlots(world);
  5855. goto("wait");
  5856. }
  5857. if(arg0 == "move") {
  5858. if(!perm.has("plot.move", player)) {
  5859. perm.no("plot.move", player);
  5860. goto("wait");
  5861. }
  5862. if(size < 2) {
  5863. msg.prefix(player, prefix_commands, "/plot move <value> [direction] [plot_id]");
  5864. goto("wait");
  5865. }
  5866. location = entity.getLocation(player);
  5867. world = loc.getWorld(location);
  5868. anzahl = list.getIndex(args, 1);
  5869. if(!isDouble(anzahl) || anzahl < 0) {
  5870. msg.prefix(player, prefix_plot, "Positive number expected.");
  5871. goto("wait");
  5872. }
  5873. if(size == 2) {
  5874. yaw = loc.getYaw(location);
  5875. direction = getDirection(yaw);
  5876. if(direction == null) {
  5877. msg.prefix(player, prefix_plot, "Direction of view too imprecise.");
  5878. goto("wait");
  5879. }
  5880. plot_list = plot.get(location);
  5881. amount = list.getSize(plot_list);
  5882. if(amount == 0) {
  5883. msg.prefix(player, prefix_plot, "You aren´t on a plot.");
  5884. goto("wait");
  5885. }
  5886. plot = list.getIndex(plot_list, 0);
  5887. if(amount > 1) {
  5888. msg.prefix(player, prefix_plot, "Multiple plots present:");
  5889. for(i = 0; i < amount; i++) {
  5890. plot = list.getIndex(plot_list, i);
  5891. plot_id = plot.getId(plot);
  5892. 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)))));
  5893. }
  5894. goto("wait");
  5895. }
  5896. } else {
  5897. if(size != 4) {
  5898. msg.prefix(player, prefix_commands, "/plot move <value> [<direction> <plot_id>]");
  5899. goto("wait");
  5900. }
  5901. direction = string.toLowerCase(list.getIndex(args, 2));
  5902. plot_id = list.getIndex(args, 3);
  5903. plot = plot.getFromId(plot_id, world);
  5904. if(plot == null) {
  5905. msg.prefix(player, prefix_plot, "Unknown plot or not in this world.");
  5906. goto("wait");
  5907. }
  5908. }
  5909. if(plot.isSub(plot)) {
  5910. msg.prefix(player, prefix_plot, "Sub plots can´t be moved.");
  5911. goto("wait");
  5912. }
  5913. x1 = plot.getMinX(plot);
  5914. y1 = plot.getMinY(plot);
  5915. z1 = plot.getMinZ(plot);
  5916. x2 = plot.getMaxX(plot);
  5917. y2 = plot.getMaxY(plot);
  5918. z2 = plot.getMaxZ(plot);
  5919. old_length = math.abs(x1 - x2) + 1;
  5920. old_width = math.abs(z1 - z2) + 1;
  5921. if(direction == "east") {
  5922. x1 += anzahl;
  5923. x2 += anzahl;
  5924. } elseif(direction == "south") {
  5925. z1 += anzahl;
  5926. z2 += anzahl;
  5927. } elseif(direction == "west") {
  5928. x1 -= anzahl;
  5929. x2 -= anzahl;
  5930. } elseif(direction == "north") {
  5931. z1 -= anzahl;
  5932. z2 -= anzahl;
  5933. } else {
  5934. msg.prefix(player, prefix_plot, "Unknown direction [north/east/south/west].");
  5935. goto("wait");
  5936. }
  5937. //Move plot
  5938. gs_edge1 = loc.new(world, x1, y1, z1);
  5939. gs_edge2 = loc.new(world, x2, y2, z2);
  5940. new_plot = plot.setEdges(plot, gs_edge1, gs_edge2);
  5941. plot.delMoveEvent(plot);
  5942. plot.setMoveEvent(new_plot, world);
  5943. msg.prefix(player, prefix_plot, "The plot has been moved.");
  5944. plot.savePlots(world);
  5945. goto("wait");
  5946. }
  5947. if(arg0 == "share") {
  5948. if(size < 2) {
  5949. msg.prefix(player, prefix_commands, "/plot share <player> [plot_id]");
  5950. goto("wait");
  5951. }
  5952. p_name = list.getIndex(args, 1);
  5953. p_uuid = player.getUuid(p_name);
  5954. if(p_uuid == null) {
  5955. msg.prefix(player, prefix_plot, "This player has never been online.");
  5956. goto("wait");
  5957. }
  5958. p_name = player.getName(p_uuid);
  5959. location = entity.getLocation(player);
  5960. world = loc.getWorld(location);
  5961. if(size == 2) {
  5962. plot_list = plot.get(location);
  5963. amount = list.getSize(plot_list);
  5964. if(amount == 0) {
  5965. msg.prefix(player, prefix_plot, "You aren´t on a plot.");
  5966. goto("wait");
  5967. }
  5968. plot = list.getIndex(plot_list, 0);
  5969. if(amount > 1) {
  5970. msg.prefix(player, prefix_plot, "Multiple plots present:");
  5971. for(i = 0; i < amount; i++) {
  5972. plot = list.getIndex(plot_list, i);
  5973. plot_id = plot.getId(plot);
  5974. 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)))));
  5975. }
  5976. goto("wait");
  5977. }
  5978. } else {
  5979. if(size != 3) {
  5980. msg.prefix(player, prefix_commands, "/plot share <player> [plot_id]");
  5981. goto("wait");
  5982. }
  5983. plot_id = list.getIndex(args, 2);
  5984. plot = plot.getFromId(plot_id, world);
  5985. if(plot == null) {
  5986. msg.prefix(player, prefix_plot, "Unknown plot or not in this world.");
  5987. goto("wait");
  5988. }
  5989. }
  5990. if(!perm.has("plot.other", player)) {
  5991. if(!world.canUsePlots(world)) {
  5992. msg.prefix(player, prefix_perms, "You have no permission for this in this world.");
  5993. goto("wait");
  5994. }
  5995. player_id = player.getId(player);
  5996. if(!plot.isLeader(plot, player_id) && !plot.isMod(plot, player_id)) {
  5997. msg.prefix(player, prefix_plot, "You aren´t a plot leader or mod.");
  5998. goto("wait");
  5999. }
  6000. }
  6001. plot.addPlayer(plot, p_name);
  6002. msg.prefix(player, prefix_plot, string.concat(p_name, " added to the plot."));
  6003. plot.savePlots(world);
  6004. goto("wait");
  6005. }
  6006. if(arg0 == "kick") {
  6007. if(size < 2) {
  6008. msg.prefix(player, prefix_commands, "/plot kick <player> [plot_id]");
  6009. goto("wait");
  6010. }
  6011. p_name = list.getIndex(args, 1);
  6012. p_uuid = player.getUuid(p_name);
  6013. if(p_uuid == null) {
  6014. msg.prefix(player, prefix_plot, "This player has never been online.");
  6015. goto("wait");
  6016. }
  6017. p_name = player.getName(p_uuid);
  6018. location = entity.getLocation(player);
  6019. world = loc.getWorld(location);
  6020. if(size == 2) {
  6021. plot_list = plot.get(location);
  6022. amount = list.getSize(plot_list);
  6023. if(amount == 0) {
  6024. msg.prefix(player, prefix_plot, "You aren´t on a plot.");
  6025. goto("wait");
  6026. }
  6027. plot = list.getIndex(plot_list, 0);
  6028. if(amount > 1) {
  6029. msg.prefix(player, prefix_plot, "Multiple plots present:");
  6030. for(i = 0; i < amount; i++) {
  6031. plot = list.getIndex(plot_list, i);
  6032. plot_id = plot.getId(plot);
  6033. 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)))));
  6034. }
  6035. goto("wait");
  6036. }
  6037. } else {
  6038. if(size != 3) {
  6039. msg.prefix(player, prefix_commands, "/plot kick <player> [plot_id]");
  6040. goto("wait");
  6041. }
  6042. plot_id = list.getIndex(args, 2);
  6043. plot = plot.getFromId(plot_id, world);
  6044. if(plot == null) {
  6045. msg.prefix(player, prefix_plot, "Unknown plot or not in this world.");
  6046. goto("wait");
  6047. }
  6048. }
  6049. if(!perm.has("plot.other", player)) {
  6050. if(!world.canUsePlots(world)) {
  6051. msg.prefix(player, prefix_perms, "You have no permission for this in this world.");
  6052. goto("wait");
  6053. }
  6054. if(!plot.isLeader(plot, player) && !plot.isMod(plot, player)) {
  6055. msg.prefix(player, prefix_plot, "You aren´t a plot leader or mod.");
  6056. goto("wait");
  6057. }
  6058. player_name = player.getName(player);
  6059. if(player_name == p_name) {
  6060. msg.prefix(player, prefix_plot, "You can´t kick yourself.");
  6061. goto("wait");
  6062. }
  6063. p_id = player.getId(p_uuid);
  6064. if(plot.isLeader(plot, p_id)) {
  6065. msg.prefix(player, prefix_plot, "You can´t kick the plot-leader.");
  6066. goto("wait");
  6067. }
  6068. }
  6069. plot.removePlayer(plot, p_name);
  6070. msg.prefix(player, prefix_plot, string.concat(p_name, " removed from this plot."));
  6071. plot.savePlots(world);
  6072. goto("wait");
  6073. }
  6074. if(arg0 == "name") {
  6075. if(size < 2) {
  6076. msg.prefix(player, prefix_commands, "/plot name [plot_id] <name>");
  6077. goto("wait");
  6078. }
  6079. location = entity.getLocation(player);
  6080. world = loc.getWorld(location);
  6081. //Angegeben wurde ein Name aus einem Wort, ohne Plotid. Der Spieler muss auf einem Plot sein.
  6082. if(size == 2) {
  6083. plot_list = plot.get(location);
  6084. amount = list.getSize(plot_list);
  6085. if(amount == 0) {
  6086. msg.prefix(player, prefix_plot, "You aren´t on a plot.");
  6087. goto("wait");
  6088. }
  6089. plot = list.getIndex(plot_list, 0);
  6090. name = list.getIndex(args, 1);
  6091. if(amount > 1) {
  6092. msg.prefix(player, prefix_plot, "Multiple plots present:");
  6093. for(i = 0; i < amount; i++) {
  6094. plot = list.getIndex(plot_list, i);
  6095. plot_id = plot.getId(plot);
  6096. 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)))));
  6097. }
  6098. goto("wait");
  6099. }
  6100. }
  6101. if(size > 2) {
  6102. plot_id = list.getIndex(args, 1);
  6103. if(isDouble(plot_id)) {
  6104. //Angegeben wurde eine eine Plotid mit einem Namen aus ein oder mehreren Wörtern
  6105. plot = plot.getFromId(plot_id, world);
  6106. if(plot == null) {
  6107. msg.prefix(player, prefix_plot, "Unknown plot or not in this world.");
  6108. goto("wait");
  6109. }
  6110. name = string.concatList(args, " ", 2, size - 1);
  6111. } else {
  6112. //Angegeben wurde ein Name aus mehreren Wörtern, ohne Plotid. Der Spieler muss auf einem Plot sein.
  6113. name = string.concatList(args, " ", 1, size - 1);
  6114. plot_list = plot.get(location);
  6115. amount = list.getSize(plot_list);
  6116. if(amount == 0) {
  6117. msg.prefix(player, prefix_plot, "You aren´t on a plot.");
  6118. goto("wait");
  6119. }
  6120. plot = list.getIndex(plot_list, 0);
  6121. if(amount > 1) {
  6122. msg.prefix(player, prefix_plot, "Multiple plots present:");
  6123. for(i = 0; i < amount; i++) {
  6124. plot = list.getIndex(plot_list, i);
  6125. plot_id = plot.getId(plot);
  6126. 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)))));
  6127. }
  6128. goto("wait");
  6129. }
  6130. }
  6131. }
  6132. if(!perm.has("plot.other", player)) {
  6133. if(!world.canUsePlots(world)) {
  6134. msg.prefix(player, prefix_perms, "You have no permission for this in this world.");
  6135. goto("wait");
  6136. }
  6137. player_id = player.getId(player);
  6138. if(!plot.isLeader(plot, player_id) && !plot.isMod(plot, player_id)) {
  6139. msg.prefix(player, prefix_plot, "You aren´t a plot leader or mod.");
  6140. goto("wait");
  6141. }
  6142. }
  6143. plot.setName(plot, name);
  6144. msg.prefix(player, prefix_plot, string.concat("Plot renamed to ", name, "."));
  6145. plot.savePlots(world);
  6146. goto("wait");
  6147. }
  6148. if(arg0 == "create" || arg0 == "create3d") {
  6149. player_id = player.getId(player);
  6150. loc1 = map.get(plotpos1, player_id);
  6151. loc2 = map.get(plotpos2, player_id);
  6152. if(loc1 == null || loc2 == null) {
  6153. msg.prefix(player, prefix_plot, "Set corners points with §d/p pos1 §rand §d/p pos2§r.");
  6154. goto("wait");
  6155. }
  6156. world1 = loc.getWorld(loc1);
  6157. if(world1 != loc.getWorld(loc2)) {
  6158. msg.prefix(player, prefix_plot, "Corner points have different worlds.");
  6159. goto("wait");
  6160. }
  6161. x1 = loc.getX(loc1);
  6162. z1 = loc.getZ(loc1);
  6163. x2 = loc.getX(loc2);
  6164. z2 = loc.getZ(loc2);
  6165. if(arg0 == "create") {
  6166. y1 = -64;
  6167. y2 = 319;
  6168. loc.setY(loc1, y1);
  6169. loc.setY(loc2, y2);
  6170. } else {
  6171. y1 = loc.getY(loc1);
  6172. y2 = loc.getY(loc2);
  6173. }
  6174. create_message = "Plot created.";
  6175. sub_plot = false;
  6176. if(!perm.has("plot.other", player)) {
  6177. world_name = world.getName(world1);
  6178. if(!world.canUsePlots(world1)) {
  6179. msg.prefix(player, prefix_perms, "You have no permission in this world.");
  6180. goto("wait");
  6181. }
  6182. list = plot.intersecting(world1, x1, y1, z1, x2, y2, z2);
  6183. if(list.getSize(list) > 0) {
  6184. city_plot = list.getIndex(list, 0);
  6185. if(plot.isCity(city_plot)) {
  6186. if(!plot.isLeader(city_plot, player_id) && !plot.isMod(city_plot, player_id)) {
  6187. msg.prefix(player, prefix_plot, "You aren´t a plot leader or mod.");
  6188. goto("wait");
  6189. }
  6190. city_id = plot.getId(city_plot);
  6191. if(!loc.hasPlotId(loc1, city_id)) {
  6192. msg.prefix(player, prefix_plot, "The sub plot needs to be surrounded by the city.");
  6193. goto("wait");
  6194. }
  6195. if(!loc.hasPlotId(loc2, city_id)) {
  6196. msg.prefix(player, prefix_plot, "The sub plot needs to be surrounded by the city.");
  6197. goto("wait");
  6198. }
  6199. sub_plot = true;
  6200. } else {
  6201. msg.prefix(player, prefix_plot, "Intersecting plots are not allowed.");
  6202. goto("wait");
  6203. }
  6204. }
  6205. if(!sub_plot) {
  6206. //Calc costs
  6207. length = math.abs(x1 - x2) + 1;
  6208. width = math.abs(z1 - z2) + 1;
  6209. if(length < 3 || width < 3) {
  6210. msg.prefix(player, prefix_plot, "Length and width of the plot must be at least 3.");
  6211. goto("wait");
  6212. }
  6213. snuvis = plot.calcCost(world1, length, width);
  6214. free_plot_used = player.usedHisFreePlot(player_id);
  6215. if(!free_plot_used && world_name != "creative") {
  6216. snuvis -= plot.calcCost(world1, 16, 16);
  6217. if(snuvis < 0) {
  6218. snuvis = 0;
  6219. }
  6220. msg.prefix(player, prefix_plot, "Free plot (16 x 16) to calculation included.");
  6221. }
  6222. if(!hasEnoughMoney(player, snuvis)) {
  6223. msg.prefix(player, prefix_plot, string.concat("You´ll need ", money.getString(snuvis), " snuvis for this."));
  6224. goto("wait");
  6225. }
  6226. create_message = string.concat("Plot created. Spent ", money.getString(snuvis), " snuvis.");
  6227. money.sub(player, snuvis);
  6228. if(!free_plot_used && world_name != "creative") {
  6229. player.setUsedFreePlot(player_id, true);
  6230. offerRank(player, "rank.settler");
  6231. }
  6232. if(!player.hasBigPlotCreated(player)) {
  6233. plot_size = length * width;
  6234. if(plot_size >= 900) {
  6235. offerRank(player, "rank.colonizer");
  6236. player.setBigPlotCreated(player, true);
  6237. }
  6238. }
  6239. }
  6240. }
  6241. //Create plot
  6242. map.remove(plotpos1, player_id);
  6243. map.remove(plotpos2, player_id);
  6244. plot = plot.add(loc1, loc2);
  6245. if(sub_plot) {
  6246. plot.setSub(plot, true);
  6247. }
  6248. plot.setMoveEvent(plot, world1);
  6249. player_name = player.getName(player);
  6250. plot.setName(plot, string.concat("Plot of ", player_name));
  6251. plot.addPlayer(plot, player_name);
  6252. plot.setLeader(plot, player_id);
  6253. msg.prefix(player, prefix_plot, create_message);
  6254. plot.savePlots(world1);
  6255. goto("wait");
  6256. }
  6257. if(arg0 == "pos1" || arg0 == "pos2") {
  6258. loc = entity.getLocation(player);
  6259. loc = getBlockLocation(loc);
  6260. player_id = player.getId(player);
  6261. if(arg0 == "pos1") {
  6262. map.add(plotpos1, player_id, loc);
  6263. pos_string = "Pos1";
  6264. } elseif(arg0 == "pos2") {
  6265. map.add(plotpos2, player_id, loc);
  6266. pos_string = "Pos2";
  6267. }
  6268. x = string.number(loc.getX(loc));
  6269. y = string.number(loc.getY(loc));
  6270. z = string.number(loc.getZ(loc));
  6271. msg.prefix(player, prefix_plot, string.concat(pos_string, " (", x, "/", y, "/", z, ") set."));
  6272. loc1 = map.get(plotpos1, player_id);
  6273. loc2 = map.get(plotpos2, player_id);
  6274. if(loc1 != null && loc2 != null) {
  6275. world1 = loc.getWorld(loc1);
  6276. snuvis = plot.calcCost(world1, loc1, loc2);
  6277. if(!player.usedHisFreePlot(player_id) && world.getName(world1) != "creative") {
  6278. snuvis -= plot.calcCost(world1, 16, 16);
  6279. if(snuvis < 0) {
  6280. snuvis = 0;
  6281. }
  6282. msg.prefix(player, prefix_plot, "Free plot (16 x 16) to calculation included.");
  6283. }
  6284. if(loc.isCity(loc1) && loc.isCity(loc2)) {
  6285. snuvis = 0;
  6286. }
  6287. msg.prefix(player, prefix_plot, string.concat("This plot will cost ", money.getString(snuvis), " snuvis."));
  6288. }
  6289. goto("wait");
  6290. }
  6291. if(arg0 == "flags") {
  6292. if(!perm.has("plot.moreinfo", player)) {
  6293. perm.no("plot.moreinfo", player);
  6294. goto("wait");
  6295. }
  6296. if(size < 3 || size > 4) {
  6297. msg.prefix(player, prefix_commands, "/plot flags <flags> <boolean> [plot_id]");
  6298. goto("wait");
  6299. }
  6300. flags = list.getIndex(args, 1);
  6301. if(!isDouble(flags) || flags < 0) {
  6302. msg.prefix(player, prefix_commands, "Positive number expected.");
  6303. goto("wait");
  6304. }
  6305. boolean = list.getIndex(args, 2);
  6306. if(!(boolean == true || boolean == false)) {
  6307. msg.prefix(player, prefix_commands, "Boolean expected.");
  6308. goto("wait");
  6309. }
  6310. location = entity.getLocation(player);
  6311. world = loc.getWorld(location);
  6312. if(size == 3) {
  6313. plot_list = plot.get(location);
  6314. amount = list.getSize(plot_list);
  6315. if(amount == 0) {
  6316. msg.prefix(player, prefix_plot, "You aren´t on a plot.");
  6317. goto("wait");
  6318. }
  6319. plot = list.getIndex(plot_list, 0);
  6320. if(amount > 1) {
  6321. msg.prefix(player, prefix_plot, "Multiple plots present:");
  6322. for(i = 0; i < amount; i++) {
  6323. plot = list.getIndex(plot_list, i);
  6324. plot_id = plot.getId(plot);
  6325. x = loc.getX(location);
  6326. y = loc.getY(location);
  6327. z = loc.getZ(location);
  6328. 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)))));
  6329. }
  6330. goto("wait");
  6331. }
  6332. } else {
  6333. plot_id = list.getIndex(args, 3);
  6334. plot = plot.getFromId(plot_id, world);
  6335. if(plot == null) {
  6336. msg.prefix(player, prefix_plot, "Unknown plot or not in this world.");
  6337. goto("wait");
  6338. }
  6339. }
  6340. plot.setFlags(plot, flags, boolean);
  6341. msg.prefix(player, prefix_plot, "Flags gesetzt.");
  6342. plot.savePlots(world);
  6343. goto("wait");
  6344. }
  6345. if(arg0 == "list") {
  6346. if(size == 1) {
  6347. p_name = player.getName(player);
  6348. } else {
  6349. if(!perm.has("plot.moreinfo", player)) {
  6350. perm.no("plot.moreinfo", player);
  6351. goto("wait");
  6352. }
  6353. p_name = list.getIndex(args, 1);
  6354. }
  6355. p_uuid = player.getUuid(p_name);
  6356. if(p_uuid == null) {
  6357. msg.prefix(player, prefix_plot, "This player has never been online.");
  6358. goto("wait");
  6359. }
  6360. p_name = player.getName(p_uuid);
  6361. msg.prefix(player, prefix_commands, string.concat("Plots of ", p_name, ":"));
  6362. world = loc.getWorld(entity.getLocation(player));
  6363. iter = plot.iterator(world, p_uuid);
  6364. while(hasNext(iter)) {
  6365. plot = next(iter);
  6366. msg.string(player, string.concat(" - #", string.number(plot.getId(plot)), " ", plot.getType(plot), " §6", plot.getName(plot)));
  6367. }
  6368. goto("wait");
  6369. }
  6370. if(arg0 == "listall") {
  6371. if(!perm.has("plot.moreinfo", player)) {
  6372. perm.no("plot.moreinfo", player);
  6373. goto("wait");
  6374. }
  6375. if(size != 1) {
  6376. msg.prefix(player, prefix_commands, "/plot listall");
  6377. goto("wait");
  6378. }
  6379. world = loc.getWorld(entity.getLocation(player));
  6380. msg.prefix(player, prefix_commands, string.concat("All plots in this world: ", world.getName(world)));
  6381. iterator = plot.iterator(world);
  6382. while(hasNext(iterator)) {
  6383. plot = next(iterator);
  6384. plot_id = plot.getId(plot);
  6385. msg.string(player, string.concat(" - #", string.number(plot_id), " ", plot.getType(plot), " §6", plot.getName(plot), " §r", plot.getLeaderName(plot)));
  6386. }
  6387. goto("wait");
  6388. }
  6389. if(arg0 == "moreinfo" || arg0 == "mi") {
  6390. if(!perm.has("plot.moreinfo", player)) {
  6391. perm.no("plot.moreinfo", player);
  6392. goto("wait");
  6393. }
  6394. location = entity.getLocation(player);
  6395. world = loc.getWorld(location);
  6396. if(size == 1) {
  6397. plot_list = plot.get(location);
  6398. amount = list.getSize(plot_list);
  6399. if(amount == 0) {
  6400. msg.prefix(player, prefix_plot, "You aren´t on a plot.");
  6401. goto("wait");
  6402. }
  6403. plot = list.getIndex(plot_list, 0);
  6404. if(amount > 1) {
  6405. msg.prefix(player, prefix_plot, "Multiple plots present:");
  6406. for(i = 0; i < amount; i++) {
  6407. plot = list.getIndex(plot_list, i);
  6408. plot_id = plot.getId(plot);
  6409. 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)))));
  6410. }
  6411. goto("wait");
  6412. }
  6413. } else {
  6414. if(size != 2) {
  6415. msg.prefix(player, prefix_commands, "/plot moreinfo [plot_id]");
  6416. goto("wait");
  6417. }
  6418. plot_id = list.getIndex(args, 1);
  6419. plot = plot.getFromId(plot_id, world);
  6420. if(plot == null) {
  6421. msg.prefix(player, prefix_plot, "Unknown plot or not in this world.");
  6422. goto("wait");
  6423. }
  6424. }
  6425. owners = "";
  6426. owners_list = plot.getOwners(plot);
  6427. copy_list = list.copy(owners_list);
  6428. plot_id = plot.getId(plot);
  6429. x1 = plot.getMinX(plot);
  6430. y1 = plot.getMinY(plot);
  6431. z1 = plot.getMinZ(plot);
  6432. x2 = plot.getMaxX(plot);
  6433. y2 = plot.getMaxY(plot);
  6434. z2 = plot.getMaxZ(plot);
  6435. length = x2 - x1 + 1;
  6436. width = z2 - z1 + 1;
  6437. msg.string(player, string.concat(" - #", string.number(plot_id), " ", plot.getType(plot), " §6", plot.getName(plot), " §r", string.number(length), "x", string.number(width)));
  6438. owners_list = plot.getOwners(plot);
  6439. copy_list = list.copy(owners_list);
  6440. msg.string(player, string.concat(" §dW §r", world.getName(world)));
  6441. msg.string(player, string.concat(" §dX1 §r", string.number(x1), " §dY1 §r", string.number(y1), " §dZ1 §r", string.number(z1)));
  6442. msg.string(player, string.concat(" §dX2 §r", string.number(x2), " §dY2 §r", string.number(y2), " §dZ2 §r", string.number(z2)));
  6443. leader_name = plot.getLeaderName(plot);
  6444. if(leader_name != "") {
  6445. msg.string(player, string.concat(" §dLeader: §r", leader_name));
  6446. list.remove(copy_list, player.getUuid(leader_name));
  6447. }
  6448. mods_list = plot.getMods(plot);
  6449. mods_amount = list.getSize(mods_list);
  6450. if(mods_amount != 0) {
  6451. iter = iterator(mods_list);
  6452. mods_string = "";
  6453. while(hasNext(iter)) {
  6454. p_name = player.getNameFromId(next(iter));
  6455. p_uuid = player.getUuid(p_name);
  6456. list.remove(copy_list, p_uuid);
  6457. if(mods_string == "") {
  6458. mods_string = p_name;
  6459. } else {
  6460. mods_string = string.concat(mods_string, " / ", p_name);
  6461. }
  6462. }
  6463. msg.string(player, string.concat(" §dMods: §r", mods_string));
  6464. }
  6465. members_amount = list.getSize(copy_list);
  6466. if(members_amount != 0) {
  6467. iter = iterator(copy_list);
  6468. members_string = "";
  6469. while(hasNext(iter)) {
  6470. p_name = player.getName(next(iter));
  6471. if(members_string == "") {
  6472. members_string = p_name;
  6473. } else {
  6474. members_string = string.concat(members_string, " / ", p_name);
  6475. }
  6476. }
  6477. msg.string(player, string.concat(" §dMembers: §r", members_string));
  6478. }
  6479. chests_list = plot.getChestRanks(plot);
  6480. chests_amount = list.getSize(chests_list);
  6481. if(chests_amount != 0) {
  6482. iter = iterator(chests_list);
  6483. chests_string = "";
  6484. while(hasNext(iter)) {
  6485. p_name = player.getNameFromId(next(iter));
  6486. if(chests_string == "") {
  6487. chests_string = p_name;
  6488. } else {
  6489. chests_string = string.concat(chests_string, " / ", p_name);
  6490. }
  6491. }
  6492. msg.string(player, string.concat(" §dOnly chest: §r", chests_string));
  6493. }
  6494. a = getFlagLists(plot);
  6495. flags_true = a[0];
  6496. flags_false = a[1];
  6497. x = loc.getX(location);
  6498. y = loc.getY(location);
  6499. z = loc.getZ(location);
  6500. msg.string(player, " §dFlags true:");
  6501. iter = iterator(flags_true);
  6502. while(hasNext(iter)) {
  6503. array = next(iter);
  6504. flag_number = array[0];
  6505. flag_name = array[1];
  6506. msg(player, text.merge(text.new(" "), string.getClickText(string.concat(" §d[§r", flag_name, "§d] "), string.concat("/plot flags ", flag_number, " false ", plot_id))));
  6507. }
  6508. msg.string(player, " §dFlags false:");
  6509. iter = iterator(flags_false);
  6510. while(hasNext(iter)) {
  6511. array = next(iter);
  6512. flag_number = array[0];
  6513. flag_name = array[1];
  6514. msg(player, text.merge(text.new(" "), string.getClickText(string.concat(" §d[§r", flag_name, "§d] "), string.concat("/plot flags ", flag_number, " true ", plot_id))));
  6515. }
  6516. goto("wait");
  6517. }
  6518. if(arg0 == "info" || arg0 == "i") {
  6519. location = entity.getLocation(player);
  6520. list = plot.get(location);
  6521. world = loc.getWorld(location);
  6522. size = list.getSize(list);
  6523. if(size == 0) {
  6524. msg.prefix(player, prefix_plot, "No plots found.");
  6525. goto("wait");
  6526. }
  6527. if(size == 1) {
  6528. msg.prefix(player, prefix_plot, string.concat(string.number(size), " plot found:"));
  6529. } else {
  6530. msg.prefix(player, prefix_plot, string.concat(string.number(size), " plots found:"));
  6531. }
  6532. for(i = 0; i < size; i++) {
  6533. plot = list.getIndex(list, i);
  6534. plot_id = plot.getId(plot);
  6535. x1 = plot.getMinX(plot);
  6536. y1 = plot.getMinY(plot);
  6537. z1 = plot.getMinZ(plot);
  6538. x2 = plot.getMaxX(plot);
  6539. y2 = plot.getMaxY(plot);
  6540. z2 = plot.getMaxZ(plot);
  6541. length = x2 - x1 + 1;
  6542. width = z2 - z1 + 1;
  6543. msg.string(player, string.concat(" - #", string.number(plot_id), " ", plot.getType(plot), " §6", plot.getName(plot), " §r", string.number(length), "x", string.number(width)));
  6544. owners_list = plot.getOwners(plot);
  6545. copy_list = list.copy(owners_list);
  6546. msg.string(player, string.concat(" §dW §r", world.getName(world)));
  6547. msg.string(player, string.concat(" §dX1 §r", string.number(x1), " §dY1 §r", string.number(y1), " §dZ1 §r", string.number(z1)));
  6548. msg.string(player, string.concat(" §dX2 §r", string.number(x2), " §dY2 §r", string.number(y2), " §dZ2 §r", string.number(z2)));
  6549. leader_name = plot.getLeaderName(plot);
  6550. if(leader_name != "") {
  6551. msg.string(player, string.concat(" §dLeader: §r", leader_name));
  6552. list.remove(copy_list, player.getUuid(leader_name));
  6553. }
  6554. mods_list = plot.getMods(plot);
  6555. mods_amount = list.getSize(mods_list);
  6556. if(mods_amount != 0) {
  6557. iter = iterator(mods_list);
  6558. mods_string = "";
  6559. while(hasNext(iter)) {
  6560. p_name = player.getNameFromId(next(iter));
  6561. p_uuid = player.getUuid(p_name);
  6562. list.remove(copy_list, p_uuid);
  6563. if(mods_string == "") {
  6564. mods_string = p_name;
  6565. } else {
  6566. mods_string = string.concat(mods_string, " / ", p_name);
  6567. }
  6568. }
  6569. msg.string(player, string.concat(" §dMods: §r", mods_string));
  6570. }
  6571. members_amount = list.getSize(copy_list);
  6572. if(members_amount != 0) {
  6573. iter = iterator(copy_list);
  6574. members_string = "";
  6575. while(hasNext(iter)) {
  6576. p_name = player.getName(next(iter));
  6577. if(members_string == "") {
  6578. members_string = p_name;
  6579. } else {
  6580. members_string = string.concat(members_string, " / ", p_name);
  6581. }
  6582. }
  6583. msg.string(player, string.concat(" §dMembers: §r", members_string));
  6584. }
  6585. chests_list = plot.getChestRanks(plot);
  6586. chests_amount = list.getSize(chests_list);
  6587. if(chests_amount != 0) {
  6588. iter = iterator(chests_list);
  6589. chests_string = "";
  6590. while(hasNext(iter)) {
  6591. p_name = player.getNameFromId(next(iter));
  6592. if(chests_string == "") {
  6593. chests_string = p_name;
  6594. } else {
  6595. chests_string = string.concat(chests_string, " / ", p_name);
  6596. }
  6597. }
  6598. msg.string(player, string.concat(" §dOnly chest: §r", chests_string));
  6599. }
  6600. }
  6601. goto("wait");
  6602. }
  6603. goto("plothelp");
  6604. @stopadventure
  6605. removeAdventureDisplay(player);
  6606. player.setAdventure(player, false);
  6607. msg.prefix(player, "§5Adventure", "Adventure canceled!");
  6608. goto("wait");
  6609. @speed
  6610. if(size < 1 || size > 2) {
  6611. if(perm.has("speed.other", player)) {
  6612. msg.prefix(player, prefix_commands, "/speed <1-10> [player]");
  6613. } else {
  6614. msg.prefix(player, prefix_commands, "/speed <1-10>");
  6615. }
  6616. goto("wait");
  6617. }
  6618. speed = list.getIndex(args, 0);
  6619. if(!isDouble(speed)) {
  6620. msg.prefix(player, prefix_commands, "Number expected.");
  6621. goto("wait");
  6622. }
  6623. if(speed < 1) {
  6624. speed = 1;
  6625. }
  6626. if(speed > 10) {
  6627. speed = 10;
  6628. }
  6629. if(size < 2) {
  6630. p = player;
  6631. }
  6632. if(size == 2) {
  6633. if(!perm.has("speed.other", player)) {
  6634. perm.no("speed.other", player);
  6635. goto("wait");
  6636. }
  6637. p_name = list.getIndex(args, 1);
  6638. p = read.player(p_name);
  6639. if(p == null) {
  6640. msg.prefix(player, prefix_commands, "This player is not online.");
  6641. goto("wait");
  6642. }
  6643. }
  6644. player.setSpeed(p, speed);
  6645. msg.prefix(p, prefix_commands, string.concat("Set your speed to ", string.number(speed), "."));
  6646. if(p != player) {
  6647. msg.prefix(player, prefix_commands, string.concat(player.getName(p), " set your speed to ", string.number(speed), "."));
  6648. }
  6649. goto("wait");
  6650. @butcher
  6651. loc = entity.getLocation(player);
  6652. world = loc.getWorld(loc);
  6653. list = world.getEntities(world);
  6654. size = list.getSize(list);
  6655. killed = 0;
  6656. for(i = 0; i < size; i++) {
  6657. element = list.getIndex(list, i);
  6658. if(isLiving(element)) {
  6659. entity_type = entity.getType(element);
  6660. if(set.contains(butcher_set, entity_type)) {
  6661. entity.remove(element);
  6662. killed++;
  6663. }
  6664. }
  6665. }
  6666. msg.prefix(player, prefix_commands, string.concat(string.number(killed), " mobs killed."));
  6667. goto("wait");
  6668. @enchant
  6669. if(size != 2) {
  6670. msg.prefix(player, prefix_commands, "/enchant <enchantment> <level>");
  6671. goto("wait");
  6672. }
  6673. ench_string = list.getIndex(args, 0);
  6674. ench = enchantment.get(ench_string);
  6675. if(ench == null) {
  6676. msg.prefix(player, prefix_commands, "Unknown enchantment");
  6677. goto("wait");
  6678. }
  6679. lvl = list.getIndex(args, 1);
  6680. if(!isDouble(lvl) || lvl < 1 || lvl > 100) {
  6681. msg.prefix(sender, prefix_commands, "Number greater than 0 and less than 101 expected.");
  6682. goto("wait");
  6683. }
  6684. item = living.getHand(player);
  6685. if(item.isAir(item)) {
  6686. msg.prefix(sender, prefix_commands, "You need to hold an item in your hand.");
  6687. goto("wait");
  6688. }
  6689. enchantment.add(ench, item, lvl);
  6690. goto("wait");
  6691. @enderchest
  6692. if(size < 1 || size > 2) {
  6693. msg.prefix(player, prefix_commands, "/enderchest [player] <from-player>");
  6694. goto("wait");
  6695. }
  6696. if(size == 1) {
  6697. from_name = list.getIndex(args, 0);
  6698. p = player;
  6699. }
  6700. elseif(size == 2) {
  6701. p_name = list.getIndex(args, 0);
  6702. from_name = list.getIndex(args, 1);
  6703. p = read.player(p_name);
  6704. if(p == null) {
  6705. msg.prefix(player, prefix_commands, "This player is not online.");
  6706. goto("wait");
  6707. }
  6708. }
  6709. from_player = read.player(from_name);
  6710. if(from_player == null) {
  6711. msg.prefix(player, prefix_commands, "This player is not online.");
  6712. goto("wait");
  6713. }
  6714. ender_inv = player.getEnderInv(from_player);
  6715. inv.open(ender_inv, p);
  6716. goto("wait");
  6717. @gamemode
  6718. if(size < 1 || size > 2) {
  6719. msg.prefix(player, prefix_commands, "/gamemode <mode> [player]");
  6720. goto("wait");
  6721. }
  6722. if(size == 1) {
  6723. p = player;
  6724. } elseif(size == 2) {
  6725. if(!perm.has("gamemode.other", player)) {
  6726. perm.no("gamemode.other", player);
  6727. goto("wait");
  6728. }
  6729. p_name = list.getIndex(args, 1);
  6730. p = read.player(p_name);
  6731. if(p == null) {
  6732. msg.prefix(player, prefix_commands, "This player is not online.");
  6733. goto("wait");
  6734. }
  6735. }
  6736. mode = list.getIndex(args, 0);
  6737. if(isDouble(mode)) {
  6738. mode = string.number(mode);
  6739. } else {
  6740. mode = string.toLowerCase(mode);
  6741. }
  6742. if(mode == "s" || mode == "0" || mode == "survival") {
  6743. mode = "SURVIVAL";
  6744. } elseif(mode == "c" || mode == "1" || mode == "creative") {
  6745. mode = "CREATIVE";
  6746. } elseif(mode == "a" || mode == "2" || mode == "adventure") {
  6747. mode = "ADVENTURE";
  6748. } elseif(mode == "w" || mode == "3" || mode == "spectator") {
  6749. mode = "SPECTATOR";
  6750. } else {
  6751. msg.prefix(player, prefix_commands, "Unknown gamemode.");
  6752. goto("wait");
  6753. }
  6754. player.setGamemode(p, mode);
  6755. if(p != player) {
  6756. p_name = player.getName(p);
  6757. msg.prefix(player, prefix_commands, string.concat("Gamemode of ", p_name, " set to ", mode, "."));
  6758. }
  6759. msg.prefix(p, prefix_commands, string.concat("Set your gamemode to ", mode, "."));
  6760. goto("wait");
  6761. @home
  6762. if(size == 0) {
  6763. @homesyntax
  6764. msg.prefix(player, prefix_commands, "/home ...");
  6765. msg.string(player, "§6 - set <name> §rSets a home");
  6766. if(perm.has("home.other", player)) {
  6767. msg.string(player, "§6 - delete <name> [player] §rDeletes a home");
  6768. msg.string(player, "§6 - list [player] §rLists all homes");
  6769. msg.string(player, "§6 - <name> [player] §rTeleports to a home");
  6770. } else {
  6771. msg.string(player, "§6 - delete <name> §rDeletes a home");
  6772. msg.string(player, "§6 - list §rLists your homes");
  6773. msg.string(player, "§6 - <name> §rTeleports to your home");
  6774. }
  6775. goto("wait");
  6776. }
  6777. arg0 = string.toLowerCase(list.getIndex(args, 0));
  6778. if(arg0 == "del" || arg0 == "delete") {
  6779. if(size < 2) {
  6780. goto("homesyntax");
  6781. }
  6782. if(size == 2) {
  6783. player_id = player.getId(player);
  6784. } else {
  6785. if(!perm.has("home.other", player)) {
  6786. perm.no("home.other", player);
  6787. goto("wait");
  6788. }
  6789. p_name = string.toLowerCase(list.getIndex(args, 2));
  6790. p_uuid = player.getUuid(p_name);
  6791. if(p_uuid == null) {
  6792. msg.prefix(player, prefix_commands, "This player has never been online.");
  6793. goto("wait");
  6794. }
  6795. player_id = player.getId(p_uuid);
  6796. }
  6797. name = string.toLowerCase(list.getIndex(args, 1));
  6798. if(!home.exists(player_id, name)) {
  6799. msg.prefix(player, prefix_commands, string.concat("Home ", name, " doesn´t exist."));
  6800. goto("wait");
  6801. }
  6802. home.delete(player_id, name);
  6803. msg.prefix(player, prefix_commands, string.concat("Home ", name, " deleted."));
  6804. goto("wait");
  6805. }
  6806. if(arg0 == "list") {
  6807. if(size < 2) {
  6808. p_uuid = player.getUuid(player);
  6809. }
  6810. if(size == 2) {
  6811. if(!perm.has("home.other", player)) {
  6812. perm.no("home.other", player);
  6813. goto("wait");
  6814. }
  6815. p_name = string.toLowerCase(list.getIndex(args, 1));
  6816. p_uuid = player.getUuid(p_name);
  6817. if(p_uuid == null) {
  6818. msg.prefix(player, prefix_commands, "This player has never been online.");
  6819. goto("wait");
  6820. }
  6821. }
  6822. id = player.getId(p_uuid);
  6823. homes_list = home.getList(id);
  6824. home_amount = list.getSize(homes_list);
  6825. if(home_amount == 0) {
  6826. msg.prefix(player, prefix_commands, "No homes existing.");
  6827. } else {
  6828. msg.prefix(player, prefix_commands, string.concat("Homes of ", player.getName(p_uuid), ":"));
  6829. for(i = 0; i < home_amount; i++) {
  6830. msg.string(player, string.concat("§6 - §r", list.getIndex(homes_list, i)));
  6831. }
  6832. }
  6833. goto("wait");
  6834. }
  6835. location = entity.getLocation(player);
  6836. world_name = world.getName(loc.getWorld(location));
  6837. if(!world.isSurvName(world_name)) {
  6838. msg.prefix(player, prefix_commands, "You can´t use this command in this world.");
  6839. goto("wait");
  6840. }
  6841. if(arg0 == "set") {
  6842. if(size < 2) {
  6843. goto("homesyntax");
  6844. }
  6845. player_id = player.getId(player);
  6846. homes_list = home.getList(player_id);
  6847. home_amount = list.getSize(homes_list);
  6848. if(perm.has("isAdmin", player)) {
  6849. max_homes = 100;
  6850. } elseif(perm.has("isMod", player)) {
  6851. max_homes = 40;
  6852. } elseif(perm.has("isTeam", player)) {
  6853. max_homes = 20;
  6854. } elseif(perm.has("canTP", player)) {
  6855. max_homes = 10;
  6856. } else {
  6857. max_homes = 5;
  6858. }
  6859. max_homes += getAdditionalVoteHomes();
  6860. if(home_amount >= max_homes) {
  6861. msg.prefix(player, prefix_commands, string.concat("You can only set ", string.number(max_homes), " homes."));
  6862. goto("wait");
  6863. }
  6864. name = string.toLowerCase(list.getIndex(args, 1));
  6865. if(name == "set" || name == "del" || name == "delete" || name == "list") {
  6866. msg.prefix(player, prefix_commands, "This name ist not allowed.");
  6867. goto("wait");
  6868. }
  6869. if(!string.onlyletters(name)) {
  6870. msg.prefix(player, prefix_commands, "Only letters allowed.");
  6871. goto("wait");
  6872. }
  6873. if(string.length(name) > 20) {
  6874. msg.prefix(player, prefix_commands, "Maximum 20 letters.");
  6875. goto("wait");
  6876. }
  6877. if(home.exists(player_id, name)) {
  6878. msg.prefix(player, prefix_commands, string.concat("Home ", name, " already exists."));
  6879. goto("wait");
  6880. }
  6881. home.set(player_id, name, location);
  6882. msg.prefix(player, prefix_commands, string.concat("Home ", name, " set."));
  6883. goto("wait");
  6884. }
  6885. //Teleportation
  6886. if(size < 2) {
  6887. p_name = player.getName(player);
  6888. }
  6889. if(size == 2) {
  6890. p_name = string.toLowerCase(list.getIndex(args, 1));
  6891. }
  6892. p_uuid = player.getUuid(p_name);
  6893. if(p_uuid == null) {
  6894. msg.prefix(player, prefix_commands, "Der Spieler war noch nie online.");
  6895. goto("wait");
  6896. }
  6897. player_id = player.getId(p_uuid);
  6898. location = home.getLocation(player_id, arg0);
  6899. if(location == null) {
  6900. msg.prefix(player, prefix_commands, "Home doesn´t exist."); //oder die welt ist nicht geladen
  6901. goto("wait");
  6902. }
  6903. player.teleport(player, location, true);
  6904. goto("wait");
  6905. @icon
  6906. msg.string(player, string.getSpacer());
  6907. msg.string(player, "Icons - Click to Copy");
  6908. msg(player, text.merge(
  6909. string.getClipBoardText(icon.getGoldCoin(), icon.getGoldCoin()), text.new(" "),
  6910. string.getClipBoardText(icon.getSilverCoin(), icon.getSilverCoin()), text.new(" "),
  6911. string.getClipBoardText(icon.getCopperCoin(), icon.getCopperCoin()), text.new(" "),
  6912. string.getClipBoardText(icon.getExp(), icon.getExp()), text.new(" "),
  6913. string.getClipBoardText(icon.getBookshelf(), icon.getBookshelf()), text.new(" "),
  6914. string.getClipBoardText(icon.getCraftingTable(), icon.getCraftingTable())
  6915. ));
  6916. msg(player, text.merge(
  6917. string.getClipBoardText(icon.getCompass(), icon.getCompass()), text.new(" "),
  6918. string.getClipBoardText(icon.getCake(), icon.getCake()), text.new(" "),
  6919. string.getClipBoardText(icon.getEnderpearl(), icon.getEnderpearl()), text.new(" "),
  6920. string.getClipBoardText(icon.getHeart(), icon.getHeart()), text.new(" "),
  6921. string.getClipBoardText(icon.getHalfHeart(), icon.getHalfHeart()), text.new(" "),
  6922. string.getClipBoardText(icon.getEmptyHeart(), icon.getEmptyHeart())
  6923. ));
  6924. goto("wait");
  6925. @tpa
  6926. if(size != 1) {
  6927. msg.prefix(player, prefix_commands, "/tpa <player>");
  6928. goto("wait");
  6929. }
  6930. p_name = list.getIndex(args, 0);
  6931. p_uuid = player.getUuid(p_name);
  6932. if(p_uuid == null) {
  6933. msg.prefix(player, prefix_commands, "This player has never been online.");
  6934. goto("wait");
  6935. }
  6936. p_name = player.getName(p_uuid);
  6937. p = read.player(p_name);
  6938. if(p == null) {
  6939. msg.prefix(player, prefix_commands, "This player is not online.");
  6940. goto("wait");
  6941. }
  6942. if(!player.doesAcceptTpaRequests(p)) {
  6943. msg.prefix(player, prefix_commands, string.concat("§c", p_name, "§r rejects teleport requests."));
  6944. goto("wait");
  6945. }
  6946. if(!player.canTeleport(p)) {
  6947. msg.prefix(player, prefix_commands, "This player can´t teleport now.");
  6948. goto("wait");
  6949. }
  6950. world_name = world.getName(loc.getWorld(entity.getLocation(player)));
  6951. if(world.isGamesName(world_name)) {
  6952. msg.prefix(player, prefix_commands, "You can´t teleport in this world.");
  6953. goto("wait");
  6954. }
  6955. world_name = world.getName(loc.getWorld(entity.getLocation(p)));
  6956. if(world.isGamesName(world_name)) {
  6957. msg.prefix(player, prefix_commands, "You can´t teleport to this world.");
  6958. goto("wait");
  6959. }
  6960. addTpaRequest(player.getUuid(player), p_uuid);
  6961. player_name = player.getName(player);
  6962. msg.string(player, string.concat("§6Teleport-Request: [§c", player_name, "§6 -> §c ", p_name, "§6]"));
  6963. 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))));
  6964. goto("wait");
  6965. @tpahere
  6966. if(size != 1) {
  6967. msg.prefix(player, prefix_commands, "/tpahere <player>");
  6968. goto("wait");
  6969. }
  6970. p_name = list.getIndex(args, 0);
  6971. p_uuid = player.getUuid(p_name);
  6972. if(p_uuid == null) {
  6973. msg.prefix(player, prefix_commands, "This player has never been online.");
  6974. goto("wait");
  6975. }
  6976. p_name = player.getName(p_uuid);
  6977. p = read.player(p_name);
  6978. if(p == null) {
  6979. msg.prefix(player, prefix_commands, "This player is not online.");
  6980. goto("wait");
  6981. }
  6982. if(!player.canTeleport(p)) {
  6983. msg.prefix(player, prefix_commands, "This player can´t teleport now.");
  6984. goto("wait");
  6985. }
  6986. if(!player.doesAcceptTpaRequests(p)) {
  6987. msg.prefix(player, prefix_commands, string.concat("§c", p_name, "§r rejects teleport requests."));
  6988. goto("wait");
  6989. }
  6990. world_name = world.getName(loc.getWorld(entity.getLocation(player)));
  6991. if(world.isGamesName(world_name)) {
  6992. msg.prefix(player, prefix_commands, string.concat("§c", p_name, "§r isn´t allowed to teleport to this world."));
  6993. goto("wait");
  6994. }
  6995. world_name = world.getName(loc.getWorld(entity.getLocation(p)));
  6996. if(world.isGamesName(world_name)) {
  6997. msg.prefix(player, prefix_commands, string.concat("§c", p_name, "§r isn´t allowed to teleport from their world."));
  6998. goto("wait");
  6999. }
  7000. addTpaRequest(p_uuid, player.getUuid(player));
  7001. player_name = player.getName(player);
  7002. msg.string(player, string.concat("§6Teleport-Request: [§c", p_name, "§6 -> §c ", player_name, "§6]"));
  7003. 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))));
  7004. goto("wait");
  7005. @tpaccept
  7006. if(size != 1) {
  7007. msg.prefix(player, prefix_commands, "/tpaccept <player>");
  7008. goto("wait");
  7009. }
  7010. p_name = list.getIndex(args, 0);
  7011. p_uuid = player.getUuid(p_name);
  7012. if(p_uuid == null) {
  7013. msg.prefix(player, prefix_commands, "This player has never been online.");
  7014. goto("wait");
  7015. }
  7016. p_name = player.getName(p_uuid);
  7017. p = read.player(p_name);
  7018. if(p == null) {
  7019. msg.prefix(player, prefix_commands, "This player is not online.");
  7020. goto("wait");
  7021. }
  7022. if(!player.canTeleport(player)) {
  7023. msg.prefix(player, prefix_commands, "This player can´t teleport to you now.");
  7024. goto("wait");
  7025. }
  7026. if(!player.canTeleport(p)) {
  7027. msg.prefix(player, prefix_commands, "This player can´t teleport to you now.");
  7028. //Kein return. Spieler A bekommt cancel adventure und Spieler B wird informiert.
  7029. }
  7030. world_name = world.getName(loc.getWorld(entity.getLocation(player)));
  7031. if(world.isGamesName(world_name)) {
  7032. msg.prefix(player, prefix_commands, string.concat("§c", p_name, "§r isn´t allowed to teleport to your world."));
  7033. goto("wait");
  7034. }
  7035. world_name = world.getName(loc.getWorld(entity.getLocation(p)));
  7036. if(world.isGamesName(world_name)) {
  7037. msg.prefix(player, prefix_commands, string.concat("§c", p_name, "§r isn´t allowed to teleport from their world."));
  7038. goto("wait");
  7039. }
  7040. player_uuid = player.getUuid(player);
  7041. if(!hasTpaRequest(p_uuid, player_uuid)) {
  7042. msg.prefix(player, prefix_commands, "No outstanding teleport-request.");
  7043. goto("wait");
  7044. }
  7045. location = entity.getLocation(player);
  7046. player.teleport(p, location, true);
  7047. goto("wait");
  7048. @tpaccepthere
  7049. if(size != 1) {
  7050. msg.prefix(player, prefix_commands, "/tpaccepthere <player>");
  7051. goto("wait");
  7052. }
  7053. p_name = list.getIndex(args, 0);
  7054. p_uuid = player.getUuid(p_name);
  7055. if(p_uuid == null) {
  7056. msg.prefix(player, prefix_commands, "This player has never been online.");
  7057. goto("wait");
  7058. }
  7059. p_name = player.getName(p_uuid);
  7060. p = read.player(p_name);
  7061. if(p == null) {
  7062. msg.prefix(player, prefix_commands, "This player is not online.");
  7063. goto("wait");
  7064. }
  7065. if(!player.canTeleport(player)) {
  7066. msg.prefix(p, prefix_commands, "This player can´t teleport to you now.");
  7067. //Kein return. Spieler A bekommt cancel adventure und Spieler B wird informiert.
  7068. }
  7069. if(!player.canTeleport(p)) {
  7070. msg.prefix(player, prefix_commands, "You must not teleport to this player now.");
  7071. goto("wait");
  7072. }
  7073. world_name = world.getName(loc.getWorld(entity.getLocation(player)));
  7074. if(world.isGamesName(world_name)) {
  7075. msg.prefix(player, prefix_commands, "You can´t teleport in this world.");
  7076. goto("wait");
  7077. }
  7078. world_name = world.getName(loc.getWorld(entity.getLocation(p)));
  7079. if(world.isGamesName(world_name)) {
  7080. msg.prefix(player, prefix_commands, "You can´t teleport to this world.");
  7081. goto("wait");
  7082. }
  7083. player_uuid = player.getUuid(player);
  7084. if(!hasTpaRequest(player_uuid, p_uuid)) {
  7085. msg.prefix(player, prefix_commands, "No outstanding teleport-request.");
  7086. goto("wait");
  7087. }
  7088. location = entity.getLocation(p);
  7089. player.teleport(player, location, true);
  7090. goto("wait");
  7091. @tp
  7092. if(size < 1 || size > 2) {
  7093. if(perm.has("tp.other", player)) {
  7094. msg.prefix(player, prefix_commands, "/tp [player] <to-player>");
  7095. } else {
  7096. msg.prefix(player, prefix_commands, "/tp <player>");
  7097. }
  7098. goto("wait");
  7099. }
  7100. if(size == 1) {
  7101. to_name = list.getIndex(args, 0);
  7102. p = player;
  7103. }
  7104. elseif(size == 2) {
  7105. if(!perm.has("tp.other", player)) {
  7106. perm.no("tp.other", player);
  7107. goto("wait");
  7108. }
  7109. p_name = list.getIndex(args, 0);
  7110. p = read.player(p_name);
  7111. //Damit der ganze Spielername und nicht nur der eingegebene angezeigt wird
  7112. to_name = list.getIndex(args, 1);
  7113. if(p == null) {
  7114. msg.prefix(player, prefix_commands, "This player is not online.");
  7115. goto("wait");
  7116. }
  7117. }
  7118. if(player.hasMinigame(p)) {
  7119. if(size == 2) {
  7120. msg.prefix(player, prefix_commands, "This player can´t be teleported now.");
  7121. goto("wait");
  7122. }
  7123. msg.prefix(player, prefix_commands, "You can´t teleport now.");
  7124. goto("wait");
  7125. }
  7126. to_player = read.player(to_name);
  7127. if(to_player == null) {
  7128. msg.prefix(player, prefix_commands, "This player is not online.");
  7129. goto("wait");
  7130. }
  7131. //Damit der ganze Spielername und nicht nur der eingegebene angezeigt wird
  7132. to_name = player.getName(to_player);
  7133. location = entity.getLocation(to_player);
  7134. if(player.teleport(p, location, true)) {
  7135. if(player != p) {
  7136. msg.prefix(player, prefix_commands, string.concat("Teleported ", player.getName(p), " to ", to_name, "."));
  7137. }
  7138. msg.prefix(p, prefix_commands, string.concat("Teleported you to ", to_name, "."));
  7139. }
  7140. goto("wait");
  7141. @say
  7142. if(size == 0) {
  7143. msg.prefix(sender, prefix_commands, "/say <text>");
  7144. goto("wait");
  7145. }
  7146. msg.online("§cServer", string.concatList(args, " ", 0, size - 1));
  7147. goto("wait");
  7148. @warp
  7149. if(size == 0) {
  7150. @warpsyntax
  7151. msg.prefix(player, prefix_commands, "/warp ...");
  7152. if(perm.has("warp.create", player)) {
  7153. msg.string(player, "§6 - set <warp> §rSets a warp");
  7154. msg.string(player, "§6 - delete <warp> §rDeletes a warp");
  7155. }
  7156. msg.string(player, "§6 - <warp> §rTeleports to a warp");
  7157. msg.string(player, "§6 - list §rLists all warps");
  7158. goto("wait");
  7159. }
  7160. arg0 = string.toLowerCase(list.getIndex(args, 0));
  7161. if(arg0 == "delete") {
  7162. if(!perm.has("warp.create", player)) {
  7163. perm.no("warp.create", player);
  7164. goto("wait");
  7165. }
  7166. if(size != 2) {
  7167. goto("warpsyntax");
  7168. }
  7169. warp_name = string.toLowerCase(list.getIndex(args, 1));
  7170. if(warp.delete(warp_name)) {
  7171. msg.prefix(player, prefix_commands, string.concat("Warp ", warp_name, " deleted."));
  7172. } else {
  7173. msg.prefix(player, prefix_commands, "Warpname doesn´t exist.");
  7174. }
  7175. goto("wait");
  7176. }
  7177. if(arg0 == "list") {
  7178. warps_list = warp.getList();
  7179. if(list.getSize(warps_list) == 0) {
  7180. msg.prefix(player, prefix_commands, "No warps existing.");
  7181. goto("wait");
  7182. }
  7183. msg.prefix(player, prefix_commands, string.concat("§6Warps:"));
  7184. for(i = 0; i < list.getSize(warps_list); i++) {
  7185. msg.string(player, string.concat("§6 - §r", list.getIndex(warps_list, i)));
  7186. }
  7187. goto("wait");
  7188. }
  7189. if(arg0 == "set") {
  7190. if(!perm.has("warp.create", player)) {
  7191. perm.no("warp.create", player);
  7192. goto("wait");
  7193. }
  7194. if(size != 2) {
  7195. goto("warpsyntax");
  7196. }
  7197. warp_name = string.toLowerCase(list.getIndex(args, 1));
  7198. if(warp.exists(warp_name)) {
  7199. msg.prefix(player, prefix_commands, "Warpname already exists.");
  7200. goto("wait");
  7201. }
  7202. warp.create(warp_name, entity.getLocation(player));
  7203. msg.prefix(player, prefix_commands, string.concat("Warp ", warp_name, " set."));
  7204. goto("wait");
  7205. }
  7206. //Teleportation
  7207. warp_name = string.toLowerCase(arg0);
  7208. warp_loc = warp.get(warp_name);
  7209. if(warp_loc == null) {
  7210. msg.prefix(player, prefix_commands, "Warpname doesn´t exist.");
  7211. goto("wait");
  7212. }
  7213. if(!perm.has("warp.create", player)) {
  7214. world_name = world.getName(loc.getWorld(entity.getLocation(player)));
  7215. if(world.isGamesName(world_name)) {
  7216. msg.prefix(player, prefix_commands, "You can´t teleport in this world.");
  7217. goto("wait");
  7218. }
  7219. world_name = world.getName(loc.getWorld(warp_loc));
  7220. if(world.isGamesName(world_name)) {
  7221. msg.prefix(player, prefix_commands, "You can´t teleport to this world.");
  7222. goto("wait");
  7223. }
  7224. }
  7225. if(player.teleport(player, warp_loc, true)) {
  7226. msg.prefix(player, prefix_commands, string.concat("You have been teleported to warp §7", warp_name, "."));
  7227. }
  7228. goto("wait");
  7229. @databank
  7230. if(size == 0) {
  7231. @databankhelp
  7232. msg.prefix(player, prefix_commands, "/databank...");
  7233. msg.string(player, "§6 - showtables §rShows all tables");
  7234. msg.string(player, "§6 - showfields §rShows fields from a table");
  7235. msg.string(player, "§6 - showdatatypes §rShows dataypes from a table");
  7236. goto("wait");
  7237. }
  7238. arg0 = string.toLowerCase(list.getIndex(args, 0));
  7239. if(arg0 == "showtables") {
  7240. msg.string(player, string.getSpacer());
  7241. stmt = databank.prepare("SHOW TABLES");
  7242. result = databank.execute(stmt);
  7243. while(databank.next(result)) {
  7244. msg.string(player, databank.getString(result, 1));
  7245. }
  7246. databank.close(result);
  7247. databank.close(stmt);
  7248. goto("wait");
  7249. }
  7250. if(arg0 == "showfields") {
  7251. if(size < 2) {
  7252. msg.prefix(player, prefix_commands, "/databank showfields <table>");
  7253. goto("wait");
  7254. }
  7255. table = list.getIndex(args, 1);
  7256. if(!databank.isExistingTable(table)) {
  7257. msg.prefix(player, prefix_commands, "This in no existing table.");
  7258. goto("wait");
  7259. }
  7260. msg.string(player, string.getSpacer());
  7261. fields = databank.getTableFields(table);
  7262. iter = iterator(fields);
  7263. while(hasNext(iter)) {
  7264. msg.string(player, next(iter));
  7265. }
  7266. goto("wait");
  7267. }
  7268. if(arg0 == "showdatatypes") {
  7269. if(size < 2) {
  7270. msg.prefix(player, prefix_commands, "/databank showdatatypes <table>");
  7271. goto("wait");
  7272. }
  7273. table = list.getIndex(args, 1);
  7274. if(!databank.isExistingTable(table)) {
  7275. msg.prefix(player, prefix_commands, "This in no existing table.");
  7276. goto("wait");
  7277. }
  7278. msg.string(player, string.getSpacer());
  7279. msg.string(player, databank.getTableDatatypes(table));
  7280. goto("wait");
  7281. }
  7282. goto("databankhelp");
  7283. @seen
  7284. if(size != 1) {
  7285. msg.prefix(player, prefix_commands, "/seen <player>");
  7286. goto("wait");
  7287. }
  7288. seen_name = list.getIndex(args, 0);
  7289. seen_uuid = player.getUuid(seen_name);
  7290. if(seen_uuid == null) {
  7291. msg.prefix(player, prefix_commands, "This player has never been online.");
  7292. goto("wait");
  7293. }
  7294. if(read.player(seen_name) != null) {
  7295. msg.prefix(player, prefix_commands, "This player is online.");
  7296. goto("wait");
  7297. }
  7298. seenStatement = databank.prepare("SELECT MAX(leave_time) FROM playtime WHERE player_id = ?;");
  7299. databank.setInt(seenStatement, 1, player.getId(seen_uuid));
  7300. result = databank.execute(seenStatement);
  7301. if(databank.next(result)) {
  7302. time = databank.getLong(result, 1);
  7303. msg.prefix(player, prefix_commands, string.concat(seen_name, " was seen at §e", time.getString(time), "."));
  7304. } else {
  7305. msg.prefix(player, prefix_commands, "Keine Daten vorhanden.");
  7306. }
  7307. databank.close(result);
  7308. databank.close(seenStatement);
  7309. goto("wait");
  7310. @lastseen
  7311. if(size != 1) {
  7312. msg.prefix(sender, prefix_commands, "/lastseen <amount>");
  7313. goto("wait");
  7314. }
  7315. amount = list.getIndex(args, 0);
  7316. if(!isDouble(amount)) {
  7317. msg.prefix(sender, prefix_commands, "Number expected.");
  7318. goto("wait");
  7319. }
  7320. if(amount < 1) {
  7321. msg.prefix(sender, prefix_commands, "Positive number expected.");
  7322. goto("wait");
  7323. }
  7324. modTimer(-5);
  7325. msg.prefix(sender, prefix_commands, "These players were last seen:");
  7326. table = table.new("§f", 12, 12);
  7327. msg.string(sender, table.getStart(table));
  7328. msg.string(sender, table.get(table, "Player", "Date"));
  7329. msg.string(sender, table.getMiddle(table));
  7330. lastseenStatement = databank.prepare("SELECT player_id, MAX(leave_time) AS max_time FROM playtime GROUP BY player_id ORDER BY max_time DESC LIMIT ?;");
  7331. databank.setInt(lastseenStatement, 1, amount);
  7332. result = databank.execute(lastseenStatement);
  7333. while(databank.next(result)) {
  7334. id = databank.getInt(result, 1);
  7335. time = databank.getLong(result, 2);
  7336. msg.string(sender, table.get(table, string.concat("§a", player.getNameFromId(id)), string.concat("§e", time.getString(time))));
  7337. }
  7338. msg.string(sender, table.getEnd(table));
  7339. databank.close(result);
  7340. databank.close(lastseenStatement);
  7341. goto("wait");
  7342. @feed
  7343. if(size > 1) {
  7344. msg.prefix(player, prefix_commands, "/feed [player]");
  7345. goto("wait");
  7346. }
  7347. if(size == 0) {
  7348. p = player;
  7349. }
  7350. if(size == 1) {
  7351. p_name = list.getIndex(args, 0);
  7352. p = read.player(p_name);
  7353. if(p == null) {
  7354. msg.prefix(player, prefix_commands, "This player is not online.");
  7355. goto("wait");
  7356. }
  7357. if(player != p) {
  7358. msg.prefix(player, prefix_commands, string.concat(player.getName(p), " has been feed."));
  7359. }
  7360. }
  7361. player.setHunger(p, 20);
  7362. player.setSaturation(p, 5);
  7363. msg.prefix(p, prefix_commands, "You have been feed.");
  7364. goto("wait");
  7365. @tempfly
  7366. if(size < 2) {
  7367. msg.prefix(sender, prefix_commands, "/tempfly <player> <sec>");
  7368. goto("wait");
  7369. }
  7370. p_name = list.getIndex(args, 0);
  7371. if(!checkIfEverOnline(p_name)) {
  7372. msg.prefix(sender, prefix_commands, "This player has never been online.");
  7373. goto("wait");
  7374. }
  7375. p = read.player(p_name);
  7376. if(p == null) {
  7377. msg.prefix(sender, prefix_commands, "This player is not online.");
  7378. goto("wait");
  7379. }
  7380. p_name = player.getName(player.getUuid(p_name));
  7381. if(player.hasMinigame(p)) {
  7382. msg.prefix(player, prefix_commands, "This player can´t fly now.");
  7383. goto("wait");
  7384. }
  7385. sec = list.getIndex(args, 1);
  7386. if(!isDouble(sec) || sec < 0) {
  7387. msg.prefix(sender, prefix_commands, "Positive number expected.");
  7388. goto("wait");
  7389. }
  7390. msg.prefix(sender, prefix_commands, string.concat(p_name, " can now fly for ", string.number(sec), " seconds."));
  7391. msg.prefix(p, prefix_commands, string.concat("You can now fly for ", string.number(sec), " seconds."));
  7392. player.setFly(p, true);
  7393. duration = sec * 20;
  7394. data.setTimer(p, "fly", duration);
  7395. //status.addTimed(player, 55, duration, "Fly");
  7396. goto("wait");
  7397. @fly
  7398. if(size > 2) {
  7399. msg.prefix(player, prefix_commands, "/fly [player] [on/off]");
  7400. goto("wait");
  7401. }
  7402. if(size >= 1) {
  7403. if(!perm.has("fly.other", player)) {
  7404. perm.no("fly.other", player);
  7405. goto("wait");
  7406. }
  7407. p_name = list.getIndex(args, 0);
  7408. p = read.player(p_name);
  7409. if(p == null) {
  7410. msg.prefix(player, prefix_commands, "This player is not online.");
  7411. goto("wait");
  7412. }
  7413. } else {
  7414. p = player;
  7415. }
  7416. world_name = world.getName(loc.getWorld(entity.getLocation(player)));
  7417. if(world.isGamesName(world_name)) {
  7418. if(player.hasMinigame(p) || (perm.has("fly", p) && !perm.has("isTeam", p))) {
  7419. if(size == 2) {
  7420. msg.prefix(player, prefix_commands, "This player can´t fly now.");
  7421. } else {
  7422. msg.prefix(player, prefix_commands, "You can´t fly now.");
  7423. }
  7424. goto("wait");
  7425. }
  7426. }
  7427. if(size < 2) {
  7428. new_state = player.toggleFly(p);
  7429. } else {
  7430. new_state = false;
  7431. if(list.getIndex(args, 1) == "on") {
  7432. new_state = true;
  7433. }
  7434. player.setFly(p, new_state);
  7435. }
  7436. if(new_state) {
  7437. msg.prefix(p, prefix_commands, "You can fly now.");
  7438. if(player != p) {
  7439. p_name = player.getName(p);
  7440. msg.prefix(player, prefix_commands, string.concat(p_name, " can fly now."));
  7441. }
  7442. } else {
  7443. msg.prefix(p, prefix_commands, "You can´t fly anymore.");
  7444. if(player != p) {
  7445. p_name = player.getName(p);
  7446. msg.prefix(player, prefix_commands, string.concat(p_name, " can´t fly anymore."));
  7447. }
  7448. }
  7449. goto("wait");
  7450. @tppos
  7451. if(size < 3 || size > 5) {
  7452. msg.prefix(player, prefix_commands, "/tppos <x> <y> <z> [world] [player]");
  7453. goto("wait");
  7454. }
  7455. x = list.getIndex(args, 0);
  7456. y = list.getIndex(args, 1);
  7457. z = list.getIndex(args, 2);
  7458. if(!isDouble(x) || !isDouble(y) || !isDouble(z)) {
  7459. msg.prefix(player, prefix_commands, "x/y/z müssen Zahlen sein.");
  7460. goto("wait");
  7461. }
  7462. if(size >= 4) {
  7463. worldname = list.getIndex(args, 3);
  7464. world = world.get(worldname);
  7465. if(world == null) {
  7466. msg.prefix(player, prefix_commands, "This world is not loaded.");
  7467. goto("wait");
  7468. }
  7469. } else {
  7470. world = loc.getWorld(entity.getLocation(player));
  7471. }
  7472. if(x < -32000) {
  7473. x = -32000;
  7474. } elseif(x > 32000) {
  7475. x = 32000;
  7476. }
  7477. if(y < -64) {
  7478. y = -64;
  7479. } elseif(y > 319) {
  7480. y = 319;
  7481. }
  7482. if(z < -32000) {
  7483. z = -32000;
  7484. } elseif(z > 32000) {
  7485. z = 32000;
  7486. }
  7487. location = loc.new(world, x, y, z);
  7488. if(size == 5) {
  7489. p_name = list.getIndex(args, 4);
  7490. p = read.player(p_name);
  7491. if(p == null) {
  7492. msg.prefix(player, prefix_commands, "This player is not online.");
  7493. goto("wait");
  7494. }
  7495. } else {
  7496. p = player;
  7497. }
  7498. if(player.hasMinigame(p)) {
  7499. if(size == 5) {
  7500. msg.prefix(player, prefix_commands, "This player can´t be teleported now.");
  7501. goto("wait");
  7502. }
  7503. msg.prefix(player, prefix_commands, "You can´t teleport now.");
  7504. goto("wait");
  7505. }
  7506. if(player.teleport(p, location, true)) {
  7507. if(player != p) {
  7508. msg.prefix(player, prefix_commands, string.concat(player.getName(p), " was teleported."));
  7509. }
  7510. }
  7511. goto("wait");
  7512. @back
  7513. if(size > 0) {
  7514. msg.prefix(player, prefix_commands, "/back");
  7515. goto("wait");
  7516. }
  7517. if(!player.canTeleport(player)) {
  7518. msg.prefix(player, prefix_commands, "You can´t teleport now.");
  7519. goto("wait");
  7520. }
  7521. hasPerms = perm.has("isTeam", player);
  7522. if(!hasPerms) {
  7523. world_name = world.getName(loc.getWorld(entity.getLocation(player)));
  7524. if(world.isGamesName(world_name)) {
  7525. msg.prefix(player, prefix_commands, "You can´t use /back in this world.");
  7526. goto("wait");
  7527. }
  7528. }
  7529. location = player.getBackPos(player);
  7530. if(location == null) {
  7531. msg.prefix(player, prefix_commands, "No back-location available.");
  7532. goto("wait");
  7533. }
  7534. world = loc.getWorld(location);
  7535. if(world == null) {
  7536. msg.prefix(player, prefix_commands, "This world is not loaded.");
  7537. goto("wait");
  7538. }
  7539. if(!hasPerms) {
  7540. world_name = world.getName(world);
  7541. if(world.isGamesName(world_name)) {
  7542. msg.prefix(player, prefix_commands, "You can´t teleport to this world.");
  7543. goto("wait");
  7544. }
  7545. }
  7546. player.teleport(player, location, true);
  7547. goto("wait");
  7548. @clan
  7549. if(size == 0) {
  7550. @clanhelp
  7551. msg.prefix(player, prefix_clan, "/clan...");
  7552. msg.string(player, "§2 - info [id/name/tag] §rReturns info about a clan");
  7553. msg.string(player, "§2 - list §rLists all clans");
  7554. msg.string(player, "");
  7555. msg.string(player, "§2 - create <name> <tag> §rCreates a clan. Costs §64096 §rsnuvis.");
  7556. msg.string(player, "§2 - invite <name> §rInvites a player");
  7557. msg.string(player, "§2 - accept <id/name/tag> §rAccepts an invitation");
  7558. msg.string(player, "");
  7559. msg.string(player, "§2 - kick <name> §rKicks a player");
  7560. msg.string(player, "§2 - leader <name> §rPromote to clan-leader");
  7561. msg.string(player, "§2 - mod <name> §rPromote to clan-mod");
  7562. msg.string(player, "§2 - degrade <name> §rDemote a clan-mod");
  7563. msg.string(player, "§2 - leave §rLeave a clan");
  7564. msg.string(player, "");
  7565. msg.string(player, "§2 - rename <name> <tag> §rRenames a clan. Costs §664 §rsnuvis.");
  7566. msg.string(player, "§2 - setspawn §rSets a clan-spawn");
  7567. msg.string(player, "§2 - spawn §rTeleports to clan-spawn");
  7568. msg.string(player, "§2 - disband §rDisband a clan");
  7569. msg.string(player, "");
  7570. msg.string(player, "§2 - deposit <money> §rDeposit money to the clan account");
  7571. msg.string(player, "§2 - withdraw <money> §rWithdraw money from the clan account");
  7572. msg.string(player, "§2 - msg <message> §rSends a clan-message");
  7573. msg.string(player, "§2 - mail <message> §rSends a clan-mail");
  7574. msg.string(player, "§2 - shout <message> §rSends a message to all online players. Costs §664 §rsnuvis.");
  7575. msg.string(player, "§2 - party §rInvites all online members to a party");
  7576. goto("wait");
  7577. }
  7578. arg0 = string.toLowerCase(list.getIndex(args, 0));
  7579. if(arg0 == "invite") {
  7580. if(size != 2) {
  7581. msg.prefix(player, prefix_commands, "/clan invite <name>");
  7582. goto("wait");
  7583. }
  7584. if(!player.isInClan(player)) {
  7585. msg.prefix(player, prefix_clan, "You are not in a clan.");
  7586. goto("wait");
  7587. }
  7588. if(!player.isClanLeader(player) && !player.isClanMod(player)) {
  7589. msg.prefix(player, prefix_clan, "You have no permission for this.");
  7590. goto("wait");
  7591. }
  7592. p_name = list.getIndex(args, 1);
  7593. if(string.toLowerCase(player.getName(player)) == string.toLowerCase(p_name)) {
  7594. msg.prefix(player, prefix_clan, "You can´t invite yourself.");
  7595. goto("wait");
  7596. }
  7597. if(!checkIfEverOnline(p_name)) {
  7598. msg.prefix(sender, prefix_clan, "This player has never been online.");
  7599. goto("wait");
  7600. }
  7601. if(!isOnline(p_name)) {
  7602. msg.prefix(player, prefix_clan, "This player has to be online.");
  7603. goto("wait");
  7604. }
  7605. p = read.player(p_name);
  7606. if(player.isClanMember(player)) {
  7607. msg.prefix(player, prefix_clan, "This player is already in a clan.");
  7608. goto("wait");
  7609. }
  7610. clan_id = player.getClanId(player);
  7611. p_id = player.getId(p);
  7612. if(player.hasClanInvitation(p_id, clan_id)) {
  7613. msg.prefix(player, prefix_clan, "This player already has an invitation from your clan.");
  7614. goto("wait");
  7615. }
  7616. player.addClanInvitation(p_id, clan_id);
  7617. clan_name = clan.getName(clan_id);
  7618. msg.prefix(player, prefix_clan, string.concat("You invited §7", p_name, "§r to your clan."));
  7619. msg.prefix(p, prefix_clan, string.concat("You got an clan invitation by §7", clan_name, "§r."));
  7620. msg.string(p, string.getClickText("§r[§aAccept§r]", string.concat("/clan accept ", clan_id)));
  7621. sgoto(6000, "remove_clan_invitation"); //5 Minuten
  7622. goto("wait");
  7623. }
  7624. if(arg0 == "accept") {
  7625. if(size != 2) {
  7626. msg.prefix(player, prefix_commands, "/clan accept <id/name/tag>");
  7627. goto("wait");
  7628. }
  7629. if(player.isInClan(player)) {
  7630. msg.prefix(player, prefix_clan, "You are already in a clan.");
  7631. goto("wait");
  7632. }
  7633. arg1 = list.getIndex(args, 1);
  7634. if(isDouble(arg1)) {
  7635. clan_id = arg1;
  7636. clan_name = clan.getName(clan_id);
  7637. if(clan_name == null) {
  7638. msg.prefix(player, prefix_clan, "Unknown clan.");
  7639. goto("wait");
  7640. }
  7641. } else {
  7642. clan_id = clan.getIdFromName(arg1);
  7643. if(clan_id == null) {
  7644. clan_id = clan.getIdFromTag(arg1);
  7645. if(clan_id == null) {
  7646. msg.prefix(player, prefix_clan, "Unknown clan.");
  7647. goto("wait");
  7648. }
  7649. }
  7650. }
  7651. player_id = player.getId(player);
  7652. if(!player.hasClanInvitation(player_id, clan_id)) {
  7653. msg.prefix(player, prefix_clan, "You have no invitation from this clan.");
  7654. goto("wait");
  7655. }
  7656. clan.addMember(clan_id, player, "member");
  7657. player.setHeadName(player);
  7658. clan.msg(clan_id, string.concat("§7", player.getName(player), "§r joined the clan."));
  7659. msg.prefix(player, prefix_clan, string.concat("You joined §7", clan_name, "§r."));
  7660. clan_size = clan.getMembersAmount(clan_id);
  7661. if(clan_size >= 15) {
  7662. rank.offerClan(clan_id, "rank.lord");
  7663. } elseif(clan_size >= 10) {
  7664. rank.offerClan(clan_id, "rank.chief");
  7665. } elseif(clan_size >= 5) {
  7666. rank.offerClan(clan_id, "rank.commander");
  7667. }
  7668. goto("wait");
  7669. }
  7670. if(arg0 == "create") {
  7671. if(size != 3) {
  7672. msg.prefix(player, prefix_commands, "/clan create <name> <tag>");
  7673. goto("wait");
  7674. }
  7675. if(player.isInClan(player)) {
  7676. msg.prefix(player, prefix_clan, "You are already in a clan.");
  7677. goto("wait");
  7678. }
  7679. clan_name = list.getIndex(args, 1);
  7680. if(string.length(clan_name) > 20) {
  7681. msg.prefix(player, prefix_clan, "Maximum 20 letters allowed for name.");
  7682. goto("wait");
  7683. }
  7684. if(!string.onlyletters(clan_name)) {
  7685. msg.prefix(player, prefix_clan, "Only letters are allowed.");
  7686. goto("wait");
  7687. }
  7688. if(clan.isExistingName(clan_name)) {
  7689. msg.prefix(player, prefix_clan, "This name already exists.");
  7690. goto("wait");
  7691. }
  7692. clan_tag = list.getIndex(args, 2);
  7693. tag_length = string.length(clan_tag);
  7694. if(tag_length < 3 || tag_length > 4) {
  7695. msg.prefix(player, prefix_clan, "3 to 4 letters allowed for tag.");
  7696. goto("wait");
  7697. }
  7698. if(!string.onlyletters(clan_tag)) {
  7699. msg.prefix(player, prefix_clan, "Only letters are allowed.");
  7700. goto("wait");
  7701. }
  7702. if(clan.isExistingTag(clan_tag)) {
  7703. msg.prefix(player, prefix_clan, "This tag already exists.");
  7704. goto("wait");
  7705. }
  7706. if(!hasEnoughMoney(player, 4096)) { //1 Goldmünze
  7707. msg.prefix(player, prefix_clan, "You need 4096 snuvis (1 gold coin).");
  7708. goto("wait");
  7709. }
  7710. money.sub(player, 4096);
  7711. clan_id = clan.create(clan_name, clan_tag);
  7712. clan.addMember(clan_id, player, "leader");
  7713. player.setHeadName(player);
  7714. msg.prefix(player, prefix_clan, "Clan successful created.");
  7715. goto("wait");
  7716. }
  7717. if(arg0 == "info") {
  7718. if(size == 1) {
  7719. if(!player.isInClan(player)) {
  7720. msg.prefix(player, prefix_commands, "/clan info <id/name/tag>");
  7721. goto("wait");
  7722. }
  7723. clan_id = player.getClanId(player);
  7724. clan_name = clan.getName(clan_id);
  7725. clan_tag = clan.getTag(clan_id);
  7726. }
  7727. if(size == 2) {
  7728. arg1 = list.getIndex(args, 1);
  7729. if(isDouble(arg1)) {
  7730. clan_id = arg1;
  7731. clan_name = clan.getName(clan_id);
  7732. if(clan_name == null) {
  7733. msg.prefix(player, prefix_clan, "Unknown clan.");
  7734. goto("wait");
  7735. }
  7736. } else {
  7737. clan_id = clan.getIdFromName(arg1);
  7738. if(clan_id == null) {
  7739. clan_id = clan.getIdFromTag(arg1);
  7740. if(clan_id == null) {
  7741. msg.prefix(player, prefix_clan, "Unknown clan.");
  7742. goto("wait");
  7743. }
  7744. }
  7745. clan_name = clan.getName(clan_id);
  7746. }
  7747. clan_tag = clan.getTag(clan_id);
  7748. }
  7749. list = clan.getMembersList(clan_id);
  7750. mod_list = list.new();
  7751. members_list = list.new();
  7752. iter = iterator(list);
  7753. while(hasNext(iter)) {
  7754. player_uuid = next(iter);
  7755. player_name = player.getName(player_uuid);
  7756. player_id = player.getId(player_uuid);
  7757. if(player.isClanLeader(player_id)) {
  7758. leader = player_name;
  7759. } else {
  7760. if(player.isClanMod(player_id)) {
  7761. list.add(mod_list, player_name);
  7762. } else {
  7763. list.add(members_list, player_name);
  7764. }
  7765. }
  7766. }
  7767. if(list.getSize(mod_list) == 0) {
  7768. mods = "-";
  7769. } else {
  7770. mods = string.concatList(mod_list, ", ", 0, list.getSize(mod_list) - 1);
  7771. }
  7772. if(list.getSize(members_list) == 0) {
  7773. members = "-";
  7774. } else {
  7775. members = string.concatList(members_list, ", ", 0, list.getSize(members_list) - 1);
  7776. }
  7777. msg.string(player, string.concat("§6§lClan §r", clan_name, " (", clan_tag, " #ID:", string.number(clan_id), ")"));
  7778. msg.string(player, "§6Leader");
  7779. msg.string(player, leader);
  7780. msg.string(player, "§6Mods");
  7781. msg.string(player, mods);
  7782. msg.string(player, "§6Members");
  7783. msg.string(player, members);
  7784. msg.string(player, "§6Money");
  7785. msg.string(player, string.number(clan.getMoney(clan_id)));
  7786. goto("wait");
  7787. }
  7788. if(arg0 == "rename") {
  7789. if(!player.isInClan(player)) {
  7790. msg.prefix(player, prefix_clan, "You are not in a clan.");
  7791. goto("wait");
  7792. }
  7793. if(!player.isClanLeader(player)) {
  7794. msg.prefix(player, prefix_clan, "You are not a clan leader.");
  7795. goto("wait");
  7796. }
  7797. if(size != 3) {
  7798. msg.prefix(player, prefix_commands, "/clan rename <name> <tag>");
  7799. goto("wait");
  7800. }
  7801. clan_name = list.getIndex(args, 1);
  7802. if(string.length(clan_name) > 20) {
  7803. msg.prefix(player, prefix_clan, "Maximum 20 letters allowed for name.");
  7804. goto("wait");
  7805. }
  7806. if(!string.onlyletters(clan_name)) {
  7807. msg.prefix(player, prefix_clan, "Only letters are allowed.");
  7808. goto("wait");
  7809. }
  7810. if(clan.isExistingName(clan_name)) {
  7811. msg.prefix(player, prefix_clan, "This name already exists.");
  7812. goto("wait");
  7813. }
  7814. clan_tag = list.getIndex(args, 2);
  7815. tag_length = string.length(clan_tag);
  7816. if(tag_length < 3 || tag_length > 4) {
  7817. msg.prefix(player, prefix_clan, "3 to 4 letters allowed for tag.");
  7818. goto("wait");
  7819. }
  7820. if(!string.onlyletters(clan_tag)) {
  7821. msg.prefix(player, prefix_clan, "Only letters are allowed.");
  7822. goto("wait");
  7823. }
  7824. if(clan.isExistingTag(clan_tag)) {
  7825. msg.prefix(player, prefix_clan, "This tag already exists.");
  7826. goto("wait");
  7827. }
  7828. clan_id = player.getClanId(player);
  7829. if(clan.getMoney(clan_id) < 64) {
  7830. msg.prefix(player, prefix_clan, "Your clan needs 64 snuvis.");
  7831. goto("wait");
  7832. }
  7833. clan.subMoney(clan_id, 64);
  7834. clan.setName(clan_id, clan_name);
  7835. clan.setTag(clan_id, clan_tag);
  7836. clan.msg(clan_id, string.concat("Clan renamed to §7", clan_name, "§r."));
  7837. //New tag for online players
  7838. clan.updateHeadNames(clan_id);
  7839. goto("wait");
  7840. }
  7841. if(arg0 == "msg") {
  7842. if(!player.isInClan(player)) {
  7843. msg.prefix(player, prefix_clan, "You are not in a clan.");
  7844. goto("wait");
  7845. }
  7846. if(size < 2) {
  7847. msg.prefix(player, prefix_commands, "/clan msg <message>");
  7848. goto("wait");
  7849. }
  7850. clan_id = player.getClanId(player);
  7851. clan.msg(clan_id, string.concat(player.getName(player), ": ", string.concatList(args, " ", 1, size - 1)));
  7852. goto("wait");
  7853. }
  7854. if(arg0 == "mail") {
  7855. if(!player.isInClan(player)) {
  7856. msg.prefix(player, prefix_clan, "You are not in a clan.");
  7857. goto("wait");
  7858. }
  7859. if(size < 2) {
  7860. msg.prefix(player, prefix_commands, "/clan mail <message>");
  7861. goto("wait");
  7862. }
  7863. if(player.isClanMember(player)) {
  7864. msg.prefix(player, prefix_commands, "You have no permission for this.");
  7865. goto("wait");
  7866. }
  7867. clan_id = player.getClanId(player);
  7868. clan.mail(clan_id, player.getName(player), string.concatList(args, " ", 1, size - 1));
  7869. goto("wait");
  7870. }
  7871. if(arg0 == "shout") {
  7872. if(!player.isInClan(player)) {
  7873. msg.prefix(player, prefix_clan, "You are not in a clan.");
  7874. goto("wait");
  7875. }
  7876. if(size < 2) {
  7877. msg.prefix(player, prefix_commands, "/clan shout <message>");
  7878. goto("wait");
  7879. }
  7880. if(player.isClanMember(player)) {
  7881. msg.prefix(player, prefix_commands, "You have no permission for this.");
  7882. goto("wait");
  7883. }
  7884. clan_id = player.getClanId(player);
  7885. if(clan.getMoney(clan_id) < 64) {
  7886. msg.prefix(player, prefix_clan, "Your clan needs 64 snuvis.");
  7887. goto("wait");
  7888. }
  7889. clan.subMoney(clan_id, 64);
  7890. msg.prefix("online", prefix_clan, string.concat(clan.getTag(clan_id), ": ", string.concatList(args, " ", 1, size - 1)));
  7891. goto("wait");
  7892. }
  7893. if(arg0 == "deposit") {
  7894. if(!player.isInClan(player)) {
  7895. msg.prefix(player, prefix_clan, "You are not in a clan.");
  7896. goto("wait");
  7897. }
  7898. if(size != 2) {
  7899. msg.prefix(player, prefix_commands, "/clan deposit <money>");
  7900. goto("wait");
  7901. }
  7902. money = list.getIndex(args, 1);
  7903. if(!isDouble(money) || money < 0) {
  7904. msg.prefix(player, prefix_clan, "Positive number expected.");
  7905. goto("wait");
  7906. }
  7907. if(!hasEnoughMoney(player, money)) {
  7908. msg.prefix(player, prefix_clan, "You can´t transfer more money than you have.");
  7909. goto("wait");
  7910. }
  7911. clan_id = player.getClanId(player);
  7912. clan.addMoney(clan_id, money);
  7913. money.sub(player, money);
  7914. clan.msg(clan_id, string.concat("§7", player.getName(player), "§r transferred §7", string.number(money), "§r snuvis."));
  7915. goto("wait");
  7916. }
  7917. if(arg0 == "party") {
  7918. counter = 0;
  7919. clan_id = player.getClanId(player);
  7920. list = clan.getMembersList(clan_id);
  7921. iter = iterator(list);
  7922. while(hasNext(iter)) {
  7923. p = player.get(next(iter));
  7924. if(p != null) {
  7925. temp = party.invitePlayer(player, p);
  7926. if(temp == true) {
  7927. counter++;
  7928. }
  7929. }
  7930. }
  7931. msg.prefix(player, prefix_clan, string.concat(string.number(counter), " online clan members invited to a party."));
  7932. goto("wait");
  7933. }
  7934. if(arg0 == "withdraw") {
  7935. if(!player.isInClan(player)) {
  7936. msg.prefix(player, prefix_clan, "You are not in a clan.");
  7937. goto("wait");
  7938. }
  7939. if(!player.isClanLeader(player)) {
  7940. msg.prefix(player, prefix_clan, "You are not a clan leader.");
  7941. goto("wait");
  7942. }
  7943. if(size != 2) {
  7944. msg.prefix(player, prefix_commands, "/clan withdraw <money>");
  7945. goto("wait");
  7946. }
  7947. money = list.getIndex(args, 1);
  7948. if(!isDouble(money) || money < 0) {
  7949. msg.prefix(player, prefix_clan, "Positive number expected.");
  7950. goto("wait");
  7951. }
  7952. clan_id = player.getClanId(player);
  7953. clan_money = clan.getMoney(clan_id);
  7954. if(clan_money < money) {
  7955. msg.prefix(player, prefix_clan, string.concat("There are only §7", string.number(clan_money), "§r snuvis on the clan account."));
  7956. goto("wait");
  7957. }
  7958. clan.subMoney(clan_id, money);
  7959. money.add(player, money);
  7960. msg.prefix(player, prefix_clan, string.concat("You have withdrawn §7", string.number(money), "§r snuvis."));
  7961. goto("wait");
  7962. }
  7963. if(arg0 == "leader") {
  7964. if(!player.isInClan(player)) {
  7965. msg.prefix(player, prefix_clan, "You are not in a clan.");
  7966. goto("wait");
  7967. }
  7968. if(!player.isClanLeader(player)) {
  7969. msg.prefix(player, prefix_clan, "You are not a clan leader.");
  7970. goto("wait");
  7971. }
  7972. if(size != 2) {
  7973. msg.prefix(player, prefix_commands, "/clan leader <name>");
  7974. goto("wait");
  7975. }
  7976. p_name = list.getIndex(args, 1);
  7977. if(!checkIfEverOnline(p_name)) {
  7978. msg.prefix(player, prefix_clan, "This player has never been online.");
  7979. goto("wait");
  7980. }
  7981. if(string.toLowerCase(player.getName(player)) == string.toLowerCase(p_name)) {
  7982. msg.prefix(player, prefix_clan, "You can´t do this for yourself.");
  7983. goto("wait");
  7984. }
  7985. p_uuid = player.getUuid(p_name);
  7986. p_id = player.getId(p_uuid);
  7987. if(!player.isSameClan(player, p_id)) {
  7988. msg.prefix(player, prefix_clan, "This player is not in your clan.");
  7989. goto("wait");
  7990. }
  7991. player.setClanRole(p_id, "leader");
  7992. player.setClanRole(player, "mod");
  7993. clan_id = player.getClanId(player);
  7994. clan.msg(clan_id, string.concat("§7", p_name, "§r was set to clan leader."));
  7995. goto("wait");
  7996. }
  7997. if(arg0 == "mod") {
  7998. if(!player.isInClan(player)) {
  7999. msg.prefix(player, prefix_clan, "You are not in a clan.");
  8000. goto("wait");
  8001. }
  8002. if(!player.isClanLeader(player)) {
  8003. msg.prefix(player, prefix_clan, "You are not a clan leader.");
  8004. goto("wait");
  8005. }
  8006. if(size != 2) {
  8007. msg.prefix(player, prefix_commands, "/clan leader <name>");
  8008. goto("wait");
  8009. }
  8010. p_name = list.getIndex(args, 1);
  8011. if(!checkIfEverOnline(p_name)) {
  8012. msg.prefix(player, prefix_clan, "This player has never been online.");
  8013. goto("wait");
  8014. }
  8015. if(string.toLowerCase(player.getName(player)) == string.toLowerCase(p_name)) {
  8016. msg.prefix(player, prefix_clan, "You can´t do this for yourself.");
  8017. goto("wait");
  8018. }
  8019. p_uuid = player.getUuid(p_name);
  8020. p_id = player.getId(p_uuid);
  8021. if(!player.isSameClan(player, p_id)) {
  8022. msg.prefix(player, prefix_clan, "This player is not in your clan.");
  8023. goto("wait");
  8024. }
  8025. player.setClanRole(p_id, "mod");
  8026. clan_id = player.getClanId(player);
  8027. clan.msg(clan_id, string.concat("§7", p_name, "§r was set to clan mod."));
  8028. goto("wait");
  8029. }
  8030. if(arg0 == "degrade") {
  8031. if(!player.isInClan(player)) {
  8032. msg.prefix(player, prefix_clan, "You are not in a clan.");
  8033. goto("wait");
  8034. }
  8035. if(!player.isClanLeader(player)) {
  8036. msg.prefix(player, prefix_clan, "You are not a clan leader.");
  8037. goto("wait");
  8038. }
  8039. if(size != 2) {
  8040. msg.prefix(player, prefix_commands, "/clan degrade <name>");
  8041. goto("wait");
  8042. }
  8043. p_name = list.getIndex(args, 1);
  8044. if(!checkIfEverOnline(p_name)) {
  8045. msg.prefix(player, prefix_clan, "This player has never been online.");
  8046. goto("wait");
  8047. }
  8048. if(string.toLowerCase(player.getName(player)) == string.toLowerCase(p_name)) {
  8049. msg.prefix(player, prefix_clan, "You can´t do this for yourself.");
  8050. goto("wait");
  8051. }
  8052. p_uuid = player.getUuid(p_name);
  8053. p_id = player.getId(p_uuid);
  8054. if(!player.isSameClan(player, p_id)) {
  8055. msg.prefix(player, prefix_clan, "This player is not in your clan.");
  8056. goto("wait");
  8057. }
  8058. player.setClanRole(p_id, "member");
  8059. clan_id = player.getClanId(player);
  8060. clan.msg(clan_id, string.concat("§7", p_name, "§r was degraded."));
  8061. goto("wait");
  8062. }
  8063. if(arg0 == "kick") {
  8064. if(!player.isInClan(player)) {
  8065. msg.prefix(player, prefix_clan, "You are not in a clan.");
  8066. goto("wait");
  8067. }
  8068. if(!player.isClanLeader(player) && !player.isClanMod(player)) {
  8069. msg.prefix(player, prefix_clan, "You have no permission for this.");
  8070. goto("wait");
  8071. }
  8072. if(size != 2) {
  8073. msg.prefix(player, prefix_commands, "/clan kick <name>");
  8074. goto("wait");
  8075. }
  8076. p_name = list.getIndex(args, 1);
  8077. if(!checkIfEverOnline(p_name)) {
  8078. msg.prefix(player, prefix_clan, "This player has never been online.");
  8079. goto("wait");
  8080. }
  8081. if(string.toLowerCase(player.getName(player)) == string.toLowerCase(p_name)) {
  8082. msg.prefix(player, prefix_clan, "You can´t do this for yourself.");
  8083. goto("wait");
  8084. }
  8085. p_uuid = player.getUuid(p_name);
  8086. p_id = player.getId(p_uuid);
  8087. if(!player.isSameClan(player, p_id)) {
  8088. msg.prefix(player, prefix_clan, "This player is not in your clan.");
  8089. goto("wait");
  8090. }
  8091. if(player.isClanLeader(p_id)) {
  8092. msg.prefix(player, prefix_clan, "You can´t kick the leader.");
  8093. goto("wait");
  8094. }
  8095. if(player.isClanMod(player) && player.isClanMod(p_id)) {
  8096. msg.prefix(player, prefix_clan, "You can´t kick another mod.");
  8097. goto("wait");
  8098. }
  8099. clan_id = player.getClanId(player);
  8100. clan.msg(clan_id, string.concat("§7", p_name, "§r got kicked out of the clan."));
  8101. clan.removeMember(clan_id, p_id);
  8102. p = read.player(p_name);
  8103. if(p_name != null) {
  8104. player.setHeadName(p);
  8105. }
  8106. goto("wait");
  8107. }
  8108. if(arg0 == "disband") {
  8109. if(!player.isInClan(player)) {
  8110. msg.prefix(player, prefix_clan, "You are not in a clan.");
  8111. goto("wait");
  8112. }
  8113. if(!player.isClanLeader(player)) {
  8114. msg.prefix(player, prefix_clan, "You are not a clan leader.");
  8115. goto("wait");
  8116. }
  8117. clan_id = player.getClanId(player);
  8118. clan.msg(clan_id, "Clan disbanded.");
  8119. list = clan.getMembersList(clan_id);
  8120. clan.delete(clan_id);
  8121. iter = iterator(list);
  8122. while(hasNext(iter)) {
  8123. p = player.get(next(iter));
  8124. if(p != null) {
  8125. player.setHeadName(p);
  8126. }
  8127. }
  8128. goto("wait");
  8129. }
  8130. if(arg0 == "leave") {
  8131. if(!player.isInClan(player)) {
  8132. msg.prefix(player, prefix_clan, "You are not in a clan.");
  8133. goto("wait");
  8134. }
  8135. if(player.isClanLeader(player)) {
  8136. msg.prefix(player, prefix_clan, "You have to set another leader first.");
  8137. goto("wait");
  8138. }
  8139. clan_id = player.getClanId(player);
  8140. clan.msg(clan_id, string.concat("§7", player.getName(player), "§r left the clan."));
  8141. clan.removeMember(clan_id, player);
  8142. player.setHeadName(player);
  8143. goto("wait");
  8144. }
  8145. if(arg0 == "list") {
  8146. table = table.new("§b", 2, 6, 4, 5);
  8147. msg.string(player, table.getStart(table));
  8148. msg.string(player, table.get(table, "§2ID", "§2Name", "§2Tag", "§2Members"));
  8149. msg.string(player, table.getMiddle(table));
  8150. list = clan.getIdList();
  8151. iter = iterator(list);
  8152. while(hasNext(iter)) {
  8153. clan_id = next(iter);
  8154. name = clan.getName(clan_id);
  8155. tag = clan.getTag(clan_id);
  8156. amount = clan.getMembersAmount(clan_id);
  8157. msg.string(player, table.get(table, string.number(clan_id), name, tag, string.number(amount)));
  8158. }
  8159. msg.string(player, table.getEnd(table));
  8160. goto("wait");
  8161. }
  8162. if(arg0 == "setspawn") {
  8163. if(!player.isInClan(player)) {
  8164. msg.prefix(player, prefix_clan, "You are not in a clan.");
  8165. goto("wait");
  8166. }
  8167. if(!player.isClanLeader(player) && !player.isClanMod(player)) {
  8168. msg.prefix(player, prefix_clan, "You have no permission for this.");
  8169. goto("wait");
  8170. }
  8171. clan_id = player.getClanId(player);
  8172. clan.setSpawn(clan_id, entity.getLocation(player));
  8173. msg.prefix(player, prefix_clan, "New clan spawn set.");
  8174. goto("wait");
  8175. }
  8176. if(arg0 == "spawn") {
  8177. if(!player.isInClan(player)) {
  8178. msg.prefix(player, prefix_clan, "You are not in a clan.");
  8179. goto("wait");
  8180. }
  8181. clan_id = player.getClanId(player);
  8182. spawn_loc = clan.getSpawn(clan_id);
  8183. if(spawn_loc == null) {
  8184. msg.prefix(player, prefix_clan, "No clan spawn set.");
  8185. goto("wait");
  8186. }
  8187. if(!perm.has("isTeam", player)) {
  8188. world_name = world.getName(loc.getWorld(entity.getLocation(player)));
  8189. if(world.isGamesName(world_name)) {
  8190. msg.prefix(player, prefix_commands, "You can´t teleport in this world.");
  8191. goto("wait");
  8192. }
  8193. }
  8194. player.teleport(player, spawn_loc, true);
  8195. goto("wait");
  8196. }
  8197. goto("clanhelp");
  8198. @remove_clan_invitation
  8199. list.removeIndex(clan_invitations, 0);
  8200. goto("wait");
  8201. @color
  8202. msg.string(player, string.getSpacer());
  8203. msg.string(player, " §0&0 §1&1 §2&2 §3&3 §4&4 §5&5 §6&6 §7&7");
  8204. msg.string(player, " §8&8 §9&9 §a&a §b&b §c&c §d&d §e&e §f&f");
  8205. msg.string(player, " &l §l(bold)");
  8206. msg.string(player, " &m §m(strikethrough)");
  8207. msg.string(player, " &n §n(underline)");
  8208. msg.string(player, " &o §o(italic)");
  8209. goto("wait");
  8210. @comeback
  8211. if(player.isOnAdventure(player)) {
  8212. msg.prefix(player, prefix_skill, "Comeback not allowed during adventure.");
  8213. goto("wait");
  8214. }
  8215. amount = skill.getAmount(player, "skill.comeback");
  8216. if(amount <= 0) {
  8217. msg.prefix(player, prefix_skill, "You have not bought that skill.");
  8218. goto("wait");
  8219. }
  8220. loc = player.getDeathLoc(player);
  8221. if(loc == null) {
  8222. msg.prefix(player, prefix_skill, "No death location found.");
  8223. goto("wait");
  8224. }
  8225. new_amount = amount - 1;
  8226. skill.setAmount(player, "skill.comeback", new_amount);
  8227. msg.prefix(player, prefix_skill, string.concat("Used Comeback. New amount: ", string.number(new_amount)));
  8228. entity.teleport(player, loc);
  8229. player.resetDeathLoc(player);
  8230. goto("wait");
  8231. @setspawn
  8232. if(size != 1) {
  8233. @setspawnhelp
  8234. msg.prefix(player, prefix_commands, "/setspawn ...");
  8235. msg.string(player, "§6 - server");
  8236. msg.string(player, "§6 - games");
  8237. msg.string(player, "§6 - creative");
  8238. goto("wait");
  8239. }
  8240. arg0 = string.toLowerCase(list.getIndex(args, 0));
  8241. new_spawn = string.location(entity.getLocation(player));
  8242. config = getServerConfig();
  8243. if(arg0 == "games") {
  8244. config.set(config, "gamesspawn", new_spawn);
  8245. msg.prefix(player, prefix_commands, "New spawn for gaming world set.");
  8246. } elseif(arg0 == "server") {
  8247. config.set(config, "serverspawn", new_spawn);
  8248. msg.prefix(player, prefix_commands, "New main Spawn set.");
  8249. } elseif(arg0 == "creative") {
  8250. config.set(config, "creativespawn", new_spawn);
  8251. msg.prefix(player, prefix_commands, "New spawn for creative world set.");
  8252. } else {
  8253. goto("setspawnhelp");
  8254. }
  8255. config.saveAsync(config);
  8256. goto("wait");
  8257. @heal
  8258. if(size > 1) {
  8259. msg.prefix(player, prefix_commands, "/heal [player]");
  8260. goto("wait");
  8261. }
  8262. if(size == 0) {
  8263. p = player;
  8264. } elseif(size == 1) {
  8265. p_name = list.getIndex(args, 0);
  8266. p = read.player(p_name);
  8267. if(p == null) {
  8268. msg.prefix(player, prefix_commands, "This player is not online.");
  8269. goto("wait");
  8270. }
  8271. if(player != p) {
  8272. msg.prefix(player, prefix_commands, string.concat(player.getName(p), " was healed."));
  8273. }
  8274. }
  8275. living.heal(p, 50);
  8276. player.setHunger(p, 20);
  8277. player.setSaturation(p, 5);
  8278. living.clearEffects(p);
  8279. entity.setBurning(p, 0);
  8280. msg.prefix(p, prefix_commands, "You have been healed.");
  8281. goto("wait");
  8282. @inv
  8283. if(size == 0) {
  8284. @invhelp
  8285. msg.prefix(player, prefix_commands, "/inv ...");
  8286. if(perm.has("inv.backups", player)) {
  8287. msg.string(player, "§6 - backups <player> §rLists backup invs of a player");
  8288. }
  8289. if(perm.has("inv.ignore", player)) {
  8290. msg.string(player, "§6 - ignore §rToggles inventory change on world change");
  8291. }
  8292. if(perm.has("inv.see", player)) {
  8293. msg.string(player, "§6 - see <player> §rOpens an inventory of a player");
  8294. }
  8295. if(perm.has("inv.reload", player)) {
  8296. msg.string(player, "§6 - reload <player> §rReloads an inventory of a player");
  8297. }
  8298. if(perm.has("inv.saveFor", player)) {
  8299. msg.string(player, "§6 - saveFor <player> <world> §rSaves your inventory for a player");
  8300. }
  8301. if(perm.has("inv.loadFrom", player)) {
  8302. msg.string(player, "§6 - loadFrom <player> <world> §rLoads an inventory of a player for you");
  8303. }
  8304. goto("wait");
  8305. }
  8306. arg0 = string.toLowerCase(list.getIndex(args, 0));
  8307. if(arg0 == "backups") {
  8308. if(!perm.has("inv.backups", player)) {
  8309. perm.no("inv.backups", player);
  8310. goto("wait");
  8311. }
  8312. if(size < 2) {
  8313. msg.prefix(player, prefix_commands, "/inv backups <player>");
  8314. goto("wait");
  8315. }
  8316. p_name = list.getIndex(args, 1);
  8317. p_uuid = player.getUuid(p_name);
  8318. if(p_uuid == null) {
  8319. msg.prefix(player, prefix_commands, "This player has never been online.");
  8320. goto("wait");
  8321. }
  8322. player_id = player.getId(p_uuid);
  8323. dir = file.new(string.concat("scripts/configs/inv_data/backup/", player_id));
  8324. if(!file.exists(dir)) {
  8325. msg.prefix(player, prefix_commands, "No backups available.");
  8326. goto("wait");
  8327. }
  8328. file_list = file.getList(dir);
  8329. if(list.getSize(file_list) == 0) {
  8330. msg.prefix(player, prefix_commands, "No backups available.");
  8331. goto("wait");
  8332. }
  8333. f_map = map.new();
  8334. table = table.new("§b", 3, 14);
  8335. msg.string(player, table.getStart(table));
  8336. msg.string(player, table.get(table, "#", p_name));
  8337. msg.string(player, table.getMiddle(table));
  8338. iter = iterator(file_list);
  8339. while(hasNext(iter)) {
  8340. f = next(iter);
  8341. f_name = file.getName(f);
  8342. split_array = string.split("_", f_name);
  8343. time_array = string.split("-", split_array[2]);
  8344. year = time_array[0];
  8345. month = time.getStringFromNumber(read.number(time_array[1]));
  8346. day = time.getStringFromNumber(read.number(time_array[2]));
  8347. hour = time.getStringFromNumber(read.number(time_array[3]));
  8348. minute = time.getStringFromNumber(read.number(time_array[4]));
  8349. second = time.getStringFromNumber(read.number(time_array[5]));
  8350. time_string = string.concat(day, ".", month, ".", year, " ", hour, ":", minute, ":", second);
  8351. map.add(f_map, read.number(split_array[1]), time_string);
  8352. }
  8353. for(i = 1; i <= 10; i++) {
  8354. time_string = map.get(f_map, i);
  8355. msg.string(player, table.get(table, string.number(i), time_string));
  8356. }
  8357. msg.string(player, table.getEnd(table));
  8358. goto("wait");
  8359. }
  8360. if(arg0 == "ignore") {
  8361. if(!perm.has("inv.ignore", player)) {
  8362. perm.no("inv.ignore", player);
  8363. goto("wait");
  8364. }
  8365. ignore = player.hasInvIgnore(player);
  8366. if(ignore == null) {
  8367. ignore = false;
  8368. }
  8369. if(ignore) {
  8370. msg.prefix(player, prefix_commands, "Your inventory will change on joining another world.");
  8371. } else {
  8372. msg.prefix(player, prefix_commands, "You´ll keep your inventory on joining another world.");
  8373. }
  8374. player.invIgnore(player, !ignore);
  8375. goto("wait");
  8376. }
  8377. if(arg0 == "see") {
  8378. if(!perm.has("inv.see", player)) {
  8379. perm.no("inv.see", player);
  8380. goto("wait");
  8381. }
  8382. if(size < 2) {
  8383. msg.prefix(player, prefix_commands, "/inv see <player>");
  8384. goto("wait");
  8385. }
  8386. p_name = list.getIndex(args, 1);
  8387. p_uuid = player.getUuid(p_name);
  8388. if(p_uuid == null) {
  8389. msg.prefix(player, prefix_commands, "This player has never been online.");
  8390. goto("wait");
  8391. }
  8392. p = read.player(p_name);
  8393. if(p == null) {
  8394. msg.prefix(player, prefix_commands, "This player is not online.");
  8395. goto("wait");
  8396. }
  8397. inv.show(p, player);
  8398. goto("wait");
  8399. }
  8400. if(arg0 == "reload") {
  8401. if(!perm.has("inv.reload", player)) {
  8402. perm.no("inv.reload", player);
  8403. goto("wait");
  8404. }
  8405. if(size < 2) {
  8406. msg.prefix(player, prefix_commands, "/inv reload <player>");
  8407. goto("wait");
  8408. }
  8409. p_name = list.getIndex(args, 1);
  8410. p_uuid = player.getUuid(p_name);
  8411. if(p_uuid == null) {
  8412. msg.prefix(player, prefix_commands, "This player has never been online.");
  8413. goto("wait");
  8414. }
  8415. p = read.player(p_name);
  8416. if(p == null) {
  8417. msg.prefix(player, prefix_commands, "This player is not online.");
  8418. goto("wait");
  8419. }
  8420. world = loc.getWorld(entity.getLocation(p));
  8421. inv.loadFromPlayer(p, p, world);
  8422. msg.prefix(player, prefix_commands, "Inventory reloaded.");
  8423. goto("wait");
  8424. }
  8425. if(arg0 == "savefor") {
  8426. if(size != 1 && size != 3) {
  8427. msg.prefix(player, prefix_commands, "/inv saveFor <player> <world>");
  8428. goto("wait");
  8429. }
  8430. if(size == 1) {
  8431. for_player_or_id = player.getId(player);
  8432. world = loc.getWorld(entity.getLocation(player));
  8433. }
  8434. if(size == 3) {
  8435. if(!perm.has("inv.saveFor", player)) {
  8436. perm.no("inv.saveFor", player);
  8437. goto("wait");
  8438. }
  8439. p_name = list.getIndex(args, 1);
  8440. p_uuid = player.getUuid(p_name);
  8441. if(p_uuid == null) {
  8442. msg.prefix(player, prefix_commands, "This player has never been online.");
  8443. goto("wait");
  8444. }
  8445. p = read.player(p_name);
  8446. if(p != null) {
  8447. msg.prefix(player, prefix_commands, "This player is online. Use /inv see to change this inventory.");
  8448. goto("wait");
  8449. }
  8450. for_player_or_id = player.getId(p_uuid);
  8451. world_name = list.getIndex(args, 2);
  8452. world = world.get(world_name);
  8453. if(world == null) {
  8454. msg.prefix(player, prefix_world, "This world is not loaded.");
  8455. goto("wait");
  8456. }
  8457. }
  8458. inv.saveForPlayer(player, for_player_or_id, world);
  8459. msg.prefix(player, prefix_commands, "Inventory saved.");
  8460. goto("wait");
  8461. }
  8462. if(arg0 == "loadfrom") {
  8463. if(size != 1 && size != 3) {
  8464. msg.prefix(player, prefix_commands, "/inv loadFrom <player> <world>");
  8465. goto("wait");
  8466. }
  8467. if(size == 1) {
  8468. from_player_or_id = player.getId(player);
  8469. world = loc.getWorld(entity.getLocation(player));
  8470. }
  8471. if(size == 3) {
  8472. if(!perm.has("inv.loadFrom", player)) {
  8473. perm.no("inv.loadFrom", player);
  8474. goto("wait");
  8475. }
  8476. p_name = list.getIndex(args, 1);
  8477. p_uuid = player.getUuid(p_name);
  8478. if(p_uuid == null) {
  8479. msg.prefix(player, prefix_commands, "This player has never been online.");
  8480. goto("wait");
  8481. }
  8482. p = read.player(p_name);
  8483. if(p != null) {
  8484. msg.prefix(player, prefix_commands, "§cThis player is online. Loaded inventory can differ from /inv see!");
  8485. }
  8486. from_player_or_id = player.getId(p_uuid);
  8487. world_name = list.getIndex(args, 2);
  8488. world = world.get(world_name);
  8489. if(world == null) {
  8490. msg.prefix(player, prefix_world, "This world is not loaded.");
  8491. goto("wait");
  8492. }
  8493. }
  8494. inv.loadFromPlayer(player, from_player_or_id, world);
  8495. msg.prefix(player, prefix_commands, "Inventory loaded.");
  8496. goto("wait");
  8497. }
  8498. goto("wait");
  8499. @sponsor
  8500. msg.prefix(sender, prefix_commands, "Be a fancy sponsor and ...");
  8501. msg.string(sender, string.concat(" §a+ §cUse §dcolors §rand §bicons§r", icon.getGoldCoin(), icon.getCraftingTable(), icon.getHeart()));
  8502. msg.string(sender, " §a+ §rEquip your head with §b/hat");
  8503. msg.string(sender, " §a+ §rGet all online players in a party with §b/joinme");
  8504. msg.string(sender, " §a+ §rSet your own §bjoin, leave §rand §bdeath message");
  8505. goto("wait");
  8506. @dev
  8507. if(size == 0) {
  8508. @dev_syntax
  8509. msg.prefix(sender, prefix_commands, "/dev ...");
  8510. msg.string(sender, "§6 - boost §rBoosts you up to the clouds");
  8511. msg.string(sender, "§6 - debug <list/clear> §rManages logged debug messages");
  8512. msg.string(sender, "§6 - entities <world> §rLists all entities in a world");
  8513. msg.string(sender, "§6 - logo §rGives the Mundus Crassus logo on a banner");
  8514. msg.string(sender, "§6 - yeet §rThrows you in sight");
  8515. goto("wait");
  8516. }
  8517. arg0 = string.toLowerCase(list.getIndex(args, 0));
  8518. if(arg0 == "logo") {
  8519. player.giveItem(player, logo);
  8520. goto("wait");
  8521. }
  8522. if(arg0 == "boost") {
  8523. entity.setMotion(player, 0, 5, 0);
  8524. goto("wait");
  8525. }
  8526. if(arg0 == "yeet") {
  8527. if(size != 2){
  8528. msg.prefix(player, prefix_commands, "/dev yeet <strength>");
  8529. goto("wait");
  8530. }
  8531. yeet_strength = list.getIndex(args, 1);
  8532. yeet(player,math.abs(yeet_strength));
  8533. msg.string(player, "§4YEET");
  8534. goto("wait");
  8535. }
  8536. if(arg0 == "debug") {
  8537. arg1 = string.toLowerCase(list.getIndex(args, 1));
  8538. if(arg1 == "list") {
  8539. error_size = debug.getSize();
  8540. if(error_size == 0) {
  8541. msg.prefix(player, prefix_commands, "No debugs logged.");
  8542. goto("wait");
  8543. }
  8544. for(i = 0; i < error_size; i++) {
  8545. msg.string(player, debug.getIndex(i));
  8546. }
  8547. goto("wait");
  8548. }
  8549. if(arg1 == "clear") {
  8550. debug.clear();
  8551. msg.prefix(player, prefix_commands, "All logged debugs deleted.");
  8552. goto("wait");
  8553. }
  8554. goto("wait");
  8555. }
  8556. if(arg0 == "entities") {
  8557. if(size != 2) {
  8558. msg.prefix(player, prefix_commands, "/dev entities <world>");
  8559. goto("wait");
  8560. }
  8561. world_name = string.toLowerCase(list.getIndex(args, 1));
  8562. world = world.get(world_name);
  8563. if(world == null) {
  8564. msg.prefix(player, prefix_world, "This world is not loaded.");
  8565. goto("wait");
  8566. }
  8567. list = world.getEntities(world);
  8568. size = list.getSize(list);
  8569. map = map.new();
  8570. living = 0;
  8571. for(i = 0; i < size; i++) {
  8572. element = list.getIndex(list, i);
  8573. if(isLiving(element)) {
  8574. living++;
  8575. entity_type = entity.getType(element);
  8576. n = map.get(map, entity_type);
  8577. if(n == null) {
  8578. map.add(map, entity_type, 1);
  8579. } else {
  8580. map.add(map, entity_type, n + 1);
  8581. }
  8582. }
  8583. }
  8584. msg.string(player, "§0-------------------------------------------------");
  8585. msg.string(player, string.concat("Living: ", living));
  8586. iter = map.iterator(map);
  8587. table = table.new("§b", 14, 14);
  8588. msg.string(player, table.getStart(table));
  8589. while(hasNext(iter)) {
  8590. element1 = next(iter);
  8591. if(hasNext(iter)) {
  8592. element2 = next(iter);
  8593. } else {
  8594. element2 = "";
  8595. }
  8596. msg.string(player, table.get(table, element1, element2));
  8597. }
  8598. msg.string(player, table.getEnd(table));
  8599. goto("wait");
  8600. }
  8601. goto("dev_syntax");
  8602. function yeet(player, strength){
  8603. array = entity.getLook(player);
  8604. x = array[0] * (math.log(strength) + 1);
  8605. y = math.abs(array[1]) * (math.log(strength) + 1);
  8606. z = array[2] * (math.log(strength) + 1);
  8607. entity.setMotion(player, x, y, z);
  8608. }
  8609. @memory
  8610. msg.prefix(sender, prefix_commands, string.concat("Used RAM: ", string.number(usedMemory()), " / ", string.number(math.round(allocatedMemory())), " MB"));
  8611. goto("wait");
  8612. @world
  8613. if(size == 0) {
  8614. @world_syntax
  8615. msg.prefix(sender, prefix_world, "/world ...");
  8616. msg.string(sender, "§b - info [world] §rShows info about a world");
  8617. msg.string(sender, "§b - tp <world> [player] §rTeleports a player to a world");
  8618. msg.string(sender, "§b - list §rShows all loaded worlds");
  8619. msg.string(sender, "§b - setspawn §rSets the spawn of a world");
  8620. msg.string(sender, "§b - diffi <world> <diffi> §rSets the difficulty of a world");
  8621. goto("wait");
  8622. }
  8623. arg0 = string.toLowerCase(list.getIndex(args, 0));
  8624. if(arg0 == "info") {
  8625. if(size == 1) {
  8626. if(!isPlayer(sender)) {
  8627. msg.string(sender, "Not possible on console.");
  8628. goto("wait");
  8629. }
  8630. world = loc.getWorld(entity.getLocation(player));
  8631. } else {
  8632. worldname = list.getIndex(args, 1);
  8633. world = world.get(worldname);
  8634. if(world == null) {
  8635. msg.prefix(sender, prefix_world, "This world is not loaded.");
  8636. goto("wait");
  8637. }
  8638. }
  8639. msg.string(sender, string.getSpacer());
  8640. msg.string(sender, string.concat("§6World: §r", world.getName(world)));
  8641. msg.string(sender, string.concat("§6Thunder: §r", world.hasThunder(world)));
  8642. msg.string(sender, string.concat("§6Rain: §r", world.hasRain(world)));
  8643. chunks = world.getLoadedChunks(world);
  8644. forced = 0;
  8645. for(i = 0; i < array.getSize(chunks); i++) {
  8646. if(world.isForceLoadedChunk(chunks[i])) {
  8647. forced++;
  8648. }
  8649. }
  8650. msg.string(sender, string.concat("§6Chunks: §r", string.number(forced), "/", string.number(array.getSize(chunks))));
  8651. time = world.getTime(world);
  8652. while(time >= 24000) {
  8653. time -= 24000;
  8654. }
  8655. msg.string(sender, string.concat("§6Time: §r", string.number(time)));
  8656. goto("wait");
  8657. }
  8658. if(arg0 == "tp") {
  8659. if(size < 2 || size > 3) {
  8660. msg.prefix(sender, prefix_world, "/world tp <world> [player]");
  8661. goto("wait");
  8662. }
  8663. if(size >= 2) {
  8664. world_name = string.toLowerCase(list.getIndex(args, 1));
  8665. world = world.get(world_name);
  8666. if(world == null) {
  8667. msg.prefix(sender, prefix_world, "This world is not loaded.");
  8668. goto("wait");
  8669. }
  8670. }
  8671. if(size > 2) {
  8672. p_name = list.getIndex(args, 2);
  8673. p = read.player(p_name);
  8674. if(p == null) {
  8675. msg.prefix(sender, prefix_world, "This player is not online.");
  8676. goto("wait");
  8677. }
  8678. } else {
  8679. if(!isPlayer(sender)) {
  8680. msg.string(sender, "Not possible on console.");
  8681. goto("wait");
  8682. }
  8683. p = sender;
  8684. }
  8685. if(!player.canTeleport(p)) {
  8686. if(size == 3) {
  8687. msg.prefix(sender, prefix_commands, "This player can´t be teleported now.");
  8688. goto("wait");
  8689. }
  8690. msg.prefix(sender, prefix_commands, "You can´t teleport now.");
  8691. goto("wait");
  8692. }
  8693. if(sender != p) {
  8694. msg.prefix(sender, prefix_world, string.concat(player.getName(p), " was teleported to the spawn of the world ", world_name, "."));
  8695. }
  8696. if(world_name == "games") {
  8697. loc = world.getGamesSpawn();
  8698. } elseif(world_name == "creative") {
  8699. loc = world.getCreativeSpawn();
  8700. } else {
  8701. loc = world.getSpawn(world);
  8702. }
  8703. player.teleport(p, loc, true);
  8704. goto("wait");
  8705. }
  8706. if(arg0 == "list") {
  8707. msg.prefix(sender, prefix_world, "Loaded worlds:");
  8708. worldlist = world.getAll();
  8709. for(i = 0; i < list.getSize(worldlist); i++) {
  8710. msg.string(sender, string.concat(" - ", world.getName(list.getIndex(worldlist, i))));
  8711. }
  8712. msg.string(sender, string.getSpacer());
  8713. goto("wait");
  8714. }
  8715. if(arg0 == "setspawn") {
  8716. if(!isPlayer(sender)) {
  8717. msg.string(sender, "Not possible on console.");
  8718. goto("wait");
  8719. }
  8720. location = entity.getLocation(sender);
  8721. world = loc.getWorld(location);
  8722. world.setSpawn(location, world);
  8723. msg.prefix(sender, prefix_world, string.concat("New spawn of the world ", world.getName(world), " set."));
  8724. goto("wait");
  8725. }
  8726. if(arg0 == "diffi") {
  8727. if(size != 3) {
  8728. msg.prefix(sender, prefix_world, "/world diffi <world> <diffi>");
  8729. goto("wait");
  8730. }
  8731. worldname = list.getIndex(args, 1);
  8732. world = world.get(worldname);
  8733. if(world == null) {
  8734. msg.prefix(sender, prefix_world, "This world is not loaded.");
  8735. goto("wait");
  8736. }
  8737. diffi_string = list.getIndex(args, 2);
  8738. if(!(diffi_string == "PEACEFUL" || diffi_string == "EASY" || diffi_string == "NORMAL" || diffi_string == "HARD")) {
  8739. msg.prefix(sender, prefix_world, "False input.");
  8740. goto("wait");
  8741. }
  8742. world.setDifficulty(world, diffi_string);
  8743. msg.prefix(sender, prefix_world, "Difficulty changed.");
  8744. goto("wait");
  8745. }
  8746. goto("world_syntax");
  8747. @giveup
  8748. script_id = quest.getFromPlayer(player);
  8749. if(script_id == null) {
  8750. msg.prefix(player, prefix_quest, "You are not in a quest.");
  8751. goto("wait");
  8752. }
  8753. script = script.getFromId(script_id);
  8754. if(script == null) {
  8755. msg.dev("Player used giveup on corrupt quest");
  8756. quest.removePlayer(player); //in case of corrupt quest
  8757. msg.prefix(player, prefix_quest, "You have no quest.");
  8758. goto("wait");
  8759. }
  8760. setScriptVar("player", player);
  8761. modTimer.scriptCallEvent("quest_term", script);
  8762. quest.term(script, player);
  8763. msg.prefix(player, prefix_quest, "Quest termed.");
  8764. goto("wait");
  8765. @leave
  8766. set = player.getMinigameIds(player);
  8767. iter = iterator(set);
  8768. if(hasNext(iter)) {
  8769. script_id = next(iter);
  8770. script = script.getFromId(script_id);
  8771. if(script == null) {
  8772. msg.dev(string.concat("Player left game without existing gamescript ", set));
  8773. 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.");
  8774. player.resetMinigames(player);
  8775. entity.teleport(player, world.getGamesSpawn());
  8776. goto("wait");
  8777. }
  8778. minigame.hub(script, player);
  8779. goto("wait");
  8780. }
  8781. msg.prefix(player, "§dScript", "You are not in a minigame.");
  8782. goto("wait");
  8783. function minigame.hub(script, player) {
  8784. script.setVar(script, "player", player);
  8785. modTimer.scriptCallEvent("player_giveup", script);
  8786. }
  8787. @jail
  8788. if(size != 1) {
  8789. msg.prefix(player, prefix_commands, "/jail <player>");
  8790. } else {
  8791. p_name = list.getIndex(args, 0);
  8792. if(!checkIfEverOnline(p_name)) {
  8793. msg.prefix(player, prefix_jail, "This player has never been online.");
  8794. goto("wait");
  8795. }
  8796. p_uuid = player.getUuid(p_name);
  8797. if(isJailed(p_uuid)) {
  8798. msg.prefix(player, prefix_jail, "This player is already jailed.");
  8799. goto("wait");
  8800. }
  8801. player_name = player.getName(player);
  8802. if(player_name == p_name) {
  8803. msg.prefix(player, prefix_jail, "Self-Jailing isn´t a good idea.");
  8804. goto("wait");
  8805. }
  8806. if(!isOnline(p_name)) {
  8807. msg.prefix(player, prefix_jail, "This player is not online.");
  8808. goto("wait");
  8809. }
  8810. p = read.player(p_name);
  8811. if(perm.has("jail", p)) {
  8812. msg.prefix(player, prefix_jail, "You can´t jail this player.");
  8813. goto("wait");
  8814. }
  8815. list.add(jailed_list, p_uuid);
  8816. msg.prefix(player, prefix_jail, string.concat(p_name, " wurde gejailt"));
  8817. showJail(p_name);
  8818. if(!jail_loop_active) {
  8819. sgoto(5, "jailloop");
  8820. }
  8821. }
  8822. goto("wait");
  8823. @unjail
  8824. if(size != 1) {
  8825. msg.prefix(player, prefix_commands, "/unjail <player>");
  8826. } else {
  8827. p_name = list.getIndex(args, 0);
  8828. if(!checkIfEverOnline(p_name)) {
  8829. msg.prefix(player, prefix_jail, "This player has never been online.");
  8830. goto("wait");
  8831. }
  8832. p_uuid = player.getUuid(p_name);
  8833. if(!isJailed(p_uuid)) {
  8834. msg.prefix(player, prefix_jail, "This player is not jailed.");
  8835. goto("wait");
  8836. }
  8837. list.remove(jailed_list, p_uuid);
  8838. msg.prefix(player, prefix_jail, "You freed this player from jail.");
  8839. }
  8840. goto("wait");
  8841. function inv.show(from_player, to_player) {
  8842. player_inv = player.getInv(from_player);
  8843. inv = inv.new("222222222222222222222222222222222222222222222", text.new(string.concat("Inventory of ", player.getName(from_player))));
  8844. set.add($invseeids, inv.getId(inv));
  8845. setInvItem(inv, 0, living.getEquip(from_player, read.slot("HEAD")));
  8846. setInvItem(inv, 1, living.getEquip(from_player, read.slot("CHEST")));
  8847. setInvItem(inv, 2, living.getEquip(from_player, read.slot("LEGS")));
  8848. setInvItem(inv, 3, living.getEquip(from_player, read.slot("FEET")));
  8849. setInvItem(inv, 4, living.getOffHand(from_player));
  8850. for(slot = 0; slot <= 8; slot++) {
  8851. setInvItem(inv, slot + 36, inv.getItem(player_inv, slot));
  8852. }
  8853. for(slot = 9; slot <= 35; slot++) {
  8854. setInvItem(inv, slot, inv.getItem(player_inv, slot));
  8855. }
  8856. inv.open(inv, to_player);
  8857. }
  8858. function setInvItem(inv, slot, item) {
  8859. if(item == null || item.isAir(item)) {
  8860. return;
  8861. }
  8862. inv.setItem(inv, slot, item);
  8863. }
  8864. function rank.add(index, tech_rank, chat_rank) {
  8865. $rank_array[index, 0] = tech_rank;
  8866. $rank_array[index, 1] = chat_rank;
  8867. }
  8868. //--------------------------------------------------
  8869. //Vote-Utils
  8870. //--------------------------------------------------
  8871. function vote.register(name, time) {
  8872. uuid = player.getUuid(name);
  8873. if(uuid == null) {
  8874. stmt = databank.prepare("INSERT INTO votes (name, time) VALUES(?,?);");
  8875. databank.setString(stmt, 1, name);
  8876. databank.setLong(stmt, 2, time);
  8877. databank.workerExecute(stmt);
  8878. return;
  8879. }
  8880. stmt = databank.prepare("INSERT INTO votes (name, player_id, time) VALUES(?,?,?);");
  8881. id = player.getId(uuid);
  8882. databank.setString(stmt, 1, name);
  8883. databank.setInt(stmt, 2, id);
  8884. databank.setLong(stmt, 3, time);
  8885. databank.workerExecute(stmt);
  8886. }
  8887. //--------------------------------------------------
  8888. //LoginRequests-Utils
  8889. //--------------------------------------------------
  8890. function loginrequests.getPlayer(player_id, amount, result) {
  8891. list = list.new();
  8892. if(result == null) {
  8893. stmt = databank.prepare("SELECT player_id,time,result FROM login_requests WHERE player_id = ? ORDER BY TIME DESC LIMIT ?;");
  8894. databank.setInt(stmt, 1, player_id);
  8895. databank.setInt(stmt, 2, amount);
  8896. } else {
  8897. stmt = databank.prepare("SELECT player_id,time,result FROM login_requests WHERE player_id = ? AND result = ? ORDER BY TIME DESC LIMIT ?;");
  8898. databank.setInt(stmt, 1, player_id);
  8899. databank.setString(stmt, 2, result);
  8900. databank.setInt(stmt, 3, amount);
  8901. }
  8902. result = databank.execute(stmt);
  8903. while(databank.next(result)) {
  8904. a = array.new(3);
  8905. a[0] = databank.getInt(result, 1); //player_id
  8906. a[1] = databank.getLong(result, 2); //time
  8907. a[2] = databank.getString(result, 3); //result
  8908. list.add(list, a);
  8909. }
  8910. databank.close(stmt);
  8911. databank.close(result);
  8912. return list;
  8913. }
  8914. function loginrequests.getAll(amount, result) {
  8915. list = list.new();
  8916. if(result == null) {
  8917. stmt = databank.prepare("SELECT player_id,time,result FROM login_requests ORDER BY TIME DESC LIMIT ?;");
  8918. databank.setInt(stmt, 1, amount);
  8919. } else {
  8920. stmt = databank.prepare("SELECT player_id,time,result FROM login_requests WHERE result = ? ORDER BY TIME DESC LIMIT ?;");
  8921. databank.setString(stmt, 1, result);
  8922. databank.setInt(stmt, 2, amount);
  8923. }
  8924. result = databank.execute(stmt);
  8925. while(databank.next(result)) {
  8926. a = array.new(3);
  8927. a[0] = databank.getInt(result, 1); //player_id
  8928. a[1] = databank.getLong(result, 2); //time
  8929. a[2] = databank.getString(result, 3); //result
  8930. list.add(list, a);
  8931. }
  8932. databank.close(stmt);
  8933. databank.close(result);
  8934. return list;
  8935. }
  8936. //--------------------------------------------------
  8937. //Tip-Utils
  8938. //--------------------------------------------------
  8939. function tip.setLoop(tipp_key, boolean) {
  8940. stmt = databank.prepare("UPDATE tipps SET tipp_loop = ? WHERE tipp_key = ?;");
  8941. databank.setBool(stmt, 1, boolean);
  8942. databank.setString(stmt, 2, tipp_key);
  8943. databank.workerExecute(stmt);
  8944. }
  8945. function tip.remove(tipp_key) {
  8946. stmt = databank.prepare("DELETE FROM tipps WHERE tipp_key = ?;");
  8947. databank.setString(stmt, 1, tipp_key);
  8948. databank.workerExecute(stmt);
  8949. }
  8950. function tip.getAll() {
  8951. list = list.new();
  8952. stmt = databank.prepare("SELECT * FROM tipps;");
  8953. result = databank.execute(stmt);
  8954. while(databank.next(result)) {
  8955. a = array.new(3);
  8956. a[0] = databank.getString(result, 1);
  8957. a[1] = databank.getString(result, 2);
  8958. a[2] = databank.getBool(result, 3);
  8959. list.add(list, a);
  8960. }
  8961. databank.close(stmt);
  8962. databank.close(result);
  8963. return list;
  8964. }
  8965. //--------------------------------------------------
  8966. //Databank-Utils
  8967. //--------------------------------------------------
  8968. function databank.isExistingTable(table) {
  8969. temp = false;
  8970. stmt = databank.prepare("SHOW TABLES");
  8971. result = databank.execute(stmt);
  8972. while(databank.next(result)) {
  8973. if(table == databank.getString(result, 1)) {
  8974. temp = true;
  8975. break;
  8976. }
  8977. }
  8978. databank.close(result);
  8979. databank.close(stmt);
  8980. return temp;
  8981. }
  8982. function databank.getTableFields(table) {
  8983. fields = list.new();
  8984. stmt = databank.prepare(string.concat("SHOW FIELDS FROM ", table));
  8985. result = databank.execute(stmt);
  8986. while(databank.next(result)) {
  8987. list.add(fields, databank.getString(result, 1));
  8988. }
  8989. databank.close(result);
  8990. databank.close(stmt);
  8991. return fields;
  8992. }
  8993. function databank.getTableDatatypes(table) {
  8994. stmt = databank.prepare(string.concat("SHOW CREATE TABLE ", table));
  8995. result = databank.execute(stmt);
  8996. if(databank.next(result)) {
  8997. temp = databank.getString(result, 2);
  8998. }
  8999. databank.close(result);
  9000. databank.close(stmt);
  9001. return temp;
  9002. }
  9003. //--------------------------------------------------
  9004. //Tipp-Utils
  9005. //--------------------------------------------------
  9006. function tipp.register(tipp_key, tipp_value) {
  9007. stmt = databank.prepare("INSERT INTO tipps (tipp_key, tipp_value) VALUES (?,?) ON DUPLICATE KEY UPDATE tipp_value = ?");
  9008. databank.setString(stmt, 1, tipp_key);
  9009. databank.setString(stmt, 2, tipp_value);
  9010. databank.setString(stmt, 3, tipp_value);
  9011. databank.workerExecute(stmt);
  9012. }
  9013. function tipp.get(tipp_key) {
  9014. tipp_value = null;
  9015. stmt = databank.prepare("SELECT tipp_value FROM tipps WHERE tipp_key = ?;");
  9016. databank.setString(stmt, 1, tipp_key);
  9017. result = databank.execute(stmt);
  9018. if(databank.next(result)) {
  9019. tipp_value = databank.getString(result, 1);
  9020. }
  9021. databank.close(result);
  9022. databank.close(stmt);
  9023. return tipp_value;
  9024. }
  9025. function tipp.exists(tipp_key) {
  9026. stmt = databank.prepare("SELECT tipp_key FROM tipps WHERE tipp_key = ?;");
  9027. databank.setString(stmt, 1, tipp_key);
  9028. result = databank.execute(stmt);
  9029. temp = false;
  9030. if(databank.next(result)) {
  9031. temp = true;
  9032. }
  9033. databank.close(result);
  9034. databank.close(stmt);
  9035. return temp;
  9036. }
  9037. //--------------------------------------------------
  9038. //Warp-Utils
  9039. //--------------------------------------------------
  9040. function warp.create(warp_name, location) {
  9041. config = config.new(string.concat("scripts/configs/warps"), warp_name);
  9042. config.set(config, "world", world.getName(loc.getWorld(location)));
  9043. config.set(config, "x", loc.getX(location));
  9044. config.set(config, "y", loc.getY(location));
  9045. config.set(config, "z", loc.getZ(location));
  9046. config.set(config, "yaw", loc.getYaw(location));
  9047. config.set(config, "pitch", loc.getPitch(location));
  9048. config.saveAsync(config);
  9049. }
  9050. function warp.exists(warp_name) {
  9051. config = config.new(string.concat("scripts/configs/warps"), warp_name);
  9052. return config.exists(config);
  9053. }
  9054. function warp.get(warp_name) {
  9055. config = config.new(string.concat("scripts/configs/warps"), warp_name);
  9056. if(config.exists(config)) {
  9057. config.load(config);
  9058. }
  9059. world_name = config.getString(config, "world", "null");
  9060. if(world_name == "null") {
  9061. return null;
  9062. }
  9063. world = world.get(world_name);
  9064. x = config.getDouble(config, "x", 0);
  9065. y = config.getDouble(config, "y", 100);
  9066. z = config.getDouble(config, "z", 0);
  9067. yaw = config.getDouble(config, "yaw", 0);
  9068. pitch = config.getDouble(config, "pitch", 0);
  9069. return loc.new(world, x, y, z, yaw, pitch);
  9070. }
  9071. function warp.delete(warp_name) {
  9072. config = config.new(string.concat("scripts/configs/warps"), warp_name);
  9073. if(!config.exists(config)) {
  9074. return false;
  9075. }
  9076. config.delete(config);
  9077. return true;
  9078. }
  9079. function warp.getList() {
  9080. dir = file.new(string.concat("scripts/configs/warps"));
  9081. warps_list = list.new();
  9082. if(file.exists(dir)) {
  9083. file_list = file.getList(dir);
  9084. iter = iterator(file_list);
  9085. while(hasNext(iter)) {
  9086. warp = file.getName(next(iter));
  9087. warp = string.replace(warp, ".snuvic", "");
  9088. list.add(warps_list, warp);
  9089. }
  9090. }
  9091. return warps_list;
  9092. }
  9093. //--------------------------------------------------
  9094. //Home-Utils
  9095. //--------------------------------------------------
  9096. function home.set(player_id, home_name, location) {
  9097. stmt = databank.prepare("INSERT INTO new_homes (player_id, name, world_name, x, y, z, yaw, pitch) VALUES (?,?,?,?,?,?,?,?);");
  9098. databank.setInt(stmt, 1, player_id);
  9099. databank.setString(stmt, 2, home_name);
  9100. databank.setString(stmt, 3, world.getName(loc.getWorld(location)));
  9101. databank.setInt(stmt, 4, loc.getX(location));
  9102. databank.setInt(stmt, 5, loc.getY(location));
  9103. databank.setInt(stmt, 6, loc.getZ(location));
  9104. databank.setInt(stmt, 7, loc.getYaw(location));
  9105. databank.setInt(stmt, 8, loc.getPitch(location));
  9106. databank.workerExecute(stmt);
  9107. }
  9108. function home.delete(player_id, home_name) {
  9109. stmt = databank.prepare("DELETE FROM new_homes WHERE player_id = ? AND name = ?;");
  9110. databank.setInt(stmt, 1, player_id);
  9111. databank.setString(stmt, 2, home_name);
  9112. databank.workerExecute(stmt);
  9113. }
  9114. function home.getLocation(player_id, home_name) {
  9115. stmt = databank.prepare("SELECT world_name, x, y, z, yaw, pitch FROM new_homes WHERE player_id = ? AND name = ?;");
  9116. databank.setInt(stmt, 1, player_id);
  9117. databank.setString(stmt, 2, home_name);
  9118. result = databank.execute(stmt);
  9119. if(databank.next(result)) {
  9120. world = world.get(databank.getString(result, 1));
  9121. if(world == null) {
  9122. return null;
  9123. }
  9124. x = databank.getDouble(result, 2);
  9125. y = databank.getDouble(result, 3);
  9126. z = databank.getDouble(result, 4);
  9127. yaw = databank.getDouble(result, 5);
  9128. pitch = databank.getDouble(result, 6);
  9129. location = loc.new(world, x, y, z, yaw, pitch);
  9130. }
  9131. databank.close(result);
  9132. databank.close(stmt);
  9133. return location;
  9134. }
  9135. function home.exists(player_id, home_name) {
  9136. stmt = databank.prepare("SELECT player_id FROM new_homes WHERE player_id = ? AND name = ?;");
  9137. databank.setInt(stmt, 1, player_id);
  9138. databank.setString(stmt, 2, home_name);
  9139. result = databank.execute(stmt);
  9140. if(databank.next(result)) {
  9141. temp = true;
  9142. } else {
  9143. temp = false;
  9144. }
  9145. databank.close(result);
  9146. databank.close(stmt);
  9147. return temp;
  9148. }
  9149. function home.getList(player_id) {
  9150. homes_list = list.new();
  9151. stmt = databank.prepare("SELECT name FROM new_homes WHERE player_id = ?;");
  9152. databank.setInt(stmt, 1, player_id);
  9153. result = databank.execute(stmt);
  9154. while(databank.next(result)) {
  9155. list.add(homes_list, databank.getString(result, 1));
  9156. }
  9157. databank.close(result);
  9158. databank.close(stmt);
  9159. return homes_list;
  9160. }
  9161. function hasTpaRequest(player_uuid, aim_uuid) {
  9162. for(i = 0; i < list.getSize($tpa_request); i++) {
  9163. array = list.getIndex($tpa_request, i);
  9164. if(array[0] == player_uuid && array[1] == aim_uuid) {
  9165. list.removeIndex($tpa_request, i);
  9166. return true;
  9167. }
  9168. }
  9169. return false;
  9170. }
  9171. function addTpaRequest(player_uuid, aim_uuid) {
  9172. array = array.new(2);
  9173. array[0] = player_uuid;
  9174. array[1] = aim_uuid;
  9175. list.add($tpa_request, array);
  9176. }
  9177. function showJail(player_name) {
  9178. if(isOnline(player_name)) {
  9179. inv.open($jailmenu, read.player(player_name));
  9180. }
  9181. }
  9182. function isJailed(player_uuid) {
  9183. return(list.contains($jailed_list, player_uuid));
  9184. }
  9185. function command.register(command, description) {
  9186. command.add(command);
  9187. list.add($command_list, command);
  9188. map.add($command_map, command, description);
  9189. }
  9190. function command.registerAlias(alias, command) {
  9191. command.add(alias);
  9192. map.add($alias_map, alias, command);
  9193. }
  9194. //--------------------------------------------------
  9195. //Time-Utils
  9196. //--------------------------------------------------
  9197. //Spielzeit aller Online-Spieler
  9198. function playtime.getTotalOnlineMinutes() {
  9199. minutes = 0;
  9200. iter = iterator(players.toList());
  9201. while(hasNext(iter)) {
  9202. minutes += playtime.getPlayerOnlineMinutes(player.getId(next(iter)));
  9203. }
  9204. return minutes;
  9205. }
  9206. //Spielzeit in einem Zeitraum exkl. der Spielzeit der Online-Spieler
  9207. function playtime.getInterval(from_cal, to_cal) {
  9208. stmt = databank.prepare("SELECT SUM(leave_time - join_time) FROM playtime WHERE join_time > ? AND join_time < ?;");
  9209. databank.setLong(stmt, 1, time.from(from_cal));
  9210. databank.setLong(stmt, 2, time.from(to_cal));
  9211. result = databank.execute(stmt);
  9212. if(databank.next(result)) {
  9213. minutes = databank.getLong(result, 1) / 1000 / 60;
  9214. } else {
  9215. minutes = 0;
  9216. }
  9217. databank.close(result);
  9218. databank.close(stmt);
  9219. return minutes;
  9220. }
  9221. //Gesamte Spielzeit inkl. der Spielzeit der Online-Spieler
  9222. function playtime.getTotal() {
  9223. minutes = playtime.getTotalOnlineMinutes();
  9224. stmt = databank.prepare("SELECT SUM(leave_time - join_time) FROM playtime;");
  9225. result = databank.execute(stmt);
  9226. if(databank.next(result)) {
  9227. minutes += databank.getLong(result, 1) / 1000 / 60;
  9228. }
  9229. databank.close(result);
  9230. databank.close(stmt);
  9231. return minutes;
  9232. }
  9233. //Spielzeit eines Spielers in einem Zeitraum exkl. der Online-Spielzeit
  9234. function playtime.getPlayerInterval(player_id, from_cal, to_cal) {
  9235. stmt = databank.prepare("SELECT SUM(leave_time - join_time) FROM playtime WHERE player_id = ? AND join_time > ? AND join_time < ?;");
  9236. databank.setInt(stmt, 1, player_id);
  9237. databank.setLong(stmt, 2, time.from(from_cal));
  9238. databank.setLong(stmt, 3, time.from(to_cal));
  9239. result = databank.execute(stmt);
  9240. if(databank.next(result)) {
  9241. minutes = databank.getLong(result, 1) / 1000 / 60;
  9242. } else {
  9243. minutes = 0;
  9244. }
  9245. databank.close(result);
  9246. databank.close(stmt);
  9247. return minutes;
  9248. }
  9249. function playtime.getPlayersPerInterval(from_cal, to_cal) {
  9250. set = set.new();
  9251. stmt = databank.prepare("SELECT player_id FROM playtime WHERE join_time > ? AND join_time < ?;");
  9252. databank.setLong(stmt, 1, time.from(from_cal));
  9253. databank.setLong(stmt, 2, time.from(to_cal));
  9254. result = databank.execute(stmt);
  9255. while(databank.next(result)) {
  9256. set.add(set, databank.getInt(result, 1));
  9257. }
  9258. databank.close(result);
  9259. databank.close(stmt);
  9260. return set.getSize(set);
  9261. }
  9262. function time.getYearDays(year) {
  9263. days = 365;
  9264. if(year % 4 == 0) {
  9265. days++;
  9266. }
  9267. return days;
  9268. }
  9269. function time.getMonthDays(month, year) {
  9270. days = month.getDays(month);
  9271. //Schaltjahre
  9272. if(month == 2 && year % 4 == 0) {
  9273. days++;
  9274. }
  9275. return days;
  9276. }
  9277. function month.register(month_index, shortname, days) {
  9278. $month_array[month_index, 0] = shortname;
  9279. $month_array[month_index, 1] = days;
  9280. }
  9281. function month.getShortName(month) {
  9282. return $month_array[month - 1, 0];
  9283. }
  9284. function month.getDays(month) {
  9285. return $month_array[month - 1, 1];
  9286. }
  9287. //--------------------------------------------------
  9288. //Player-Utils
  9289. //--------------------------------------------------
  9290. function player.hasClanInvitation(player_or_id, clan_id) {
  9291. if(isPlayer(player_or_id)) {
  9292. player_id = player.getId(player_or_id);
  9293. } else {
  9294. player_id = player_or_id;
  9295. }
  9296. iter = iterator($clan_invitations);
  9297. while(hasNext(iter)) {
  9298. invitation = next(iter);
  9299. p_id = invitation[0];
  9300. c_id = invitation[1];
  9301. if(player_id == p_id && clan_id == c_id) {
  9302. return true;
  9303. }
  9304. }
  9305. return false;
  9306. }
  9307. function player.addClanInvitation(player_id, clan_id) {
  9308. invitation = array.new(2);
  9309. invitation[0] = player_id;
  9310. invitation[1] = clan_id;
  9311. list.add($clan_invitations, invitation);
  9312. }
  9313. //--------------------------------------------------
  9314. //Party-Utils
  9315. //--------------------------------------------------
  9316. function party.invitePlayer(inviter, invitee) {
  9317. //Wenn bereits ein Party besteht, diese Party-ID verwenden.
  9318. //Ansonsten überprüfen, ob der Einlader bereits andere Spieler eingeladen hat. Dann diese Party-ID verwenden.
  9319. //Ansonsten neue Party-ID vergeben.
  9320. inviter_uuid = player.getUuid(inviter);
  9321. if(player.isInParty(inviter)) {
  9322. party_id = player.getPartyId(inviter);
  9323. } else {
  9324. party_id = map.get($party_invite_ids, inviter_uuid);
  9325. if(party_id == null) {
  9326. party_id = ++$party_counter;
  9327. }
  9328. }
  9329. if(invitee == null) {
  9330. return "inviteeNotOnline";
  9331. }
  9332. if(inviter == invitee) {
  9333. return "inviterEqualsInvitee";
  9334. }
  9335. if(player.isInParty(inviter)) {
  9336. if(!player.isPartyLeaderOrMod(inviter)) {
  9337. return "inviterNotPermitted";
  9338. }
  9339. }
  9340. if(player.isInParty(invitee)) {
  9341. return "inviteeAlreadyInParty";
  9342. }
  9343. invitee_uuid = player.getUuid(invitee);
  9344. list = map.get($party_invitations, invitee_uuid);
  9345. if(list == null) {
  9346. list = list.new();
  9347. map.add($party_invitations, invitee_uuid, list);
  9348. }
  9349. if(list.contains(list, inviter_uuid)) {
  9350. return "inviteeAlreadyInvited";
  9351. }
  9352. list.add(list, inviter_uuid);
  9353. list.add($deluuid, inviter_uuid);
  9354. list.add($delkeytime, time.getMillis());
  9355. list = map.get($delkeytimes, invitee_uuid);
  9356. if(list == null) {
  9357. list = list.new();
  9358. map.add($delkeytimes, invitee_uuid, list);
  9359. }
  9360. list.add(list, time.getMillis());
  9361. map.add($party_invite_ids, inviter_uuid, party_id);
  9362. inviter_name = player.getName(inviter);
  9363. msg.prefix(invitee, $prefix_party, string.concat(inviter_name, " invites you to a party."));
  9364. 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))));
  9365. sgoto(200, "deletePartyInvitation"); //Einladung bleibt 1 Minute lang erhalten
  9366. return true;
  9367. }
  9368. function party.kickPlayer(player, reason) {
  9369. party_id = player.getPartyId(player);
  9370. //Nachrichten
  9371. player_name = player.getName(player);
  9372. if(reason == "kick") {
  9373. message = string.concat("§r", player_name, " has been kicked out of the party.");
  9374. } else {
  9375. message = string.concat("§r", player_name, " has left the party.");
  9376. }
  9377. party.sendMessage(party_id, message);
  9378. player_uuid = player.getUuid(player_name);
  9379. //aus Partyliste entfernen
  9380. party_list = party.getList(party_id);
  9381. list.remove(party_list, player_uuid);
  9382. //ID und Rang entfernen
  9383. rank = player.getPartyRank(player);
  9384. player.delPartyRank(player);
  9385. player.delPartyId(player);
  9386. //Einladungen löschen
  9387. map.remove($party_invitations, player_uuid);
  9388. map.remove($delkeytimes, player_uuid);
  9389. //Wenn Party keine zwei Spieler mehr hat, dann Party auflösen
  9390. if(list.getSize(party_list) < 2) {
  9391. party.delete(party_id);
  9392. return;
  9393. }
  9394. //Wenn Spieler Partyleiter war, neuen Partyleiter ernennen
  9395. if(rank == "Leader") {
  9396. new_player = player.get(list.getIndex(party_list, 0));
  9397. player.setPartyRank(new_player, "Leader");
  9398. party.sendMessage(party_id, string.concat("§r", player.getName(new_player), " is now Leader."));
  9399. }
  9400. }
  9401. function party.sendMessage(party_id, message) {
  9402. iter = iterator(party.getList(party_id));
  9403. while(hasNext(iter)) {
  9404. msg.prefix(player.get(next(iter)), $prefix_party, message);
  9405. }
  9406. }
  9407. function party.delete(party_id) {
  9408. party.sendMessage(party_id, "Party disbanded.");
  9409. iter = iterator(party.getList(party_id));
  9410. while(hasNext(iter)) {
  9411. player = player.get(next(iter));
  9412. player.delPartyRank(player);
  9413. player.delPartyId(player);
  9414. }
  9415. }
  9416. @deletePartyInvitation
  9417. player_uuid = list.getIndex(deluuid, 0);
  9418. invitations = map.get(party_invitations, player_uuid);
  9419. keytimes = map.get(delkeytimes, player_uuid);
  9420. if(invitations != null) {
  9421. if(list.getSize(invitations) != 0) {
  9422. keytime = list.getIndex(delkeytime, 0);
  9423. keytime2 = list.getIndex(keytimes, 0);
  9424. list.remove(delkeytime, keytime);
  9425. if(keytime == keytime2) {
  9426. index = list.getIndexOf(keytimes, keytime2);
  9427. list.remove(keytimes, keytime2);
  9428. list.removeIndex(invitations, index);
  9429. }
  9430. }
  9431. }
  9432. goto("wait");
  9433. //--------------------------------------------------
  9434. //Plot-Utils
  9435. //--------------------------------------------------
  9436. function plot.registerMoveEvents(world) {
  9437. if(world == null) {
  9438. return;
  9439. }
  9440. iter = plot.iterator(world);
  9441. while(hasNext(iter)) {
  9442. plot = next(iter);
  9443. plot.setMoveEvent(plot, world);
  9444. }
  9445. }
  9446. function plot.delMoveEvent(plot) {
  9447. plot_id = plot.getId(plot);
  9448. for(i = 0; i < list.getSize($plot_move_ids_list); i++) {
  9449. a = list.getIndex($plot_move_ids_list, i);
  9450. if(a[1] == plot_id) {
  9451. event.removeMoveData(a[0]);
  9452. list.removeIndex($plot_move_ids_list, i);
  9453. break;
  9454. }
  9455. }
  9456. }
  9457. function plot.setMoveEvent(plot, world) {
  9458. if(!plot.isCity(plot) && !plot.isPlot(plot)) {
  9459. return;
  9460. }
  9461. x1 = plot.getMinX(plot);
  9462. y1 = plot.getMinY(plot);
  9463. z1 = plot.getMinZ(plot);
  9464. x2 = plot.getMaxX(plot);
  9465. y2 = plot.getMaxY(plot);
  9466. z2 = plot.getMaxZ(plot);
  9467. loc1 = loc.new(world, x1, y1, z1);
  9468. loc2 = loc.new(world, x2, y2, z2);
  9469. move_id = event.addMoveData(loc1, loc2, 100, -1);
  9470. plot_id = plot.getId(plot);
  9471. a = array.new(2);
  9472. a[0] = move_id;
  9473. a[1] = plot_id;
  9474. list.add($plot_move_ids_list, a);
  9475. }
  9476. function plot.getPlotIdFromMoveId(move_id) {
  9477. iter = iterator($plot_move_ids_list);
  9478. while(hasNext(iter)) {
  9479. a = next(iter);
  9480. if(a[0] == move_id) {
  9481. return a[1];
  9482. }
  9483. }
  9484. return null;
  9485. }
  9486. function plot.getMoveIdFromPlotId(plot_id) {
  9487. iter = iterator($plot_move_ids_list);
  9488. while(hasNext(iter)) {
  9489. a = next(iter);
  9490. if(a[1] == plot_id) {
  9491. return a[0];
  9492. }
  9493. }
  9494. return null;
  9495. }
  9496. @checkForPlot
  9497. player_uuid = list.getIndex(check_for_plot_list, 0);
  9498. list.removeIndex(check_for_plot_list, 0);
  9499. player = player.get(player_uuid);
  9500. if(player == null) {
  9501. map.remove(actual_move_id, player_uuid);
  9502. goto("wait");
  9503. }
  9504. player_loc = entity.getLocation(player);
  9505. plot_list = plot.get(player_loc);
  9506. if(list.getSize(plot_list) == 0) {
  9507. map.remove(actual_move_id, player_uuid);
  9508. } else {
  9509. list.add(check_for_plot_list, player_uuid);
  9510. sgoto(100, "checkForPlot");
  9511. }
  9512. goto("wait");
  9513. function tpBottom(player) {
  9514. player_loc = entity.getLocation(player);
  9515. y = loc.getY(player_loc);
  9516. while(y > -64 && block.isAir(block.get(player_loc))) {
  9517. loc.setY(player_loc, y);
  9518. y--;
  9519. }
  9520. if(y <= 0) {
  9521. return;
  9522. }
  9523. loc.addY(player_loc, 1);
  9524. entity.teleport(player, player_loc);
  9525. }
  9526. //--------------------------------------------------
  9527. //Mailbox-Utils
  9528. //--------------------------------------------------
  9529. function mailbox.sendItem(player_id, item) {
  9530. index = mailbox.getFreeIndex(player_id);
  9531. if(index == -1) {
  9532. return false;
  9533. }
  9534. mailbox.setItem(player_id, index, item);
  9535. return true;
  9536. }
  9537. function mailbox.clear(player_id) {
  9538. pfad = "scripts/configs/inv_data/mailbox";
  9539. config = config.new(pfad, player_id);
  9540. if(config.exists(config)) {
  9541. config.load(config);
  9542. }
  9543. for(index = 0; index < 27; index++) {
  9544. config.set(config, string.concat("item-", string.number(index)), "null");
  9545. }
  9546. config.saveAsync(config);
  9547. }
  9548. function mailbox.setItem(player_id, index, item) {
  9549. pfad = "scripts/configs/inv_data/mailbox";
  9550. config = config.new(pfad, player_id);
  9551. if(config.exists(config)) {
  9552. config.load(config);
  9553. }
  9554. item_string = string.item(item);
  9555. config.set(config, string.concat("item-", string.number(index)), item_string);
  9556. config.saveAsync(config);
  9557. }
  9558. function mailbox.removeItem(player_id, index) {
  9559. pfad = "scripts/configs/inv_data/mailbox";
  9560. config = config.new(pfad, player_id);
  9561. if(config.exists(config)) {
  9562. config.load(config);
  9563. }
  9564. config.set(config, string.concat("item-", string.number(index)), "null");
  9565. config.saveAsync(config);
  9566. }
  9567. function mailbox.getFreeIndex(player_id) {
  9568. pfad = "scripts/configs/inv_data/mailbox";
  9569. config = config.new(pfad, player_id);
  9570. if(config.exists(config)) {
  9571. config.load(config);
  9572. }
  9573. for(i = 0; i < 27; i++) {
  9574. item_string = config.getString(config, string.concat("item-", string.number(i)), "null");
  9575. if(item_string == "null") {
  9576. return i;
  9577. }
  9578. }
  9579. return -1;
  9580. }
  9581. function mailbox.show(to_player, player_id, bool) {
  9582. pfad = "scripts/configs/inv_data/mailbox";
  9583. config = config.new(pfad, player_id);
  9584. if(config.exists(config)) {
  9585. config.load(config);
  9586. }
  9587. if(bool) {
  9588. inv = inv.new("222222222222222222222222222", text.new(string.concat("Mailbox from ", player.getNameFromId(player_id))));
  9589. } else {
  9590. inv = inv.new("111111111111111111111111111", text.new(string.concat("Mailbox from ", player.getNameFromId(player_id))));
  9591. }
  9592. for(i = 0; i < 27; i++) {
  9593. item_string = config.getString(config, string.concat("item-", string.number(i)), "null");
  9594. if(item_string == "null") {
  9595. continue;
  9596. }
  9597. item = read.item(item_string);
  9598. if(item == null) {
  9599. continue;
  9600. }
  9601. setInvItem(inv, i, item);
  9602. }
  9603. inv.open(inv, to_player);
  9604. }
  9605. function updateVoteInv() {
  9606. lore_list = list.new();
  9607. list.add(lore_list, text.new("§fCost: §e1 VP"));
  9608. list.add(lore_list, text.new(string.concat("§fCounter: §e", string.number(getHomeBoost()))));
  9609. list.add(lore_list, text.new("§5Every 20 VP the possible homes increase by one."));
  9610. list.add(lore_list, text.new("§5Counter automatically shrinks by one every day."));
  9611. inv.setItem($vote_inv, 2, item.create("RED_BED", 1, "§aMore Homes", lore_list));
  9612. }
  9613. function getAdditionalVoteHomes() {
  9614. return math.roundDown(getHomeBoost() / 20);
  9615. }
  9616. function getHomeBoost() {
  9617. config = getServerConfig();
  9618. return config.getDouble(config, "homeBoostPoints", 0);
  9619. }
  9620. function increaseHomeBoost() {
  9621. config = getServerConfig();
  9622. points = config.getDouble(config, "homeBoostPoints", 0) + 1;
  9623. config.set(config, "homeBoostPoints", points);
  9624. config.saveAsync(config);
  9625. updateVoteInv();
  9626. }
  9627. function decreaseHomeBoost() {
  9628. config = getServerConfig();
  9629. points = config.getDouble(config, "homeBoostPoints", 0) - 1;
  9630. if(points < 0) {
  9631. points = 0;
  9632. }
  9633. config.set(config, "homeBoostPoints", points);
  9634. config.saveAsync(config);
  9635. updateVoteInv();
  9636. }