commands.txt 326 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881
  1. error_counter = 0;
  2. last_error_message = null;
  3. @on_error
  4. error_counter++;
  5. if(error_counter > 1) {
  6. snuvi.debug("Error Handler activated");
  7. if(last_error_message == error_message) {
  8. snuvi.debug("Same error again");
  9. term();
  10. }
  11. last_error_message = error_message;
  12. if(event == "custom_command") {
  13. snuvi.debug(string.concat("Command ", command, " failed."));
  14. set.add(failed_cmds, command);
  15. goto("wait");
  16. }
  17. snuvi.debug("Restarting script...");
  18. error_counter++;
  19. if(error_counter >= 5) {
  20. snuvi.debug("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. command.add("hack");
  29. //Games
  30. command.add("nextplayer");
  31. command.add("invstats");
  32. command.add("topinvstats");
  33. command.add("removeinvstats");
  34. command.add("sfstats");
  35. command.add("topsfstats");
  36. command.add("removesfstats");
  37. command.add("questanswer");
  38. //Overwrite vanilla
  39. command.add("butcher");
  40. //--- Register commands shown on /help here ---
  41. alias_map = map.new();
  42. command_list = list.new();
  43. command_map = map.new();
  44. command.register("afk", "Toggles afk");
  45. command.register("allsounds", "Plays all sounds");
  46. command.register("answer", "Answers the last private message");
  47. command.register("armorstand", "Armorstand commands");
  48. command.register("ass", "Armor Stand Signs");
  49. command.register("back", "Teleports to the last position");
  50. command.register("ban", "Bans a player");
  51. command.register("block", "Block commands");
  52. //command.register("clan", "Clan-Commands");
  53. command.register("color", "Shows all colors");
  54. command.register("comeback", "Teleports to your death location");
  55. command.register("copyisland", "Copyisland-Commands");
  56. command.register("creative", "Teleports to creative-spawn");
  57. command.register("customitems", "Shows all custom items");
  58. command.register("databank", "Databank-Commands");
  59. command.register("datatools", "Datatools-Commands");
  60. command.register("dev", "Dev-Commands");
  61. command.register("enchant", "Enchants an item in your hand");
  62. command.register("enderchest", "Shows enderchests");
  63. command.register("error", "Error-Logger");
  64. command.register("feed", "Fills hunger bar");
  65. command.register("fly", "Toggles fly");
  66. command.register("friend", "Friend-Commands");
  67. command.register("game", "marvs minigame shit");
  68. command.register("gamemode", "Change gamemode");
  69. command.register("gamerule", "Manage gamerules");
  70. command.register("games", "Teleports to games-spawn");
  71. command.register("giveup", "Giveup a quest");
  72. command.register("grow", "Grow seeds");
  73. command.register("hat", "Be fame with a new hat");
  74. command.register("head", "Gives you the head of a player");
  75. command.register("heal", "Heals, fills hunger bar and remove effects");
  76. command.register("help", "Shows this help");
  77. command.register("home", "Manage your homes");
  78. command.register("icon", "Shows all icons");
  79. command.register("live", "Toggles Live-Mode");
  80. command.register("lag", "Executes a lag test");
  81. command.register("leave", "Leaves a minigame");
  82. command.register("loginrequests", "Lists the last login requests");
  83. command.register("human", "Human-Commands");
  84. command.register("inv", "Inv-Commands");
  85. command.register("iteminfo", "Returns information about an item");
  86. command.register("jail", "Sends a player to jail");
  87. command.register("joinme", "Sends a party invitation to all online players");
  88. command.register("jumpto", "Jumps to a block in sight");
  89. command.register("kick", "Kicks a player");
  90. command.register("lastseen", "Shows the last players online");
  91. command.register("lightning", "Summons a lightning_bolt");
  92. command.register("list", "List all players online");
  93. command.register("mail", "Mail-Commands");
  94. command.register("mailbox", "Mailbox-Commands");
  95. command.register("memory", "Returns RAM-usage");
  96. command.register("msg", "Send a private message");
  97. command.register("mute", "Mutes a player");
  98. command.register("news", "Send Push-News to all players");
  99. command.register("nickname", "Set a nickname");
  100. command.register("nowb", "Sends no 'is back' message if afk");
  101. command.register("party", "Party-Commands");
  102. command.register("perm", "Manage permissions");
  103. command.register("playtime", "Shows your playtime");
  104. command.register("plot", "Plot-Commands");
  105. command.register("potion", "Adds a potion effects to an item");
  106. command.register("pvp", "Toggles pvp");
  107. command.register("quest", "Quest-Commands");
  108. command.register("rank", "Shows your available ranks");
  109. command.register("repair", "Repairs your item in mainhand");
  110. command.register("ride", "Rides an entity");
  111. command.register("say", "[Server] chat message");
  112. command.register("script", "Script-Commands");
  113. command.register("settings", "Opens settings menu");
  114. command.register("seen", "Returns the last date the player was online");
  115. //command.register("senditem", "Sends an itemstack to another player");
  116. command.register("setmessage", "Set your join/leave-message");
  117. command.register("setrank", "");
  118. command.register("setservermessage", "Sets the server-message in the serverlist");
  119. command.register("setspawn", "Changes a spawn");
  120. command.register("shop", "Shop-Commands");
  121. command.register("sign", "Edit a sign");
  122. command.register("silentjoin", "Toggles your silentjoins");
  123. command.register("skills", "Shows all skills");
  124. command.register("skipnight", "Skips the night");
  125. command.register("spawn", "Teleports to spawn");
  126. command.register("speed", "Sets your speed");
  127. command.register("sponsor", "See what a sponsor can do");
  128. command.register("start", "Starts a script");
  129. command.register("startgame", "Reduces start-countdown for a minigame");
  130. command.register("stats", "Statistics-Commands");
  131. //command.register("stopadventure", "Stops an adventure");
  132. command.register("suicide", "Kill yourself");
  133. command.register("support", "Creates a ticket for support");
  134. command.register("tempban", "Bans a player temporarly");
  135. command.register("tempfly", "Let a player temporarly fly");
  136. command.register("ticket", "Ticket-Commands");
  137. command.register("time", "Time-Commands");
  138. command.register("tip", "Tip-Commands");
  139. command.register("top", "Teleports to to highest point at the current position");
  140. command.register("tp", "Teleport command");
  141. command.register("tpa", "Sends a teleport request to a player");
  142. command.register("tpahere", "Sends a teleport request to a player");
  143. command.register("tpaccept", "Accepts a teleport request");
  144. command.register("tpaccepthere", "Accepts a teleport request");
  145. command.register("tppos", "Teleports to coordinates");
  146. command.register("unban", "Unbans a player");
  147. command.register("unjail", "Releases a player from jail");
  148. command.register("unmute", "Unmutes a player");
  149. command.register("user", "Returns infos about a user");
  150. command.register("vanish", "Vanishes a player");
  151. command.register("var", "Reads variables from a scripts");
  152. command.register("vote", "Show vote links");
  153. command.register("voteshop", "Show vote rewars");
  154. command.register("warn", "Warns a player");
  155. command.register("warp", "Warp-Commands");
  156. command.register("weather", "Weather-Commands");
  157. command.register("world", "World-Commands");
  158. command.registerAlias("as", "armorstand");
  159. command.registerAlias("h", "home");
  160. command.registerAlias("skull", "head");
  161. command.registerAlias("r", "answer");
  162. command.registerAlias("pardon", "unban");
  163. command.registerAlias("j", "jumpto");
  164. command.registerAlias("mimimi", "help");
  165. command.registerAlias("ci", "copyisland");
  166. command.registerAlias("mem", "memory");
  167. command.registerAlias("ram", "memory");
  168. command.registerAlias("colour", "color");
  169. command.registerAlias("gm", "gamemode");
  170. command.registerAlias("p", "plot");
  171. command.registerAlias("dt", "datatools");
  172. command.registerAlias("l", "leave");
  173. command.registerAlias("hub", "leave");
  174. command.registerAlias("v", "vanish");
  175. command.registerAlias("fuckit", "giveup");
  176. command.registerAlias("thor", "lightning");
  177. composter_par = particle.get("COMPOSTER");
  178. wall_signs_tag = block.getTag("minecraft:wall_signs");
  179. beds_tag = block.getTag("minecraft:beds");
  180. chest_tag = block.getTag("km:container");
  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, 0);
  699. if(line0 != "§3[§bFree Plot§3]") {
  700. goto("wait");
  701. }
  702. price = read.number(string.removeFormat(sign.getString(block, 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, 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. snuvi.debug("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, 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, 0, "[Shop]");
  1363. sign.setString(sign_block, 3, string.number(player.getId(player)));
  1364. msg.prefix(player, prefix_shop, "Created Shop.");
  1365. goto("wait");
  1366. }
  1367. if(arg0 == "buy" || arg0 == "sell") {
  1368. if(size != 3) {
  1369. msg.prefix(player, prefix_shop, string.concat("§6/shop ", arg0, " <amount> <price>"));
  1370. goto("wait");
  1371. }
  1372. amount = list.getIndex(args, 1);
  1373. price = list.getIndex(args, 2);
  1374. if(!isDouble(amount) || !isDouble(price)) {
  1375. msg.prefix(player, prefix_shop, "Number expected.");
  1376. goto("wait");
  1377. }
  1378. amount = math.round(amount);
  1379. if(amount < 0) {
  1380. msg.prefix(player, prefix_shop, "Positive number expected.");
  1381. goto("wait");
  1382. }
  1383. if(price < 0) {
  1384. msg.prefix(player, prefix_shop, "Positive number expected.");
  1385. goto("wait");
  1386. }
  1387. if(price > 266304) {
  1388. msg.prefix(player, prefix_shop, string.concat("Maximum ", money.getString(266304), " allowed."));
  1389. goto("wait");
  1390. }
  1391. sign_block = player.getTargetBlock(player, 5, false, false);
  1392. if(!block.isWallSign(sign_block)) {
  1393. msg.prefix(player, prefix_shop, "Look at a wall sign.");
  1394. goto("wait");
  1395. }
  1396. chest_block = block.mod(sign_block, 0, -1, 0);
  1397. if(!block.isChest(chest_block)) {
  1398. msg.prefix(player, prefix_shop, "No chest under sign.");
  1399. goto("wait");
  1400. }
  1401. if(!shop.isOwner(player, sign_block)) {
  1402. msg.prefix(player, prefix_shop, "You are not the owner.");
  1403. goto("wait");
  1404. }
  1405. if(arg0 == "buy") {
  1406. sign.setString(sign_block, 1, string.concat("Buy ", string.number(amount), " for ", string.number(price)));
  1407. } else {
  1408. sign.setString(sign_block, 2, string.concat("Sell ", string.number(amount), " for ", string.number(price)));
  1409. }
  1410. msg.prefix(player, prefix_shop, "Price set.");
  1411. goto("wait");
  1412. }
  1413. if(arg0 == "remove") {
  1414. if(size != 2) {
  1415. msg.prefix(player, prefix_shop, "§6/shop remove <buy/sell>");
  1416. goto("wait");
  1417. }
  1418. sign_block = player.getTargetBlock(player, 5, false, false);
  1419. if(!block.isWallSign(sign_block)) {
  1420. msg.prefix(player, prefix_shop, "Look at a wall sign.");
  1421. goto("wait");
  1422. }
  1423. chest_block = block.mod(sign_block, 0, -1, 0);
  1424. if(!block.isChest(chest_block)) {
  1425. msg.prefix(player, prefix_shop, "No chest under sign.");
  1426. goto("wait");
  1427. }
  1428. if(!shop.isOwner(player, sign_block)) {
  1429. msg.prefix(player, prefix_shop, "You are not the owner.");
  1430. goto("wait");
  1431. }
  1432. arg1 = string.toLowerCase(list.getIndex(args, 1));
  1433. if(arg1 == "buy") {
  1434. sign.setString(sign_block, 1, "");
  1435. } elseif(arg1 == "sell") {
  1436. sign.setString(sign_block, 2, "");
  1437. } else {
  1438. msg.prefix(player, prefix_shop, "§6/shop remove <buy/sell>");
  1439. goto("wait");
  1440. }
  1441. msg.prefix(player, prefix_shop, "Price removed.");
  1442. goto("wait");
  1443. }
  1444. if(arg0 == "owner") {
  1445. if(!perm.has("shop.owner", player)) {
  1446. perm.no("shop.owner", player);
  1447. goto("wait");
  1448. }
  1449. if(size != 2) {
  1450. msg.prefix(player, prefix_shop, "§6/shop owner <player>");
  1451. goto("wait");
  1452. }
  1453. p_name = list.getIndex(args, 1);
  1454. p_uuid = player.getUuid(p_name);
  1455. if(p_uuid == null) {
  1456. msg.prefix(player, prefix_shop, "This player has never been online.");
  1457. goto("wait");
  1458. }
  1459. sign_block = player.getTargetBlock(player, 5, false, false);
  1460. if(!block.isWallSign(sign_block)) {
  1461. msg.prefix(player, prefix_shop, "Look at a wall sign.");
  1462. goto("wait");
  1463. }
  1464. sign.setString(sign_block, 3, string.number(player.getId(p_uuid)));
  1465. goto("wait");
  1466. }
  1467. goto("shop_help");
  1468. @mailbox
  1469. location = entity.getLocation(player);
  1470. world_name = world.getName(loc.getWorld(entity.getLocation(player)));
  1471. if(!world.isSurvName(world_name)) {
  1472. msg.prefix(player, prefix_commands, "You can´t use this command in this world.");
  1473. goto("wait");
  1474. }
  1475. if(player.isOnAdventure(player) && !perm.has("mailbox.other", player)) {
  1476. msg.prefix(player, prefix_commands, "You can´t use the mailbox while on adventure.");
  1477. goto("wait");
  1478. }
  1479. if(size == 0) {
  1480. msg.prefix(player, prefix_commands, "/mailbox...");
  1481. if(perm.has("mailbox.other", player)) {
  1482. msg.string(player, "§6 - show [player] §rOpens a mailbox of a player.");
  1483. } else {
  1484. msg.string(player, "§6 - show §rOpens your mailbox.");
  1485. }
  1486. msg.string(player, "§6 - send <player> §rSends the item in your hand to a mailbox of a player.");
  1487. goto("wait");
  1488. }
  1489. arg0 = string.toLowerCase(list.getIndex(args, 0));
  1490. if(arg0 == "send") {
  1491. if(size != 2) {
  1492. msg.prefix(player, prefix_commands, "/mailbox send <player>");
  1493. goto("wait");
  1494. }
  1495. item = living.getHand(player);
  1496. if(item.isAir(item)) {
  1497. msg.prefix(player, prefix_commands, "You have to hold an item in your mainhand.");
  1498. goto("wait");
  1499. }
  1500. to_name = list.getIndex(args, 1);
  1501. if(!checkIfEverOnline(to_name)) {
  1502. msg.prefix(player, prefix_commands, "This player has never been online.");
  1503. goto("wait");
  1504. }
  1505. to_player_id = player.getId(player.getUuid(to_name));
  1506. if(!mailbox.sendItem(to_player_id, item)) {
  1507. msg.prefix(player, prefix_commands, "No free space in mailbox.");
  1508. goto("wait");
  1509. }
  1510. living.setEquip(player, read.slot("HAND"), null);
  1511. msg.send(player, to_name, prefix_commands, string.concat(player.getName(player), " sent you items to your mailbox."), true);
  1512. msg.prefix(player, prefix_commands, "Item sent to player.");
  1513. goto("wait");
  1514. }
  1515. if(arg0 == "show") {
  1516. if(size == 1) {
  1517. player_id = player.getId(player);
  1518. mailbox.show(player, player_id, false);
  1519. mailbox.clear(player_id);
  1520. goto("wait");
  1521. }
  1522. if(size == 2) {
  1523. if(!perm.has("mailbox.other", player)) {
  1524. perm.no("mailbox.other", player);
  1525. goto("wait");
  1526. }
  1527. from_name = list.getIndex(args, 1);
  1528. if(!checkIfEverOnline(from_name)) {
  1529. msg.prefix(player, prefix_commands, "This player has never been online.");
  1530. goto("wait");
  1531. }
  1532. from_player_id = player.getId(player.getUuid(from_name));
  1533. mailbox.show(player, from_player_id, true);
  1534. goto("wait");
  1535. }
  1536. if(perm.has("mailbox.other", player)) {
  1537. msg.prefix(player, prefix_commands, "/mailbox show [player]");
  1538. } else {
  1539. msg.prefix(player, prefix_commands, "/mailbox show");
  1540. }
  1541. }
  1542. goto("wait");
  1543. @RickRole_play
  1544. if(rickIndex < rick_sounds_amount) {
  1545. pitch = list.getIndex(RickRollSounds, rickIndex);
  1546. PlayVoteSound(pitch);
  1547. ticks = 2 + list.getIndex(RickRollSoundDists, rickIndex);
  1548. sgoto(ticks, "RickRole_play");
  1549. }
  1550. rickIndex++;
  1551. goto("wait");
  1552. @bobbycar_play
  1553. if(bobbycarIndex < bcar_sounds_amount) {
  1554. pitch = list.getIndex(bobbyCarSounds, bobbycarIndex);
  1555. PlayVoteSound(pitch);
  1556. ticks = list.getIndex(bobbyCarSoundDists, bobbycarIndex);
  1557. sgoto(ticks, "bobbycar_play");
  1558. }
  1559. bobbycarIndex++;
  1560. goto("wait");
  1561. function PlayVoteSound(pitch) {
  1562. iter = iterator(players.toList());
  1563. while(hasNext(iter)) {
  1564. online_player = next(iter);
  1565. if(online_player == null) {
  1566. continue;
  1567. }
  1568. sound.spawnForPlayer(online_player, $sound_flute, $sound_category_master, 1, pitch);
  1569. sound.spawnForPlayer(online_player, $sound_harp, $sound_category_master, 1, pitch);
  1570. sound.spawnForPlayer(online_player, $sound_pling, $sound_category_master, 1, pitch);
  1571. }
  1572. }
  1573. @resetMoneyBoost
  1574. money.setBoostFactor(1);
  1575. online_list = players.toList();
  1576. iter = iterator(online_list);
  1577. while(hasNext(iter)) {
  1578. p = next(iter);
  1579. sb.remove(p, 5);
  1580. }
  1581. goto("wait");
  1582. @skip_night_loop
  1583. skip_night_counter--;
  1584. if(skip_night_counter == 0) {
  1585. msg.online(prefix_commands, "Skip night results:");
  1586. msg("online", text.new(string.concat("§e - §rYes: §e", string.number(skip_night_yes))));
  1587. msg("online", text.new(string.concat("§e - §rNo: §e", string.number(skip_night_no))));
  1588. msg("online", text.new(string.concat("§e - §rI don´t care: §e", string.number(skip_night_no_care))));
  1589. if(skip_night_yes > skip_night_no) {
  1590. world = world.getOverWorld();
  1591. world.setTime(world, 0);
  1592. }
  1593. set.clear(skip_night_set);
  1594. last_skip_night = time.getMillis();
  1595. iter = iterator(skip_night_yes_list);
  1596. while(hasNext(iter)) {
  1597. p = player.get(next(iter));
  1598. if(p != null) {
  1599. player.resetSleep(p);
  1600. }
  1601. }
  1602. sgoto(8400, "reset_skip_night");
  1603. goto("wait");
  1604. }
  1605. sgoto(20, "skip_night_loop");
  1606. goto("wait");
  1607. @reset_skip_night
  1608. skip_night_started = false;
  1609. goto("wait");
  1610. @skills
  1611. //skills [player]
  1612. if(size == 0) {
  1613. skill.showAll(player, player);
  1614. goto("wait");
  1615. }
  1616. if(!perm.has("skills.other", player)) {
  1617. perm.no("skills.other", player);
  1618. goto("wait");
  1619. }
  1620. p_name = list.getIndex(args, 0);
  1621. p_uuid = player.getUuid(p_name);
  1622. if(p_uuid == null) {
  1623. msg.prefix(player, prefix_tips, "This player has never been online.");
  1624. goto("wait");
  1625. }
  1626. from_p_id = player.getId(p_uuid);
  1627. skill.showAll(from_p_id, player);
  1628. goto("wait");
  1629. @infopoint1
  1630. msg.string(player, string.getSpacer());
  1631. msg.prefix(player, "§eSurvival", "§aEnjoy our modded survival feeling. New ores, items and displays, and we are still beginner friendly.");
  1632. goto("wait");
  1633. @infopoint2
  1634. msg.string(player, string.getSpacer());
  1635. 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.");
  1636. goto("wait");
  1637. @infopoint3
  1638. msg.string(player, string.getSpacer());
  1639. msg.prefix(player, "§ePlots", "§aClaim land and protect your buildings against other players. Use /plot to create and manage your plots.");
  1640. goto("wait");
  1641. @infopoint4
  1642. msg.string(player, string.getSpacer());
  1643. 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.");
  1644. goto("wait");
  1645. @infopoint5
  1646. msg.string(player, string.getSpacer());
  1647. 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.");
  1648. goto("wait");
  1649. @infopoint6
  1650. msg.string(player, string.getSpacer());
  1651. 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.");
  1652. goto("wait");
  1653. @infopoint7
  1654. msg.string(player, string.getSpacer());
  1655. msg.prefix(player, "§eMinigames", "§aWe offer a range of different single- and multiplayer games.");
  1656. goto("wait");
  1657. @infopoint8
  1658. msg.string(player, string.getSpacer());
  1659. msg.prefix(player, "§eQuests", "§aYou are nice and helpful? There are lots of tasks to do in the villages.");
  1660. goto("wait");
  1661. @infopoint9
  1662. msg.string(player, string.getSpacer());
  1663. msg.prefix(player, "§eRanking", "§aWanna rise in rank and be the best player in every branch? Look at our ranks.");
  1664. goto("wait");
  1665. @infopoint10
  1666. msg.string(player, string.getSpacer());
  1667. msg.prefix(player, "§eRules", "§aThere is at least one rule: Be respectful. Look at our fake rules.");
  1668. goto("wait");
  1669. @infopoint11
  1670. msg.string(player, string.getSpacer());
  1671. msg.prefix(player, "§eNote", "§aEverything is self-coded. Worldedit is the only external mod we use.");
  1672. goto("wait");
  1673. @infopoint12
  1674. msg.string(player, string.getSpacer());
  1675. msg.prefix(player, "§eNote", "§aBe Creative in our creative world.");
  1676. goto("wait");
  1677. @party
  1678. if(size == 0) {
  1679. @partyhelp
  1680. msg.prefix(player, prefix_party, "/party ...");
  1681. msg.string(player, "§5 - invite <player> §rInvite a player");
  1682. msg.string(player, "§5 - accept <player> §rAccept an invitation");
  1683. msg.string(player, "§5 - deny <player> §rDeny an invitation");
  1684. msg.string(player, "§5 - kick <player> §rKick a player");
  1685. msg.string(player, "§5 - leave §rLeave the party");
  1686. msg.string(player, "§5 - promote <player> §rPromote a player");
  1687. msg.string(player, "§5 - demote <player> §rDemote a player");
  1688. msg.string(player, "§5 - disband §rDisband a party");
  1689. msg.string(player, "§5 - list §rParty information");
  1690. msg.string(player, "§5 - <message> §rSends a party message");
  1691. goto("wait");
  1692. }
  1693. arg0 = string.toLowerCase(list.getIndex(args, 0));
  1694. if(arg0 == "list") {
  1695. if(size != 1) {
  1696. msg.prefix(player, prefix_party, "§5/party list");
  1697. } else {
  1698. if(!player.isInParty(player)) {
  1699. msg.prefix(player, prefix_party, "You are not in a party.");
  1700. goto("wait");
  1701. }
  1702. list = party.getList(player.getPartyId(player));
  1703. width = 1;
  1704. if(list.getSize(list) > 9) {
  1705. width = 2;
  1706. }
  1707. table = table.new("§5", width, 13, 7);
  1708. msg.string(player, table.getStart(table));
  1709. msg.string(player, table.get(table, "§d#", "§d§lName", "§d§lRole"));
  1710. msg.string(player, table.getMiddle(table));
  1711. iter = iterator(list);
  1712. c = 0;
  1713. while(hasNext(iter)) {
  1714. c++;
  1715. p = player.get(next(iter));
  1716. msg.string(player, table.get(table, string.number(c), player.getName(p), player.getPartyRank(p)));
  1717. }
  1718. msg.string(player, table.getEnd(table));
  1719. }
  1720. goto("wait");
  1721. }
  1722. if(arg0 == "leave") {
  1723. if(size != 1) {
  1724. msg.prefix(player, prefix_party, "§5/party leave");
  1725. } else {
  1726. if(!player.isInParty(player)) {
  1727. msg.prefix(player, prefix_party, "You are not in a party.");
  1728. goto("wait");
  1729. }
  1730. party.kickPlayer(player, "leave");
  1731. }
  1732. goto("wait");
  1733. }
  1734. if(arg0 == "disband") {
  1735. if(size != 1) {
  1736. msg.prefix(player, prefix_party, "§5/party disband");
  1737. } else {
  1738. if(!player.isInParty(player)) {
  1739. msg.prefix(player, prefix_party, "You are not in a party.");
  1740. goto("wait");
  1741. }
  1742. if(!player.isPartyLeader(player)) {
  1743. msg.prefix(player, prefix_party, "You are not the party leader.");
  1744. goto("wait");
  1745. }
  1746. party.delete(player.getPartyId(player));
  1747. }
  1748. goto("wait");
  1749. }
  1750. if(arg0 == "kick") {
  1751. if(size != 2) {
  1752. msg.prefix(player, prefix_party, "§5/party kick <player>");
  1753. } else {
  1754. if(!player.isInParty(player)) {
  1755. msg.prefix(player, prefix_party, "You are not in a party.");
  1756. goto("wait");
  1757. }
  1758. if(!player.isPartyLeaderOrMod(player)) {
  1759. msg.prefix(player, prefix_party, "You are not leader or moderator of the party.");
  1760. goto("wait");
  1761. }
  1762. pname = list.getIndex(args, 1);
  1763. if(!checkIfEverOnline(pname)) {
  1764. msg.prefix(player, prefix_party, "This player has never been online.");
  1765. goto("wait");
  1766. }
  1767. p = read.player(pname);
  1768. if(p == null) {
  1769. msg.prefix(player, prefix_party, "This player is not online.");
  1770. goto("wait");
  1771. }
  1772. if(player == p) {
  1773. msg.prefix(player, prefix_party, "You can´t apply that to yourself.");
  1774. goto("wait");
  1775. }
  1776. if(!party.same(p, player)) {
  1777. msg.prefix(player, prefix_party, "This player is not in your party.");
  1778. goto("wait");
  1779. }
  1780. ownrank = player.getPartyRank(player);
  1781. if(ownrank == "Moderator") {
  1782. if(player.isPartyLeaderOrMod(p)) {
  1783. msg.prefix(player, prefix_party, "You can´t kick this player.");
  1784. goto("wait");
  1785. }
  1786. }
  1787. party.kickPlayer(p, "kick");
  1788. }
  1789. goto("wait");
  1790. }
  1791. if(arg0 == "promote" || arg0 == "demote") {
  1792. if(size != 2) {
  1793. msg.prefix(player, prefix_party, string.concat("§5/party ", arg0, " <player>"));
  1794. } else {
  1795. pname = list.getIndex(args, 1);
  1796. if(!player.isInParty(player)) {
  1797. msg.prefix(player, prefix_party, "You are not in a party.");
  1798. goto("wait");
  1799. }
  1800. if(!player.isPartyLeader(player)) {
  1801. msg.prefix(player, prefix_party, "You are not the party leader.");
  1802. goto("wait");
  1803. }
  1804. if(!checkIfEverOnline(pname)) {
  1805. msg.prefix(player, prefix_party, "This player has never been online.");
  1806. goto("wait");
  1807. }
  1808. p = read.player(pname);
  1809. if(p == null) {
  1810. msg.prefix(player, prefix_party, "This player is not online.");
  1811. goto("wait");
  1812. }
  1813. if(player == p) {
  1814. msg.prefix(player, prefix_party, "You can´t apply that to yourself.");
  1815. goto("wait");
  1816. }
  1817. if(!party.same(p, player)) {
  1818. msg.prefix(player, prefix_party, "This player is not in your party.");
  1819. goto("wait");
  1820. }
  1821. partyid = player.getPartyId(player);
  1822. rank = player.getPartyRank(p);
  1823. if(arg0 == "promote") {
  1824. if(rank == "Player") {
  1825. player.setPartyRank(p, "Moderator");
  1826. party.sendMessage(partyid, string.concat("§r", pname, " is now Moderator."));
  1827. } elseif(rank == "Moderator") {
  1828. player.setPartyRank(p, "Leader");
  1829. player.setPartyRank(player, "Moderator"); //Ex-Leader degradieren
  1830. party.sendMessage(partyid, string.concat("§r", pname, " is now Leader."));
  1831. }
  1832. } elseif(arg0 == "demote") {
  1833. if(rank == "Moderator") {
  1834. player.setPartyRank(p, "Player");
  1835. party.sendMessage(partyid, string.concat("§r", pname, " is no longer Moderator."));
  1836. } else {
  1837. msg.prefix(player, prefix_party, "This player cannot be demoted.");
  1838. }
  1839. }
  1840. }
  1841. goto("wait");
  1842. }
  1843. if(arg0 == "invite") {
  1844. if(size != 2) {
  1845. msg.prefix(player, prefix_party, "§5/party invite <player>");
  1846. } else {
  1847. p_name = list.getIndex(args, 1);
  1848. if(!checkIfEverOnline(p_name)) {
  1849. msg.prefix(player, prefix_party, "This player has never been online.");
  1850. goto("wait");
  1851. }
  1852. p = read.player(p_name);
  1853. temp = party.invitePlayer(player, p);
  1854. if(temp == "inviteeNotOnline") {
  1855. msg.prefix(player, prefix_party, "This player is not online.");
  1856. } elseif(temp == "inviterEqualsInvitee") {
  1857. msg.prefix(player, prefix_party, "You can´t apply that to yourself.");
  1858. } elseif(temp == "inviterNotPermitted") {
  1859. msg.prefix(player, prefix_party, "You are not leader or moderator of the party.");
  1860. } elseif(temp == "inviteeAlreadyInParty") {
  1861. msg.prefix(player, prefix_party, "This player is already in your party.");
  1862. } elseif(temp == "inviteeAlreadyInvited") {
  1863. msg.prefix(player, prefix_party, "This player already has an invitation from you.");
  1864. } else {
  1865. msg.prefix(player, prefix_party, "Invitation sent.");
  1866. }
  1867. }
  1868. goto("wait");
  1869. }
  1870. if(arg0 == "accept") {
  1871. if(size != 2) {
  1872. msg.prefix(player, prefix_party, "§5/party accept <player>");
  1873. } else {
  1874. if(player.isInParty(player)) {
  1875. msg.prefix(player, prefix_party, "You are already in a party.");
  1876. goto("wait");
  1877. }
  1878. pname = list.getIndex(args, 1);
  1879. if(!checkIfEverOnline(pname)) {
  1880. msg.prefix(player, prefix_party, "This player has never been online.");
  1881. goto("wait");
  1882. }
  1883. p = read.player(pname);
  1884. if(p == null) {
  1885. msg.prefix(player, prefix_party, "This player is no longer online.");
  1886. goto("wait");
  1887. }
  1888. player_uuid = player.getUuid(player);
  1889. p_uuid = player.getUuid(p);
  1890. list = map.get(party_invitations, player_uuid);
  1891. if(list == null || !list.contains(list, p_uuid)) {
  1892. msg.prefix(player, prefix_party, "This invitation is invalid.");
  1893. goto("wait");
  1894. }
  1895. if(player.isInParty(p)) { //wenn einlader bereits in party
  1896. partyid = player.getPartyId(p);
  1897. if(map.get(party_invite_ids, p_uuid) == partyid) { //wenn partyid noch die gleiche ist wie bei einladung
  1898. party.addPlayer(partyid, player);
  1899. player.setPartyRank(player, "Player");
  1900. } else {
  1901. msg.prefix(player, prefix_party, "This player is already in another party.");
  1902. goto("wait");
  1903. }
  1904. } else {
  1905. partyid = map.get(party_invite_ids, p_uuid);
  1906. party.setList(partyid, list.new());
  1907. party.addPlayer(partyid, p);
  1908. party.addPlayer(partyid, player);
  1909. player.setPartyRank(p, "Leader");
  1910. player.setPartyRank(player, "Player");
  1911. msg.prefix(p, prefix_party, "The party was created.");
  1912. }
  1913. list.clear(list); //Einladungs-Liste von oben
  1914. party.sendMessage(partyid, string.concat("§r", player.getName(player), " joined the party."));
  1915. }
  1916. goto("wait");
  1917. }
  1918. if(arg0 == "deny") {
  1919. if(size != 2) {
  1920. msg.prefix(player, prefix_party, "§5/party deny <player>");
  1921. } else {
  1922. player_uuid = player.getUuid(player);
  1923. list = map.get(party_invitations, player_uuid);
  1924. if(list != null) {
  1925. pname = list.getIndex(args, 1);
  1926. p = read.player(pname);
  1927. if(p == null) {
  1928. msg.prefix(player, prefix_party, "This player is no longer online.");
  1929. goto("wait");
  1930. }
  1931. p_uuid = player.getUuid(p);
  1932. if(list == null || !list.contains(list, p_uuid)) {
  1933. msg.prefix(player, prefix_party, "This invitation is invalid.");
  1934. goto("wait");
  1935. }
  1936. index = list.getIndexOf(list, p_uuid);
  1937. list.remove(list, p_uuid);
  1938. keytimes = map.get(delkeytimes, player_uuid);
  1939. list.removeIndex(keytimes, index);
  1940. p = read.player(pname);
  1941. if(p != null) {
  1942. msg.prefix(p, prefix_party, string.concat("§r", player.getName(player), " has denied your invitation."));
  1943. }
  1944. msg.prefix(player, prefix_party, string.concat("Invitation from ", pname, " denied."));
  1945. }
  1946. }
  1947. goto("wait");
  1948. }
  1949. if(player.isInParty(player)) {
  1950. message = string.concat(player.getName(player), " §1| §r", string.concatList(args, " ", 0, list.getSize(args) - 1));
  1951. party.sendMessage(player.getPartyId(player), message);
  1952. goto("wait");
  1953. }
  1954. goto("partyhelp");
  1955. @setmessage
  1956. if(size == 0) {
  1957. @setmessagehelp
  1958. msg.prefix(player, prefix_commands, "/setmessage ...");
  1959. msg.string(player, "§e- join <message> §rSets your join message");
  1960. msg.string(player, "§e- leave <message> §rSets your leave message");
  1961. msg.string(player, "§e- death <message> §rSets your death message");
  1962. msg.string(player, "§e- info §rShows you set messages");
  1963. if(perm.has("setmessage.delete", player)) {
  1964. msg.string(player, "§e- delete <player> §rDeletes a players messages");
  1965. }
  1966. goto("wait");
  1967. }
  1968. arg0 = string.toLowerCase(list.getIndex(args, 0));
  1969. if(arg0 == "info") {
  1970. if(player.usesCustomMessage(player)) {
  1971. msg.prefix(player, prefix_commands, "Custom messages are activated.");
  1972. } else {
  1973. msg.prefix(player, prefix_commands, "Custom messages are deactivated. /settings");
  1974. }
  1975. fullname = player.getFullName(player);
  1976. message = player.getJoinMessage(player);
  1977. if(message == null) {
  1978. msg.prefix(player, prefix_commands, "No join message set.");
  1979. } else {
  1980. msg.prefix(player, prefix_commands, string.concat("§a§l> §r", fullname, " §9", message));
  1981. }
  1982. message = player.getLeaveMessage(player);
  1983. if(message == null) {
  1984. msg.prefix(player, prefix_commands, "No leave message set.");
  1985. } else {
  1986. msg.prefix(player, prefix_commands, string.concat("§c§l> §r", fullname, " §9", message));
  1987. }
  1988. message = player.getDeathMessage(player);
  1989. if(message == null) {
  1990. msg.prefix(player, prefix_commands, "No death message set.");
  1991. } else {
  1992. msg.prefix(player, prefix_commands, string.concat("§0§lx §r", fullname, " §9", message));
  1993. }
  1994. goto("wait");
  1995. }
  1996. if(arg0 == "join") {
  1997. if(size < 2) {
  1998. goto("setmessagehelp");
  1999. }
  2000. message = string.concatList(args, " ", 1, size - 1);
  2001. player.setJoinMessage(player, message);
  2002. msg.prefix(player, prefix_commands, "Join message set.");
  2003. goto("wait");
  2004. }
  2005. if(arg0 == "leave") {
  2006. if(size < 2) {
  2007. goto("setmessagehelp");
  2008. }
  2009. message = string.concatList(args, " ", 1, size - 1);
  2010. player.setLeaveMessage(player, message);
  2011. msg.prefix(player, prefix_commands, "Leave message set.");
  2012. goto("wait");
  2013. }
  2014. if(arg0 == "death") {
  2015. if(size < 2) {
  2016. goto("setmessagehelp");
  2017. }
  2018. message = string.concatList(args, " ", 1, size - 1);
  2019. player.setDeathMessage(player, message);
  2020. msg.prefix(player, prefix_commands, "Death message set.");
  2021. goto("wait");
  2022. }
  2023. if(arg0 == "delete") {
  2024. if(size == 1) {
  2025. p_uuid = player.getUuid(player);
  2026. } elseif(size == 2) {
  2027. if(!perm.has("setmessage.delete", player)) {
  2028. perm.no("setmessage.delete", player);
  2029. goto("wait");
  2030. }
  2031. p_name = list.getIndex(args, 1);
  2032. if(!checkIfEverOnline(p_name)) {
  2033. msg.prefix(player, prefix_commands, "This player has never been online.");
  2034. goto("wait");
  2035. }
  2036. p_uuid = player.getUuid(p_name);
  2037. } else {
  2038. goto("setmessagehelp");
  2039. }
  2040. p_id = player.getId(p_uuid);
  2041. player.setJoinMessage(p_id, "null");
  2042. player.setLeaveMessage(p_id, "null");
  2043. msg.prefix(player, prefix_commands, "Messages deleted.");
  2044. goto("wait");
  2045. }
  2046. goto("wait");
  2047. @lag
  2048. msg.prefix(player, prefix_commands, "Lag test is performed. Please wait...");
  2049. a = array.new(2);
  2050. a[0] = player.getUuid(player);
  2051. a[1] = time.getMillis();
  2052. list.add(lag_list, a);
  2053. sgoto(100, "do_lag_test");
  2054. goto("wait");
  2055. @do_lag_test
  2056. t = time.getMillis();
  2057. a = list.getIndex(lag_list, 0);
  2058. list.removeIndex(lag_list, 0);
  2059. p_uuid = a[0];
  2060. t_old = a[1];
  2061. t = math.roundComma((t - t_old) / 50 / 5, 2); //ms -> ticks
  2062. t = 40 - t;
  2063. p = player.get(p_uuid);
  2064. if(p != null) {
  2065. msg.prefix(p, prefix_commands, "Expected: 20 ticks/sec");
  2066. msg.prefix(p, prefix_commands, string.concat("Measured: ", string.number(t), " ticks/sec"));
  2067. }
  2068. goto("wait");
  2069. @live
  2070. boolean = !player.isLive(player);
  2071. player.setLive(player, boolean);
  2072. player.setHeadName(player);
  2073. player.setTabName(player);
  2074. msg.prefix(player, prefix_commands, "Live toggled.");
  2075. goto("wait");
  2076. @lightning
  2077. block = player.getTargetBlock(player, 50);
  2078. if(block == null) {
  2079. msg.prefix(player, prefix_commands, "No block in sight.");
  2080. goto("wait");
  2081. }
  2082. entity.spawn(block.getLocation(block), "LIGHTNING");
  2083. goto("wait");
  2084. @ride
  2085. entity = player.getTargetEntity(player, 5);
  2086. if(entity == null) {
  2087. msg.prefix(player, prefix_commands, "No entity found.");
  2088. goto("wait");
  2089. }
  2090. world_name = world.getName(loc.getWorld(entity.getLocation(player)));
  2091. if(world.isGamesName(world_name)) {
  2092. if(player.hasMinigame(player) || (perm.has("ride", player) && !perm.has("isTeam", player))) {
  2093. msg.prefix(player, prefix_commands, "You can´t use this now.");
  2094. goto("wait");
  2095. }
  2096. }
  2097. entity.mount(player, entity);
  2098. goto("wait");
  2099. @vanish
  2100. //vanish [on/off] [player]
  2101. if(size == 0) {
  2102. if(set.contains(vanish_set, player.getUuid(player))) {
  2103. bool = "off";
  2104. } else {
  2105. bool = "on";
  2106. }
  2107. }
  2108. if(size >= 1) {
  2109. bool = list.getIndex(args, 0);
  2110. }
  2111. if(size > 1) {
  2112. p_name = list.getIndex(args, 1);
  2113. p = read.player(p_name);
  2114. if(p == null) {
  2115. msg.prefix(player, prefix_commands, "This player is not online.");
  2116. goto("wait");
  2117. }
  2118. } else {
  2119. p = player;
  2120. }
  2121. p_name = player.getName(p);
  2122. player_name = player.getName(player);
  2123. if(bool == "on") {
  2124. if(p != player) {
  2125. msg.prefix(player, prefix_commands, string.concat(p_name, " has been vanished."));
  2126. msg.prefix(p, prefix_commands, string.concat("You have been vanished by ", player_name, "."));
  2127. } else {
  2128. msg.prefix(p, prefix_commands, "You are vanished.");
  2129. }
  2130. set.add(vanish_set, player.getUuid(p));
  2131. player.hideOnline(p);
  2132. } elseif(bool == "off") {
  2133. if(p != player) {
  2134. msg.prefix(player, prefix_commands, string.concat(p_name, " is no longer vanished."));
  2135. msg.prefix(p, prefix_commands, string.concat("You are no longer vanished caused by ", player_name, "."));
  2136. } else {
  2137. msg.prefix(p, prefix_commands, "You are no longer vanished.");
  2138. }
  2139. set.remove(vanish_set, player.getUuid(p));
  2140. player.showOnline(p);
  2141. } else {
  2142. msg.prefix(player, prefix_commands, "/vanish [on/off] [player]");
  2143. }
  2144. goto("wait");
  2145. @user
  2146. if(size == 0) {
  2147. @user_help
  2148. msg.prefix(sender, prefix_commands, "/user ...");
  2149. if(perm.has("user.other", player)) {
  2150. msg.string(sender, "§6 - info [player] §rReturns info about a user");
  2151. } else {
  2152. msg.string(sender, "§6 - info §rReturns info about you");
  2153. }
  2154. if(perm.has("user.money", player)) {
  2155. msg.string(sender, "§6 - addmoney <player> <money> §rAdds money to a player");
  2156. msg.string(sender, "§6 - setmoney <player> <money> §rSets the money of a player");
  2157. }
  2158. goto("wait");
  2159. }
  2160. arg0 = string.toLowerCase(list.getIndex(args, 0));
  2161. if(arg0 == "info") {
  2162. if(size < 2) {
  2163. if(!isPlayer(sender)) {
  2164. msg.prefix(sender, prefix_commands, "/user info <player>");
  2165. goto("wait");
  2166. }
  2167. p_name = player.getName(player);
  2168. p_uuid = player.getUuid(p_name);
  2169. } else {
  2170. if(!perm.has("user.other", sender)) {
  2171. perm.no("user.other", sender);
  2172. goto("wait");
  2173. }
  2174. p_name = list.getIndex(args, 1);
  2175. if(!checkIfEverOnline(p_name)) {
  2176. msg.prefix(sender, prefix_commands, "This player has never been online.");
  2177. goto("wait");
  2178. }
  2179. p_uuid = player.getUuid(p_name);
  2180. p_name = player.getName(p_uuid);
  2181. }
  2182. p = read.player(p_name);
  2183. p_id = player.getId(p_uuid);
  2184. if(p == null) {
  2185. p_or_id = p_id;
  2186. } else {
  2187. p_or_id = p;
  2188. }
  2189. table = table.new("§8", 7, 24);
  2190. msg.string(sender, table.getStart(table));
  2191. msg.string(sender, table.get(table, "Player", p_name));
  2192. msg.string(sender, table.getMiddle(table));
  2193. msg.string(sender, table.get(table, "Playtime", string.number(math.roundDown(player.getTotalPlaytime(p_or_id) / 60))));
  2194. msg.string(sender, table.get(table, "Joins", string.number(player.getJoins(p_or_id))));
  2195. msg.string(sender, table.get(table, "First Join", time.getDateString(player.getFirstJoin(p_or_id))));
  2196. msg.string(sender, table.get(table, "Last Join", time.getDateString(player.getLastJoin(p_or_id))));
  2197. if(perm.has("user.other", sender)) {
  2198. msg.string(sender, table.get(table, "UUID", p_uuid));
  2199. msg.string(sender, table.get(table, "ID", string.number(p_id)));
  2200. if(player.isLive(sender)) {
  2201. msg.string(sender, table.get(table, "IP", "§7§oHidden"));
  2202. } else {
  2203. msg.string(sender, table.get(table, "IP", player.getLoggedIp(p_or_id)));
  2204. }
  2205. snuvis = money.get(p_or_id);
  2206. msg.string(sender, table.get(table, "Money", string.concat(money.getString(snuvis), " (",string.number(snuvis), ")")));
  2207. }
  2208. msg.string(sender, table.get(table, "Rank", getRank(p_or_id)));
  2209. msg.string(sender, table.get(table, "PvP", hasPvpOn(p_or_id)));
  2210. msg.string(sender, table.get(table, "Quests", string.number(quest.getCounter(p_or_id))));
  2211. msg.string(sender, table.get(table, "Adventures", string.number(player.getAdventureAmounts(p_or_id))));
  2212. msg.string(sender, table.getEnd(table));
  2213. goto("wait");
  2214. }
  2215. if(arg0 == "addmoney") {
  2216. if(!perm.has("user.money", sender)) {
  2217. perm.no("user.money", sender);
  2218. goto("wait");
  2219. }
  2220. if(size != 3) {
  2221. msg.prefix(sender, prefix_commands, "/user addmoney <player> <money>");
  2222. goto("wait");
  2223. }
  2224. p_name = list.getIndex(args, 1);
  2225. if(!checkIfEverOnline(p_name)) {
  2226. msg.prefix(sender, prefix_commands, "This player has never been online.");
  2227. goto("wait");
  2228. }
  2229. money = list.getIndex(args, 2);
  2230. if(!isDouble(money)) {
  2231. msg.prefix(sender, prefix_commands, "Number expected.");
  2232. goto("wait");
  2233. }
  2234. p_uuid = player.getUuid(p_name);
  2235. p_id = player.getId(p_uuid);
  2236. money.add(p_id, money);
  2237. msg.prefix(sender, prefix_commands, string.concat("Added ", money.getString(money), " to ", player.getName(p_uuid), "."));
  2238. goto("wait");
  2239. }
  2240. if(arg0 == "setmoney") {
  2241. if(!perm.has("user.money", sender)) {
  2242. perm.no("user.money", sender);
  2243. goto("wait");
  2244. }
  2245. if(size != 3) {
  2246. msg.prefix(sender, prefix_commands, "/user setmoney <player> <money>");
  2247. goto("wait");
  2248. }
  2249. p_name = list.getIndex(args, 1);
  2250. if(!checkIfEverOnline(p_name)) {
  2251. msg.prefix(sender, prefix_commands, "This player has never been online.");
  2252. goto("wait");
  2253. }
  2254. money = list.getIndex(args, 2);
  2255. if(!isDouble(money)) {
  2256. msg.prefix(sender, prefix_commands, "Number expected.");
  2257. goto("wait");
  2258. }
  2259. p_uuid = player.getUuid(p_name);
  2260. p_id = player.getId(p_uuid);
  2261. setMoney(p_id, money);
  2262. msg.prefix(sender, prefix_commands, string.concat("Set ", string.number(money), " snuvis for ", player.getName(p_uuid), "."));
  2263. goto("wait");
  2264. }
  2265. goto("user_help");
  2266. @quest
  2267. if(size == 0) {
  2268. @quest_syntax
  2269. msg.prefix(player, prefix_quest, "/quest ...");
  2270. msg.string(player, "§5 - see §rSee all active quests");
  2271. msg.string(player, "§5 - term <player> §rTerminates a quest of a player");
  2272. goto("wait");
  2273. }
  2274. arg0 = string.toLowerCase(list.getIndex(args, 0));
  2275. if(arg0 == "see") {
  2276. if(size != 1) {
  2277. msg.prefix(player, prefix_quest, "/quest see");
  2278. goto("wait");
  2279. }
  2280. msg.prefix(player, prefix_quest, "Active quests:");
  2281. quest_map = quest.getIds();
  2282. iter = map.iterator(quest_map);
  2283. while(hasNext(iter)) {
  2284. element = next(iter);
  2285. key = map.getKey(element);
  2286. value = map.getValue(element);
  2287. script = script.getFromId(value);
  2288. if(script == null) {
  2289. continue;
  2290. }
  2291. q_name = script.getVar(script, "quest_name");
  2292. stage = script.getVar(script, "stage");
  2293. all_stages = script.getVar(script, "all_stages");
  2294. msg.string(player, string.concat( "§d- §r", player.getName(key), " ", string.number(value), " ", q_name, " (", string.number(stage), "/", string.number(all_stages), ")"));
  2295. }
  2296. goto("wait");
  2297. }
  2298. if(arg0 == "term") {
  2299. if(size != 2) {
  2300. msg.prefix(player, prefix_quest, "/quest term <player>");
  2301. goto("wait");
  2302. }
  2303. p_name = list.getIndex(args, 1);
  2304. if(!checkIfEverOnline(p_name)) {
  2305. msg.prefix(player, prefix_quest, "This player has never been online.");
  2306. goto("wait");
  2307. }
  2308. p = read.player(p_name);
  2309. if(p == null) {
  2310. msg.prefix(player, prefix_quest, "This player is not online.");
  2311. goto("wait");
  2312. }
  2313. script_id = quest.getFromPlayer(p);
  2314. if(script_id == null) {
  2315. msg.prefix(player, prefix_quest, "This player has no quest.");
  2316. goto("wait");
  2317. }
  2318. script = script.getFromId(script_id);
  2319. if(script == null) {
  2320. quest.removePlayer(p);
  2321. msg.prefix(player, prefix_quest, "Corrupt quest terminated.");
  2322. goto("wait");
  2323. }
  2324. setScriptVar("player", p);
  2325. modTimer.scriptCallEvent("quest_term", script);
  2326. quest.term(script, player);
  2327. msg.prefix(player, prefix_quest, "Quest terminated.");
  2328. goto("wait");
  2329. }
  2330. goto("quest_syntax");
  2331. @friend
  2332. if(size == 0) {
  2333. @friend_syntax
  2334. msg.prefix(player, prefix_friends, "/friend ...");
  2335. msg.string(player, "§5 - add <player> §rAdds a friend");
  2336. msg.string(player, "§5 - remove <player> §rRemoves a friend");
  2337. msg.string(player, "§5 - list §rLists all your friends");
  2338. goto("wait");
  2339. }
  2340. arg0 = string.toLowerCase(list.getIndex(args, 0));
  2341. if(arg0 == "add") {
  2342. if(size != 2) {
  2343. msg.prefix(player, prefix_friends, "/friend add <player>");
  2344. goto("wait");
  2345. }
  2346. friend_name = list.getIndex(args, 1);
  2347. player_name = player.getName(player);
  2348. if(player_name == friend_name) {
  2349. msg.prefix(player, prefix_friends, "You can´t invite yourself.");
  2350. goto("wait");
  2351. }
  2352. player_id = player.getId(player);
  2353. if(!checkIfEverOnline(friend_name)) {
  2354. msg.prefix(player, prefix_friends, "This player has never been online.");
  2355. goto("wait");
  2356. }
  2357. friend_id = player.getId(player.getUuid(friend_name));
  2358. if(friend.check(player_id, friend_id)) {
  2359. msg.prefix(player, prefix_friends, "This player is already your friend.");
  2360. goto("wait");
  2361. }
  2362. if(map.contains(friend_requests, friend_id)) {
  2363. if(map.get(friend_requests, friend_id) == player_id) {
  2364. friend.add(player_id, friend_id);
  2365. map.remove(friend_requests, friend_id);
  2366. msg.prefix(player, prefix_friends, string.concat("§7", friend_name, "§r is your friend now."));
  2367. msg.send(player, friend_name, prefix_friends, string.concat("§7", player_name, "§r is your friend now."), true);
  2368. goto("wait");
  2369. }
  2370. }
  2371. map.add(friend_requests, player_id, friend_id); //Einlader, Eingeladener
  2372. friend = read.player(friend_name);
  2373. msg.prefix(player, prefix_friends, string.concat("You sent an invitation to §7", friend_name, "§r."));
  2374. if(friend != null) {
  2375. 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))));
  2376. }
  2377. goto("wait");
  2378. }
  2379. if(arg0 == "remove") {
  2380. if(size != 2) {
  2381. msg.prefix(player, prefix_friends, "/friend remove <player>");
  2382. goto("wait");
  2383. }
  2384. friend_name = list.getIndex(args, 1);
  2385. player_id = player.getId(player);
  2386. if(!checkIfEverOnline(friend_name)) {
  2387. msg.prefix(player, prefix_friends, "This player has never been online.");
  2388. goto("wait");
  2389. }
  2390. friend_id = player.getId(player.getUuid(friend_name));
  2391. if(!friend.check(player_id, friend_id)) {
  2392. msg.prefix(player, prefix_friends, "This player isn´t your friend.");
  2393. goto("wait");
  2394. }
  2395. friend.delete(player_id, friend_id);
  2396. msg.prefix(player, prefix_friends, string.concat("§7", friend_name, "§r is no longer your friend."));
  2397. msg.send(player, friend_name, prefix_friends, string.concat("§7", player.getName(player), "§r is no longer your friend."), true);
  2398. goto("wait");
  2399. }
  2400. if(arg0 == "list") {
  2401. if(size != 1) {
  2402. msg.prefix(player, prefix_friends, "/friend list");
  2403. goto("wait");
  2404. }
  2405. player_id = player.getId(player);
  2406. friendlist = friend.getList(player_id);
  2407. listsize = list.getSize(friendlist);
  2408. if(listsize == 0) {
  2409. msg.prefix(player, prefix_friends, "You have no friends yet.");
  2410. goto("wait");
  2411. }
  2412. msg.string(player, "§5Friends:");
  2413. for(i = 0; i <= listsize - 1; i++) {
  2414. friend_name = player.getNameFromId(list.getIndex(friendlist, i));
  2415. if(friend_name != null) {
  2416. msg.string(player, string.concat("- ", friend_name));
  2417. }
  2418. }
  2419. goto("wait");
  2420. }
  2421. goto("friend_syntax");
  2422. @var
  2423. if(size != 2) {
  2424. msg.prefix(player, prefix_commands, "/var <id> <varname>");
  2425. goto("wait");
  2426. }
  2427. script_id = list.getIndex(args, 0);
  2428. script = script.getFromId(script_id);
  2429. if(script == null) {
  2430. msg.prefix(player, "§dScript", "Invalid id");
  2431. goto("wait");
  2432. }
  2433. var_name = list.getIndex(args, 1);
  2434. var = script.getVar(script, var_name);
  2435. msg.prefix(player, "§dScript", string.concat(var_name, " = ", var));
  2436. goto("wait");
  2437. @vote
  2438. msg.string(player, string.getSpacer());
  2439. if(size == 0) {
  2440. link1 = "https://minecraft-server.eu/vote/index/2227F";
  2441. link2 = "https://minecraft-server-list.com/server/478200/vote/";
  2442. msg(player, text.merge(text.new(string.getPrefix(prefix_vote)), text.new(" "), string.getLinkText("§r<§dminecraft-server.eu§r>", link1)));
  2443. msg(player, text.merge(text.new(string.getPrefix(prefix_vote)), text.new(" "), string.getLinkText("§r<§dminecraft-server-list.com§r>", link2)));
  2444. p_id = player.getId(player);
  2445. } else {
  2446. if(!perm.has("user.other", player)) {
  2447. perm.no("user.other", player);
  2448. goto("wait");
  2449. }
  2450. p_name = list.getIndex(args, 0);
  2451. if(!checkIfEverOnline(p_name)) {
  2452. msg.prefix(player, prefix_commands, "This player has never been online.");
  2453. goto("wait");
  2454. }
  2455. p_id = player.getId(player.getUuid(p_name));
  2456. }
  2457. msg(player, text.merge(text.new(string.getPrefix(prefix_vote)), text.new(" "), text.new(string.concat("Votepoints: §6", string.number(player.getVotePoints(p_id))))));
  2458. msg(player, text.merge(text.new(string.getPrefix(prefix_vote)), text.new(" "), text.new(string.concat("Votestreak: §6", string.number(player.getVoteStreak(p_id))))));
  2459. last_vote_time = player.getLastVoteTime(p_id);
  2460. if(last_vote_time == 0) {
  2461. last_vote_time = "-";
  2462. } else {
  2463. last_vote_time = time.getString(last_vote_time);
  2464. }
  2465. msg(player, text.merge(text.new(string.getPrefix(prefix_vote)), text.new(" "), text.new(string.concat("Last vote: §6", last_vote_time))));
  2466. goto("wait");
  2467. @voteshop
  2468. inv.open(vote_inv, player, string.concat("Your vote points: §6", string.number(player.getVotePoints(player))));
  2469. goto("wait");
  2470. @setservermessage
  2471. if(size < 1) {
  2472. msg.prefix(player, prefix_commands, "/setservermessage <text>");
  2473. goto("wait");
  2474. }
  2475. message = string.concatList(args, " ", 0, size - 1);
  2476. message = string.replace(message, "&", "§");
  2477. setMOTD(message);
  2478. msg.prefix(player, prefix_commands, "Server-Message gesetzt");
  2479. goto("wait");
  2480. @error
  2481. if(size < 1) {
  2482. msg.prefix(player, "§cError", "/error ...");
  2483. msg.string(player, "§c - list §rLists all errors");
  2484. msg.string(player, "§c - clear §rDeletes all errors");
  2485. goto("wait");
  2486. }
  2487. arg0 = string.toLowerCase(list.getIndex(args, 0));
  2488. if(arg0 == "list") {
  2489. error_size = error.getSize();
  2490. if(error_size == 0) {
  2491. msg.prefix(player, "§cError", "No errors existing.");
  2492. goto("wait");
  2493. }
  2494. for(i = 0; i < error_size; i++) {
  2495. msg.string(player, error.getIndex(i));
  2496. }
  2497. goto("wait");
  2498. }
  2499. if(arg0 == "clear") {
  2500. error.clear();
  2501. msg.prefix(player, "§cError", "All errors deleted.");
  2502. goto("wait");
  2503. }
  2504. goto("wait");
  2505. @hat
  2506. item = living.getHand(player);
  2507. if(item.isAir(item)) {
  2508. msg.prefix(player, prefix_commands, "You have to hold an item in hand.");
  2509. goto("wait");
  2510. }
  2511. head_slot = slot.getHead();
  2512. head_item = living.getEquip(player, head_slot);
  2513. living.setEquip(player, head_slot, item);
  2514. living.setEquip(player, slot.getHand(), head_item);
  2515. goto("wait");
  2516. @news
  2517. if(size < 1) {
  2518. msg.prefix(player, prefix_commands, "/news <text>");
  2519. goto("wait");
  2520. }
  2521. message = string.concatList(args, " ", 0, size - 1);
  2522. online_list = players.toList();
  2523. iter = iterator(online_list);
  2524. while(hasNext(iter)) {
  2525. p = next(iter);
  2526. title.send(p, text.new("§cNews"), text.new(string.concat("by ", player.getName(player))));
  2527. msg.prefix(p, "§4News", string.concat("§c", message));
  2528. }
  2529. goto("wait");
  2530. @skipnight
  2531. player_loc = entity.getLocation(player);
  2532. world_name = world.getName(loc.getWorld(player_loc));
  2533. if(!world.isSurvName(world_name)) {
  2534. msg.prefix(player, prefix_commands, "Not possible in this world.");
  2535. goto("wait");
  2536. }
  2537. world_time = world.getTime(world.getOverWorld());
  2538. while(world_time >= 24000) {
  2539. world_time -= 24000;
  2540. }
  2541. if(world_time <= 12500) {
  2542. msg.prefix(player, prefix_commands, "Only during night possible.");
  2543. goto("wait");
  2544. }
  2545. player_uuid = player.getUuid(player);
  2546. if(set.contains(skip_night_set, player_uuid)) {
  2547. msg.prefix(player, prefix_commands, "Already voted.");
  2548. goto("wait");
  2549. }
  2550. if(time.getMillis() - last_skip_night < 420000) {
  2551. msg.prefix(player, prefix_commands, "Only once per night possible.");
  2552. goto("wait");
  2553. }
  2554. inv.open(skip_night_inv, player);
  2555. goto("wait");
  2556. @spawn
  2557. if(size == 0) {
  2558. p = player;
  2559. }
  2560. if(size == 1) {
  2561. if(!perm.has("tp.other", player)) {
  2562. perm.no("tp.other", player);
  2563. goto("wait");
  2564. }
  2565. p_name = list.getIndex(args, 0);
  2566. p = read.player(p_name);
  2567. if(p == null) {
  2568. msg.prefix(player, prefix_commands, "This player is not online.");
  2569. goto("wait");
  2570. }
  2571. }
  2572. if(player.hasMinigame(p)) {
  2573. if(size == 1) {
  2574. msg.prefix(player, prefix_commands, "This player can´t be teleported now.");
  2575. goto("wait");
  2576. }
  2577. msg.prefix(player, prefix_commands, "You can´t teleport now.");
  2578. goto("wait");
  2579. }
  2580. if(player.teleport(p, world.getServerSpawn(), true)) {
  2581. if(player == p) {
  2582. msg.prefix(p, prefix_commands, "You have been teleported to the spawn.");
  2583. } else {
  2584. msg.prefix(player, prefix_commands, string.concat(player.getName(p), " was teleported to the spawn."));
  2585. }
  2586. }
  2587. goto("wait");
  2588. @rank
  2589. msg.string(player, string.getSpacer());
  2590. rank = getRank(player);
  2591. msg.string(player, string.concat("§6Current rank: §r[", rank, "§r]"));
  2592. msg.string(player, "Choose a rank:");
  2593. rank.showAll(player);
  2594. goto("wait");
  2595. @setrank
  2596. if(size < 2) {
  2597. msg.prefix(player, prefix_commands, "/setrank <player> <rank>");
  2598. goto("wait");
  2599. }
  2600. p_name = list.getIndex(args, 0);
  2601. if(!checkIfEverOnline(p_name)) {
  2602. msg.prefix(player, prefix_commands, "This player has never been online.");
  2603. goto("wait");
  2604. }
  2605. p = read.player(p_name);
  2606. if(p == null) {
  2607. msg.prefix(player, prefix_commands, "This player is not online.");
  2608. goto("wait");
  2609. }
  2610. p_name = player.getName(p);
  2611. rank = string.concatList(args, " ", 1, size - 1);
  2612. if(!perm.has("setrank.other", player)) {
  2613. if(player.getName(player) != p_name) {
  2614. perm.no("setrank.other", player);
  2615. goto("wait");
  2616. }
  2617. colored = string.startsWith(rank, "&", 0);
  2618. if(colored) {
  2619. rank = string.subString(rank, 1, string.length(rank));
  2620. }
  2621. a = rank.getRankArray();
  2622. a_size = array.getSize(a);
  2623. for(i = 0; i < a_size; i++) {
  2624. tech_name = a[i, 0];
  2625. if(rank == a[i, 1] && !rank.checkCriteria(p, tech_name)) {
  2626. perm.no(tech_name, p);
  2627. goto("wait");
  2628. }
  2629. }
  2630. if(colored) {
  2631. rank = string.concat("&", rank);
  2632. }
  2633. }
  2634. if(string.length(rank) >= 30) {
  2635. msg.prefix(player, prefix_commands, "Only 30 letters allowed.");
  2636. goto("wait");
  2637. }
  2638. rank = string.replace(rank, "&", "§");
  2639. setRank(p, rank);
  2640. player.setTabName(p);
  2641. msg.prefix(player, prefix_commands, string.concat("Rank for ", p_name, " changed to [", rank, "§r]."));
  2642. goto("wait");
  2643. @nowb
  2644. if(player.isAfk(player)) {
  2645. player.setAfk(player, false);
  2646. msg.prefix(player, prefix_commands, "marvinius whispers to you: Welcome back ;-)");
  2647. player.setTabName(player);
  2648. } else {
  2649. msg.prefix(player, prefix_commands, "You are not afk.");
  2650. }
  2651. goto("wait");
  2652. @afk
  2653. if(player.hasMinigame(player)) {
  2654. msg.prefix(player, prefix_commands, "No afk while in a minigame :P");
  2655. goto("wait");
  2656. }
  2657. nickname = player.getNickname(player);
  2658. if(player.isAfk(player)) {
  2659. msg.prefix("online", prefix_commands, string.concat(nickname, "§7 is back."));
  2660. player.setAfk(player, false);
  2661. } else {
  2662. msg.prefix("online", prefix_commands, string.concat(nickname, "§7 is now afk."));
  2663. player.setAfk(player, true);
  2664. if(!afk_loop_active) {
  2665. afk_loop_active = true;
  2666. sgoto(30, "afk_loop");
  2667. }
  2668. }
  2669. player.setTabName(player);
  2670. goto("wait");
  2671. @silentjoin
  2672. silentjoin = player.getSilentJoin(player);
  2673. if(silentjoin) {
  2674. player.setSilentJoin(player, false);
  2675. msg.prefix(player, prefix_commands, "Silentjoin deactivated.");
  2676. } else {
  2677. player.setSilentJoin(player, true);
  2678. msg.prefix(player, prefix_commands, "Silentjoin activated.");
  2679. }
  2680. goto("wait");
  2681. @joinme
  2682. list = players.toList();
  2683. iter = iterator(list);
  2684. while(hasNext(iter)) {
  2685. invitee = next(iter);
  2686. if(player == invitee) {
  2687. continue;
  2688. }
  2689. party.invitePlayer(player, invitee);
  2690. }
  2691. msg.prefix(player, prefix_party, "Party invitation sent to all online players.");
  2692. goto("wait");
  2693. @jumpto
  2694. block = player.getTargetBlock(player, 100);
  2695. if(block == null) {
  2696. msg.prefix(player, prefix_commands, "No block in sight.");
  2697. goto("wait");
  2698. }
  2699. loc = block.getLocation(block);
  2700. y = loc.getY(loc);
  2701. while(y < 319 && !block.isAir(block.get(loc))) {
  2702. loc.setY(loc, y);
  2703. y++;
  2704. }
  2705. player.teleport(player, loc.mod(loc, 0, 1, 0), true);
  2706. goto("wait");
  2707. @jailloop
  2708. size = list.getSize(jailed_list);
  2709. for(i = 0; i < size; i++) {
  2710. p_name = player.getName(list.getIndex(jailed_list, i));
  2711. showJail(p_name);
  2712. }
  2713. if(size > 0) {
  2714. jail_loop_active = true;
  2715. sgoto(5, "jailloop");
  2716. } else {
  2717. jail_loop_active = false;
  2718. }
  2719. goto("wait");
  2720. @sb_title_loop
  2721. list = players.toList();
  2722. iter = iterator(list);
  2723. if(title_a == null) {
  2724. while(hasNext(iter)) {
  2725. p = next(iter);
  2726. sb.setTitle(p, text.new("§c§k# §6minecraft§c.§6hammerle§c.§6me §c§k#"));
  2727. title_a = true;
  2728. }
  2729. } else {
  2730. while(hasNext(iter)) {
  2731. p = next(iter);
  2732. sb.setTitle(p, text.new(string.concat(icon.getHeart(), "§6Mundus §cCrassus§f", icon.getHeart())));
  2733. title_a = null;
  2734. }
  2735. }
  2736. sgoto(200, "sb_title_loop");
  2737. goto("wait");
  2738. @coordsloop
  2739. list = players.toList();
  2740. size = list.getSize(list);
  2741. for(i = 0; i < size; i++) {
  2742. p = list.getIndex(list, i);
  2743. if(player.getShowcoords(p)) {
  2744. p_loc = entity.getLocation(p);
  2745. 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))));
  2746. sb.add(p, 2, string.concat(icon.getCompass(), " ", getDirectionExact(loc.getYaw(p_loc))));
  2747. }
  2748. }
  2749. sgoto(15, "coordsloop");
  2750. goto("wait");
  2751. @customitems
  2752. inv = inv.new("222222222222222222222222222222222222222222222222222222", text.new("Customitems"));
  2753. a = item.custom.getAll();
  2754. for(i = 0; i < array.getSize(a); i++) {
  2755. item = item.custom.new(a[i]);
  2756. item.setAmount(item, item.getMaxAmount(item));
  2757. inv.setItem(inv, i, item);
  2758. if(i > 53) {
  2759. snuvi.debug("More customitems than can be shown in one inv");
  2760. break;
  2761. }
  2762. }
  2763. inv.open(inv, player);
  2764. goto("wait");
  2765. @afk_loop
  2766. if(!afk_loop_active) {
  2767. goto("wait");
  2768. }
  2769. afk_map = getScriptVar("afk_map");
  2770. iter = map.iterator(afk_map);
  2771. while(hasNext(iter)) {
  2772. element = next(iter);
  2773. yaw = map.getValue(element);
  2774. player = player.get(map.getKey(element));
  2775. if(player != null) {
  2776. if(yaw != loc.getYaw(entity.getLocation(player))) {
  2777. nickname = player.getNickname(player);
  2778. msg.prefix("online", prefix_commands, string.concat(nickname, "§7 is back."));
  2779. remove(iter);
  2780. player.setAfk(player, false);
  2781. player.setTabName(player);
  2782. }
  2783. }
  2784. }
  2785. size = map.getSize(afk_map);
  2786. if(size > 0) {
  2787. afk_loop_active = true;
  2788. sgoto(30, "afk_loop");
  2789. } else {
  2790. afk_loop_active = false;
  2791. }
  2792. goto("wait");
  2793. @minute_loop
  2794. cal = time.new(time.getMillis());
  2795. timer_day = time.getDay(cal);
  2796. if(old_timer_day == null) {
  2797. old_timer_day = timer_day;
  2798. }
  2799. if(timer_day != old_timer_day) {
  2800. old_timer_day = timer_day;
  2801. //Tageswechsel
  2802. decreaseHomeBoost();
  2803. }
  2804. sgoto(1200, "minute_loop");
  2805. goto("wait");
  2806. @afk_checker_loop
  2807. online_list = players.toList();
  2808. iter = iterator(online_list);
  2809. while(hasNext(iter)) {
  2810. uuid = next(iter);
  2811. p = player.get(uuid);
  2812. if(player.hasMinigame(p)) {
  2813. continue;
  2814. }
  2815. yaw = loc.getYaw(entity.getLocation(p));
  2816. a = map.get(afk_checker_map, uuid);
  2817. if(a == null) {
  2818. a = array.new(2);
  2819. a[0] = yaw;
  2820. a[1] = 0;
  2821. map.add(afk_checker_map, uuid, a);
  2822. continue;
  2823. }
  2824. last_yaw = a[0];
  2825. counter = a[1];
  2826. if(last_yaw == yaw) {
  2827. counter++;
  2828. } else {
  2829. counter = 0;
  2830. }
  2831. a[0] = yaw;
  2832. a[1] = counter;
  2833. map.add(afk_checker_map, uuid, a);
  2834. if(counter == 5) {
  2835. nickname = player.getNickname(p);
  2836. if(player.isAfk(p)) {
  2837. continue;
  2838. }
  2839. msg.prefix("online", prefix_commands, string.concat(nickname, "§7 is now afk."));
  2840. player.setAfk(p, true);
  2841. player.setTabName(p);
  2842. if(!afk_loop_active) {
  2843. afk_loop_active = true;
  2844. sgoto(30, "afk_loop");
  2845. }
  2846. }
  2847. }
  2848. sgoto(1200, "afk_checker_loop");
  2849. goto("wait");
  2850. @armorstand
  2851. if(size == 0) {
  2852. @armorstand_syntax
  2853. msg.prefix(player, prefix_datatools, "/armorstand ...");
  2854. msg.string(player, "§6 - name <name> §rSets the name");
  2855. msg.string(player, "§6 - visible <true/false> §rSets if is visible");
  2856. msg.string(player, "§6 - arms <true/false> §rSets if has arms");
  2857. msg.string(player, "§6 - small <true/false> §rSets if is small");
  2858. msg.string(player, "§6 - baseplate <true/false> §rSets if has baseplate");
  2859. msg.string(player, "§6 - marker <true/false> §rSets if is marker");
  2860. msg.string(player, "§6 - move <true/false> §rSets if can move");
  2861. msg.string(player, "§6 - tick <true/false> §rSets if can tick");
  2862. msg.string(player, "§6 - setpose <bodypart> <x> <y> <z> §rSets the pose");
  2863. msg.string(player, "§6 - addpose <bodypart> <x> <y> <z> §rSets the pose");
  2864. goto("wait");
  2865. }
  2866. as = player.getTargetEntity(player, 5);
  2867. if(!entity.isArmorstand(entity)) {
  2868. location = entity.getLocation(player);
  2869. as = entity.get(location, 3, "org.bukkit.entity.ArmorStand");
  2870. if(as == null) {
  2871. msg.action(player, "No armorstand found.");
  2872. goto("wait");
  2873. }
  2874. }
  2875. arg0 = string.toLowerCase(list.getIndex(args, 0));
  2876. if(arg0 == "name") {
  2877. if(size < 2) {
  2878. msg.prefix(player, prefix_datatools, "/armorstand name <name>");
  2879. goto("wait");
  2880. }
  2881. name = string.concatList(args, " ", 1, size - 1);
  2882. name = string.replace(name, "&", "§");
  2883. entity.setName(as, text.new(name), true);
  2884. msg.action(player, string.concat("Armorstand renamed to ", name, "§r."));
  2885. goto("wait");
  2886. }
  2887. if(arg0 == "visible") {
  2888. if(size < 2) {
  2889. msg.prefix(player, prefix_datatools, "/armorstand visible <true/false>");
  2890. goto("wait");
  2891. }
  2892. bool = list.getIndex(args, 1);
  2893. if(bool != true && bool != false) {
  2894. msg.action(player, "True/False expected.");
  2895. goto("wait");
  2896. }
  2897. living.setInvisible(as, !bool);
  2898. msg.action(player, "Visibility set.");
  2899. goto("wait");
  2900. }
  2901. if(arg0 == "arms") {
  2902. if(size < 2) {
  2903. msg.prefix(player, prefix_datatools, "/armorstand arms <true/false>");
  2904. goto("wait");
  2905. }
  2906. bool = list.getIndex(args, 1);
  2907. if(bool != true && bool != false) {
  2908. msg.action(player, "True/False expected.");
  2909. goto("wait");
  2910. }
  2911. as.setArms(as, bool);
  2912. msg.action(player, "Arms set.");
  2913. goto("wait");
  2914. }
  2915. if(arg0 == "small") {
  2916. if(size < 2) {
  2917. msg.prefix(player, prefix_datatools, "/armorstand small <true/false>");
  2918. goto("wait");
  2919. }
  2920. bool = list.getIndex(args, 1);
  2921. if(bool != true && bool != false) {
  2922. msg.action(player, "True/False expected.");
  2923. goto("wait");
  2924. }
  2925. as.setSmall(as, bool);
  2926. msg.action(player, "Small set.");
  2927. goto("wait");
  2928. }
  2929. if(arg0 == "baseplate") {
  2930. if(size < 2) {
  2931. msg.prefix(player, prefix_datatools, "/armorstand baseplate <true/false>");
  2932. goto("wait");
  2933. }
  2934. bool = list.getIndex(args, 1);
  2935. if(bool != true && bool != false) {
  2936. msg.action(player, "True/False expected.");
  2937. goto("wait");
  2938. }
  2939. as.setBasePlate(as, bool);
  2940. msg.action(player, "Baseplate set.");
  2941. goto("wait");
  2942. }
  2943. if(arg0 == "marker") {
  2944. if(size < 2) {
  2945. msg.prefix(player, prefix_datatools, "/armorstand marker <true/false>");
  2946. goto("wait");
  2947. }
  2948. bool = list.getIndex(args, 1);
  2949. if(bool != true && bool != false) {
  2950. msg.action(player, "True/False expected.");
  2951. goto("wait");
  2952. }
  2953. as.setMarker(as, bool);
  2954. msg.action(player, "Marker set.");
  2955. goto("wait");
  2956. }
  2957. if(arg0 == "move") {
  2958. if(size < 2) {
  2959. msg.prefix(player, prefix_datatools, "/armorstand move <true/false>");
  2960. goto("wait");
  2961. }
  2962. bool = list.getIndex(args, 1);
  2963. if(bool != true && bool != false) {
  2964. msg.action(player, "True/False expected.");
  2965. goto("wait");
  2966. }
  2967. as.canMove(as, bool);
  2968. msg.action(player, "Move set.");
  2969. goto("wait");
  2970. }
  2971. if(arg0 == "tick") {
  2972. if(size < 2) {
  2973. msg.prefix(player, prefix_datatools, "/armorstand tick <true/false>");
  2974. goto("wait");
  2975. }
  2976. bool = list.getIndex(args, 1);
  2977. if(bool != true && bool != false) {
  2978. msg.action(player, "True/False expected.");
  2979. goto("wait");
  2980. }
  2981. as.canTick(as, bool);
  2982. msg.action(player, "Tick set.");
  2983. goto("wait");
  2984. }
  2985. if(arg0 == "setpose") {
  2986. if(size < 5) {
  2987. msg.prefix(player, prefix_datatools, "/armorstand setpose <bodypart> <x> <y> <z>");
  2988. goto("wait");
  2989. }
  2990. x = list.getIndex(args, 2);
  2991. if(!isDouble(x) || x < -360 || x > 360) {
  2992. msg.action(player, "Number between -360 and 360 expected.");
  2993. goto("wait");
  2994. }
  2995. x *= math.pi() / 180;
  2996. y = list.getIndex(args, 3);
  2997. if(!isDouble(y) || y < -360 || y > 360) {
  2998. msg.action(player, "Number between -360 and 360 expected.");
  2999. goto("wait");
  3000. }
  3001. y *= math.pi() / 180;
  3002. z = list.getIndex(args, 4);
  3003. if(!isDouble(z) || z < -360 || z > 360) {
  3004. player.action(player, "Number between -360 and 360 expected.");
  3005. goto("wait");
  3006. }
  3007. z *= math.pi() / 180;
  3008. euler_angle = euler.new(x, y, z);
  3009. bodypart = list.getIndex(args, 1);
  3010. if(bodypart == "head") {
  3011. as.setHeadPose(as, euler_angle);
  3012. } elseif(bodypart == "body") {
  3013. as.setBodyPose(as, euler_angle);
  3014. } elseif(bodypart == "leftleg") {
  3015. as.setLeftLegPose(as, euler_angle);
  3016. } elseif(bodypart == "rightleg") {
  3017. as.setRightLegPose(as, euler_angle);
  3018. } elseif(bodypart == "leftarm") {
  3019. as.setLeftArmPose(as, euler_angle);
  3020. } elseif(bodypart == "rightarm") {
  3021. as.setRightArmPose(as, euler_angle);
  3022. } else {
  3023. msg.action(player, "Not a legit bodypart.");
  3024. goto("wait");
  3025. }
  3026. msg.action(player, "Pose set.");
  3027. goto("wait");
  3028. }
  3029. if(arg0 == "addpose") {
  3030. if(size < 5) {
  3031. msg.prefix(player, prefix_datatools, "/armorstand addpose <bodypart> <x> <y> <z>");
  3032. goto("wait");
  3033. }
  3034. x = list.getIndex(args, 2);
  3035. if(!isDouble(x) || x < -360 || x > 360) {
  3036. msg.action(player, "Number between -360 and 360 expected.");
  3037. goto("wait");
  3038. }
  3039. x *= math.pi() / 180;
  3040. y = list.getIndex(args, 3);
  3041. if(!isDouble(y) || y < -360 || y > 360) {
  3042. msg.action(player, "Number between -360 and 360 expected.");
  3043. goto("wait");
  3044. }
  3045. y *= math.pi() / 180;
  3046. z = list.getIndex(args, 4);
  3047. if(!isDouble(z) || z < -360 || z > 360) {
  3048. msg.action(player, "Number between -360 and 360 expected.");
  3049. goto("wait");
  3050. }
  3051. z *= math.pi() / 180;
  3052. bodypart = list.getIndex(args, 1);
  3053. if(bodypart == "head") {
  3054. euler_angle = as.getHeadPose(as);
  3055. euler_angle = euler.setX(euler_angle, euler.getX(euler_angle) + x);
  3056. euler_angle = euler.setY(euler_angle, euler.getY(euler_angle) + y);
  3057. euler_angle = euler.setZ(euler_angle, euler.getZ(euler_angle) + z);
  3058. as.setHeadPose(as, euler_angle);
  3059. } elseif(bodypart == "body") {
  3060. euler_angle = as.getBodyPose(as);
  3061. euler_angle = euler.setX(euler_angle, euler.getX(euler_angle) + x);
  3062. euler_angle = euler.setY(euler_angle, euler.getY(euler_angle) + y);
  3063. euler_angle = euler.setZ(euler_angle, euler.getZ(euler_angle) + z);
  3064. as.setBodyPose(as, euler_angle);
  3065. } elseif(bodypart == "leftleg") {
  3066. euler_angle = as.getLeftLegPose(as);
  3067. euler_angle = euler.setX(euler_angle, euler.getX(euler_angle) + x);
  3068. euler_angle = euler.setY(euler_angle, euler.getY(euler_angle) + y);
  3069. euler_angle = euler.setZ(euler_angle, euler.getZ(euler_angle) + z);
  3070. as.setLeftLegPose(as, euler_angle);
  3071. } elseif(bodypart == "rightleg") {
  3072. euler_angle = as.getRightLegPose(as);
  3073. euler_angle = euler.setX(euler_angle, euler.getX(euler_angle) + x);
  3074. euler_angle = euler.setY(euler_angle, euler.getY(euler_angle) + y);
  3075. euler_angle = euler.setZ(euler_angle, euler.getZ(euler_angle) + z);
  3076. as.setRightLegPose(as, euler_angle);
  3077. } elseif(bodypart == "leftarm") {
  3078. euler_angle = as.getLeftArmPose(as);
  3079. euler_angle = euler.setX(euler_angle, euler.getX(euler_angle) + x);
  3080. euler_angle = euler.setY(euler_angle, euler.getY(euler_angle) + y);
  3081. euler_angle = euler.setZ(euler_angle, euler.getZ(euler_angle) + z);
  3082. as.setLeftArmPose(as, euler_angle);
  3083. } elseif(bodypart == "rightarm") {
  3084. euler_angle = as.getRightArmPose(as);
  3085. euler_angle = euler.setX(euler_angle, euler.getX(euler_angle) + x);
  3086. euler_angle = euler.setY(euler_angle, euler.getY(euler_angle) + y);
  3087. euler_angle = euler.setZ(euler_angle, euler.getZ(euler_angle) + z);
  3088. as.setRightArmPose(as, euler_angle);
  3089. } else {
  3090. msg.action(player, "Not a legit bodypart.");
  3091. goto("wait");
  3092. }
  3093. msg.action(player, "Pose set.");
  3094. goto("wait");
  3095. }
  3096. goto("armorstand_syntax");
  3097. @ass
  3098. if(size == 0) {
  3099. msg.prefix(player, prefix_commands, "§r/ass ...");
  3100. msg.string(player, " - set <name>");
  3101. msg.string(player, " - name <name>");
  3102. msg.string(player, " - remove");
  3103. goto("wait");
  3104. }
  3105. arg0 = string.toLowerCase(list.getIndex(args, 0));
  3106. if(arg0 == "set") {
  3107. if(size < 2) {
  3108. msg.prefix(player, prefix_datatools, "/ass set <name>");
  3109. goto("wait");
  3110. }
  3111. name = string.concatList(string_args, " ", 1, size - 1);
  3112. name = string.replace(name, "&", "§");
  3113. as = entity.spawn(entity.getLocation(player), "ARMOR_STAND");
  3114. entity.setGravity(as, false);
  3115. entity.setName(as, text.new(name), true);
  3116. living.setInvisible(as, true);
  3117. as.setMarker(as, true);
  3118. as.canTick(as, false);
  3119. goto("wait");
  3120. }
  3121. as = player.getTargetEntity(player, 5);
  3122. if(!entity.isArmorstand(entity)) {
  3123. location = entity.getLocation(player);
  3124. as = entity.get(location, 3, "org.bukkit.entity.ArmorStand");
  3125. if(as == null) {
  3126. msg.action(player, "No armorstand found.");
  3127. goto("wait");
  3128. }
  3129. }
  3130. if(arg0 == "name") {
  3131. if(size < 2) {
  3132. msg.prefix(player, prefix_datatools, "/ass name <name>");
  3133. goto("wait");
  3134. }
  3135. name = string.concatList(string_args, " ", 1, size - 1);
  3136. name = string.replace(name, "&", "§");
  3137. entity.setName(as, text.new(name), true);
  3138. msg.action(player, "Armorstand renamed.");
  3139. goto("wait");
  3140. }
  3141. if(arg0 == "remove") {
  3142. entity.remove(as);
  3143. msg.action(player, "Armorstand removed.");
  3144. goto("wait");
  3145. }
  3146. goto("wait");
  3147. @potion
  3148. if(size != 3) {
  3149. msg.prefix(player, prefix_perms, "/potion <potion_name> <duration> <power>");
  3150. goto("wait");
  3151. }
  3152. item = living.getHand(player);
  3153. if(item.getType(item) == null || !(item.isType(item, "POTION") || item.isType(item, "SPLASH_POTION") || item.isType(item, "LINGERING_POTION"))) {
  3154. msg.prefix(player, prefix_commands, "You need to hold an potion in your hand.");
  3155. goto("wait");
  3156. }
  3157. potion_name = list.getIndex(args, 0);
  3158. list = getPotionTypes();
  3159. if(!list.contains(list, potion_name)) {
  3160. msg.prefix(player, prefix_commands, "Not an potion effect type.");
  3161. goto("wait");
  3162. }
  3163. duration = list.getIndex(args, 1);
  3164. if(!isDouble(duration) || duration < 0) {
  3165. msg.prefix(player, prefix_commands, "Positive number expected.");
  3166. goto("wait");
  3167. }
  3168. power = list.getIndex(args, 2);
  3169. if(!isDouble(power) || power < 0) {
  3170. msg.prefix(player, prefix_commands, "Positive number expected.");
  3171. goto("wait");
  3172. }
  3173. item.addPotion(item, potion_name, duration, power);
  3174. goto("wait");
  3175. @pvp
  3176. if(size == 0) {
  3177. if(hasPvpOn(player)) {
  3178. mode = "off";
  3179. } else {
  3180. mode = "on";
  3181. }
  3182. p = player;
  3183. } elseif(size == 1) {
  3184. mode = list.getIndex(args, 0);
  3185. if(!(mode == "on" || mode == "off")) {
  3186. goto("pvphelp");
  3187. }
  3188. p = player;
  3189. } elseif(size == 2) {
  3190. if(!perm.has("pvp.other", player)) {
  3191. perm.no("pvp.other", player);
  3192. goto("wait");
  3193. }
  3194. mode = list.getIndex(args, 0);
  3195. if(!(mode == "on" || mode == "off")) {
  3196. goto("pvphelp");
  3197. }
  3198. p_name = list.getIndex(args, 1);
  3199. if(!checkIfEverOnline(p_name)) {
  3200. msg.prefix(player, prefix_commands, "This player has never been online.");
  3201. goto("wait");
  3202. }
  3203. p = read.player(p_name);
  3204. if(p == null) {
  3205. msg.prefix(player, prefix_commands, "This player is not online.");
  3206. goto("wait");
  3207. }
  3208. } else {
  3209. @pvphelp
  3210. if(perm.has("pvp.other", player)) {
  3211. msg.prefix(player, prefix_commands, "/pvp [on/off] [player]");
  3212. } else {
  3213. msg.prefix(player, prefix_commands, "/pvp [on/off]");
  3214. }
  3215. goto("wait");
  3216. }
  3217. if(mode == "on") {
  3218. setPvp(p, true);
  3219. msg.prefix(p, prefix_commands, "You have enabled PvP!");
  3220. if(p != player) {
  3221. msg.prefix(player, prefix_commands, string.concat(player.getName(p), " has now enabled PvP!"));
  3222. }
  3223. } else {
  3224. setPvp(p, false);
  3225. msg.prefix(p, prefix_commands, "You have PvP disabled!");
  3226. if(p != player) {
  3227. msg.prefix(player, prefix_commands, string.concat(player.getName(p), " has now disabled PvP!"));
  3228. }
  3229. }
  3230. goto("wait");
  3231. @suicide
  3232. if(size < 0 || size > 1) {
  3233. msg.prefix(player, prefix_commands, "/suicide [player]");
  3234. goto("wait");
  3235. }
  3236. if(size == 0) {
  3237. p = player;
  3238. }
  3239. if(size == 1) {
  3240. if(!perm.has("suicide.other", player)) {
  3241. perm.no("suicide.other", player);
  3242. goto("wait");
  3243. }
  3244. p_name = list.getIndex(args, 0);
  3245. p = read.player(p_name);
  3246. if(p == null) {
  3247. msg.prefix(player, prefix_commands, "This player is not online.");
  3248. goto("wait");
  3249. }
  3250. }
  3251. if(p != player) {
  3252. msg.prefix(player, prefix_commands, string.concat(player.getName(p), " has been killed."));
  3253. msg.prefix(p, prefix_commands, string.concat("You have been killed by ", player.getName(player), "."));
  3254. } else {
  3255. msg.prefix(p, prefix_commands, "You killed yourself.");
  3256. }
  3257. living.damage(p, 1000, damage.get("generic"));
  3258. goto("wait");
  3259. @nickname
  3260. if(size < 1) {
  3261. msg.prefix(player, "§eNickname", "/nickname ...");
  3262. msg.string(player, string.concat("§e - <name> ", "Sets a nickname"));
  3263. msg.string(player, string.concat("§e - remove ", "Removes a nickname"));
  3264. goto("wait");
  3265. }
  3266. nickname = string.replace(string.concatList(args, " ", 0, size - 1), "&", "§");
  3267. if(nickname == "remove") {
  3268. player.removeNickName(player);
  3269. msg.prefix(player, prefix_commands, string.concat("Your nickname was removed."));
  3270. } else {
  3271. player.setNickName(player, nickname);
  3272. msg.prefix(player, prefix_commands, string.concat("Your nickname was changed to ", nickname, "§r."));
  3273. }
  3274. player.setTabName(player);
  3275. player.setHeadName(player);
  3276. goto("wait");
  3277. @iteminfo
  3278. item = living.getHand(player);
  3279. string = string.item(item);
  3280. string = string.replace(string, "\"", "'");
  3281. msg(player, string.getClipBoardText(string, string));
  3282. item_type = string(item.getType(item));
  3283. msg(player, string.getClipBoardText(item_type, item_type));
  3284. goto("wait");
  3285. @perm
  3286. if(size == 0) {
  3287. @perm_syntax
  3288. msg.prefix(player, prefix_perms, "/perm ...");
  3289. if(perm.has("perm.give", player)) {
  3290. msg.string(player, "§6 - give <player> <perm>");
  3291. }
  3292. if(perm.has("perm.remove", player)) {
  3293. msg.string(player, "§6 - remove <player> <perm>");
  3294. }
  3295. if(perm.has("perm.removeall", player)) {
  3296. msg.string(player, "§6 - removeall <player>");
  3297. }
  3298. if(perm.has("perm.list", player)) {
  3299. msg.string(player, "§6 - list <player>");
  3300. }
  3301. if(perm.has("perm.toggle", player)) {
  3302. msg.string(player, "§6 - toggle");
  3303. }
  3304. goto("wait");
  3305. }
  3306. arg0 = string.toLowerCase(list.getIndex(args, 0));
  3307. if(arg0 == "give") {
  3308. if(!perm.has("perm.give", player)) {
  3309. perm.no("perm.give", player);
  3310. goto("wait");
  3311. }
  3312. if(size != 3) {
  3313. msg.prefix(player, prefix_perms, "/perm give <player> <perm>");
  3314. goto("wait");
  3315. }
  3316. p_name = list.getIndex(args, 1);
  3317. perm = list.getIndex(args, 2);
  3318. if(!checkIfEverOnline(p_name)) {
  3319. msg.prefix(player, prefix_perms, "This player has never been online.");
  3320. goto("wait");
  3321. }
  3322. if(!perm.isGroupName(perm)) {
  3323. msg.prefix(player, prefix_perms, "This is not a permission group.");
  3324. goto("wait");
  3325. }
  3326. if(!perm.has("isOwner", player)) {
  3327. if(perm == "owner") {
  3328. msg.prefix(player, prefix_perms, "Only owners can give this permission group.");
  3329. goto("wait");
  3330. }
  3331. }
  3332. if(!perm.has("isAdmin", player)) {
  3333. if(perm == "admin" || perm == "mod") {
  3334. msg.prefix(player, prefix_perms, "Only admins can give this permission group.");
  3335. goto("wait");
  3336. }
  3337. }
  3338. p_uuid = player.getUuid(p_name);
  3339. p_id = player.getId(p_uuid);
  3340. p_name = player.getName(p_uuid);
  3341. perm_id = perm.getIdFromGroupname(perm);
  3342. if(player.hasPermGroup(p_id, perm_id)) {
  3343. msg.prefix(player, prefix_perms, "Perm already added.");
  3344. goto("wait");
  3345. }
  3346. if(isOnline(p_name)) {
  3347. p = read.player(p_name);
  3348. rank = perm.getRankFromGroupname(perm);
  3349. if(rank != null) {
  3350. offerRank(p, rank.getTechName(rank));
  3351. }
  3352. if(perm == "creative") {
  3353. if(loc.isInCreativeWorld(entity.getLocation(p))) {
  3354. player.setGamemode(p, "CREATIVE");
  3355. }
  3356. }
  3357. }
  3358. perm.addGroupToPlayer(p_id, perm_id);
  3359. msg.prefix(player, prefix_perms, string.concat("§rPerm §7", perm, "§r added to §7", p_name, "§r."));
  3360. goto("wait");
  3361. }
  3362. if(arg0 == "remove") {
  3363. if(!perm.has("perm.remove", player)) {
  3364. perm.no("perm.remove", player);
  3365. goto("wait");
  3366. }
  3367. if(size != 3) {
  3368. msg.prefix(player, prefix_perms, "/perm remove <player> <perm>");
  3369. goto("wait");
  3370. }
  3371. p_name = list.getIndex(args, 1);
  3372. perm = list.getIndex(args, 2);
  3373. if(!checkIfEverOnline(p_name)) {
  3374. msg.prefix(player, prefix_perms, "This player has never been online.");
  3375. goto("wait");
  3376. }
  3377. if(!perm.isGroupName(perm)) {
  3378. msg.prefix(player, prefix_perms, "This is not a permission group.");
  3379. goto("wait");
  3380. }
  3381. if(!perm.has("isOwner", player)) {
  3382. if(perm == "owner") {
  3383. msg.prefix(player, prefix_perms, "Only owners can remove this permission group.");
  3384. goto("wait");
  3385. }
  3386. }
  3387. if(!perm.has("isAdmin", player)) {
  3388. if(perm == "admin" || perm == "mod") {
  3389. msg.prefix(player, prefix_perms, "Only admins can remove this permission group.");
  3390. goto("wait");
  3391. }
  3392. }
  3393. p_uuid = player.getUuid(p_name);
  3394. p_id = player.getId(p_uuid);
  3395. p_name = player.getName(p_uuid);
  3396. perm_id = perm.getIdFromGroupname(perm);
  3397. if(!player.hasPermGroup(p_id, perm_id)) {
  3398. msg.prefix(player, prefix_perms, "This player doesn´t have that perm.");
  3399. goto("wait");
  3400. }
  3401. perm.removeGroupFromPlayer(p_id, perm_id);
  3402. msg.prefix(player, prefix_perms, string.concat("Perm §7", perm, "§r removed from §7", p_name, "§r."));
  3403. goto("wait");
  3404. }
  3405. if(arg0 == "removeall") {
  3406. if(!perm.has("perm.removeall", player)) {
  3407. perm.no("perm.removeall", player);
  3408. goto("wait");
  3409. }
  3410. if(size != 2) {
  3411. msg.prefix(player, prefix_perms, "/perm removeall <player>");
  3412. goto("wait");
  3413. }
  3414. p_name = list.getIndex(args, 1);
  3415. if(!checkIfEverOnline(p_name)) {
  3416. msg.prefix(player, prefix_perms, "This player has never been online.");
  3417. goto("wait");
  3418. }
  3419. p_id = player.getId(player.getUuid(p_name));
  3420. player.removeAllPerms(p_id);
  3421. msg.prefix(player, prefix_perms, string.concat("All perms of §7", p_name, " §rwere removed."));
  3422. goto("wait");
  3423. }
  3424. if(arg0 == "list") {
  3425. if(!perm.has("perm.list", player)) {
  3426. perm.no("perm.list", player);
  3427. goto("wait");
  3428. }
  3429. if(size != 2) {
  3430. msg.prefix(player, prefix_perms, "/perm list <player>");
  3431. goto("wait");
  3432. }
  3433. p_name = list.getIndex(args, 1);
  3434. if(!checkIfEverOnline(p_name)) {
  3435. msg.prefix(player, prefix_perms, "This player has never been online.");
  3436. goto("wait");
  3437. }
  3438. p_id = player.getId(player.getUuid(p_name));
  3439. permslist = player.getPerms(p_id);
  3440. listsize = list.getSize(permslist);
  3441. if(listsize == 0) {
  3442. msg.prefix(player, prefix_perms, "No permissions found.");
  3443. } else {
  3444. msg.prefix(player, prefix_perms, p_name);
  3445. for(i = 0; i < listsize; i++) {
  3446. msg.string(player, string.concat(" - ", perm.getNameFromId(list.getIndex(permslist, i))));
  3447. }
  3448. }
  3449. goto("wait");
  3450. }
  3451. if(arg0 == "toggle") {
  3452. if(!perm.has("perm.toggle", player)) {
  3453. perm.no("perm.toggle", player);
  3454. goto("wait");
  3455. }
  3456. if(perm.has("simuser", player)) {
  3457. perm.initPlayer(player);
  3458. msg.prefix(player, prefix_commands, "You have regained your permissions.");
  3459. } else {
  3460. perm.simUser(player);
  3461. msg.prefix(player, prefix_commands, "Have fun as a user.");
  3462. }
  3463. goto("wait");
  3464. }
  3465. goto("perm_syntax");
  3466. @allsounds
  3467. if(size == 0) {
  3468. msg.prefix(player, prefix_commands, "§r/allsounds...");
  3469. msg.string(player, "§e - start §rStart all sounds loop");
  3470. msg.string(player, "§e - stop §rStop all sounds loop");
  3471. msg.string(player, "§e - play <sound> §rPlay a sound");
  3472. msg.string(player, "§e - show [page] §rClick on a sound");
  3473. goto("wait");
  3474. }
  3475. arg0 = string.toLowerCase(list.getIndex(args, 0));
  3476. if(arg0 == "start") {
  3477. player_uuid = player.getUuid(player);
  3478. if(map.contains(allsounds_indizes, player_uuid)) {
  3479. msg.prefix(player, prefix_commands, "All sounds already started.");
  3480. goto("wait");
  3481. }
  3482. map.add(allsounds_indizes, player_uuid, 0);
  3483. list.add(allsounds_uuids, player_uuid);
  3484. list.add(allsounds_uuids_cross_check, player_uuid);
  3485. msg.prefix(player, prefix_commands, "All sounds started.");
  3486. goto("playallsounds");
  3487. }
  3488. if(arg0 == "stop") {
  3489. player_uuid = player.getUuid(player);
  3490. if(!list.contains(allsounds_uuids_cross_check, player_uuid)) {
  3491. msg.prefix(player, prefix_commands, "No sounds playing.");
  3492. goto("wait");
  3493. }
  3494. map.remove(allsounds_indizes, player_uuid);
  3495. list.remove(allsounds_uuids_cross_check, player_uuid);
  3496. msg.prefix(player, prefix_commands, "All sounds stopped.");
  3497. goto("wait");
  3498. }
  3499. if(arg0 == "play") {
  3500. if(size != 2) {
  3501. msg.prefix(player, prefix_perms, "/allsounds player <sound>");
  3502. goto("wait");
  3503. }
  3504. sound_name = list.getIndex(args, 1);
  3505. sound_name = string.replace(sound_name, "minecraft:", "");
  3506. sound_name = string.replace(sound_name, "[.]", "_");
  3507. sound_name = string.toUpperCase(sound_name);
  3508. if(!list.contains(allsounds_list, sound_name)) {
  3509. msg.prefix(sender, prefix_commands, "Not a known sound.");
  3510. goto("wait");
  3511. }
  3512. sound = sound.get(sound_name);
  3513. sound.spawnForPlayer(player, sound, sound_category_master);
  3514. goto("wait");
  3515. }
  3516. if(arg0 == "show") {
  3517. amount_sounds = list.getSize(allsounds_list);
  3518. max_side = amount_sounds / 10;
  3519. if(size == 1) {
  3520. side = 1;
  3521. print_side = side - 1;
  3522. } else {
  3523. side = list.getIndex(args, 1);
  3524. if(!isDouble(side)) {
  3525. msg.prefix(sender, prefix_commands, "/allsounds show [side]");
  3526. goto("wait");
  3527. }
  3528. print_side = side - 1;
  3529. if(print_side < 0 || print_side > max_side) {
  3530. msg.prefix(sender, prefix_commands, string.concat("Possible: 1 - ", string.number(math.roundDown(max_side + 1))));
  3531. goto("wait");
  3532. }
  3533. }
  3534. msg.string(sender, string.concat("§a --- All Sounds ", string.number(side), " ---"));
  3535. for(i = print_side * 10; i < print_side * 10 + 10; i++) {
  3536. if(i < amount_sounds) {
  3537. sound_name = list.getIndex(allsounds_list, i);
  3538. msg(sender, string.getClickText(string.concat(" ", sound_name), string.concat("/allsounds play ", sound_name)));
  3539. }
  3540. }
  3541. if(side == 1) {
  3542. backward = text.new("§c<<Backward<<");
  3543. forward = string.getClickText("§b>>Forward>>", string.concat("/allsounds show ", side + 1));
  3544. } elseif(side > max_side) {
  3545. backward = string.getClickText("§b<<Backward<<", string.concat("/allsounds show ", side - 1));
  3546. forward = text.new("§c>>Forward>>");
  3547. } else {
  3548. backward = string.getClickText("§b<<Backward<<", string.concat("/allsounds show ", side - 1));
  3549. forward = string.getClickText("§b>>Forward>>", string.concat("/allsounds show ", side + 1));
  3550. }
  3551. msg(sender, text.merge(backward, text.new(" "), forward));
  3552. goto("wait");
  3553. }
  3554. goto("wait");
  3555. @playallsounds
  3556. player_uuid = list.getIndex(allsounds_uuids, 0);
  3557. list.removeIndex(allsounds_uuids, 0);
  3558. if(!list.contains(allsounds_uuids_cross_check, player_uuid)) {
  3559. goto("wait");
  3560. }
  3561. player = player.get(player_uuid);
  3562. if(player == null) {
  3563. map.remove(allsounds_indizes, player_uuid);
  3564. goto("wait");
  3565. }
  3566. i = map.get(allsounds_indizes, player_uuid);
  3567. if(i == list.getSize(allsounds_list)) {
  3568. map.remove(allsounds_indizes, player_uuid);
  3569. msg.prefix(player, prefix_commands, "All sounds finished.");
  3570. goto("wait");
  3571. }
  3572. sound_name = list.getIndex(allsounds_list, i);
  3573. sound = sound.get(sound_name);
  3574. sound.spawnForPlayer(player, sound, sound_category_master);
  3575. msg.string(player, sound_name);
  3576. map.add(allsounds_indizes, player_uuid, i + 1);
  3577. list.add(allsounds_uuids, player_uuid);
  3578. sgoto(100, "playallsounds");
  3579. goto("wait");
  3580. @weather
  3581. if(size == 0) {
  3582. @weather_syntax
  3583. msg.prefix(player, "§eWeather", "/weather ...");
  3584. msg.string(player, "§e - clear [duration]");
  3585. msg.string(player, "§e - rain [duration]");
  3586. msg.string(player, "§e - thunder [duration]");
  3587. goto("wait");
  3588. }
  3589. arg0 = string.toLowerCase(list.getIndex(args, 0));
  3590. if(arg0 == "clear" || arg0 == "rain" || arg0 == "thunder") {
  3591. if(size == 2) {
  3592. duration = list.getIndex(args, 1);
  3593. if(!isDouble(duration)) {
  3594. msg.prefix(player, prefix_commands, "Number expected.");
  3595. goto("wait");
  3596. }
  3597. if(duration < 0) {
  3598. msg.prefix(player, prefix_commands, "Positive number expected.");
  3599. goto("wait");
  3600. }
  3601. } else {
  3602. duration = 12000;
  3603. }
  3604. world = loc.getWorld(entity.getLocation(player));
  3605. if(arg0 == "clear") {
  3606. if(size > 2) {
  3607. msg.prefix(player, prefix_commands, "/weather clear [duration]");
  3608. goto("wait");
  3609. }
  3610. world.clearWeather(world, duration);
  3611. msg.prefix(player, prefix_commands, "Weather cleared.");
  3612. goto("wait");
  3613. }
  3614. if(arg0 == "rain") {
  3615. if(size > 2) {
  3616. msg.prefix(player, prefix_commands, "/weather rain [duration]");
  3617. goto("wait");
  3618. }
  3619. world.setRain(world, duration);
  3620. msg.prefix(player, prefix_commands, "Weather set to rain.");
  3621. goto("wait");
  3622. }
  3623. if(arg0 == "thunder") {
  3624. if(size > 2) {
  3625. msg.prefix(player, prefix_commands, "/weather thunder [duration]");
  3626. goto("wait");
  3627. }
  3628. world.setThunder(world, duration);
  3629. msg.prefix(player, prefix_commands, "Weather set to thunder.");
  3630. goto("wait");
  3631. }
  3632. goto("wait");
  3633. }
  3634. goto("weather_syntax");
  3635. @time
  3636. if(size == 0) {
  3637. @time_syntax
  3638. msg.prefix(player, "§eTime", "/time ...");
  3639. msg.string(player, "§e - set <time>");
  3640. msg.string(player, "§e - add <time>");
  3641. msg.string(player, "§e - <day / noon / night / midnight>");
  3642. goto("wait");
  3643. }
  3644. arg0 = string.toLowerCase(list.getIndex(args, 0));
  3645. if(arg0 == "set") {
  3646. if(size != 2) {
  3647. msg.prefix(player, prefix_commands, "/time set <time>");
  3648. goto("wait");
  3649. }
  3650. setTime = list.getIndex(args, 1);
  3651. if(!isDouble(setTime)) {
  3652. msg.prefix(player, prefix_commands, "Number expected.");
  3653. goto("wait");
  3654. }
  3655. if(setTime < 0) {
  3656. msg.prefix(player, prefix_commands, "Positive number expected.");
  3657. goto("wait");
  3658. }
  3659. world = loc.getWorld(entity.getLocation(player));
  3660. while(setTime >= 24000) {
  3661. setTime -= 24000;
  3662. }
  3663. world.setTime(world, setTime);
  3664. msg.prefix(player, prefix_commands, string.concat("Time set to ", string.number(setTime), "."));
  3665. goto("wait");
  3666. }
  3667. if(arg0 == "add") {
  3668. if(size != 2) {
  3669. msg.prefix(player, prefix_commands, "/time add <time>");
  3670. goto("wait");
  3671. }
  3672. addTime = list.getIndex(args, 1);
  3673. if(!isDouble(addTime)) {
  3674. msg.prefix(player, prefix_commands, "Number expected.");
  3675. goto("wait");
  3676. }
  3677. if(addTime < 0) {
  3678. msg.prefix(player, prefix_commands, "Positive number expected.");
  3679. goto("wait");
  3680. }
  3681. world = loc.getWorld(entity.getLocation(player));
  3682. newtime = world.getTime(world) + addTime;
  3683. while(newtime >= 24000) {
  3684. newtime -= 24000;
  3685. }
  3686. world.setTime(world, newtime);
  3687. msg.prefix(player, prefix_commands, string.concat("Time set to ", string.number(newtime), "."));
  3688. goto("wait");
  3689. }
  3690. newtime = null;
  3691. if(arg0 == "day") {
  3692. newtime = 1000;
  3693. } elseif(arg0 == "noon") {
  3694. newtime = 6000;
  3695. } elseif(arg0 == "night") {
  3696. newtime = 13000;
  3697. } elseif(arg0 == "midnight") {
  3698. newtime = 18000;
  3699. }
  3700. if(newtime != null) {
  3701. world = loc.getWorld(entity.getLocation(player));
  3702. world.setTime(world, newtime);
  3703. msg.prefix(player, prefix_commands, string.concat("Time set to ", string.number(newtime), "."));
  3704. goto("wait");
  3705. }
  3706. goto("time_syntax");
  3707. @gamerule
  3708. world = loc.getWorld(entity.getLocation(player));
  3709. if(size == 0) {
  3710. msg.prefix(player, prefix_commands, "/gamerule <gamerule> [value]");
  3711. goto("wait");
  3712. }
  3713. gamerule_string = list.getIndex(args, 0);
  3714. gamerule_key = gamerule.getKey(gamerule_string);
  3715. if(gamerule_key == null) {
  3716. msg.prefix(player, prefix_commands, "Gamerule doesn´t exist.");
  3717. goto("wait");
  3718. }
  3719. gamerule_value = gamerule.getValue(world, gamerule_key);
  3720. if(size == 1) {
  3721. if(isDouble(gamerule_value)) {
  3722. gamerule_value = string.number(gamerule_value);
  3723. }
  3724. msg.prefix(player, prefix_commands, string.concat(gamerule_string, " ", gamerule_value));
  3725. goto("wait");
  3726. }
  3727. if(size == 2) {
  3728. if(!perm.has("gamerule.write", player)) {
  3729. perm.no("gamerule.write", player);
  3730. goto("wait");
  3731. }
  3732. value = list.getIndex(args, 1);
  3733. if(isBool(gamerule_value)) {
  3734. gamerule.setBool(world, gamerule_key, value);
  3735. } elseif(isDouble(gamerule_value)) {
  3736. gamerule.setInt(world, gamerule_key, value);
  3737. value = string.number(value);
  3738. } else {
  3739. msg.prefix(player, prefix_commands, "Unknown gamerule type.");
  3740. goto("wait");
  3741. }
  3742. msg.prefix(player, prefix_commands, string.concat(gamerule_string, " set to ", value, "."));
  3743. }
  3744. goto("wait");
  3745. @tip
  3746. if(size == 0) {
  3747. msg.prefix(player, prefix_tips, "/tip ...");
  3748. msg.string(player, "§e - list §rList all tips");
  3749. msg.string(player, "§e - add <tip> <text> §rAdds a tip");
  3750. msg.string(player, "§e - remove <tip> §rRemoves a tip");
  3751. msg.string(player, "§e - loop <tip> <boolean> §rTrue shows on tip loop");
  3752. msg.string(player, "§e - <tip> [player] §rSends a tip to all/a player");
  3753. goto("wait");
  3754. }
  3755. arg0 = string.toLowerCase(list.getIndex(args, 0));
  3756. if(arg0 == "list") {
  3757. msg.string(player, "--==§eTipps§r==--");
  3758. list = tip.getAll();
  3759. if(list.getSize(list) == 0) {
  3760. msg.prefix(player, prefix_tips, "No tips available.");
  3761. goto("wait");
  3762. }
  3763. iter = iterator(list);
  3764. while(hasNext(iter)) {
  3765. a = next(iter);
  3766. tipp_key = a[0];
  3767. tipp_value = a[1];
  3768. tipp_loop = a[2];
  3769. if(tipp_loop) {
  3770. tipp_loop = string.concat("§a", tipp_loop);
  3771. } else {
  3772. tipp_loop = string.concat("§c", tipp_loop);
  3773. }
  3774. msg(player, text.merge(text.new(string.concat(" ", tipp_loop, " §e", tipp_key, "§r : ")), string.getInterpretedText(tipp_value)));
  3775. }
  3776. goto("wait");
  3777. }
  3778. if(arg0 == "add") {
  3779. if(!perm.has("tip.mod", player)) {
  3780. perm.no("tip.mod", player);
  3781. goto("wait");
  3782. }
  3783. if(size < 3) {
  3784. msg.prefix(player, prefix_commands, "/tip add <name> <text>");
  3785. goto("wait");
  3786. }
  3787. tipp_key = list.getIndex(args, 1);
  3788. tipp_value = string.concatList(string_args, " ", 2, size - 1);
  3789. tipp_value = string.replace(tipp_value, "&", "§");
  3790. tipp.register(tipp_key, tipp_value);
  3791. msg.prefix(player, prefix_tips, "Tip added.");
  3792. goto("wait");
  3793. }
  3794. if(arg0 == "loop") {
  3795. if(!perm.has("tip.mod", player)) {
  3796. perm.no("tip.mod", player);
  3797. goto("wait");
  3798. }
  3799. if(size != 3) {
  3800. msg.prefix(player, prefix_commands, "/tip loop <tip> <boolean>");
  3801. goto("wait");
  3802. }
  3803. tipp_key = list.getIndex(args, 1);
  3804. if(!tipp.exists(tipp_key)) {
  3805. msg.prefix(player, prefix_tips, "This tip does not exist.");
  3806. goto("wait");
  3807. }
  3808. boolean = list.getIndex(args, 2);
  3809. if(string.class(boolean) != "Boolean") {
  3810. msg.prefix(player, prefix_tips, "True or false expected.");
  3811. goto("wait");
  3812. }
  3813. if(boolean) {
  3814. tip.setLoop(tipp_key, boolean);
  3815. } else {
  3816. tip.setLoop(tipp_key, boolean);
  3817. }
  3818. msg.prefix(player, prefix_tips, "Tip settings changed.");
  3819. goto("wait");
  3820. }
  3821. if(arg0 == "remove") {
  3822. if(!perm.has("tip.mod", player)) {
  3823. perm.no("tip.mod", player);
  3824. goto("wait");
  3825. }
  3826. if(size != 2) {
  3827. msg.prefix(player, prefix_commands, "/tip remove <name>");
  3828. goto("wait");
  3829. }
  3830. tipp_key = list.getIndex(args, 1);
  3831. tip.remove(tipp_key);
  3832. msg.prefix(player, prefix_tips, "Tip removed.");
  3833. goto("wait");
  3834. }
  3835. tipp_key = arg0;
  3836. if(!tipp.exists(tipp_key)) {
  3837. msg.prefix(player, prefix_tips, "This tip does not exist.");
  3838. goto("wait");
  3839. }
  3840. if(size == 1) {
  3841. p = "online";
  3842. } else {
  3843. p_name = list.getIndex(args, 1);
  3844. if(!isOnline(p_name)) {
  3845. msg.prefix(player, prefix_tips, "This player is not online.");
  3846. goto("wait");
  3847. }
  3848. p = read.player(p_name);
  3849. msg.prefix(player, prefix_tips, string.concat("Tip sent to §7", p_name, "§r."));
  3850. }
  3851. tipp_value = tipp.get(tipp_key);
  3852. msg(p, text.merge(text.new(string.concat(string.getPrefix(string.concat("§e", player.getName(player))), " ")), string.getInterpretedText(tipp_value)));
  3853. goto("wait");
  3854. @help
  3855. if(size > 1) {
  3856. msg.prefix(sender, prefix_commands, "/help [side]");
  3857. goto("wait");
  3858. }
  3859. //Auf Permission überprüfen
  3860. temp_list = list.new();
  3861. for(i = 0; i < list.getSize(command_list); i++) {
  3862. command = list.getIndex(command_list, i);
  3863. if(perm.has(command, sender)) {
  3864. list.add(temp_list, command);
  3865. }
  3866. }
  3867. list.sort(temp_list);
  3868. temp_size = list.getSize(temp_list);
  3869. max_side = temp_size / 10;
  3870. if(size == 0) {
  3871. side = 1;
  3872. print_side = side - 1;
  3873. } else {
  3874. side = list.getIndex(args, 0);
  3875. if(!isDouble(side)) {
  3876. msg.prefix(sender, prefix_commands, "/help [side]");
  3877. goto("wait");
  3878. }
  3879. print_side = side - 1;
  3880. if(print_side < 0 || print_side > max_side) {
  3881. msg.prefix(sender, prefix_commands, string.concat("Possible: 1 - ", string.number(math.roundDown(max_side + 1))));
  3882. goto("wait");
  3883. }
  3884. }
  3885. msg.string(sender, string.concat("§a --- Help ", string.number(side), " ---"));
  3886. for(i = print_side * 10; i < print_side * 10 + 10; i++) {
  3887. if(i < temp_size) {
  3888. command_string = list.getIndex(temp_list, i);
  3889. command = string.getHoverText(command_string, map.getOrDefault(command_map, command_string, ""));
  3890. msg(sender, text.merge(text.new(" /"), text.suggest(command, string.concat("/", command_string))));
  3891. }
  3892. }
  3893. if(side == 1) {
  3894. backward = text.new("§c<<Backward<<");
  3895. forward = string.getClickText("§b>>Forward>>", string.concat("/help ", side + 1));
  3896. } elseif(side > max_side) {
  3897. backward = string.getClickText("§b<<Backward<<", string.concat("/help ", side - 1));
  3898. forward = text.new("§c>>Forward>>");
  3899. } else {
  3900. backward = string.getClickText("§b<<Backward<<", string.concat("/help ", side - 1));
  3901. forward = string.getClickText("§b>>Forward>>", string.concat("/help ", side + 1));
  3902. }
  3903. msg(sender, text.merge(backward, text.new(" "), forward));
  3904. goto("wait");
  3905. @grow
  3906. if(size != 1) {
  3907. msg.prefix(player, prefix_commands, "/grow <radius>");
  3908. goto("wait");
  3909. }
  3910. radius = list.getIndex(args, 0);
  3911. if(!isDouble(radius)) {
  3912. msg.prefix(player, prefix_commands, "Number expected.");
  3913. goto("wait");
  3914. }
  3915. if(radius < 0) {
  3916. msg.prefix(player, prefix_commands, "Positive number expected.");
  3917. goto("wait");
  3918. }
  3919. center_loc = getBlockLocation(entity.getLocation(player));
  3920. grow(center_loc, radius);
  3921. msg.prefix(player, prefix_commands, "Field grown.");
  3922. goto("wait");
  3923. @start
  3924. if(size != 1) {
  3925. @starthelp
  3926. msg.prefix(sender, prefix_commands, "/start <name>");
  3927. goto("wait");
  3928. }
  3929. arg0 = string.toLowerCase(list.getIndex(args, 0));
  3930. modTimer(-500);
  3931. if(arg0 == "chat") {
  3932. script = script.get("Chat");
  3933. if(script != null) {
  3934. script.term(script);
  3935. }
  3936. script.startNamed("Chat", "utils/u_error", "system/chat", "utils/u_general");
  3937. }
  3938. elseif(arg0 == "challenges") {
  3939. script = script.get("Challenges");
  3940. if(script != null) {
  3941. script.term(script);
  3942. }
  3943. script.startNamed("Challenges", "utils/u_error", "survival/challenges", "utils/u_general");
  3944. script = script.get("AllDamageTypes");
  3945. if(script != null) {
  3946. script.term(script);
  3947. }
  3948. script.startNamed("AllDamageTypes", "utils/u_error", "challenges/all_damage_types", "utils/u_general");
  3949. script = script.get("AllEntities");
  3950. if(script != null) {
  3951. script.term(script);
  3952. }
  3953. script.startNamed("AllEntities", "utils/u_error", "challenges/all_entities", "utils/u_general");
  3954. script = script.get("AllItems");
  3955. if(script != null) {
  3956. script.term(script);
  3957. }
  3958. script.startNamed("AllItems", "utils/u_error", "challenges/all_items", "utils/u_general");
  3959. }
  3960. elseif(arg0 == "commands") {
  3961. script = script.startNamed("Commands", "system/commands", "utils/u_general", "utils/u_commands", "utils/u_cmdhelp", "utils/u_skills");
  3962. if(script == null) {
  3963. snuvi.debug("Old commands script still active due to error in new script");
  3964. goto("wait");
  3965. }
  3966. script.term(script.get());
  3967. }
  3968. elseif(arg0 == "copyisland") {
  3969. script = script.get("Copyisland");
  3970. if(script != null) {
  3971. script.term(script);
  3972. }
  3973. script.startNamed("Copyisland", "system/copyisland", "utils/u_general");
  3974. }
  3975. elseif(arg0 == "creative") {
  3976. script = script.get("Creative");
  3977. if(script != null) {
  3978. script.term(script);
  3979. }
  3980. script.startNamed("Creative", "utils/u_error", "system/creative", "utils/u_general");
  3981. }
  3982. elseif(arg0 == "damage") {
  3983. script = script.get("Damage");
  3984. if(script != null) {
  3985. script.term(script);
  3986. }
  3987. script.startNamed("Damage", "utils/u_error", "system/damage", "utils/u_general");
  3988. }
  3989. elseif(arg0 == "doors") {
  3990. script = script.get("Doors");
  3991. if(script != null) {
  3992. script.term(script);
  3993. }
  3994. script.startNamed("Doors", "utils/u_error", "system/doors", "utils/u_general");
  3995. }
  3996. elseif(arg0 == "fixitems") {
  3997. script = script.get("Fixitems");
  3998. if(script != null) {
  3999. script.term(script);
  4000. }
  4001. script.startNamed("Fixitems", "utils/u_error", "system/fixitems", "utils/u_general");
  4002. }
  4003. elseif(arg0 == "games") {
  4004. script = script.get("Gamecenter");
  4005. if(script != null) {
  4006. script.term(script);
  4007. }
  4008. script.startNamed("Gamecenter", "utils/u_error", "minigames/gamecenter", "utils/u_general", "utils/u_games");
  4009. }
  4010. elseif(arg0 == "gemstones") {
  4011. script = script.get("Gemstones");
  4012. if(script != null) {
  4013. script.term(script);
  4014. }
  4015. script.startNamed("Gemstones", "utils/u_error", "survival/gemstones", "utils/u_general");
  4016. }
  4017. elseif(arg0 == "harvest") {
  4018. script = script.get("Harvest");
  4019. if(script != null) {
  4020. script.term(script);
  4021. }
  4022. script.startNamed("Harvest", "utils/u_error", "survival/harvest", "utils/u_general");
  4023. }
  4024. elseif(arg0 == "herobrine") {
  4025. script = script.get("Herobrine");
  4026. if(script != null) {
  4027. script.term(script);
  4028. }
  4029. script.startNamed("Herobrine", "utils/u_error", "survival/herobrine", "utils/u_general");
  4030. }
  4031. elseif(arg0 == "humans") {
  4032. script = script.get("Humans");
  4033. if(script != null) {
  4034. script.term(script);
  4035. }
  4036. script.startNamed("Humans", "utils/u_error", "system/humans", "utils/u_general");
  4037. }
  4038. elseif(arg0 == "lectern") {
  4039. script = script.get("Lectern");
  4040. if(script != null) {
  4041. script.term(script);
  4042. }
  4043. script.startNamed("Lectern", "utils/u_error", "survival/lectern", "utils/u_general");
  4044. }
  4045. elseif(arg0 == "loginrequests") {
  4046. script = script.get("loginrequests");
  4047. if(script != null) {
  4048. script.term(script);
  4049. }
  4050. script.startNamed("LoginRequests", "system/login_requests", "utils/u_general");
  4051. }
  4052. elseif(arg0 == "loom") {
  4053. script = script.get("Loom");
  4054. if(script != null) {
  4055. script.term(script);
  4056. }
  4057. script.startNamed("Loom", "utils/u_error", "survival/loom", "utils/u_general");
  4058. }
  4059. elseif(arg0 == "perms") {
  4060. script = script.get("Perms");
  4061. if(script != null) {
  4062. script.term(script);
  4063. }
  4064. script.startNamed("Perms", "utils/u_error", "system/perms", "utils/u_general");
  4065. }
  4066. elseif(arg0 == "playerdata") {
  4067. script = script.get("Playerdata");
  4068. if(script != null) {
  4069. script.term(script);
  4070. }
  4071. script.startNamed("Playerdata", "utils/u_error", "system/player_data", "utils/u_general");
  4072. }
  4073. elseif(arg0 == "playtime") {
  4074. script = script.get("Playtime");
  4075. if(script != null) {
  4076. script.term(script);
  4077. }
  4078. script.startNamed("Playtime", "system/playtime", "utils/u_general");
  4079. }
  4080. elseif(arg0 == "pumpkin") {
  4081. script = script.get("Pumpkin");
  4082. if(script != null) {
  4083. script.term(script);
  4084. }
  4085. script.startNamed("Pumpkin", "utils/u_error", "survival/pumpkin", "utils/u_general");
  4086. }
  4087. elseif(arg0 == "recipes") {
  4088. script = script.get("Recipes");
  4089. if(script != null) {
  4090. script.term(script);
  4091. }
  4092. script.startNamed("Recipes", "survival/recipes");
  4093. }
  4094. elseif(arg0 == "stats") {
  4095. script = script.get("Ranklist");
  4096. if(script != null) {
  4097. script.term(script);
  4098. }
  4099. script.startNamed("Ranklist", "utils/u_error", "system/ranklist", "utils/u_general", "utils/u_games");
  4100. }
  4101. elseif(arg0 == "scheduler") {
  4102. script = script.get("Scheduler");
  4103. if(script != null) {
  4104. script.term(script);
  4105. }
  4106. script.startNamed("Scheduler", "utils/u_error", "system/scheduler", "utils/u_general");
  4107. }
  4108. elseif(arg0 == "shop") {
  4109. script = script.get("ChestShops");
  4110. if(script != null) {
  4111. script.term(script);
  4112. }
  4113. script.startNamed("ChestShops", "utils/u_error", "system/chestshops", "utils/u_general");
  4114. }
  4115. elseif(arg0 == "teleporter") {
  4116. script = script.get("Teleporter");
  4117. if(script != null) {
  4118. script.term(script);
  4119. }
  4120. script.startNamed("Teleporter", "utils/u_error", "survival/teleporter", "utils/u_general");
  4121. }
  4122. elseif(arg0 == "mails") {
  4123. script = script.get("Mails");
  4124. if(script != null) {
  4125. script.term(script);
  4126. }
  4127. script.startNamed("Mails", "utils/u_error", "system/mailsystem", "utils/u_general");
  4128. }
  4129. elseif(arg0 == "market") {
  4130. script = script.get("Market");
  4131. if(script != null) {
  4132. script.term(script);
  4133. }
  4134. script.startNamed("Market", "utils/u_error", "system/market", "utils/u_general");
  4135. }
  4136. elseif(arg0 == "mobarena") {
  4137. script = script.get("Mobarena");
  4138. if(script != null) {
  4139. script.term(script);
  4140. }
  4141. script.startNamed("Mobarena", "utils/u_error", "survival/mobarena", "utils/u_general");
  4142. }
  4143. elseif(arg0 == "ticket") {
  4144. script = script.get("Ticket");
  4145. if(script != null) {
  4146. script.term(script);
  4147. }
  4148. script.startNamed("Ticket", "utils/u_error", "system/tickets", "utils/u_general");
  4149. }
  4150. elseif(arg0 == "timber") {
  4151. script = script.get("Timber");
  4152. if(script != null) {
  4153. script.term(script);
  4154. }
  4155. script.startNamed("Timber", "utils/u_error", "survival/timber", "utils/u_general", "utils/u_skills");
  4156. }
  4157. elseif(arg0 == "tiploop") {
  4158. script = script.get("tiploop");
  4159. if(script != null) {
  4160. script.term(script);
  4161. }
  4162. script.startNamed("tiploop", "utils/u_error", "system/tiploop", "utils/u_general");
  4163. }
  4164. elseif(arg0 == "trader") {
  4165. script = script.get("Trader");
  4166. if(script != null) {
  4167. script.term(script);
  4168. }
  4169. script.startNamed("Trader", "utils/u_error", "survival/trader", "utils/u_general");
  4170. }
  4171. elseif(arg0 == "skills") {
  4172. script = script.get("Skills");
  4173. if(script != null) {
  4174. script.term(script);
  4175. }
  4176. script.startNamed("Skills", "utils/u_error", "survival/skills", "utils/u_general", "utils/u_skills", "utils/u_quest");
  4177. }
  4178. elseif(arg0 == "story") {
  4179. /*script = script.get("Story");
  4180. if(script != null) {
  4181. script.term(script);
  4182. }
  4183. script.startNamed("Story", "utils/u_error", "story/story", "utils/u_general");*/
  4184. script = script.get("QuestsAdmont");
  4185. if(script != null) {
  4186. script.term(script);
  4187. }
  4188. script.startNamed("QuestsAdmont", "utils/u_error", "story/admont/core", "utils/u_general", "utils/u_quest");
  4189. /*script = script.get("QuestsSchiffbruch");
  4190. if(script != null) {
  4191. script.term(script);
  4192. }
  4193. script.startNamed("QuestsSchiffbruch", "utils/u_error", "story/schiffbruch/core", "utils/u_general", "utils/u_quest");*/
  4194. }
  4195. elseif(arg0 == "sitting") {
  4196. script = script.get("Sitting");
  4197. if(script != null) {
  4198. script.term(script);
  4199. }
  4200. script.startNamed("Sitting", "utils/u_error", "system/sitting", "utils/u_general");
  4201. }
  4202. elseif(arg0 == "survival") {
  4203. script = script.get("Survival");
  4204. if(script != null) {
  4205. script.term(script);
  4206. }
  4207. script.startNamed("Survival", "utils/u_error", "survival/survival", "utils/u_general", "utils/u_skills");
  4208. }
  4209. else {
  4210. goto("starthelp");
  4211. }
  4212. goto("wait");
  4213. @senditem
  4214. if(size != 1) {
  4215. msg.prefix(player, prefix_commands, "/senditem <player>");
  4216. goto("wait");
  4217. }
  4218. item = living.getHand(player);
  4219. if(item.isAir(item)) {
  4220. msg.prefix(player, prefix_commands, "You need to hold an item in your hand.");
  4221. goto("wait");
  4222. }
  4223. p_name = list.getIndex(args, 0);
  4224. p_uuid = player.getUuid(p_name);
  4225. if(p_uuid == null) {
  4226. msg.prefix(player, prefix_commands, "This player has never been online.");
  4227. goto("wait");
  4228. }
  4229. p = read.player(p_name);
  4230. if(p == null) {
  4231. msg.prefix(player, prefix_commands, "This player is not online.");
  4232. goto("wait");
  4233. }
  4234. player.safeGiveItem(p, item);
  4235. player.removeItem(player, item);
  4236. goto("wait");
  4237. @top
  4238. player_loc = entity.getLocation(player);
  4239. y = 319;
  4240. loc.setY(player_loc, y);
  4241. while(y > -64 && block.isAir(block.get(player_loc))) {
  4242. loc.setY(player_loc, y);
  4243. y--;
  4244. }
  4245. if(y == -64) {
  4246. msg.prefix(player, prefix_commands, "No block found.");
  4247. goto("wait");
  4248. }
  4249. player.teleport(player, loc.mod(player_loc, 0, 1, 0), true);
  4250. goto("wait");
  4251. @creative
  4252. crea_spawn = world.getCreativeSpawn();
  4253. world = loc.getWorld(crea_spawn);
  4254. if(world == null) {
  4255. msg.prefix(player, prefix_commands, "This world is not loaded.");
  4256. goto("wait");
  4257. }
  4258. if(size > 1) {
  4259. msg.prefix(player, prefix_commands, "/creative [player]");
  4260. goto("wait");
  4261. }
  4262. if(size == 0) {
  4263. p = player;
  4264. }
  4265. if(size == 1) {
  4266. p_name = list.getIndex(args, 0);
  4267. p = read.player(p_name);
  4268. if(p == null) {
  4269. msg.prefix(player, prefix_commands, "This player is not online.");
  4270. goto("wait");
  4271. }
  4272. if(!perm.has("tp.other", player)) {
  4273. perm.no("tp.other", player);
  4274. goto("wait");
  4275. }
  4276. }
  4277. if(player.hasMinigame(p)) {
  4278. if(size == 1) {
  4279. msg.prefix(player, prefix_commands, "This player can´t be teleported now.");
  4280. goto("wait");
  4281. }
  4282. msg.prefix(player, prefix_commands, "You can´t teleport now.");
  4283. goto("wait");
  4284. }
  4285. if(size == 1) {
  4286. if(player != p) {
  4287. msg.prefix(player, prefix_commands, string.concat(player.getName(p), " was teleported to the creative world."));
  4288. }
  4289. }
  4290. if(player.teleport(p, crea_spawn, true)) {
  4291. msg.prefix(p, prefix_commands, "You have been teleported to the creative world.");
  4292. }
  4293. goto("wait");
  4294. @games
  4295. world = loc.getWorld(world.getGamesSpawn());
  4296. if(world == null) {
  4297. msg.prefix(player, prefix_commands, "This world is not loaded.");
  4298. goto("wait");
  4299. }
  4300. if(size > 1) {
  4301. msg.prefix(player, prefix_commands, "/games [player]");
  4302. goto("wait");
  4303. }
  4304. if(size == 0) {
  4305. p = player;
  4306. }
  4307. if(size == 1) {
  4308. p_name = list.getIndex(args, 0);
  4309. p = read.player(p_name);
  4310. if(p == null) {
  4311. msg.prefix(player, prefix_commands, "This player is not online.");
  4312. goto("wait");
  4313. }
  4314. if(!perm.has("tp.other", player)) {
  4315. perm.no("tp.other", player);
  4316. goto("wait");
  4317. }
  4318. }
  4319. if(player.hasMinigame(p)) {
  4320. if(size == 1) {
  4321. msg.prefix(player, prefix_commands, "This player can´t be teleported now.");
  4322. goto("wait");
  4323. }
  4324. msg.prefix(player, prefix_commands, "You can´t teleport now.");
  4325. goto("wait");
  4326. }
  4327. if(size == 1) {
  4328. if(player != p) {
  4329. msg.prefix(player, prefix_commands, string.concat(player.getName(p), " was teleported to the games world."));
  4330. }
  4331. }
  4332. if(player.teleport(p, world.getGamesSpawn(), true)) {
  4333. msg.prefix(p, prefix_commands, "You have been teleported to the games world.");
  4334. }
  4335. goto("wait");
  4336. @repair
  4337. item = living.getHand(player);
  4338. if(item.isAir(item)) {
  4339. msg.prefix(player, prefix_commands, "You have to hold an item in your mainhand.");
  4340. goto("wait");
  4341. }
  4342. item.setDamage(item, 0);
  4343. msg.prefix(player, prefix_commands, "Your item has been repaired.");
  4344. goto("wait");
  4345. @playtime
  4346. if(size == 0) {
  4347. p_id = player.getId(player);
  4348. arg0 = player.getName(player);
  4349. } else {
  4350. arg0 = string.toLowerCase(list.getIndex(args, 0));
  4351. if(arg0 == "year") {
  4352. modTimer(-20);
  4353. if(!perm.has("playtime.year", player)) {
  4354. perm.no("playtime.year", player);
  4355. goto("wait");
  4356. }
  4357. calendar = time.new(time.getMillis());
  4358. now_month = time.getMonth(calendar);
  4359. now_year = time.getYear(calendar);
  4360. if(size == 1) {
  4361. year = now_year;
  4362. } else {
  4363. year = list.getIndex(args, 1);
  4364. if(!isDouble(year)) {
  4365. msg.prefix(player, prefix_commands, "Number expected.");
  4366. goto("wait");
  4367. }
  4368. if(year > now_year) {
  4369. year = now_year;
  4370. }
  4371. }
  4372. //Von allen Online-Spielern die Onlinezeit abrufen, summieren und zur Heute-Spielzeit addieren
  4373. since_minutes = playtime.getTotalOnlineMinutes();
  4374. //Tabelle erstellen
  4375. table = table.new("§8", 4, 5, 5);
  4376. msg.string(player, table.getStart(table));
  4377. msg.string(player, table.get(table, string.number(year), "Playtime", "Change"));
  4378. msg.string(player, table.getMiddle(table));
  4379. //Monats-Spielzeit berechnen
  4380. temp_list = list.new();
  4381. 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
  4382. for(i = 1; i <= 12; i++) {
  4383. midnight = time.getCal(year, i, 1, 0, 0, 0);
  4384. midnight_2 = time.getCal(year, i + 1, 1, 0, 0, 0);
  4385. minutes = playtime.getInterval(midnight, midnight_2);
  4386. list.add(temp_list, minutes);
  4387. if(i == now_month && year == now_year) {
  4388. minutes += since_minutes;
  4389. }
  4390. }
  4391. for(i = 1; i <= 12; i++) {
  4392. minutes = list.getIndex(temp_list, i);
  4393. hours = math.roundDown(minutes / 60);
  4394. mod_minutes = minutes % 60;
  4395. if(mod_minutes < 10) {
  4396. time_string = string.concat("§6", string.number(hours), ":0", string.number(mod_minutes), " h");
  4397. } else {
  4398. time_string = string.concat("§6", string.number(hours), ":", string.number(mod_minutes), " h");
  4399. }
  4400. pre_minutes = list.getIndex(temp_list, i - 1);
  4401. if(minutes >= pre_minutes) {
  4402. color = "§a+";
  4403. a = minutes;
  4404. b = pre_minutes;
  4405. } else {
  4406. color = "§c-";
  4407. a = pre_minutes;
  4408. b = minutes;
  4409. }
  4410. if(b == 0) {
  4411. change = "";
  4412. } else {
  4413. change = math.round(a / b * 100 - 100);
  4414. change = string.concat(color, string.number(change), " %");
  4415. }
  4416. msg.string(player, table.get(table, string.concat("§6", month.getShortName(i)), time_string, change));
  4417. if(i == now_month && year == now_year) {
  4418. break;
  4419. }
  4420. }
  4421. //Tabelle beenden
  4422. msg.string(player, table.getEnd(table));
  4423. goto("wait");
  4424. }
  4425. if(arg0 == "month") {
  4426. modTimer(-100);
  4427. if(!perm.has("playtime.month", player)) {
  4428. perm.no("playtime.month", player);
  4429. goto("wait");
  4430. }
  4431. calendar = time.new(time.getMillis());
  4432. now_day = time.getDay(calendar);
  4433. now_month = time.getMonth(calendar);
  4434. now_year = time.getYear(calendar);
  4435. year = now_year;
  4436. if(size == 1) {
  4437. month = now_month;
  4438. } else {
  4439. month = list.getIndex(args, 1);
  4440. if(!isDouble(month)) {
  4441. msg.prefix(player, prefix_commands, "Number expected.");
  4442. goto("wait");
  4443. }
  4444. if(month < 1) {
  4445. month = 1;
  4446. } elseif(month > 12) {
  4447. month = 12;
  4448. }
  4449. if(size == 3) {
  4450. year = list.getIndex(args, 2);
  4451. if(!isDouble(year)) {
  4452. msg.prefix(player, prefix_commands, "Number expected.");
  4453. goto("wait");
  4454. }
  4455. }
  4456. if(year > now_year ||(year >= now_year && month > now_month)) {
  4457. month = now_month;
  4458. year = now_year;
  4459. }
  4460. }
  4461. sum_minutes = 0;
  4462. sum_players = 0;
  4463. //Von allen Online-Spielern die Onlinezeit abrufen, summieren und zur Heute-Spielzeit addieren
  4464. since_minutes = playtime.getTotalOnlineMinutes();
  4465. //Tabelle erstellen
  4466. table = table.new("§8", 4, 5, 5);
  4467. msg.string(player, table.getStart(table));
  4468. msg.string(player, table.get(table, month.getShortName(month), "Playtime", "Players"));
  4469. msg.string(player, table.getMiddle(table));
  4470. //Tages-Spielzeit berechnen
  4471. month_days = time.getMonthDays(month, year);
  4472. for(i = 1; i <= month_days; i++) {
  4473. midnight = time.getCal(year, month, i, 0, 0, 0);
  4474. if(i == month_days) {
  4475. midnight_2 = time.getCal(year, month + 1, 1, 0, 0, 0);
  4476. } else {
  4477. midnight_2 = time.getCal(year, month, i + 1, 0, 0, 0);
  4478. }
  4479. players = playtime.getPlayersPerInterval(midnight, midnight_2);
  4480. sum_players += players;
  4481. minutes = playtime.getInterval(midnight, midnight_2);
  4482. if(i == now_day && month == now_month && year == now_year) {
  4483. minutes += since_minutes;
  4484. }
  4485. sum_minutes += minutes;
  4486. hours = math.roundDown(minutes / 60);
  4487. minutes = minutes % 60;
  4488. if(minutes < 10) {
  4489. time_string = string.concat("§6", string.number(hours), ":0", string.number(minutes), " h");
  4490. } else {
  4491. time_string = string.concat("§6", string.number(hours), ":", string.number(minutes), " h");
  4492. }
  4493. msg.string(player, table.get(table, string.concat("§6", string.number(i)), time_string, string.number(players)));
  4494. if(i == now_day && month == now_month && year == now_year) {
  4495. break;
  4496. }
  4497. }
  4498. //Average
  4499. avg_mins = sum_minutes / i;
  4500. avg_hours = math.roundDown(avg_mins / 60);
  4501. avg_mins = avg_mins % 60;
  4502. if(avg_mins < 10) {
  4503. avg_time_string = string.concat("§6", string.number(avg_hours), ":0", string.number(avg_mins), " h");
  4504. } else {
  4505. avg_time_string = string.concat("§6", string.number(avg_hours), ":", string.number(avg_mins), " h");
  4506. }
  4507. avg_players = sum_players / i;
  4508. msg.string(player, table.getMiddle(table));
  4509. msg.string(player, table.get(table, "§6Ø", avg_time_string, string.number(math.roundDown(avg_players))));
  4510. //Tabelle beenden
  4511. msg.string(player, table.getEnd(table));
  4512. goto("wait");
  4513. }
  4514. if(arg0 == "all") {
  4515. modTimer(-10);
  4516. msg.string(player, string.getSpacer());
  4517. msg.prefix(player, prefix_commands, "Server-Playtime");
  4518. //Von allen Online-Spielern die Onlinezeit abrufen, summieren und zur Heute-Spielzeit addieren
  4519. since_minutes = playtime.getTotalOnlineMinutes();
  4520. //Spielzeit heute
  4521. now_cal = time.new(time.getMillis());
  4522. now_day = time.getDay(now_cal);
  4523. now_month = time.getMonth(now_cal);
  4524. now_year = time.getYear(now_cal);
  4525. midnight = time.getCal(now_year, now_month, now_day, 0, 0, 0);
  4526. minutes = playtime.getInterval(midnight, now_cal) + since_minutes;
  4527. hours = string.number(math.roundDown(minutes / 60));
  4528. minutes = string.number(minutes % 60);
  4529. msg.string(player, string.concat("§6Today: §r", hours, " h ", minutes, " min"));
  4530. //Spielzeit 30 Tage für alle Spieler
  4531. year = now_year;
  4532. month = now_month;
  4533. day = now_day - 30;
  4534. if(day < 1) {
  4535. month -= 1;
  4536. if(month < 1) {
  4537. year -= 1;
  4538. month = 12;
  4539. }
  4540. day += time.getMonthDays(month, year);
  4541. }
  4542. thirtyDaysAgo = time.getCal(year, month, day, time.getHour(now_cal), time.getMinute(now_cal), time.getSecond(now_cal));
  4543. minutes = playtime.getInterval(thirtyDaysAgo, now_cal) + since_minutes;
  4544. hours = string.number(math.roundDown(minutes / 60));
  4545. minutes = string.number(minutes % 60);
  4546. msg.string(player, string.concat("§630 Days: §r", hours, " h ", minutes, " min"));
  4547. //Spielzeit gesamt
  4548. minutes = playtime.getTotal();
  4549. hours = string.number(math.roundDown(minutes / 60));
  4550. minutes = string.number(minutes % 60);
  4551. msg.string(player, string.concat("§6Total: §r", hours, " h ", minutes, " min"));
  4552. goto("wait");
  4553. }
  4554. if(!perm.has("playtime.other", player)) {
  4555. perm.no("playtime.other", player);
  4556. goto("wait");
  4557. }
  4558. }
  4559. if(!checkIfEverOnline(arg0)) {
  4560. msg.prefix(player, prefix_commands, "This player has never been online.");
  4561. goto("wait");
  4562. }
  4563. p_uuid = player.getUuid(arg0);
  4564. arg0 = player.getName(p_uuid);
  4565. p_id = player.getId(p_uuid);
  4566. msg.string(player, string.getSpacer());
  4567. msg.prefix(player, prefix_commands, string.concat("Playtime of ", player.getName(p_uuid)));
  4568. //Online seit
  4569. since_minutes = playtime.getPlayerOnlineMinutes(p_id);
  4570. if(isOnline(arg0)) {
  4571. since_hours = math.roundDown(since_minutes / 60);
  4572. mod_minutes = since_minutes % 60;
  4573. msg.string(player, string.concat("§aOnline since: §r", string.number(since_hours), " hours ", string.number(mod_minutes), " minutes"));
  4574. } else {
  4575. msg.string(player, "§6Status: §cOffline");
  4576. }
  4577. //Spielzeit heute
  4578. now_cal = time.new(time.getMillis());
  4579. now_day = time.getDay(now_cal);
  4580. now_month = time.getMonth(now_cal);
  4581. now_year = time.getYear(now_cal);
  4582. midnight = time.getCal(now_year, now_month, now_day, 0, 0, 0);
  4583. minutes = playtime.getPlayerInterval(p_id, midnight, now_cal) + since_minutes;
  4584. hours = string.number(math.roundDown(minutes / 60));
  4585. minutes = string.number(minutes % 60);
  4586. msg.string(player, string.concat("§6Today: §r", hours, " h ", minutes, " min"));
  4587. //Spielzeit 30 Tage
  4588. year = now_year;
  4589. month = now_month;
  4590. day = now_day - 30;
  4591. if(day < 1) {
  4592. month -= 1;
  4593. if(month < 1) {
  4594. year -= 1;
  4595. month = 12;
  4596. }
  4597. day += time.getMonthDays(month, year);
  4598. }
  4599. thirtyDaysAgo = time.getCal(year, month, day, time.getHour(now_cal), time.getMinute(now_cal), time.getSecond(now_cal));
  4600. minutes = playtime.getPlayerInterval(p_id, thirtyDaysAgo, now_cal) + since_minutes;
  4601. hours = string.number(math.roundDown(minutes / 60));
  4602. minutes = string.number(minutes % 60);
  4603. msg.string(player, string.concat("§630 Days: §r", hours, " h ", minutes, " min"));
  4604. //Spielzeit gesamt
  4605. minutes = playtime.getPlayerTotal(p_id);
  4606. hours = string.number(math.roundDown(minutes / 60));
  4607. minutes = string.number(minutes % 60);
  4608. msg.string(player, string.concat("§6Total: §r", hours, " h ", minutes, " min"));
  4609. goto("wait");
  4610. @datatools
  4611. if(size == 0) {
  4612. @datatoolshelp
  4613. msg.prefix(player, prefix_datatools, "/datatools ...");
  4614. msg.string(player, "§6 - item-flag <name> §rAdds a flag on an item");
  4615. msg.string(player, "§6 - item-name <name> §rRenames an item");
  4616. msg.string(player, "§6 - item-lore <lore> §rSets an item lore");
  4617. msg.string(player, "§6 - item-attribute <attribut> <slot> <double> <op> §rAdds an attribute to an item");
  4618. msg.string(player, "§6 - entity-hide §rHides an entity");
  4619. msg.string(player, "§6 - entity-show §rShows an entity");
  4620. msg.string(player, "§6 - entity-name <name> §rRenames an entity");
  4621. msg.string(player, "§6 - entity-print §rPrint entities nbt-tag");
  4622. msg.string(player, "§6 - frame-hide §rHides an item frame");
  4623. msg.string(player, "§6 - frame-show §rShows an item frame");
  4624. msg.string(player, "§6 - name-visibility <boolean> §rShow name (not) permanent");
  4625. goto("wait");
  4626. }
  4627. arg0 = string.toLowerCase(list.getIndex(args, 0));
  4628. if(arg0 == "item-flag") {
  4629. if(size < 2) {
  4630. msg.prefix(player, prefix_datatools, "/datatools item-flag <name>");
  4631. goto("wait");
  4632. }
  4633. item = living.getHand(player);
  4634. if(item.isAir(item)) {
  4635. msg.prefix(player, prefix_datatools, "Hold an item in your hand.");
  4636. goto("wait");
  4637. }
  4638. name = string.concatList(args, " ", 1, size - 1);
  4639. if(!list.contains(item_flags, name)) {
  4640. msg.prefix(player, prefix_datatools, "You can´t add that flag.");
  4641. goto("wait");
  4642. }
  4643. item.addFlag(item, name);
  4644. msg.prefix(player, prefix_datatools, "Flag added.");
  4645. goto("wait");
  4646. }
  4647. if(arg0 == "item-attribute") {
  4648. if(size < 5) {
  4649. msg.prefix(player, prefix_datatools, "/datatools item-attribute <attribut> <slot> <double> <op>");
  4650. goto("wait");
  4651. }
  4652. item = living.getHand(player);
  4653. if(item.isAir(item)) {
  4654. msg.prefix(player, prefix_commands, "You have to hold an item in your mainhand.");
  4655. goto("wait");
  4656. }
  4657. double = list.getIndex(args, 3);
  4658. if(!isDouble(double) || double < 0) {
  4659. msg.prefix(player, prefix_datatools, "Natural number expected.");
  4660. goto("wait");
  4661. }
  4662. attribut = list.getIndex(args, 1);
  4663. if(!set.contains(attribut_set, attribut)) {
  4664. msg.prefix(player, prefix_datatools, "Unknown attribute.");
  4665. goto("wait");
  4666. }
  4667. slot = read.slot(list.getIndex(args, 2));
  4668. if(slot == null) {
  4669. msg.prefix(player, prefix_datatools, "Incorrect slot.");
  4670. goto("wait");
  4671. }
  4672. operation = list.getIndex(args, 4);
  4673. if(!set.contains(operation_set, operation)) {
  4674. msg.prefix(player, prefix_datatools, "Unknown operation.");
  4675. goto("wait");
  4676. }
  4677. item.addAttribute(item, attribut, slot, double, operation);
  4678. msg.prefix(player, prefix_datatools, "Attribute added.");
  4679. goto("wait");
  4680. }
  4681. if(arg0 == "item-name") {
  4682. if(size < 2) {
  4683. msg.prefix(player, prefix_datatools, "/datatools item-name <name>");
  4684. goto("wait");
  4685. }
  4686. item = living.getHand(player);
  4687. if(item.isAir(item)) {
  4688. msg.prefix(player, prefix_datatools, "You need to hold an item in your hand.");
  4689. goto("wait");
  4690. }
  4691. name = string.concatList(args, " ", 1, size - 1);
  4692. name = string.replace(name, "&", "§");
  4693. name = string.replace(name, "\\n", "\n");
  4694. item.setName(item, text.new(name));
  4695. msg.prefix(player, prefix_datatools, string.concat("Item renamed to ", name, "§r."));
  4696. goto("wait");
  4697. }
  4698. if(arg0 == "entity-print") {
  4699. entity = player.getTargetEntity(player, 5);
  4700. if(entity == null) {
  4701. msg.prefix(player, prefix_commands, "No entity found.");
  4702. goto("wait");
  4703. }
  4704. txt_ent = string.entity(entity);
  4705. msg(player, string.getClipBoardText(txt_ent, txt_ent));
  4706. goto("wait");
  4707. }
  4708. if(arg0 == "item-lore") {
  4709. if(size < 2) {
  4710. msg.prefix(player, prefix_datatools, "/datatools item-lore <lore>");
  4711. goto("wait");
  4712. }
  4713. item = living.getHand(player);
  4714. if(item.isAir(item)) {
  4715. msg.prefix(player, prefix_datatools, "You need to hold an item in your hand.");
  4716. goto("wait");
  4717. }
  4718. lore = string.concatList(args, " ", 1, size - 1);
  4719. lore = string.replace(lore, "&", "§");
  4720. item.addLore(item, lore);
  4721. msg.prefix(player, prefix_datatools, "New lore added.");
  4722. goto("wait");
  4723. }
  4724. if(arg0 == "entity-name") {
  4725. if(size < 2) {
  4726. msg.prefix(player, prefix_datatools, "/datatools entity-name <name>");
  4727. goto("wait");
  4728. }
  4729. templist = living.near(player, 3);
  4730. list.remove(templist, player);
  4731. if(list.getSize(templist) == 0) {
  4732. msg.prefix(player, prefix_datatools, "Too far away from an entity.");
  4733. goto("wait");
  4734. }
  4735. entity = list.getIndex(templist, 0);
  4736. name = string.concatList(args, " ", 1, size - 1);
  4737. name = string.replace(name, "&", "§");
  4738. entity.setName(entity, text.new(name), true);
  4739. msg.prefix(player, prefix_datatools, string.concat("Entity renamed to ", name, "§r."));
  4740. goto("wait");
  4741. }
  4742. if(arg0 == "name-visibility") {
  4743. if(size != 2) {
  4744. msg.prefix(player, prefix_datatools, "/datatools name-visibility <boolean>");
  4745. goto("wait");
  4746. }
  4747. templist = living.near(player, 3);
  4748. list.remove(templist, player);
  4749. if(list.getSize(templist) == 0) {
  4750. msg.prefix(player, prefix_datatools, "Too far away from an entity.");
  4751. goto("wait");
  4752. }
  4753. entity = list.getIndex(templist, 0);
  4754. boolean = list.getIndex(args, 1);
  4755. name = entity.getName(entity);
  4756. entity.setName(entity, name, boolean);
  4757. msg.prefix(player, prefix_datatools, "Name-Visibility changed.");
  4758. goto("wait");
  4759. }
  4760. if(arg0 == "frame-hide") {
  4761. if(size != 1) {
  4762. msg.prefix(player, prefix_datatools, "/datatools frame-hide");
  4763. goto("wait");
  4764. }
  4765. entity = player.getTargetEntity(player, 5);
  4766. if(entity == null) {
  4767. msg.prefix(player, prefix_datatools, "Not an item frame.");
  4768. goto("wait");
  4769. }
  4770. entity_type = entity.getType(entity);
  4771. if(entity_type != "item_frame" && entity_type != "glow_item_frame") {
  4772. msg.prefix(player, prefix_datatools, "Not an item frame.");
  4773. goto("wait");
  4774. }
  4775. entity.frame.hide(entity);
  4776. msg.prefix(player, prefix_datatools, "Item frame is now hidden.");
  4777. goto("wait");
  4778. }
  4779. if(arg0 == "frame-show") {
  4780. if(size != 1) {
  4781. msg.prefix(player, prefix_datatools, "/datatools frame-show");
  4782. goto("wait");
  4783. }
  4784. entity = player.getTargetEntity(player, 5);
  4785. if(entity == null) {
  4786. msg.prefix(player, prefix_datatools, "Not an item frame.");
  4787. goto("wait");
  4788. }
  4789. entity_type = entity.getType(entity);
  4790. if(entity_type != "item_frame" && entity_type != "glow_item_frame") {
  4791. msg.prefix(player, prefix_datatools, "Not an item frame.");
  4792. goto("wait");
  4793. }
  4794. entity.frame.show(entity);
  4795. msg.prefix(player, prefix_datatools, "Item frame now shown.");
  4796. goto("wait");
  4797. }
  4798. if(arg0 == "entity-hide") {
  4799. if(size != 1) {
  4800. msg.prefix(player, prefix_datatools, "/datatools entity-hide");
  4801. goto("wait");
  4802. }
  4803. templist = living.near(player, 3);
  4804. list.remove(templist, player);
  4805. if(list.getSize(templist) == 0) {
  4806. msg.prefix(player, prefix_datatools, "Too far away from an entity.");
  4807. goto("wait");
  4808. }
  4809. entity = list.getIndex(templist, 0);
  4810. living.setInvisible(entity, true);
  4811. msg.prefix(player, prefix_datatools, "Entity is now hidden.");
  4812. goto("wait");
  4813. }
  4814. if(arg0 == "entity-show") {
  4815. if(size != 1) {
  4816. msg.prefix(player, prefix_datatools, "/datatools entity-show");
  4817. goto("wait");
  4818. }
  4819. templist = living.near(player, 3);
  4820. list.remove(templist, player);
  4821. if(list.getSize(templist) == 0) {
  4822. msg.prefix(player, prefix_datatools, "Too far away from an entity.");
  4823. goto("wait");
  4824. }
  4825. entity = list.getIndex(templist, 0);
  4826. living.setInvisible(entity, false);
  4827. msg.prefix(player, prefix_datatools, "Entity is now visible.");
  4828. goto("wait");
  4829. }
  4830. goto("datatoolshelp");
  4831. @human
  4832. if(size == 0) {
  4833. @humanhelp
  4834. msg.prefix(player, prefix_human, "/human ...");
  4835. msg.string(player, string.concat("§6 - skin <name> §rSets the skin of a citizen"));
  4836. goto("wait");
  4837. }
  4838. arg0 = string.toLowerCase(list.getIndex(args, 0));
  4839. citizen = player.getTargetCitizen(player, 5);
  4840. if(!isCitizen(citizen)) {
  4841. msg.prefix(player, prefix_human, "No citizen.");
  4842. goto("wait");
  4843. }
  4844. elseif(arg0 == "skin") {
  4845. if(size == 2) {
  4846. name = string.toLowerCase(list.getIndex(args, 1));
  4847. if(name == "farmer") {
  4848. cit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+CbSJuHorHPbPskJRV8+L+Ra6rJLA9LJQh5li5EZCwiAwqBSQwqycIU7032xjtoPjfOXio0gAnqKLffTEc2irDq4KzZGH9WZjYJrEfS9eCkQ1780jl96oEordJT940G/mgiB+XZdg1RQs+YuDprGvX1ILVZluoN+SFWji9l3aPmktwGoP9K5NDJr1Yjqqtr0QcXUvB3bqs4EDeYe7+NXCtE4eW1bupr22dKO9EERyrL4oOm8K1lgmFRupeSH66R0Ny5Io8NrscZSSH1XZncnj6SZfYskJWRNN//F9BxM86hL0MEPtloAB9o0oJWLyoaXszMb1iJC9RKbvK3c2nAdyjWtcWijRA5muEZszzOX5XngHlFPAYWDI33EuTvqbth3GqZ7kid24Zly6TQbSCrd30EiNTeXYTJ1T5Fx1GRIzEYW+60qf3f2e59SlcBf4D7eA4btIaCAvfx2bKxbZQsdsHKDphpxsr7nizA8iRroo37nBiJ97gYUF2GsL03bLuge4cFLROpb4oaKGyldPZ4cHq33b8sbFs0eQUiS9selDsyx8G8MrvKfhYACpjyBv+ZLlWa+QMF4s=");
  4863. } elseif(name == "mage") {
  4864. citizen.setSkin(citizen, "ewogICJ0aW1lc3RhbXAiIDogMTU5NjMzNjk5OTgwMSwKICAicHJvZmlsZUlkIiA6ICI5MWYwNGZlOTBmMzY0M2I1OGYyMGUzMzc1Zjg2ZDM5ZSIsCiAgInByb2ZpbGVOYW1lIiA6ICJTdG9ybVN0b3JteSIsCiAgInNpZ25hdHVyZVJlcXVpcmVkIiA6IHRydWUsCiAgInRleHR1cmVzIiA6IHsKICAgICJTS0lOIiA6IHsKICAgICAgInVybCIgOiAiaHR0cDovL3RleHR1cmVzLm1pbmVjcmFmdC5uZXQvdGV4dHVyZS9kZjBiNzBmZmQ3NDE4N2Q5MTE2NmUzYmMxMTQzNTI2NTZmODVlNDdlYTNhYjcwNWI5MzUxMTkyMzJhMDA4Yzk2IgogICAgfQogIH0KfQ==", "eUzFSAiEth5qG5VV7uqbbfQln2QLJ6hurw4RARJ7qFHZaRqU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DJhNzIwMWJhMzBkMiIsCiAgInByb2ZpbGVOYW1lIiA6ICJDVUNGTDE3IiwKICAic2lnbmF0dXJlUmVxdWlyZWQiIDogdHJ1ZSwKICAidGV4dHVyZXMiIDogewogICAgIlNLSU4iIDogewogICAgICAidXJsIiA6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzYzYmMzNzczODg5YmRlNWFlZDA0NTliMWE5MWM5OWI1MTI4MDI1YzVmNTEwNDZjZjcxYjAxOWZhMTY2NWEyYTYiCiAgICB9CiAgfQp9", "r4SGS/TGW7tlibNTq4+uKg/v6oNc5eDD3BLbxIzcppll2tA9P4Za+16X968sgXQhrddNfdAh1zDui43WoON2Jrer797S1JzkddddISMiBq8CpjlUX77N6GvBOr5pBGgMKd0qLsDJUQF5Xa5FNun+ymwh1D57d0pb9eD0zNPIfD4V3REC1a9in1SHkoLfic11f8vCqBZ/oQ72eZ51GMYK1HWNSelCPGC1YQOEYI4WOD8suy44jRTrKO68cvmiizRBYykhJPP7Oqmcy2dOwXnDncif2vEEvTQVFp+uHolguIUOvKXy5lX7JIrZXsEgDaUHIAkQtMjO+9mH+qtkg2tniVTAUDFxQSdkbUY7kDfv40NipbiYgLyA4p+WPXr6BJyWGX6CCI8I71u7yUjOTH8pUt4OPVnGYUG0mT9kQO8P+vJIdW+Thg63/cTDHXmf8v+TDEdB2lyvjSdVeFD21C+MXXeM9yAWoZ370P1aLUar7dVUCRREpSBNpLFCo0wqpy1uiNYkO107LXD5wduxQJL1nQHVlym8+cvc7TyoRwEk7z6fL8NU+K8ijG/i9YhEUVPusCNhsbD33vJe2huroYMFx2DKHm9NeyTsTPsUmTu23bO4fZqttTdQohngbWYiDx0y8rDxakErF/gV4Ms38GVM80dAOde3dQpu0txYqGnPHxw=");
  4877. } elseif(name == "smith") {
  4878. citizen.setSkin(citizen, "eyJ0aW1lc3RhbXAiOjE1ODM1NTQzMTAxOTQsInByb2ZpbGVJZCI6IjIzZjFh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lROARCHwOA1sRDvP1nQHhZD1Uekj4Bmo6rsAjJCrzr++nK2IcaPMv1uTLv0sbsGe4JF884rqWHYzs7/Cc5lGv8FNy+QjHmTcISfjnlxwJIkI48KOmAjuaova+tU1gBHRFHqJR186Vw8gtIGHusitFr6rUuutODaHyJ1C9VnItyk5RF3eznsh+uUHSkT9NOCTAhx11UhaFjlIHgqHG3rRVmeFWyEKHE8Pk2yEAlROGPedp+oYEwMFbM97Q+og7W/RtSH+kYl9vNwpLrQEG2F0bQUtulwQrWzk8T2fKgPHncZIDS2YvQjrrHjjlG0bLbiakHGvRrMrLbrVtmQrKjOjLuc5j4M/quMoZpFz98q4uftCmNOyN9ZmoEjgFv5fOdsJDGJawSaug9VEieCWhuuPnXPx19GpT1TRzGRjDW9DqO08kNeCcRxq0=");
  4891. } else {
  4892. msg.action(player, "Not supported name.");
  4893. }
  4894. goto("wait");
  4895. }
  4896. }
  4897. goto("humanhelp");
  4898. @answer
  4899. if(player.isMuted(player)) {
  4900. msg.prefix(player, "§6Commands", "You are muted.");
  4901. goto("wait");
  4902. }
  4903. if(size < 1) {
  4904. msg.prefix(sender, prefix_commands, "/answer <message>");
  4905. goto("wait");
  4906. }
  4907. player_uuid = player.getUuid(sender);
  4908. p_uuid = map.get(answer_map, player_uuid);
  4909. if(p_uuid == null) {
  4910. msg.prefix(sender, prefix_commands, "There is no one you could answer.");
  4911. goto("wait");
  4912. }
  4913. string_message = string.concatList(string_args, " ", 0, size - 1);
  4914. string_message = string.concat("§e", string_message);
  4915. message = getMessage(string_message);
  4916. p = player.get(p_uuid);
  4917. if(p == null) {
  4918. msg.prefix(sender, prefix_commands, "This player is not online.");
  4919. goto("wait");
  4920. }
  4921. msg(sender, text.merge(text.new(string.concat("§6[§cme §6-> §c", player.getName(p), "§6] §r")), message));
  4922. msg(p, text.merge(text.new(string.concat("§6[§c", player.getName(sender), " §6-> §cme§6] §r")), message));
  4923. map.add(answer_map, p_uuid, player_uuid);
  4924. map.add(answer_map, player_uuid, p_uuid);
  4925. goto("wait");
  4926. @msg
  4927. if(player.isMuted(sender)) {
  4928. msg.prefix(sender, "§6Commands", "You are muted.");
  4929. goto("wait");
  4930. }
  4931. if(size < 2) {
  4932. msg.prefix(sender, prefix_commands, "/msg <player> <message>");
  4933. if(perm.has("msg.team", player)) {
  4934. msg.prefix(sender, prefix_commands, "/msg team <message>");
  4935. }
  4936. goto("wait");
  4937. }
  4938. string_message = string.concatList(string_args, " ", 1, size - 1);
  4939. string_message = string.concat("§e", string_message);
  4940. message = getMessage(string_message);
  4941. p_name = list.getIndex(args, 0);
  4942. if(p_name == "team") {
  4943. msg.team(player, message);
  4944. goto("wait");
  4945. }
  4946. p_uuid = player.getUuid(p_name);
  4947. if(p_uuid == null) {
  4948. msg.prefix(sender, prefix_commands, "Unknown player.");
  4949. goto("wait");
  4950. }
  4951. p = read.player(p_name);
  4952. if(p == null) {
  4953. msg.prefix(sender, prefix_commands, "This player is not online.");
  4954. goto("wait");
  4955. }
  4956. msg(p, text.merge(text.new(string.concat("§6[§c", player.getName(sender), " §6-> §cme§6] ")), message));
  4957. msg(sender, text.merge(text.new(string.concat("§6[§cme §6-> §c", player.getName(p), "§6] ")), message));
  4958. player_uuid = player.getUuid(sender);
  4959. map.add(answer_map, p_uuid, player_uuid);
  4960. map.add(answer_map, player_uuid, p_uuid);
  4961. goto("wait");
  4962. @list
  4963. list = players.toList();
  4964. size = list.getSize(list);
  4965. msg.string(sender, string.getSpacer());
  4966. if(size == 1) {
  4967. msg.string(sender, string.concat("§6There is ", string.number(size), " players online."));
  4968. } else {
  4969. msg.string(sender, string.concat("§6There are ", string.number(size), " players online."));
  4970. }
  4971. table = table.new("§f", 16, 16);
  4972. msg.string(sender, table.getStart(table));
  4973. for(i = 0; i < size; i++) {
  4974. p = list.getIndex(list, i++);
  4975. full_name = player.getFullName(p);
  4976. if(player.isAfk(p)) {
  4977. full_name = string.concat(full_name, " §5§o[Afk]");
  4978. }
  4979. if(i < size) {
  4980. p_2 = list.getIndex(list, i);
  4981. full_name_2 = player.getFullName(p_2);
  4982. if(player.isAfk(p_2)) {
  4983. full_name_2 = string.concat(full_name_2, " §5§o[Afk]");
  4984. }
  4985. } else {
  4986. full_name_2 = "";
  4987. }
  4988. msg.string(sender, table.get(table, full_name, full_name_2));
  4989. }
  4990. msg.string(sender, table.getEnd(table));
  4991. goto("wait");
  4992. @sign
  4993. if(size == 0) {
  4994. msg.prefix(player, prefix_commands, "/sign ...");
  4995. msg.string(player, "§6 - <row:1-4> [text] §rSet a sign line");
  4996. if(perm.has("sign.copy", player)) {
  4997. msg.string(player, "§6 - copy §rCopy a sign content");
  4998. msg.string(player, "§6 - paste §rPaste a sign content");
  4999. }
  5000. goto("wait");
  5001. }
  5002. block = player.getTargetBlock(player, 5);
  5003. if(block == null) {
  5004. msg.prefix(player, prefix_commands, "Look at a sign.");
  5005. goto("wait");
  5006. }
  5007. if(!block.hasTag(block, sign_tag)) {
  5008. msg.prefix(player, prefix_commands, "Look at a sign.");
  5009. goto("wait");
  5010. }
  5011. arg0 = string.toLowerCase(list.getIndex(args, 0));
  5012. if(arg0 == "copy") {
  5013. a = array.new(4);
  5014. a[0] = sign.getString(block, 0);
  5015. a[1] = sign.getString(block, 1);
  5016. a[2] = sign.getString(block, 2);
  5017. a[3] = sign.getString(block, 3);
  5018. map.add(sign_copy_map, player.getId(player), a);
  5019. msg.prefix(player, prefix_commands, "Sign copied.");
  5020. goto("wait");
  5021. }
  5022. if(arg0 == "paste") {
  5023. a = map.get(sign_copy_map, player.getId(player));
  5024. if(a == null) {
  5025. msg.prefix(player, prefix_commands, "Use '/sign copy' first.");
  5026. goto("wait");
  5027. }
  5028. sign.setString(block, 0, a[0]);
  5029. sign.setString(block, 1, a[1]);
  5030. sign.setString(block, 2, a[2]);
  5031. sign.setString(block, 3, a[3]);;
  5032. msg.prefix(player, prefix_commands, "Sign pasted.");
  5033. goto("wait");
  5034. }
  5035. line = list.getIndex(args, 0);
  5036. if(!isDouble(line)) {
  5037. msg.prefix(player, prefix_commands, "Number expected.");
  5038. goto("wait");
  5039. }
  5040. if(!(line == 1 || line == 2 || line == 3 || line == 4)) {
  5041. msg.prefix(player, prefix_commands, "Number between 1 and 4 expected.");
  5042. goto("wait");
  5043. }
  5044. if(!player.hasBypass(player)) {
  5045. if(!plot.check(block.getLocation(block), player, 19, true)) {
  5046. msg.prefix(player, prefix_commands, "Not your plot.");
  5047. goto("wait");
  5048. }
  5049. }
  5050. string = "";
  5051. if(size > 1) {
  5052. for(i = 1; i < size; i++) {
  5053. arg = list.getIndex(string_args, i);
  5054. if(i == 1) {
  5055. string = arg;
  5056. } else {
  5057. string = string.concat(string, " ", arg);
  5058. }
  5059. }
  5060. }
  5061. string = string.replace(string, "&", "§");
  5062. block.setSign(block, line - 1, text.new(string));
  5063. goto("wait");
  5064. @head
  5065. if(size != 1) {
  5066. msg.prefix(player, prefix_commands, "/head <player>");
  5067. goto("wait");
  5068. }
  5069. name = list.getIndex(args, 0);
  5070. uuid = player.getUuid(name);
  5071. if(uuid == null) {
  5072. head = read.item(string.concat("{id:\"minecraft:player_head\", Count:1b, tag:{SkullOwner:\"", name, "\"}}"));
  5073. } else {
  5074. head = player.getHead(uuid, name);
  5075. }
  5076. player.giveItem(player, head);
  5077. goto("wait");
  5078. @mute
  5079. if(size < 1) {
  5080. msg.prefix(sender, prefix_commands, "/mute <player> [message]");
  5081. goto("wait");
  5082. }
  5083. p_name = list.getIndex(args, 0);
  5084. if(!isOnline(p_name)) {
  5085. msg.prefix(sender, prefix_commands, "This player is not online.");
  5086. goto("wait");
  5087. }
  5088. p = read.player(p_name);
  5089. p_name = player.getName(p);
  5090. if(p_name == "marvinius") {
  5091. msg.string(sender, "§cSorry §b¯\\_(._.)_/¯");
  5092. goto("wait");
  5093. }
  5094. sender_name = player.getName(sender);
  5095. player.mute(p, true);
  5096. if(size > 1) {
  5097. reason = string.concatList(args, " ", 1, size - 1);
  5098. msg.team(sender_name, string.concat("§cMuted ", p_name, ": ", reason));
  5099. } else {
  5100. msg.team(sender_name, string.concat("§cMuted ", p_name, "."));
  5101. }
  5102. goto("wait");
  5103. @unmute
  5104. if(size < 1) {
  5105. msg.prefix(sender, prefix_commands, "/unmute <player>");
  5106. goto("wait");
  5107. }
  5108. p_name = list.getIndex(args, 0);
  5109. if(!isOnline(p_name)) {
  5110. msg.prefix(sender, prefix_commands, "This player is not online.");
  5111. goto("wait");
  5112. }
  5113. p = read.player(p_name);
  5114. p_name = player.getName(p);
  5115. if(p_name == "marvinius") {
  5116. msg.string(sender, "§cSorry §b¯\\_(._.)_/¯");
  5117. goto("wait");
  5118. }
  5119. msg.team(player.getName(sender), string.concat("§cUnmuted ", p_name, "."));
  5120. player.mute(p, false);
  5121. goto("wait");
  5122. @kick
  5123. if(size < 1) {
  5124. msg.prefix(sender, prefix_commands, "/kick <player> [reason]");
  5125. goto("wait");
  5126. }
  5127. p_name = list.getIndex(args, 0);
  5128. if(!isOnline(p_name)) {
  5129. msg.prefix(sender, prefix_commands, "This player is not online.");
  5130. goto("wait");
  5131. }
  5132. p = read.player(p_name);
  5133. p_name = player.getName(p);
  5134. if(p_name == "marvinius") {
  5135. msg.string(sender, "§cSorry §b¯\\_(._.)_/¯");
  5136. goto("wait");
  5137. }
  5138. sender_name = player.getName(sender);
  5139. if(size > 1) {
  5140. reason = string.concatList(args, " ", 1, size - 1);
  5141. msg.team(sender_name, string.concat("§c", p_name, " got kicked: ", reason));
  5142. } else {
  5143. reason = "You got kicked";
  5144. msg.team(sender_name, string.concat("§c", p_name, " got kicked."));
  5145. }
  5146. ban.kick(p, text.new(reason));
  5147. goto("wait");
  5148. @warn
  5149. if(size != 1) {
  5150. msg.prefix(sender, prefix_commands, "/warn <player>");
  5151. goto("wait");
  5152. }
  5153. p_name = list.getIndex(args, 0);
  5154. if(!isOnline(p_name)) {
  5155. msg.prefix(sender, prefix_commands, "This player is not online.");
  5156. goto("wait");
  5157. }
  5158. p = read.player(p_name);
  5159. p_name = player.getName(p);
  5160. if(p_name == "marvinius") {
  5161. msg.string(sender, "§cSorry §b¯\\_(._.)_/¯");
  5162. goto("wait");
  5163. }
  5164. title.send(p, text.new(string.concat("§c", player.getName(sender))), text.new("is watching you"));
  5165. msg.prefix(sender, prefix_commands, "The player got warned.");
  5166. goto("wait");
  5167. @ban
  5168. if(size < 1) {
  5169. msg.prefix(sender, prefix_commands, "/ban <player> [reason]");
  5170. goto("wait");
  5171. }
  5172. p_name = list.getIndex(args, 0);
  5173. if(!checkIfEverOnline(p_name)) {
  5174. msg.prefix(sender, prefix_commands, "This player has never been online.");
  5175. goto("wait");
  5176. }
  5177. p_name = player.getName(player.getUuid(p_name));
  5178. if(p_name == "marvinius") {
  5179. msg.string(sender, "§cSorry §b¯\\_(._.)_/¯");
  5180. goto("wait");
  5181. }
  5182. sender_name = player.getName(sender);
  5183. if(size > 1) {
  5184. reason = string.concatList(args, " ", 1, size - 1);
  5185. msg.team(sender_name, string.concat("§c", p_name, " got banned: ", reason));
  5186. } else {
  5187. reason = "You got banned.";
  5188. msg.team(sender_name, string.concat("§c", p_name, " got banned."));
  5189. }
  5190. ban.add(player.getUuid(p_name), reason, sender_name);
  5191. if(isOnline(p_name)) {
  5192. p = read.player(p_name);
  5193. ban.kick(p, text.new(reason));
  5194. }
  5195. goto("wait");
  5196. @unban
  5197. if(size != 1) {
  5198. msg.prefix(sender, prefix_commands, "/unban <player>");
  5199. goto("wait");
  5200. }
  5201. p_name = list.getIndex(args, 0);
  5202. if(!checkIfEverOnline(p_name)) {
  5203. msg.prefix(sender, prefix_commands, "This player has never been online.");
  5204. goto("wait");
  5205. }
  5206. p_name = player.getName(player.getUuid(p_name));
  5207. ban.remove(player.getUuid(p_name));
  5208. msg.team(player.getName(sender), string.concat("§cUnbanned ", p_name, "."));
  5209. goto("wait");
  5210. @tempban
  5211. if(size < 4) {
  5212. msg.prefix(sender, prefix_commands, "/tempban <player> <days> <hours> <minutes> [reason]");
  5213. goto("wait");
  5214. }
  5215. p_name = list.getIndex(args, 0);
  5216. if(!checkIfEverOnline(p_name)) {
  5217. msg.prefix(sender, prefix_commands, "This player has never been online.");
  5218. goto("wait");
  5219. }
  5220. p_name = player.getName(player.getUuid(p_name));
  5221. if(p_name == "marvinius") {
  5222. msg.string(sender, "§cSorry §b¯\\_(._.)_/¯");
  5223. goto("wait");
  5224. }
  5225. days = list.getIndex(args, 1);
  5226. hours = list.getIndex(args, 2);
  5227. minutes = list.getIndex(args, 3);
  5228. if(!isDouble(days) || !isDouble(hours) || !isDouble(minutes)) {
  5229. msg.prefix(sender, prefix_commands, "Number expected.");
  5230. goto("wait");
  5231. }
  5232. if(days < 0 || hours < 0 || minutes < 0) {
  5233. msg.prefix(sender, prefix_commands, "Positive number expected.");
  5234. goto("wait");
  5235. }
  5236. endtime = time.getMillis() + minutes * 60000 + hours * 3600000 + days * 86400000;
  5237. timestring = time.getString(endtime);
  5238. sender_name = player.getName(sender);
  5239. if(size > 4) {
  5240. reason = string.concatList(args, " ", 4, size - 1);
  5241. msg.team(sender_name, string.concat("§c", p_name, " got banned until ", timestring, ". Reason: ", reason));
  5242. } else {
  5243. reason = "You got banned.";
  5244. msg.team(sender_name, string.concat("§c", p_name, " got banned until ", timestring, "."));
  5245. }
  5246. calendar = time.new(endtime);
  5247. ban.add(player.getUuid(p_name), reason, sender_name, calendar);
  5248. if(isOnline(p_name)) {
  5249. p = read.player(p_name);
  5250. ban.kick(p, text.new(reason));
  5251. }
  5252. goto("wait");
  5253. @ping
  5254. msg.string(player, "pong");
  5255. goto("wait");
  5256. @plot
  5257. if(size == 0) {
  5258. @plothelp
  5259. msg.prefix(player, prefix_plot, "/plot ...");
  5260. msg.string(player, "§d - info §rReturns info about current location");
  5261. if(!perm.has("plot.moreinfo", player)) {
  5262. msg.string(player, "§d - list §rLists your plots");
  5263. }
  5264. msg.string(player, "");
  5265. msg.string(player, "§d - pos1/pos2 §rSet corner points");
  5266. msg.string(player, "§d - create §rCreates a (sub-)plot (Y: -64 to 319)");
  5267. msg.string(player, "§d - create3D §rCreates a 3D (sub-)plot");
  5268. msg.string(player, "");
  5269. msg.string(player, "§d - remove [id] §rRemoves a plot");
  5270. msg.string(player, "§d - expand <value> [direction] [id] §rExpands a plot");
  5271. msg.string(player, "§d - name [id] <name> §rRenames a plot");
  5272. msg.string(player, "");
  5273. msg.string(player, "§d - share <player> [id] §rAdd a player to a plot");
  5274. msg.string(player, "§d - kick <player> [id] §rRemove a player from a plot");
  5275. msg.string(player, "§d - leader <player> [id] §rSet a new plot leader");
  5276. msg.string(player, "§d - mod <player> [id] §rPromote to plot mod");
  5277. msg.string(player, "§d - chest <player> [id] §rAllows a player to open chests");
  5278. msg.string(player, "");
  5279. msg.string(player, "§d - raise §rRaises a plot to a city. Costs §610 gold snuvis§r.");
  5280. msg.string(player, "§d - sell <price> §rSells a sub-plot");
  5281. msg.string(player, "");
  5282. if(perm.has("plot.moreinfo", player)) {
  5283. msg.string(player, "§d - list [player] §rLists all plots from a player");
  5284. msg.string(player, "§d - moreinfo [id] §rReturns more detailed infos");
  5285. msg.string(player, "§d - listall §rLists all plots");
  5286. msg.string(player, "§d - flags <flags> <boolean> §rSet all flags to the boolean");
  5287. msg.string(player, "§d - move <value> [direction] [id] §rMoves a block");
  5288. }
  5289. goto("wait");
  5290. }
  5291. arg0 = string.toLowerCase(list.getIndex(args, 0));
  5292. if(arg0 == "sell") {
  5293. if(size != 2) {
  5294. msg.prefix(player, prefix_commands, "/plot sell <price>");
  5295. goto("wait");
  5296. }
  5297. block = player.getTargetBlock(player, 5);
  5298. if(block == null) {
  5299. msg.prefix(player, prefix_commands, "Look at a sign.");
  5300. goto("wait");
  5301. }
  5302. if(!block.hasTag(block, sign_tag)) {
  5303. msg.prefix(player, prefix_plot, "You need to look at an empty sign.");
  5304. goto("wait");
  5305. }
  5306. if(sign.getString(block, 0) != "" || sign.getString(block, 1) != "" || sign.getString(block, 2) != "" || sign.getString(block, 3) != "") {
  5307. msg.prefix(player, prefix_plot, "You need to look at an empty sign.");
  5308. goto("wait");
  5309. }
  5310. sign_loc = block.getLocation(block);
  5311. plot_list = plot.get(sign_loc);
  5312. amount = list.getSize(plot_list);
  5313. if(amount == 0 || amount == 1) {
  5314. msg.prefix(player, prefix_plot, "You aren´t on a sub plot.");
  5315. goto("wait");
  5316. }
  5317. if(amount > 2) {
  5318. msg.prefix(player, prefix_plot, "Multiple plots present. Not possible.");
  5319. goto("wait");
  5320. }
  5321. plot_1 = list.getIndex(plot_list, 0);
  5322. plot_2 = list.getIndex(plot_list, 1);
  5323. if(plot.isCity(plot_1)) {
  5324. city_plot = plot_1;
  5325. sell_plot = plot_2;
  5326. } elseif(plot.isCity(plot_2)) {
  5327. sell_plot = plot_1;
  5328. city_plot = plot_2;
  5329. } else {
  5330. msg.prefix(player, prefix_plot, "No city found.");
  5331. goto("wait");
  5332. }
  5333. if(!plot.isLeader(city_plot, player) && !plot.isMod(city_plot, player)) {
  5334. msg.prefix(player, prefix_plot, "You aren´t a city plot leader or mod.");
  5335. goto("wait");
  5336. }
  5337. snuvis = list.getIndex(args, 1);
  5338. if(!isDouble(snuvis) || snuvis < 0) {
  5339. msg.prefix(player, prefix_plot, "Positive number expected.");
  5340. goto("wait");
  5341. }
  5342. //Sell Plot
  5343. x1 = plot.getMinX(sell_plot);
  5344. y1 = plot.getMinY(sell_plot);
  5345. z1 = plot.getMinZ(sell_plot);
  5346. x2 = plot.getMaxX(sell_plot);
  5347. y2 = plot.getMaxY(sell_plot);
  5348. z2 = plot.getMaxZ(sell_plot);
  5349. length = math.abs(x1 - x2) + 1;
  5350. width = math.abs(z1 - z2) + 1;
  5351. high = math.abs(y1 - y2) + 1;
  5352. //Change plot settings
  5353. plot.setFree(sell_plot, true);
  5354. plot.setName(sell_plot, "Free Plot");
  5355. plot.removePlayer(sell_plot, player.getName(player));
  5356. //Label Sign
  5357. block.setSign(sign_loc, 0, "§3[§bFree Plot§3]");
  5358. block.setSign(sign_loc, 1, string.concat("§2", string.number(snuvis)));
  5359. if(high == 319) {
  5360. block.setSign(sign_loc, 2, string.concat(string.number(length), "x", string.number(width)));
  5361. } else {
  5362. block.setSign(sign_loc, 2, string.concat(string.number(length), "x", string.number(width), " (Y:", string.number(high), ")"));
  5363. }
  5364. block.setSign(sign_loc, 3, string.number(player.getId(player)));
  5365. msg.prefix(player, prefix_plot, "Free plot for selling created.");
  5366. world = loc.getWorld(sign_loc);
  5367. plot.savePlots(world);
  5368. goto("wait");
  5369. }
  5370. if(arg0 == "raise") {
  5371. location = entity.getLocation(player);
  5372. plot_list = plot.get(location);
  5373. amount = list.getSize(plot_list);
  5374. if(amount == 0) {
  5375. msg.prefix(player, prefix_plot, "You aren´t on a plot.");
  5376. goto("wait");
  5377. }
  5378. plot = list.getIndex(plot_list, 0);
  5379. if(plot.isCity(plot)) {
  5380. msg.prefix(player, prefix_plot, "This plot is already a city.");
  5381. goto("wait");
  5382. }
  5383. if(!plot.isLeader(plot, player)) {
  5384. msg.prefix(player, prefix_plot, "Only the plot leader can do this.");
  5385. goto("wait");
  5386. }
  5387. if(amount > 1) {
  5388. msg.prefix(player, prefix_plot, "Multiple plots present. Not possible.");
  5389. goto("wait");
  5390. }
  5391. x1 = plot.getMinX(plot);
  5392. z1 = plot.getMinZ(plot);
  5393. x2 = plot.getMaxX(plot);
  5394. z2 = plot.getMaxZ(plot);
  5395. length = math.abs(x1 - x2) + 1;
  5396. width = math.abs(z1 - z2) + 1;
  5397. plot_size = length * width;
  5398. if(plot_size < 2500) {
  5399. msg.prefix(player, prefix_plot, "Your plot must be over 2500m2.");
  5400. goto("wait");
  5401. }
  5402. snuvis = 40960;
  5403. if(!hasEnoughMoney(player, snuvis)) {
  5404. msg.prefix(player, prefix_plot, string.concat("You´ll need §6", string.number(snuvis), "§r snuvis for this."));
  5405. goto("wait");
  5406. }
  5407. offerRank(player, "rank.major");
  5408. player.setPlotRaised(player, true);
  5409. money.sub(player, snuvis);
  5410. plot.setCity(plot, true);
  5411. msg.prefix(player, prefix_plot, string.concat("City created. Spent §6", string.number(snuvis), "§r snuvis."));
  5412. world = loc.getWorld(location);
  5413. plot.savePlots(world);
  5414. goto("wait");
  5415. }
  5416. if(arg0 == "leader") {
  5417. if(size < 2) {
  5418. msg.prefix(player, prefix_commands, "/plot leader <player> [plot_id]");
  5419. goto("wait");
  5420. }
  5421. p_name = list.getIndex(args, 1);
  5422. p_uuid = player.getUuid(p_name);
  5423. if(p_uuid == null) {
  5424. msg.prefix(player, prefix_plot, "This player has never been online.");
  5425. goto("wait");
  5426. }
  5427. p_name = player.getName(p_uuid);
  5428. location = entity.getLocation(player);
  5429. world = loc.getWorld(location);
  5430. if(size == 2) {
  5431. plot_list = plot.get(location);
  5432. amount = list.getSize(plot_list);
  5433. if(amount == 0) {
  5434. msg.prefix(player, prefix_plot, "You aren´t on a plot.");
  5435. goto("wait");
  5436. }
  5437. plot = list.getIndex(plot_list, 0);
  5438. if(amount > 1) {
  5439. msg.prefix(player, prefix_plot, "Multiple plots present:");
  5440. for(i = 0; i < amount; i++) {
  5441. plot = list.getIndex(plot_list, i);
  5442. plot_id = plot.getId(plot);
  5443. 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)))));
  5444. }
  5445. goto("wait");
  5446. }
  5447. } else {
  5448. if(size != 3) {
  5449. msg.prefix(player, prefix_commands, "/plot leader <player> [plot_id]");
  5450. goto("wait");
  5451. }
  5452. plot_id = list.getIndex(args, 2);
  5453. plot = plot.getFromId(plot_id, world);
  5454. if(plot == null) {
  5455. msg.prefix(player, prefix_plot, "Unknown plot or not in this world.");
  5456. goto("wait");
  5457. }
  5458. }
  5459. player_id = player.getId(player);
  5460. if(!perm.has("plot.other", player)) {
  5461. if(!world.canUsePlots(world)) {
  5462. msg.prefix(player, prefix_perms, "You have no permission for this in this world.");
  5463. goto("wait");
  5464. }
  5465. if(!plot.isLeader(plot, player_id)) {
  5466. msg.prefix(player, prefix_plot, "You aren´t the plot leader.");
  5467. goto("wait");
  5468. }
  5469. player_name = player.getName(player);
  5470. if(player_name == p_name) {
  5471. msg.prefix(player, prefix_plot, "You are already the plot leader.");
  5472. goto("wait");
  5473. }
  5474. }
  5475. p_id = player.getId(p_uuid);
  5476. if(plot.isLeader(plot, p_id)) {
  5477. msg.prefix(player, prefix_plot, "This player is already the plot leader.");
  5478. goto("wait");
  5479. }
  5480. old_leader = plot.getLeaderId(plot);
  5481. if(old_leader != null) {
  5482. plot.setMod(plot, old_leader);
  5483. }
  5484. plot.setLeader(plot, p_id);
  5485. plot.addPlayer(plot, p_name);
  5486. msg.prefix(player, prefix_plot, string.concat(p_name, " promoted to plot leader."));
  5487. plot.savePlots(world);
  5488. goto("wait");
  5489. }
  5490. if(arg0 == "mod") {
  5491. if(size < 2) {
  5492. msg.prefix(player, prefix_commands, "/plot mod <player> [plot_id]");
  5493. goto("wait");
  5494. }
  5495. p_name = list.getIndex(args, 1);
  5496. p_uuid = player.getUuid(p_name);
  5497. if(p_uuid == null) {
  5498. msg.prefix(player, prefix_plot, "This player has never been online.");
  5499. goto("wait");
  5500. }
  5501. p_name = player.getName(p_uuid);
  5502. location = entity.getLocation(player);
  5503. world = loc.getWorld(location);
  5504. if(size == 2) {
  5505. plot_list = plot.get(location);
  5506. amount = list.getSize(plot_list);
  5507. if(amount == 0) {
  5508. msg.prefix(player, prefix_plot, "You aren´t on a plot.");
  5509. goto("wait");
  5510. }
  5511. plot = list.getIndex(plot_list, 0);
  5512. if(amount > 1) {
  5513. msg.prefix(player, prefix_plot, "Multiple plots present:");
  5514. for(i = 0; i < amount; i++) {
  5515. plot = list.getIndex(plot_list, i);
  5516. plot_id = plot.getId(plot);
  5517. 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)))));
  5518. }
  5519. goto("wait");
  5520. }
  5521. } else {
  5522. if(size != 3) {
  5523. msg.prefix(player, prefix_commands, "/plot mod <player> [plot_id]");
  5524. goto("wait");
  5525. }
  5526. plot_id = list.getIndex(args, 2);
  5527. plot = plot.getFromId(plot_id, world);
  5528. if(plot == null) {
  5529. msg.prefix(player, prefix_plot, "Unknown plot or not in this world.");
  5530. goto("wait");
  5531. }
  5532. }
  5533. player_id = player.getId(player);
  5534. if(!perm.has("plot.other", player)) {
  5535. if(!world.canUsePlots(world)) {
  5536. msg.prefix(player, prefix_perms, "You have no permission for this in this world.");
  5537. goto("wait");
  5538. }
  5539. if(!plot.isLeader(plot, player_id)) {
  5540. msg.prefix(player, prefix_plot, "You aren´t the plot leader.");
  5541. goto("wait");
  5542. }
  5543. }
  5544. p_id = player.getId(p_uuid);
  5545. if(plot.isLeader(plot, p_id)) {
  5546. msg.prefix(player, prefix_plot, "Not possible. Promote another player first /plot leader <player>.");
  5547. goto("wait");
  5548. }
  5549. if(plot.isMod(plot, p_id)) {
  5550. msg.prefix(player, prefix_plot, "This player is already a plot mod.");
  5551. goto("wait");
  5552. }
  5553. plot.setMod(plot, p_id);
  5554. plot.addPlayer(plot, p_name);
  5555. msg.prefix(player, prefix_plot, string.concat(p_name, " promoted to plot mod."));
  5556. plot.savePlots(world);
  5557. goto("wait");
  5558. }
  5559. if(arg0 == "chest") {
  5560. if(size < 2) {
  5561. msg.prefix(player, prefix_commands, "/plot chest <player> [plot_id]");
  5562. goto("wait");
  5563. }
  5564. p_name = list.getIndex(args, 1);
  5565. p_uuid = player.getUuid(p_name);
  5566. if(p_uuid == null) {
  5567. msg.prefix(player, prefix_plot, "This player has never been online.");
  5568. goto("wait");
  5569. }
  5570. p_name = player.getName(p_uuid);
  5571. location = entity.getLocation(player);
  5572. world = loc.getWorld(location);
  5573. if(size == 2) {
  5574. plot_list = plot.get(location);
  5575. amount = list.getSize(plot_list);
  5576. if(amount == 0) {
  5577. msg.prefix(player, prefix_plot, "You aren´t on a plot.");
  5578. goto("wait");
  5579. }
  5580. plot = list.getIndex(plot_list, 0);
  5581. if(amount > 1) {
  5582. msg.prefix(player, prefix_plot, "Multiple plots present:");
  5583. for(i = 0; i < amount; i++) {
  5584. plot = list.getIndex(plot_list, i);
  5585. plot_id = plot.getId(plot);
  5586. 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)))));
  5587. }
  5588. goto("wait");
  5589. }
  5590. } else {
  5591. if(size != 3) {
  5592. msg.prefix(player, prefix_commands, "/plot chest <player> [plot_id]");
  5593. goto("wait");
  5594. }
  5595. plot_id = list.getIndex(args, 2);
  5596. plot = plot.getFromId(plot_id, world);
  5597. if(plot == null) {
  5598. msg.prefix(player, prefix_plot, "Unknown plot or not in this world.");
  5599. goto("wait");
  5600. }
  5601. }
  5602. player_id = player.getId(player);
  5603. if(!perm.has("plot.other", player)) {
  5604. if(!world.canUsePlots(world)) {
  5605. msg.prefix(player, prefix_perms, "You have no permission for this in this world.");
  5606. goto("wait");
  5607. }
  5608. if(!plot.isLeader(plot, player_id) && !plot.isMod(plot, player_id)) {
  5609. msg.prefix(player, prefix_plot, "You aren´t a plot leader or mod.");
  5610. goto("wait");
  5611. }
  5612. }
  5613. p_id = player.getId(p_uuid);
  5614. if(plot.isLeader(plot, p_id) || plot.isMod(plot, p_id)) {
  5615. msg.prefix(player, prefix_plot, "Not possible. Player has higher permissions.");
  5616. goto("wait");
  5617. }
  5618. if(plot.canOpenChests(plot, p_id)) {
  5619. msg.prefix(player, prefix_plot, "This player already can open chests.");
  5620. goto("wait");
  5621. }
  5622. plot.setChest(plot, p_id);
  5623. msg.prefix(player, prefix_plot, string.concat(p_name, " can now open chests."));
  5624. goto("wait");
  5625. }
  5626. if(arg0 == "remove") {
  5627. location = entity.getLocation(player);
  5628. world = loc.getWorld(location);
  5629. if(size == 1) {
  5630. plot_list = plot.get(location);
  5631. amount = list.getSize(plot_list);
  5632. if(amount == 0) {
  5633. msg.prefix(player, prefix_plot, "You aren´t on a plot.");
  5634. goto("wait");
  5635. }
  5636. plot = list.getIndex(plot_list, 0);
  5637. if(amount > 1) {
  5638. msg.prefix(player, prefix_plot, "Multiple plots present:");
  5639. for(i = 0; i < amount; i++) {
  5640. plot = list.getIndex(plot_list, i);
  5641. plot_id = plot.getId(plot);
  5642. 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)))));
  5643. }
  5644. goto("wait");
  5645. }
  5646. } else {
  5647. if(size != 2) {
  5648. msg.prefix(player, prefix_commands, "/plot remove [plot_id]");
  5649. goto("wait");
  5650. }
  5651. plot_id = list.getIndex(args, 1);
  5652. plot = plot.getFromId(plot_id, world);
  5653. if(plot == null) {
  5654. msg.prefix(player, prefix_plot, "Unknown plot or not in this world.");
  5655. goto("wait");
  5656. }
  5657. }
  5658. if(!perm.has("plot.other", player)) {
  5659. if(!world.canUsePlots(world)) {
  5660. msg.prefix(player, prefix_perms, "You have no permission for this in this world.");
  5661. goto("wait");
  5662. }
  5663. player_id = player.getId(player);
  5664. if(!plot.isLeader(plot, player_id)) {
  5665. msg.prefix(player, prefix_plot, "You aren´t the plot leader.");
  5666. goto("wait");
  5667. }
  5668. }
  5669. if(plot.isCity(plot)) {
  5670. plot_list = plot.intersecting(world, plot.getMinX(plot), plot.getMinY(plot), plot.getMinZ(plot), plot.getMaxX(plot), plot.getMaxY(plot), plot.getMaxZ(plot));
  5671. iter = iterator(plot_list);
  5672. while(hasNext(iter)) {
  5673. sub_plot = next(iter);
  5674. plot.removeAllPlayers(sub_plot);
  5675. plot.remove(sub_plot, world);
  5676. }
  5677. }
  5678. //10% money back
  5679. x1 = plot.getMinX(plot);
  5680. z1 = plot.getMinZ(plot);
  5681. x2 = plot.getMaxX(plot);
  5682. z2 = plot.getMaxZ(plot);
  5683. length = x2 - x1 + 1;
  5684. width = z2 - z1 + 1;
  5685. snuvis = math.round(plot.calcCost(world, length, width) / 10);
  5686. leader_id = plot.getLeaderId(plot);
  5687. if(leader_id != null) {
  5688. money.add(leader_id, snuvis);
  5689. msg.prefix(player, prefix_plot, string.concat("Returned 10% of plot costs: ", money.getString(snuvis)));
  5690. }
  5691. //remove plot
  5692. plot.removeAllPlayers(plot);
  5693. plot.delMoveEvent(plot);
  5694. plot.remove(plot, world);
  5695. msg.prefix(player, prefix_plot, string.concat("Plot removed. #", string.number(plot.getId(plot)), " §6", plot.getName(plot)));
  5696. plot.savePlots(world);
  5697. goto("wait");
  5698. }
  5699. if(arg0 == "expand") {
  5700. if(size < 2) {
  5701. msg.prefix(player, prefix_commands, "/plot expand <value> [direction] [plot_id]");
  5702. goto("wait");
  5703. }
  5704. location = entity.getLocation(player);
  5705. world = loc.getWorld(location);
  5706. anzahl = list.getIndex(args, 1);
  5707. if(!isDouble(anzahl) || anzahl < 0) {
  5708. msg.prefix(player, prefix_plot, "Positive number expected.");
  5709. goto("wait");
  5710. }
  5711. if(size == 2) {
  5712. yaw = loc.getYaw(location);
  5713. direction = getDirection(yaw);
  5714. if(direction == null) {
  5715. msg.prefix(player, prefix_plot, "Direction of view too imprecise.");
  5716. goto("wait");
  5717. }
  5718. plot_list = plot.get(location);
  5719. amount = list.getSize(plot_list);
  5720. if(amount == 0) {
  5721. msg.prefix(player, prefix_plot, "You aren´t on a plot.");
  5722. goto("wait");
  5723. }
  5724. plot = list.getIndex(plot_list, 0);
  5725. if(amount > 1) {
  5726. msg.prefix(player, prefix_plot, "Multiple plots present:");
  5727. for(i = 0; i < amount; i++) {
  5728. plot = list.getIndex(plot_list, i);
  5729. plot_id = plot.getId(plot);
  5730. 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)))));
  5731. }
  5732. goto("wait");
  5733. }
  5734. } else {
  5735. if(size != 4) {
  5736. msg.prefix(player, prefix_commands, "/plot expand <value> [<direction> <plot_id>]");
  5737. goto("wait");
  5738. }
  5739. direction = string.toLowerCase(list.getIndex(args, 2));
  5740. plot_id = list.getIndex(args, 3);
  5741. plot = plot.getFromId(plot_id, world);
  5742. if(plot == null) {
  5743. msg.prefix(player, prefix_plot, "Unknown plot or not in this world.");
  5744. goto("wait");
  5745. }
  5746. }
  5747. if(plot.isSub(plot)) {
  5748. msg.prefix(player, prefix_plot, "Sub plots can´t be expanded.");
  5749. goto("wait");
  5750. }
  5751. x1 = plot.getMinX(plot);
  5752. y1 = plot.getMinY(plot);
  5753. z1 = plot.getMinZ(plot);
  5754. x2 = plot.getMaxX(plot);
  5755. y2 = plot.getMaxY(plot);
  5756. z2 = plot.getMaxZ(plot);
  5757. old_length = math.abs(x1 - x2) + 1;
  5758. old_width = math.abs(z1 - z2) + 1;
  5759. if(direction == "east") {
  5760. old_x2 = x2;
  5761. x2 += anzahl;
  5762. list = plot.intersecting(world, x2, y1, z1, old_x2, y2, z2);
  5763. } elseif(direction == "south") {
  5764. old_z2 = z2;
  5765. z2 += anzahl;
  5766. list = plot.intersecting(world, x1, y1, z2, x2, y2, old_z2);
  5767. } elseif(direction == "west") {
  5768. old_x1 = x1;
  5769. x1 -= anzahl;
  5770. list = plot.intersecting(world, old_x1, y1, z1, x1, y2, z2);
  5771. } elseif(direction == "north") {
  5772. old_z1 = z1;
  5773. z1 -= anzahl;
  5774. list = plot.intersecting(world, x1, y1, old_z1, x2, y2, z1);
  5775. } else {
  5776. msg.prefix(player, prefix_plot, "Unknown direction [north/east/south/west].");
  5777. goto("wait");
  5778. }
  5779. if(!perm.has("plot.other", player)) {
  5780. if(list.getSize(list) > 0) {
  5781. msg.prefix(player, prefix_plot, "New area is intersecting with other plots.");
  5782. goto("wait");
  5783. }
  5784. if(!world.canUsePlots(world)) {
  5785. msg.prefix(player, prefix_perms, "You have no permission for this in this world.");
  5786. goto("wait");
  5787. }
  5788. player_id = player.getId(player);
  5789. if(!plot.isLeader(plot, player_id)) {
  5790. msg.prefix(player, prefix_plot, "You aren´t the plot leader.");
  5791. goto("wait");
  5792. }
  5793. //Calc costs
  5794. length = math.abs(x1 - x2) + 1;
  5795. width = math.abs(z1 - z2) + 1;
  5796. snuvis = plot.calcCost(world, length, width) - plot.calcCost(world, old_length, old_width);
  5797. if(!hasEnoughMoney(player, snuvis)) {
  5798. msg.prefix(player, prefix_plot, string.concat("You´ll need §6", string.number(snuvis), "§r snuvis for this."));
  5799. goto("wait");
  5800. }
  5801. money.sub(player, snuvis);
  5802. expand_message = string.concat("The plot has been expanded. Spent §6", string.number(snuvis), "§r snuvis.");
  5803. if(!player.hasBigPlotCreated(player)) {
  5804. plot_size = length * width;
  5805. if(plot_size >= 900) {
  5806. offerRank(player, "rank.colonizer");
  5807. player.setBigPlotCreated(player, true);
  5808. }
  5809. }
  5810. } else {
  5811. expand_message = string.concat("The plot has been expanded.");
  5812. }
  5813. //Expand plot
  5814. gs_edge1 = loc.new(world, x1, y1, z1);
  5815. gs_edge2 = loc.new(world, x2, y2, z2);
  5816. new_plot = plot.setEdges(plot, gs_edge1, gs_edge2);
  5817. plot.delMoveEvent(plot);
  5818. plot.setMoveEvent(new_plot, world);
  5819. msg.prefix(player, prefix_plot, expand_message);
  5820. plot.savePlots(world);
  5821. goto("wait");
  5822. }
  5823. if(arg0 == "move") {
  5824. if(!perm.has("plot.move", player)) {
  5825. perm.no("plot.move", player);
  5826. goto("wait");
  5827. }
  5828. if(size < 2) {
  5829. msg.prefix(player, prefix_commands, "/plot move <value> [direction] [plot_id]");
  5830. goto("wait");
  5831. }
  5832. location = entity.getLocation(player);
  5833. world = loc.getWorld(location);
  5834. anzahl = list.getIndex(args, 1);
  5835. if(!isDouble(anzahl) || anzahl < 0) {
  5836. msg.prefix(player, prefix_plot, "Positive number expected.");
  5837. goto("wait");
  5838. }
  5839. if(size == 2) {
  5840. yaw = loc.getYaw(location);
  5841. direction = getDirection(yaw);
  5842. if(direction == null) {
  5843. msg.prefix(player, prefix_plot, "Direction of view too imprecise.");
  5844. goto("wait");
  5845. }
  5846. plot_list = plot.get(location);
  5847. amount = list.getSize(plot_list);
  5848. if(amount == 0) {
  5849. msg.prefix(player, prefix_plot, "You aren´t on a plot.");
  5850. goto("wait");
  5851. }
  5852. plot = list.getIndex(plot_list, 0);
  5853. if(amount > 1) {
  5854. msg.prefix(player, prefix_plot, "Multiple plots present:");
  5855. for(i = 0; i < amount; i++) {
  5856. plot = list.getIndex(plot_list, i);
  5857. plot_id = plot.getId(plot);
  5858. 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)))));
  5859. }
  5860. goto("wait");
  5861. }
  5862. } else {
  5863. if(size != 4) {
  5864. msg.prefix(player, prefix_commands, "/plot move <value> [<direction> <plot_id>]");
  5865. goto("wait");
  5866. }
  5867. direction = string.toLowerCase(list.getIndex(args, 2));
  5868. plot_id = list.getIndex(args, 3);
  5869. plot = plot.getFromId(plot_id, world);
  5870. if(plot == null) {
  5871. msg.prefix(player, prefix_plot, "Unknown plot or not in this world.");
  5872. goto("wait");
  5873. }
  5874. }
  5875. if(plot.isSub(plot)) {
  5876. msg.prefix(player, prefix_plot, "Sub plots can´t be moved.");
  5877. goto("wait");
  5878. }
  5879. x1 = plot.getMinX(plot);
  5880. y1 = plot.getMinY(plot);
  5881. z1 = plot.getMinZ(plot);
  5882. x2 = plot.getMaxX(plot);
  5883. y2 = plot.getMaxY(plot);
  5884. z2 = plot.getMaxZ(plot);
  5885. old_length = math.abs(x1 - x2) + 1;
  5886. old_width = math.abs(z1 - z2) + 1;
  5887. if(direction == "east") {
  5888. x1 += anzahl;
  5889. x2 += anzahl;
  5890. } elseif(direction == "south") {
  5891. z1 += anzahl;
  5892. z2 += anzahl;
  5893. } elseif(direction == "west") {
  5894. x1 -= anzahl;
  5895. x2 -= anzahl;
  5896. } elseif(direction == "north") {
  5897. z1 -= anzahl;
  5898. z2 -= anzahl;
  5899. } else {
  5900. msg.prefix(player, prefix_plot, "Unknown direction [north/east/south/west].");
  5901. goto("wait");
  5902. }
  5903. //Move plot
  5904. gs_edge1 = loc.new(world, x1, y1, z1);
  5905. gs_edge2 = loc.new(world, x2, y2, z2);
  5906. new_plot = plot.setEdges(plot, gs_edge1, gs_edge2);
  5907. plot.delMoveEvent(plot);
  5908. plot.setMoveEvent(new_plot, world);
  5909. msg.prefix(player, prefix_plot, "The plot has been moved.");
  5910. plot.savePlots(world);
  5911. goto("wait");
  5912. }
  5913. if(arg0 == "share") {
  5914. if(size < 2) {
  5915. msg.prefix(player, prefix_commands, "/plot share <player> [plot_id]");
  5916. goto("wait");
  5917. }
  5918. p_name = list.getIndex(args, 1);
  5919. p_uuid = player.getUuid(p_name);
  5920. if(p_uuid == null) {
  5921. msg.prefix(player, prefix_plot, "This player has never been online.");
  5922. goto("wait");
  5923. }
  5924. p_name = player.getName(p_uuid);
  5925. location = entity.getLocation(player);
  5926. world = loc.getWorld(location);
  5927. if(size == 2) {
  5928. plot_list = plot.get(location);
  5929. amount = list.getSize(plot_list);
  5930. if(amount == 0) {
  5931. msg.prefix(player, prefix_plot, "You aren´t on a plot.");
  5932. goto("wait");
  5933. }
  5934. plot = list.getIndex(plot_list, 0);
  5935. if(amount > 1) {
  5936. msg.prefix(player, prefix_plot, "Multiple plots present:");
  5937. for(i = 0; i < amount; i++) {
  5938. plot = list.getIndex(plot_list, i);
  5939. plot_id = plot.getId(plot);
  5940. 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)))));
  5941. }
  5942. goto("wait");
  5943. }
  5944. } else {
  5945. if(size != 3) {
  5946. msg.prefix(player, prefix_commands, "/plot share <player> [plot_id]");
  5947. goto("wait");
  5948. }
  5949. plot_id = list.getIndex(args, 2);
  5950. plot = plot.getFromId(plot_id, world);
  5951. if(plot == null) {
  5952. msg.prefix(player, prefix_plot, "Unknown plot or not in this world.");
  5953. goto("wait");
  5954. }
  5955. }
  5956. if(!perm.has("plot.other", player)) {
  5957. if(!world.canUsePlots(world)) {
  5958. msg.prefix(player, prefix_perms, "You have no permission for this in this world.");
  5959. goto("wait");
  5960. }
  5961. player_id = player.getId(player);
  5962. if(!plot.isLeader(plot, player_id) && !plot.isMod(plot, player_id)) {
  5963. msg.prefix(player, prefix_plot, "You aren´t a plot leader or mod.");
  5964. goto("wait");
  5965. }
  5966. }
  5967. plot.addPlayer(plot, p_name);
  5968. msg.prefix(player, prefix_plot, string.concat(p_name, " added to the plot."));
  5969. plot.savePlots(world);
  5970. goto("wait");
  5971. }
  5972. if(arg0 == "kick") {
  5973. if(size < 2) {
  5974. msg.prefix(player, prefix_commands, "/plot kick <player> [plot_id]");
  5975. goto("wait");
  5976. }
  5977. p_name = list.getIndex(args, 1);
  5978. p_uuid = player.getUuid(p_name);
  5979. if(p_uuid == null) {
  5980. msg.prefix(player, prefix_plot, "This player has never been online.");
  5981. goto("wait");
  5982. }
  5983. p_name = player.getName(p_uuid);
  5984. location = entity.getLocation(player);
  5985. world = loc.getWorld(location);
  5986. if(size == 2) {
  5987. plot_list = plot.get(location);
  5988. amount = list.getSize(plot_list);
  5989. if(amount == 0) {
  5990. msg.prefix(player, prefix_plot, "You aren´t on a plot.");
  5991. goto("wait");
  5992. }
  5993. plot = list.getIndex(plot_list, 0);
  5994. if(amount > 1) {
  5995. msg.prefix(player, prefix_plot, "Multiple plots present:");
  5996. for(i = 0; i < amount; i++) {
  5997. plot = list.getIndex(plot_list, i);
  5998. plot_id = plot.getId(plot);
  5999. 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)))));
  6000. }
  6001. goto("wait");
  6002. }
  6003. } else {
  6004. if(size != 3) {
  6005. msg.prefix(player, prefix_commands, "/plot kick <player> [plot_id]");
  6006. goto("wait");
  6007. }
  6008. plot_id = list.getIndex(args, 2);
  6009. plot = plot.getFromId(plot_id, world);
  6010. if(plot == null) {
  6011. msg.prefix(player, prefix_plot, "Unknown plot or not in this world.");
  6012. goto("wait");
  6013. }
  6014. }
  6015. if(!perm.has("plot.other", player)) {
  6016. if(!world.canUsePlots(world)) {
  6017. msg.prefix(player, prefix_perms, "You have no permission for this in this world.");
  6018. goto("wait");
  6019. }
  6020. if(!plot.isLeader(plot, player) && !plot.isMod(plot, player)) {
  6021. msg.prefix(player, prefix_plot, "You aren´t a plot leader or mod.");
  6022. goto("wait");
  6023. }
  6024. player_name = player.getName(player);
  6025. if(player_name == p_name) {
  6026. msg.prefix(player, prefix_plot, "You can´t kick yourself.");
  6027. goto("wait");
  6028. }
  6029. p_id = player.getId(p_uuid);
  6030. if(plot.isLeader(plot, p_id)) {
  6031. msg.prefix(player, prefix_plot, "You can´t kick the plot-leader.");
  6032. goto("wait");
  6033. }
  6034. }
  6035. plot.removePlayer(plot, p_name);
  6036. msg.prefix(player, prefix_plot, string.concat(p_name, " removed from this plot."));
  6037. plot.savePlots(world);
  6038. goto("wait");
  6039. }
  6040. if(arg0 == "name") {
  6041. if(size < 2) {
  6042. msg.prefix(player, prefix_commands, "/plot name [plot_id] <name>");
  6043. goto("wait");
  6044. }
  6045. location = entity.getLocation(player);
  6046. world = loc.getWorld(location);
  6047. //Angegeben wurde ein Name aus einem Wort, ohne Plotid. Der Spieler muss auf einem Plot sein.
  6048. if(size == 2) {
  6049. plot_list = plot.get(location);
  6050. amount = list.getSize(plot_list);
  6051. if(amount == 0) {
  6052. msg.prefix(player, prefix_plot, "You aren´t on a plot.");
  6053. goto("wait");
  6054. }
  6055. plot = list.getIndex(plot_list, 0);
  6056. name = list.getIndex(args, 1);
  6057. if(amount > 1) {
  6058. msg.prefix(player, prefix_plot, "Multiple plots present:");
  6059. for(i = 0; i < amount; i++) {
  6060. plot = list.getIndex(plot_list, i);
  6061. plot_id = plot.getId(plot);
  6062. 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)))));
  6063. }
  6064. goto("wait");
  6065. }
  6066. }
  6067. if(size > 2) {
  6068. plot_id = list.getIndex(args, 1);
  6069. if(isDouble(plot_id)) {
  6070. //Angegeben wurde eine eine Plotid mit einem Namen aus ein oder mehreren Wörtern
  6071. plot = plot.getFromId(plot_id, world);
  6072. if(plot == null) {
  6073. msg.prefix(player, prefix_plot, "Unknown plot or not in this world.");
  6074. goto("wait");
  6075. }
  6076. name = string.concatList(args, " ", 2, size - 1);
  6077. } else {
  6078. //Angegeben wurde ein Name aus mehreren Wörtern, ohne Plotid. Der Spieler muss auf einem Plot sein.
  6079. name = string.concatList(args, " ", 1, size - 1);
  6080. plot_list = plot.get(location);
  6081. amount = list.getSize(plot_list);
  6082. if(amount == 0) {
  6083. msg.prefix(player, prefix_plot, "You aren´t on a plot.");
  6084. goto("wait");
  6085. }
  6086. plot = list.getIndex(plot_list, 0);
  6087. if(amount > 1) {
  6088. msg.prefix(player, prefix_plot, "Multiple plots present:");
  6089. for(i = 0; i < amount; i++) {
  6090. plot = list.getIndex(plot_list, i);
  6091. plot_id = plot.getId(plot);
  6092. 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)))));
  6093. }
  6094. goto("wait");
  6095. }
  6096. }
  6097. }
  6098. if(!perm.has("plot.other", player)) {
  6099. if(!world.canUsePlots(world)) {
  6100. msg.prefix(player, prefix_perms, "You have no permission for this in this world.");
  6101. goto("wait");
  6102. }
  6103. player_id = player.getId(player);
  6104. if(!plot.isLeader(plot, player_id) && !plot.isMod(plot, player_id)) {
  6105. msg.prefix(player, prefix_plot, "You aren´t a plot leader or mod.");
  6106. goto("wait");
  6107. }
  6108. }
  6109. plot.setName(plot, name);
  6110. msg.prefix(player, prefix_plot, string.concat("Plot renamed to ", name, "."));
  6111. plot.savePlots(world);
  6112. goto("wait");
  6113. }
  6114. if(arg0 == "create" || arg0 == "create3d") {
  6115. player_id = player.getId(player);
  6116. loc1 = map.get(plotpos1, player_id);
  6117. loc2 = map.get(plotpos2, player_id);
  6118. if(loc1 == null || loc2 == null) {
  6119. msg.prefix(player, prefix_plot, "Set corners points with §d/p pos1 §rand §d/p pos2§r.");
  6120. goto("wait");
  6121. }
  6122. world1 = loc.getWorld(loc1);
  6123. if(world1 != loc.getWorld(loc2)) {
  6124. msg.prefix(player, prefix_plot, "Corner points have different worlds.");
  6125. goto("wait");
  6126. }
  6127. x1 = loc.getX(loc1);
  6128. z1 = loc.getZ(loc1);
  6129. x2 = loc.getX(loc2);
  6130. z2 = loc.getZ(loc2);
  6131. if(arg0 == "create") {
  6132. y1 = -64;
  6133. y2 = 319;
  6134. loc.setY(loc1, y1);
  6135. loc.setY(loc2, y2);
  6136. } else {
  6137. y1 = loc.getY(loc1);
  6138. y2 = loc.getY(loc2);
  6139. }
  6140. create_message = "Plot created.";
  6141. sub_plot = false;
  6142. if(!perm.has("plot.other", player)) {
  6143. world_name = world.getName(world1);
  6144. if(!world.canUsePlots(world1)) {
  6145. msg.prefix(player, prefix_perms, "You have no permission in this world.");
  6146. goto("wait");
  6147. }
  6148. list = plot.intersecting(world1, x1, y1, z1, x2, y2, z2);
  6149. if(list.getSize(list) > 0) {
  6150. city_plot = list.getIndex(list, 0);
  6151. if(plot.isCity(city_plot)) {
  6152. if(!plot.isLeader(city_plot, player_id) && !plot.isMod(city_plot, player_id)) {
  6153. msg.prefix(player, prefix_plot, "You aren´t a plot leader or mod.");
  6154. goto("wait");
  6155. }
  6156. city_id = plot.getId(city_plot);
  6157. if(!loc.hasPlotId(loc1, city_id)) {
  6158. msg.prefix(player, prefix_plot, "The sub plot needs to be surrounded by the city.");
  6159. goto("wait");
  6160. }
  6161. if(!loc.hasPlotId(loc2, city_id)) {
  6162. msg.prefix(player, prefix_plot, "The sub plot needs to be surrounded by the city.");
  6163. goto("wait");
  6164. }
  6165. sub_plot = true;
  6166. } else {
  6167. msg.prefix(player, prefix_plot, "Intersecting plots are not allowed.");
  6168. goto("wait");
  6169. }
  6170. }
  6171. if(!sub_plot) {
  6172. //Calc costs
  6173. length = math.abs(x1 - x2) + 1;
  6174. width = math.abs(z1 - z2) + 1;
  6175. if(length < 3 || width < 3) {
  6176. msg.prefix(player, prefix_plot, "Length and width of the plot must be at least 3.");
  6177. goto("wait");
  6178. }
  6179. snuvis = plot.calcCost(world1, length, width);
  6180. free_plot_used = player.usedHisFreePlot(player_id);
  6181. if(!free_plot_used && world_name != "creative") {
  6182. snuvis -= plot.calcCost(world1, 16, 16);
  6183. if(snuvis < 0) {
  6184. snuvis = 0;
  6185. }
  6186. msg.prefix(player, prefix_plot, "Free plot (16 x 16) to calculation included.");
  6187. }
  6188. if(!hasEnoughMoney(player, snuvis)) {
  6189. msg.prefix(player, prefix_plot, string.concat("You´ll need ", money.getString(snuvis), " snuvis for this."));
  6190. goto("wait");
  6191. }
  6192. create_message = string.concat("Plot created. Spent ", money.getString(snuvis), " snuvis.");
  6193. money.sub(player, snuvis);
  6194. if(!free_plot_used && world_name != "creative") {
  6195. player.setUsedFreePlot(player_id, true);
  6196. offerRank(player, "rank.settler");
  6197. }
  6198. if(!player.hasBigPlotCreated(player)) {
  6199. plot_size = length * width;
  6200. if(plot_size >= 900) {
  6201. offerRank(player, "rank.colonizer");
  6202. player.setBigPlotCreated(player, true);
  6203. }
  6204. }
  6205. }
  6206. }
  6207. //Create plot
  6208. map.remove(plotpos1, player_id);
  6209. map.remove(plotpos2, player_id);
  6210. plot = plot.add(loc1, loc2);
  6211. if(sub_plot) {
  6212. plot.setSub(plot, true);
  6213. }
  6214. plot.setMoveEvent(plot, world1);
  6215. player_name = player.getName(player);
  6216. plot.setName(plot, string.concat("Plot of ", player_name));
  6217. plot.addPlayer(plot, player_name);
  6218. plot.setLeader(plot, player_id);
  6219. msg.prefix(player, prefix_plot, create_message);
  6220. plot.savePlots(world1);
  6221. goto("wait");
  6222. }
  6223. if(arg0 == "pos1" || arg0 == "pos2") {
  6224. loc = entity.getLocation(player);
  6225. loc = getBlockLocation(loc);
  6226. player_id = player.getId(player);
  6227. if(arg0 == "pos1") {
  6228. map.add(plotpos1, player_id, loc);
  6229. pos_string = "Pos1";
  6230. } elseif(arg0 == "pos2") {
  6231. map.add(plotpos2, player_id, loc);
  6232. pos_string = "Pos2";
  6233. }
  6234. x = string.number(loc.getX(loc));
  6235. y = string.number(loc.getY(loc));
  6236. z = string.number(loc.getZ(loc));
  6237. msg.prefix(player, prefix_plot, string.concat(pos_string, " (", x, "/", y, "/", z, ") set."));
  6238. loc1 = map.get(plotpos1, player_id);
  6239. loc2 = map.get(plotpos2, player_id);
  6240. if(loc1 != null && loc2 != null) {
  6241. world1 = loc.getWorld(loc1);
  6242. snuvis = plot.calcCost(world1, loc1, loc2);
  6243. if(!player.usedHisFreePlot(player_id) && world.getName(world1) != "creative") {
  6244. snuvis -= plot.calcCost(world1, 16, 16);
  6245. if(snuvis < 0) {
  6246. snuvis = 0;
  6247. }
  6248. msg.prefix(player, prefix_plot, "Free plot (16 x 16) to calculation included.");
  6249. }
  6250. if(loc.isCity(loc1) && loc.isCity(loc2)) {
  6251. snuvis = 0;
  6252. }
  6253. msg.prefix(player, prefix_plot, string.concat("This plot will cost ", money.getString(snuvis), " snuvis."));
  6254. }
  6255. goto("wait");
  6256. }
  6257. if(arg0 == "flags") {
  6258. if(!perm.has("plot.moreinfo", player)) {
  6259. perm.no("plot.moreinfo", player);
  6260. goto("wait");
  6261. }
  6262. if(size < 3 || size > 4) {
  6263. msg.prefix(player, prefix_commands, "/plot flags <flags> <boolean> [plot_id]");
  6264. goto("wait");
  6265. }
  6266. flags = list.getIndex(args, 1);
  6267. if(!isDouble(flags) || flags < 0) {
  6268. msg.prefix(player, prefix_commands, "Positive number expected.");
  6269. goto("wait");
  6270. }
  6271. boolean = list.getIndex(args, 2);
  6272. if(!(boolean == true || boolean == false)) {
  6273. msg.prefix(player, prefix_commands, "Boolean expected.");
  6274. goto("wait");
  6275. }
  6276. location = entity.getLocation(player);
  6277. world = loc.getWorld(location);
  6278. if(size == 3) {
  6279. plot_list = plot.get(location);
  6280. amount = list.getSize(plot_list);
  6281. if(amount == 0) {
  6282. msg.prefix(player, prefix_plot, "You aren´t on a plot.");
  6283. goto("wait");
  6284. }
  6285. plot = list.getIndex(plot_list, 0);
  6286. if(amount > 1) {
  6287. msg.prefix(player, prefix_plot, "Multiple plots present:");
  6288. for(i = 0; i < amount; i++) {
  6289. plot = list.getIndex(plot_list, i);
  6290. plot_id = plot.getId(plot);
  6291. x = loc.getX(location);
  6292. y = loc.getY(location);
  6293. z = loc.getZ(location);
  6294. 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)))));
  6295. }
  6296. goto("wait");
  6297. }
  6298. } else {
  6299. plot_id = list.getIndex(args, 3);
  6300. plot = plot.getFromId(plot_id, world);
  6301. if(plot == null) {
  6302. msg.prefix(player, prefix_plot, "Unknown plot or not in this world.");
  6303. goto("wait");
  6304. }
  6305. }
  6306. plot.setFlags(plot, flags, boolean);
  6307. msg.prefix(player, prefix_plot, "Flags gesetzt.");
  6308. plot.savePlots(world);
  6309. goto("wait");
  6310. }
  6311. if(arg0 == "list") {
  6312. if(size == 1) {
  6313. p_name = player.getName(player);
  6314. } else {
  6315. if(!perm.has("plot.moreinfo", player)) {
  6316. perm.no("plot.moreinfo", player);
  6317. goto("wait");
  6318. }
  6319. p_name = list.getIndex(args, 1);
  6320. }
  6321. p_uuid = player.getUuid(p_name);
  6322. if(p_uuid == null) {
  6323. msg.prefix(player, prefix_plot, "This player has never been online.");
  6324. goto("wait");
  6325. }
  6326. p_name = player.getName(p_uuid);
  6327. msg.prefix(player, prefix_commands, string.concat("Plots of ", p_name, ":"));
  6328. world = loc.getWorld(entity.getLocation(player));
  6329. iter = plot.iterator(world, p_uuid);
  6330. while(hasNext(iter)) {
  6331. plot = next(iter);
  6332. msg.string(player, string.concat(" - #", string.number(plot.getId(plot)), " ", plot.getType(plot), " §6", plot.getName(plot)));
  6333. }
  6334. goto("wait");
  6335. }
  6336. if(arg0 == "listall") {
  6337. if(!perm.has("plot.moreinfo", player)) {
  6338. perm.no("plot.moreinfo", player);
  6339. goto("wait");
  6340. }
  6341. if(size != 1) {
  6342. msg.prefix(player, prefix_commands, "/plot listall");
  6343. goto("wait");
  6344. }
  6345. world = loc.getWorld(entity.getLocation(player));
  6346. msg.prefix(player, prefix_commands, string.concat("All plots in this world: ", world.getName(world)));
  6347. iterator = plot.iterator(world);
  6348. while(hasNext(iterator)) {
  6349. plot = next(iterator);
  6350. plot_id = plot.getId(plot);
  6351. msg.string(player, string.concat(" - #", string.number(plot_id), " ", plot.getType(plot), " §6", plot.getName(plot), " §r", plot.getLeaderName(plot)));
  6352. }
  6353. goto("wait");
  6354. }
  6355. if(arg0 == "moreinfo" || arg0 == "mi") {
  6356. if(!perm.has("plot.moreinfo", player)) {
  6357. perm.no("plot.moreinfo", player);
  6358. goto("wait");
  6359. }
  6360. location = entity.getLocation(player);
  6361. world = loc.getWorld(location);
  6362. if(size == 1) {
  6363. plot_list = plot.get(location);
  6364. amount = list.getSize(plot_list);
  6365. if(amount == 0) {
  6366. msg.prefix(player, prefix_plot, "You aren´t on a plot.");
  6367. goto("wait");
  6368. }
  6369. plot = list.getIndex(plot_list, 0);
  6370. if(amount > 1) {
  6371. msg.prefix(player, prefix_plot, "Multiple plots present:");
  6372. for(i = 0; i < amount; i++) {
  6373. plot = list.getIndex(plot_list, i);
  6374. plot_id = plot.getId(plot);
  6375. 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)))));
  6376. }
  6377. goto("wait");
  6378. }
  6379. } else {
  6380. if(size != 2) {
  6381. msg.prefix(player, prefix_commands, "/plot moreinfo [plot_id]");
  6382. goto("wait");
  6383. }
  6384. plot_id = list.getIndex(args, 1);
  6385. plot = plot.getFromId(plot_id, world);
  6386. if(plot == null) {
  6387. msg.prefix(player, prefix_plot, "Unknown plot or not in this world.");
  6388. goto("wait");
  6389. }
  6390. }
  6391. owners = "";
  6392. owners_list = plot.getOwners(plot);
  6393. copy_list = list.copy(owners_list);
  6394. plot_id = plot.getId(plot);
  6395. x1 = plot.getMinX(plot);
  6396. y1 = plot.getMinY(plot);
  6397. z1 = plot.getMinZ(plot);
  6398. x2 = plot.getMaxX(plot);
  6399. y2 = plot.getMaxY(plot);
  6400. z2 = plot.getMaxZ(plot);
  6401. length = x2 - x1 + 1;
  6402. width = z2 - z1 + 1;
  6403. msg.string(player, string.concat(" - #", string.number(plot_id), " ", plot.getType(plot), " §6", plot.getName(plot), " §r", string.number(length), "x", string.number(width)));
  6404. owners_list = plot.getOwners(plot);
  6405. copy_list = list.copy(owners_list);
  6406. msg.string(player, string.concat(" §dW §r", world.getName(world)));
  6407. msg.string(player, string.concat(" §dX1 §r", string.number(x1), " §dY1 §r", string.number(y1), " §dZ1 §r", string.number(z1)));
  6408. msg.string(player, string.concat(" §dX2 §r", string.number(x2), " §dY2 §r", string.number(y2), " §dZ2 §r", string.number(z2)));
  6409. leader_name = plot.getLeaderName(plot);
  6410. if(leader_name != "") {
  6411. msg.string(player, string.concat(" §dLeader: §r", leader_name));
  6412. list.remove(copy_list, player.getUuid(leader_name));
  6413. }
  6414. mods_list = plot.getMods(plot);
  6415. mods_amount = list.getSize(mods_list);
  6416. if(mods_amount != 0) {
  6417. iter = iterator(mods_list);
  6418. mods_string = "";
  6419. while(hasNext(iter)) {
  6420. p_name = player.getNameFromId(next(iter));
  6421. p_uuid = player.getUuid(p_name);
  6422. list.remove(copy_list, p_uuid);
  6423. if(mods_string == "") {
  6424. mods_string = p_name;
  6425. } else {
  6426. mods_string = string.concat(mods_string, " / ", p_name);
  6427. }
  6428. }
  6429. msg.string(player, string.concat(" §dMods: §r", mods_string));
  6430. }
  6431. members_amount = list.getSize(copy_list);
  6432. if(members_amount != 0) {
  6433. iter = iterator(copy_list);
  6434. members_string = "";
  6435. while(hasNext(iter)) {
  6436. p_name = player.getName(next(iter));
  6437. if(members_string == "") {
  6438. members_string = p_name;
  6439. } else {
  6440. members_string = string.concat(members_string, " / ", p_name);
  6441. }
  6442. }
  6443. msg.string(player, string.concat(" §dMembers: §r", members_string));
  6444. }
  6445. chests_list = plot.getChestRanks(plot);
  6446. chests_amount = list.getSize(chests_list);
  6447. if(chests_amount != 0) {
  6448. iter = iterator(chests_list);
  6449. chests_string = "";
  6450. while(hasNext(iter)) {
  6451. p_name = player.getNameFromId(next(iter));
  6452. if(chests_string == "") {
  6453. chests_string = p_name;
  6454. } else {
  6455. chests_string = string.concat(chests_string, " / ", p_name);
  6456. }
  6457. }
  6458. msg.string(player, string.concat(" §dOnly chest: §r", chests_string));
  6459. }
  6460. a = getFlagLists(plot);
  6461. flags_true = a[0];
  6462. flags_false = a[1];
  6463. x = loc.getX(location);
  6464. y = loc.getY(location);
  6465. z = loc.getZ(location);
  6466. msg.string(player, " §dFlags true:");
  6467. iter = iterator(flags_true);
  6468. while(hasNext(iter)) {
  6469. array = next(iter);
  6470. flag_number = array[0];
  6471. flag_name = array[1];
  6472. msg(player, text.merge(text.new(" "), string.getClickText(string.concat(" §d[§r", flag_name, "§d] "), string.concat("/plot flags ", flag_number, " false ", plot_id))));
  6473. }
  6474. msg.string(player, " §dFlags false:");
  6475. iter = iterator(flags_false);
  6476. while(hasNext(iter)) {
  6477. array = next(iter);
  6478. flag_number = array[0];
  6479. flag_name = array[1];
  6480. msg(player, text.merge(text.new(" "), string.getClickText(string.concat(" §d[§r", flag_name, "§d] "), string.concat("/plot flags ", flag_number, " true ", plot_id))));
  6481. }
  6482. goto("wait");
  6483. }
  6484. if(arg0 == "info" || arg0 == "i") {
  6485. location = entity.getLocation(player);
  6486. list = plot.get(location);
  6487. world = loc.getWorld(location);
  6488. size = list.getSize(list);
  6489. if(size == 0) {
  6490. msg.prefix(player, prefix_plot, "No plots found.");
  6491. goto("wait");
  6492. }
  6493. if(size == 1) {
  6494. msg.prefix(player, prefix_plot, string.concat(string.number(size), " plot found:"));
  6495. } else {
  6496. msg.prefix(player, prefix_plot, string.concat(string.number(size), " plots found:"));
  6497. }
  6498. for(i = 0; i < size; i++) {
  6499. plot = list.getIndex(list, i);
  6500. plot_id = plot.getId(plot);
  6501. x1 = plot.getMinX(plot);
  6502. y1 = plot.getMinY(plot);
  6503. z1 = plot.getMinZ(plot);
  6504. x2 = plot.getMaxX(plot);
  6505. y2 = plot.getMaxY(plot);
  6506. z2 = plot.getMaxZ(plot);
  6507. length = x2 - x1 + 1;
  6508. width = z2 - z1 + 1;
  6509. msg.string(player, string.concat(" - #", string.number(plot_id), " ", plot.getType(plot), " §6", plot.getName(plot), " §r", string.number(length), "x", string.number(width)));
  6510. owners_list = plot.getOwners(plot);
  6511. copy_list = list.copy(owners_list);
  6512. msg.string(player, string.concat(" §dW §r", world.getName(world)));
  6513. msg.string(player, string.concat(" §dX1 §r", string.number(x1), " §dY1 §r", string.number(y1), " §dZ1 §r", string.number(z1)));
  6514. msg.string(player, string.concat(" §dX2 §r", string.number(x2), " §dY2 §r", string.number(y2), " §dZ2 §r", string.number(z2)));
  6515. leader_name = plot.getLeaderName(plot);
  6516. if(leader_name != "") {
  6517. msg.string(player, string.concat(" §dLeader: §r", leader_name));
  6518. list.remove(copy_list, player.getUuid(leader_name));
  6519. }
  6520. mods_list = plot.getMods(plot);
  6521. mods_amount = list.getSize(mods_list);
  6522. if(mods_amount != 0) {
  6523. iter = iterator(mods_list);
  6524. mods_string = "";
  6525. while(hasNext(iter)) {
  6526. p_name = player.getNameFromId(next(iter));
  6527. p_uuid = player.getUuid(p_name);
  6528. list.remove(copy_list, p_uuid);
  6529. if(mods_string == "") {
  6530. mods_string = p_name;
  6531. } else {
  6532. mods_string = string.concat(mods_string, " / ", p_name);
  6533. }
  6534. }
  6535. msg.string(player, string.concat(" §dMods: §r", mods_string));
  6536. }
  6537. members_amount = list.getSize(copy_list);
  6538. if(members_amount != 0) {
  6539. iter = iterator(copy_list);
  6540. members_string = "";
  6541. while(hasNext(iter)) {
  6542. p_name = player.getName(next(iter));
  6543. if(members_string == "") {
  6544. members_string = p_name;
  6545. } else {
  6546. members_string = string.concat(members_string, " / ", p_name);
  6547. }
  6548. }
  6549. msg.string(player, string.concat(" §dMembers: §r", members_string));
  6550. }
  6551. chests_list = plot.getChestRanks(plot);
  6552. chests_amount = list.getSize(chests_list);
  6553. if(chests_amount != 0) {
  6554. iter = iterator(chests_list);
  6555. chests_string = "";
  6556. while(hasNext(iter)) {
  6557. p_name = player.getNameFromId(next(iter));
  6558. if(chests_string == "") {
  6559. chests_string = p_name;
  6560. } else {
  6561. chests_string = string.concat(chests_string, " / ", p_name);
  6562. }
  6563. }
  6564. msg.string(player, string.concat(" §dOnly chest: §r", chests_string));
  6565. }
  6566. }
  6567. goto("wait");
  6568. }
  6569. goto("plothelp");
  6570. @stopadventure
  6571. removeAdventureDisplay(player);
  6572. player.setAdventure(player, false);
  6573. msg.prefix(player, "§5Adventure", "Adventure canceled!");
  6574. goto("wait");
  6575. @speed
  6576. if(size < 1 || size > 2) {
  6577. if(perm.has("speed.other", player)) {
  6578. msg.prefix(player, prefix_commands, "/speed <1-10> [player]");
  6579. } else {
  6580. msg.prefix(player, prefix_commands, "/speed <1-10>");
  6581. }
  6582. goto("wait");
  6583. }
  6584. speed = list.getIndex(args, 0);
  6585. if(!isDouble(speed)) {
  6586. msg.prefix(player, prefix_commands, "Number expected.");
  6587. goto("wait");
  6588. }
  6589. if(speed < 1) {
  6590. speed = 1;
  6591. }
  6592. if(speed > 10) {
  6593. speed = 10;
  6594. }
  6595. if(size < 2) {
  6596. p = player;
  6597. }
  6598. if(size == 2) {
  6599. if(!perm.has("speed.other", player)) {
  6600. perm.no("speed.other", player);
  6601. goto("wait");
  6602. }
  6603. p_name = list.getIndex(args, 1);
  6604. p = read.player(p_name);
  6605. if(p == null) {
  6606. msg.prefix(player, prefix_commands, "This player is not online.");
  6607. goto("wait");
  6608. }
  6609. }
  6610. player.setSpeed(p, speed);
  6611. msg.prefix(p, prefix_commands, string.concat("Set your speed to ", string.number(speed), "."));
  6612. if(p != player) {
  6613. msg.prefix(player, prefix_commands, string.concat(player.getName(p), " set your speed to ", string.number(speed), "."));
  6614. }
  6615. goto("wait");
  6616. @butcher
  6617. loc = entity.getLocation(player);
  6618. world = loc.getWorld(loc);
  6619. list = world.getEntities(world);
  6620. size = list.getSize(list);
  6621. killed = 0;
  6622. for(i = 0; i < size; i++) {
  6623. element = list.getIndex(list, i);
  6624. if(isLiving(element)) {
  6625. entity_type = entity.getType(element);
  6626. if(set.contains(butcher_set, entity_type)) {
  6627. entity.remove(element);
  6628. killed++;
  6629. }
  6630. }
  6631. }
  6632. msg.prefix(player, prefix_commands, string.concat(string.number(killed), " mobs killed."));
  6633. goto("wait");
  6634. @enchant
  6635. if(size != 2) {
  6636. msg.prefix(player, prefix_commands, "/enchant <enchantment> <level>");
  6637. goto("wait");
  6638. }
  6639. ench_string = list.getIndex(args, 0);
  6640. ench = enchantment.get(ench_string);
  6641. if(ench == null) {
  6642. msg.prefix(player, prefix_commands, "Unknown enchantment");
  6643. goto("wait");
  6644. }
  6645. lvl = list.getIndex(args, 1);
  6646. if(!isDouble(lvl) || lvl < 1 || lvl > 100) {
  6647. msg.prefix(sender, prefix_commands, "Number greater than 0 and less than 101 expected.");
  6648. goto("wait");
  6649. }
  6650. item = living.getHand(player);
  6651. if(item.isAir(item)) {
  6652. msg.prefix(sender, prefix_commands, "You need to hold an item in your hand.");
  6653. goto("wait");
  6654. }
  6655. enchantment.add(ench, item, lvl);
  6656. goto("wait");
  6657. @enderchest
  6658. if(size < 1 || size > 2) {
  6659. msg.prefix(player, prefix_commands, "/enderchest [player] <from-player>");
  6660. goto("wait");
  6661. }
  6662. if(size == 1) {
  6663. from_name = list.getIndex(args, 0);
  6664. p = player;
  6665. }
  6666. elseif(size == 2) {
  6667. p_name = list.getIndex(args, 0);
  6668. from_name = list.getIndex(args, 1);
  6669. p = read.player(p_name);
  6670. if(p == null) {
  6671. msg.prefix(player, prefix_commands, "This player is not online.");
  6672. goto("wait");
  6673. }
  6674. }
  6675. from_player = read.player(from_name);
  6676. if(from_player == null) {
  6677. msg.prefix(player, prefix_commands, "This player is not online.");
  6678. goto("wait");
  6679. }
  6680. ender_inv = player.getEnderInv(from_player);
  6681. inv.open(ender_inv, p);
  6682. goto("wait");
  6683. @gamemode
  6684. if(size < 1 || size > 2) {
  6685. msg.prefix(player, prefix_commands, "/gamemode <mode> [player]");
  6686. goto("wait");
  6687. }
  6688. if(size == 1) {
  6689. p = player;
  6690. } elseif(size == 2) {
  6691. if(!perm.has("gamemode.other", player)) {
  6692. perm.no("gamemode.other", player);
  6693. goto("wait");
  6694. }
  6695. p_name = list.getIndex(args, 1);
  6696. p = read.player(p_name);
  6697. if(p == null) {
  6698. msg.prefix(player, prefix_commands, "This player is not online.");
  6699. goto("wait");
  6700. }
  6701. }
  6702. mode = list.getIndex(args, 0);
  6703. if(isDouble(mode)) {
  6704. mode = string.number(mode);
  6705. } else {
  6706. mode = string.toLowerCase(mode);
  6707. }
  6708. if(mode == "s" || mode == "0" || mode == "survival") {
  6709. mode = "SURVIVAL";
  6710. } elseif(mode == "c" || mode == "1" || mode == "creative") {
  6711. mode = "CREATIVE";
  6712. } elseif(mode == "a" || mode == "2" || mode == "adventure") {
  6713. mode = "ADVENTURE";
  6714. } elseif(mode == "w" || mode == "3" || mode == "spectator") {
  6715. mode = "SPECTATOR";
  6716. } else {
  6717. msg.prefix(player, prefix_commands, "Unknown gamemode.");
  6718. goto("wait");
  6719. }
  6720. player.setGamemode(p, mode);
  6721. if(p != player) {
  6722. p_name = player.getName(p);
  6723. msg.prefix(player, prefix_commands, string.concat("Gamemode of ", p_name, " set to ", mode, "."));
  6724. }
  6725. msg.prefix(p, prefix_commands, string.concat("Set your gamemode to ", mode, "."));
  6726. goto("wait");
  6727. @home
  6728. if(size == 0) {
  6729. @homesyntax
  6730. msg.prefix(player, prefix_commands, "/home ...");
  6731. msg.string(player, "§6 - set <name> §rSets a home");
  6732. if(perm.has("home.other", player)) {
  6733. msg.string(player, "§6 - delete <name> [player] §rDeletes a home");
  6734. msg.string(player, "§6 - list [player] §rLists all homes");
  6735. msg.string(player, "§6 - <name> [player] §rTeleports to a home");
  6736. } else {
  6737. msg.string(player, "§6 - delete <name> §rDeletes a home");
  6738. msg.string(player, "§6 - list §rLists your homes");
  6739. msg.string(player, "§6 - <name> §rTeleports to your home");
  6740. }
  6741. goto("wait");
  6742. }
  6743. arg0 = string.toLowerCase(list.getIndex(args, 0));
  6744. if(arg0 == "del" || arg0 == "delete") {
  6745. if(size < 2) {
  6746. goto("homesyntax");
  6747. }
  6748. if(size == 2) {
  6749. player_id = player.getId(player);
  6750. } else {
  6751. if(!perm.has("home.other", player)) {
  6752. perm.no("home.other", player);
  6753. goto("wait");
  6754. }
  6755. p_name = string.toLowerCase(list.getIndex(args, 2));
  6756. p_uuid = player.getUuid(p_name);
  6757. if(p_uuid == null) {
  6758. msg.prefix(player, prefix_commands, "This player has never been online.");
  6759. goto("wait");
  6760. }
  6761. player_id = player.getId(p_uuid);
  6762. }
  6763. name = string.toLowerCase(list.getIndex(args, 1));
  6764. if(!home.exists(player_id, name)) {
  6765. msg.prefix(player, prefix_commands, string.concat("Home ", name, " doesn´t exist."));
  6766. goto("wait");
  6767. }
  6768. home.delete(player_id, name);
  6769. msg.prefix(player, prefix_commands, string.concat("Home ", name, " deleted."));
  6770. goto("wait");
  6771. }
  6772. if(arg0 == "list") {
  6773. if(size < 2) {
  6774. p_uuid = player.getUuid(player);
  6775. }
  6776. if(size == 2) {
  6777. if(!perm.has("home.other", player)) {
  6778. perm.no("home.other", player);
  6779. goto("wait");
  6780. }
  6781. p_name = string.toLowerCase(list.getIndex(args, 1));
  6782. p_uuid = player.getUuid(p_name);
  6783. if(p_uuid == null) {
  6784. msg.prefix(player, prefix_commands, "This player has never been online.");
  6785. goto("wait");
  6786. }
  6787. }
  6788. id = player.getId(p_uuid);
  6789. homes_list = home.getList(id);
  6790. home_amount = list.getSize(homes_list);
  6791. if(home_amount == 0) {
  6792. msg.prefix(player, prefix_commands, "No homes existing.");
  6793. } else {
  6794. msg.prefix(player, prefix_commands, string.concat("Homes of ", player.getName(p_uuid), ":"));
  6795. for(i = 0; i < home_amount; i++) {
  6796. msg.string(player, string.concat("§6 - §r", list.getIndex(homes_list, i)));
  6797. }
  6798. }
  6799. goto("wait");
  6800. }
  6801. location = entity.getLocation(player);
  6802. world_name = world.getName(loc.getWorld(location));
  6803. if(!world.isSurvName(world_name)) {
  6804. msg.prefix(player, prefix_commands, "You can´t use this command in this world.");
  6805. goto("wait");
  6806. }
  6807. if(arg0 == "set") {
  6808. if(size < 2) {
  6809. goto("homesyntax");
  6810. }
  6811. player_id = player.getId(player);
  6812. homes_list = home.getList(player_id);
  6813. home_amount = list.getSize(homes_list);
  6814. if(perm.has("isAdmin", player)) {
  6815. max_homes = 100;
  6816. } elseif(perm.has("isMod", player)) {
  6817. max_homes = 40;
  6818. } elseif(perm.has("isTeam", player)) {
  6819. max_homes = 20;
  6820. } elseif(perm.has("canTP", player)) {
  6821. max_homes = 10;
  6822. } else {
  6823. max_homes = 5;
  6824. }
  6825. max_homes += getAdditionalVoteHomes();
  6826. if(home_amount >= max_homes) {
  6827. msg.prefix(player, prefix_commands, string.concat("You can only set ", string.number(max_homes), " homes."));
  6828. goto("wait");
  6829. }
  6830. name = string.toLowerCase(list.getIndex(args, 1));
  6831. if(name == "set" || name == "del" || name == "delete" || name == "list") {
  6832. msg.prefix(player, prefix_commands, "This name ist not allowed.");
  6833. goto("wait");
  6834. }
  6835. if(!string.onlyletters(name)) {
  6836. msg.prefix(player, prefix_commands, "Only letters allowed.");
  6837. goto("wait");
  6838. }
  6839. if(string.length(name) > 20) {
  6840. msg.prefix(player, prefix_commands, "Maximum 20 letters.");
  6841. goto("wait");
  6842. }
  6843. if(home.exists(player_id, name)) {
  6844. msg.prefix(player, prefix_commands, string.concat("Home ", name, " already exists."));
  6845. goto("wait");
  6846. }
  6847. home.set(player_id, name, location);
  6848. msg.prefix(player, prefix_commands, string.concat("Home ", name, " set."));
  6849. goto("wait");
  6850. }
  6851. //Teleportation
  6852. if(size < 2) {
  6853. p_name = player.getName(player);
  6854. }
  6855. if(size == 2) {
  6856. p_name = string.toLowerCase(list.getIndex(args, 1));
  6857. }
  6858. p_uuid = player.getUuid(p_name);
  6859. if(p_uuid == null) {
  6860. msg.prefix(player, prefix_commands, "Der Spieler war noch nie online.");
  6861. goto("wait");
  6862. }
  6863. player_id = player.getId(p_uuid);
  6864. location = home.getLocation(player_id, arg0);
  6865. if(location == null) {
  6866. msg.prefix(player, prefix_commands, "Home doesn´t exist."); //oder die welt ist nicht geladen
  6867. goto("wait");
  6868. }
  6869. player.teleport(player, location, true);
  6870. goto("wait");
  6871. @icon
  6872. msg.string(player, string.getSpacer());
  6873. msg.string(player, "Icons - Click to Copy");
  6874. msg(player, text.merge(
  6875. string.getClipBoardText(icon.getGoldCoin(), icon.getGoldCoin()), text.new(" "),
  6876. string.getClipBoardText(icon.getSilverCoin(), icon.getSilverCoin()), text.new(" "),
  6877. string.getClipBoardText(icon.getCopperCoin(), icon.getCopperCoin()), text.new(" "),
  6878. string.getClipBoardText(icon.getExp(), icon.getExp()), text.new(" "),
  6879. string.getClipBoardText(icon.getBookshelf(), icon.getBookshelf()), text.new(" "),
  6880. string.getClipBoardText(icon.getCraftingTable(), icon.getCraftingTable())
  6881. ));
  6882. msg(player, text.merge(
  6883. string.getClipBoardText(icon.getCompass(), icon.getCompass()), text.new(" "),
  6884. string.getClipBoardText(icon.getCake(), icon.getCake()), text.new(" "),
  6885. string.getClipBoardText(icon.getEnderpearl(), icon.getEnderpearl()), text.new(" "),
  6886. string.getClipBoardText(icon.getHeart(), icon.getHeart()), text.new(" "),
  6887. string.getClipBoardText(icon.getHalfHeart(), icon.getHalfHeart()), text.new(" "),
  6888. string.getClipBoardText(icon.getEmptyHeart(), icon.getEmptyHeart())
  6889. ));
  6890. goto("wait");
  6891. @tpa
  6892. if(size != 1) {
  6893. msg.prefix(player, prefix_commands, "/tpa <player>");
  6894. goto("wait");
  6895. }
  6896. p_name = list.getIndex(args, 0);
  6897. p_uuid = player.getUuid(p_name);
  6898. if(p_uuid == null) {
  6899. msg.prefix(player, prefix_commands, "This player has never been online.");
  6900. goto("wait");
  6901. }
  6902. p_name = player.getName(p_uuid);
  6903. p = read.player(p_name);
  6904. if(p == null) {
  6905. msg.prefix(player, prefix_commands, "This player is not online.");
  6906. goto("wait");
  6907. }
  6908. if(!player.doesAcceptTpaRequests(p)) {
  6909. msg.prefix(player, prefix_commands, string.concat("§c", p_name, "§r rejects teleport requests."));
  6910. goto("wait");
  6911. }
  6912. if(!player.canTeleport(p)) {
  6913. msg.prefix(player, prefix_commands, "This player can´t teleport now.");
  6914. goto("wait");
  6915. }
  6916. world_name = world.getName(loc.getWorld(entity.getLocation(player)));
  6917. if(world.isGamesName(world_name)) {
  6918. msg.prefix(player, prefix_commands, "You can´t teleport in this world.");
  6919. goto("wait");
  6920. }
  6921. world_name = world.getName(loc.getWorld(entity.getLocation(p)));
  6922. if(world.isGamesName(world_name)) {
  6923. msg.prefix(player, prefix_commands, "You can´t teleport to this world.");
  6924. goto("wait");
  6925. }
  6926. addTpaRequest(player.getUuid(player), p_uuid);
  6927. player_name = player.getName(player);
  6928. msg.string(player, string.concat("§6Teleport-Request: [§c", player_name, "§6 -> §c ", p_name, "§6]"));
  6929. 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))));
  6930. goto("wait");
  6931. @tpahere
  6932. if(size != 1) {
  6933. msg.prefix(player, prefix_commands, "/tpahere <player>");
  6934. goto("wait");
  6935. }
  6936. p_name = list.getIndex(args, 0);
  6937. p_uuid = player.getUuid(p_name);
  6938. if(p_uuid == null) {
  6939. msg.prefix(player, prefix_commands, "This player has never been online.");
  6940. goto("wait");
  6941. }
  6942. p_name = player.getName(p_uuid);
  6943. p = read.player(p_name);
  6944. if(p == null) {
  6945. msg.prefix(player, prefix_commands, "This player is not online.");
  6946. goto("wait");
  6947. }
  6948. if(!player.canTeleport(p)) {
  6949. msg.prefix(player, prefix_commands, "This player can´t teleport now.");
  6950. goto("wait");
  6951. }
  6952. if(!player.doesAcceptTpaRequests(p)) {
  6953. msg.prefix(player, prefix_commands, string.concat("§c", p_name, "§r rejects teleport requests."));
  6954. goto("wait");
  6955. }
  6956. world_name = world.getName(loc.getWorld(entity.getLocation(player)));
  6957. if(world.isGamesName(world_name)) {
  6958. msg.prefix(player, prefix_commands, string.concat("§c", p_name, "§r isn´t allowed to teleport to this world."));
  6959. goto("wait");
  6960. }
  6961. world_name = world.getName(loc.getWorld(entity.getLocation(p)));
  6962. if(world.isGamesName(world_name)) {
  6963. msg.prefix(player, prefix_commands, string.concat("§c", p_name, "§r isn´t allowed to teleport from their world."));
  6964. goto("wait");
  6965. }
  6966. addTpaRequest(p_uuid, player.getUuid(player));
  6967. player_name = player.getName(player);
  6968. msg.string(player, string.concat("§6Teleport-Request: [§c", p_name, "§6 -> §c ", player_name, "§6]"));
  6969. 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))));
  6970. goto("wait");
  6971. @tpaccept
  6972. if(size != 1) {
  6973. msg.prefix(player, prefix_commands, "/tpaccept <player>");
  6974. goto("wait");
  6975. }
  6976. p_name = list.getIndex(args, 0);
  6977. p_uuid = player.getUuid(p_name);
  6978. if(p_uuid == null) {
  6979. msg.prefix(player, prefix_commands, "This player has never been online.");
  6980. goto("wait");
  6981. }
  6982. p_name = player.getName(p_uuid);
  6983. p = read.player(p_name);
  6984. if(p == null) {
  6985. msg.prefix(player, prefix_commands, "This player is not online.");
  6986. goto("wait");
  6987. }
  6988. if(!player.canTeleport(player)) {
  6989. msg.prefix(player, prefix_commands, "This player can´t teleport to you now.");
  6990. goto("wait");
  6991. }
  6992. if(!player.canTeleport(p)) {
  6993. msg.prefix(player, prefix_commands, "This player can´t teleport to you now.");
  6994. //Kein return. Spieler A bekommt cancel adventure und Spieler B wird informiert.
  6995. }
  6996. world_name = world.getName(loc.getWorld(entity.getLocation(player)));
  6997. if(world.isGamesName(world_name)) {
  6998. msg.prefix(player, prefix_commands, string.concat("§c", p_name, "§r isn´t allowed to teleport to your world."));
  6999. goto("wait");
  7000. }
  7001. world_name = world.getName(loc.getWorld(entity.getLocation(p)));
  7002. if(world.isGamesName(world_name)) {
  7003. msg.prefix(player, prefix_commands, string.concat("§c", p_name, "§r isn´t allowed to teleport from their world."));
  7004. goto("wait");
  7005. }
  7006. player_uuid = player.getUuid(player);
  7007. if(!hasTpaRequest(p_uuid, player_uuid)) {
  7008. msg.prefix(player, prefix_commands, "No outstanding teleport-request.");
  7009. goto("wait");
  7010. }
  7011. location = entity.getLocation(player);
  7012. player.teleport(p, location, true);
  7013. goto("wait");
  7014. @tpaccepthere
  7015. if(size != 1) {
  7016. msg.prefix(player, prefix_commands, "/tpaccepthere <player>");
  7017. goto("wait");
  7018. }
  7019. p_name = list.getIndex(args, 0);
  7020. p_uuid = player.getUuid(p_name);
  7021. if(p_uuid == null) {
  7022. msg.prefix(player, prefix_commands, "This player has never been online.");
  7023. goto("wait");
  7024. }
  7025. p_name = player.getName(p_uuid);
  7026. p = read.player(p_name);
  7027. if(p == null) {
  7028. msg.prefix(player, prefix_commands, "This player is not online.");
  7029. goto("wait");
  7030. }
  7031. if(!player.canTeleport(player)) {
  7032. msg.prefix(p, prefix_commands, "This player can´t teleport to you now.");
  7033. //Kein return. Spieler A bekommt cancel adventure und Spieler B wird informiert.
  7034. }
  7035. if(!player.canTeleport(p)) {
  7036. msg.prefix(player, prefix_commands, "You must not teleport to this player now.");
  7037. goto("wait");
  7038. }
  7039. world_name = world.getName(loc.getWorld(entity.getLocation(player)));
  7040. if(world.isGamesName(world_name)) {
  7041. msg.prefix(player, prefix_commands, "You can´t teleport in this world.");
  7042. goto("wait");
  7043. }
  7044. world_name = world.getName(loc.getWorld(entity.getLocation(p)));
  7045. if(world.isGamesName(world_name)) {
  7046. msg.prefix(player, prefix_commands, "You can´t teleport to this world.");
  7047. goto("wait");
  7048. }
  7049. player_uuid = player.getUuid(player);
  7050. if(!hasTpaRequest(player_uuid, p_uuid)) {
  7051. msg.prefix(player, prefix_commands, "No outstanding teleport-request.");
  7052. goto("wait");
  7053. }
  7054. location = entity.getLocation(p);
  7055. player.teleport(player, location, true);
  7056. goto("wait");
  7057. @tp
  7058. if(size < 1 || size > 2) {
  7059. if(perm.has("tp.other", player)) {
  7060. msg.prefix(player, prefix_commands, "/tp [player] <to-player>");
  7061. } else {
  7062. msg.prefix(player, prefix_commands, "/tp <player>");
  7063. }
  7064. goto("wait");
  7065. }
  7066. if(size == 1) {
  7067. to_name = list.getIndex(args, 0);
  7068. p = player;
  7069. }
  7070. elseif(size == 2) {
  7071. if(!perm.has("tp.other", player)) {
  7072. perm.no("tp.other", player);
  7073. goto("wait");
  7074. }
  7075. p_name = list.getIndex(args, 0);
  7076. p = read.player(p_name);
  7077. //Damit der ganze Spielername und nicht nur der eingegebene angezeigt wird
  7078. to_name = list.getIndex(args, 1);
  7079. if(p == null) {
  7080. msg.prefix(player, prefix_commands, "This player is not online.");
  7081. goto("wait");
  7082. }
  7083. }
  7084. if(player.hasMinigame(p)) {
  7085. if(size == 2) {
  7086. msg.prefix(player, prefix_commands, "This player can´t be teleported now.");
  7087. goto("wait");
  7088. }
  7089. msg.prefix(player, prefix_commands, "You can´t teleport now.");
  7090. goto("wait");
  7091. }
  7092. to_player = read.player(to_name);
  7093. if(to_player == null) {
  7094. msg.prefix(player, prefix_commands, "This player is not online.");
  7095. goto("wait");
  7096. }
  7097. //Damit der ganze Spielername und nicht nur der eingegebene angezeigt wird
  7098. to_name = player.getName(to_player);
  7099. location = entity.getLocation(to_player);
  7100. if(player.teleport(p, location, true)) {
  7101. if(player != p) {
  7102. msg.prefix(player, prefix_commands, string.concat("Teleported ", player.getName(p), " to ", to_name, "."));
  7103. }
  7104. msg.prefix(p, prefix_commands, string.concat("Teleported you to ", to_name, "."));
  7105. }
  7106. goto("wait");
  7107. @say
  7108. if(size == 0) {
  7109. msg.prefix(sender, prefix_commands, "/say <text>");
  7110. goto("wait");
  7111. }
  7112. msg.online("§cServer", string.concatList(args, " ", 0, size - 1));
  7113. goto("wait");
  7114. @warp
  7115. if(size == 0) {
  7116. @warpsyntax
  7117. msg.prefix(player, prefix_commands, "/warp ...");
  7118. if(perm.has("warp.create", player)) {
  7119. msg.string(player, "§6 - set <warp> §rSets a warp");
  7120. msg.string(player, "§6 - delete <warp> §rDeletes a warp");
  7121. }
  7122. msg.string(player, "§6 - <warp> §rTeleports to a warp");
  7123. msg.string(player, "§6 - list §rLists all warps");
  7124. goto("wait");
  7125. }
  7126. arg0 = string.toLowerCase(list.getIndex(args, 0));
  7127. if(arg0 == "delete") {
  7128. if(!perm.has("warp.create", player)) {
  7129. perm.no("warp.create", player);
  7130. goto("wait");
  7131. }
  7132. if(size != 2) {
  7133. goto("warpsyntax");
  7134. }
  7135. warp_name = string.toLowerCase(list.getIndex(args, 1));
  7136. if(warp.delete(warp_name)) {
  7137. msg.prefix(player, prefix_commands, string.concat("Warp ", warp_name, " deleted."));
  7138. } else {
  7139. msg.prefix(player, prefix_commands, "Warpname doesn´t exist.");
  7140. }
  7141. goto("wait");
  7142. }
  7143. if(arg0 == "list") {
  7144. warps_list = warp.getList();
  7145. if(list.getSize(warps_list) == 0) {
  7146. msg.prefix(player, prefix_commands, "No warps existing.");
  7147. goto("wait");
  7148. }
  7149. msg.prefix(player, prefix_commands, string.concat("§6Warps:"));
  7150. for(i = 0; i < list.getSize(warps_list); i++) {
  7151. msg.string(player, string.concat("§6 - §r", list.getIndex(warps_list, i)));
  7152. }
  7153. goto("wait");
  7154. }
  7155. if(arg0 == "set") {
  7156. if(!perm.has("warp.create", player)) {
  7157. perm.no("warp.create", player);
  7158. goto("wait");
  7159. }
  7160. if(size != 2) {
  7161. goto("warpsyntax");
  7162. }
  7163. warp_name = string.toLowerCase(list.getIndex(args, 1));
  7164. if(warp.exists(warp_name)) {
  7165. msg.prefix(player, prefix_commands, "Warpname already exists.");
  7166. goto("wait");
  7167. }
  7168. warp.create(warp_name, entity.getLocation(player));
  7169. msg.prefix(player, prefix_commands, string.concat("Warp ", warp_name, " set."));
  7170. goto("wait");
  7171. }
  7172. //Teleportation
  7173. warp_name = string.toLowerCase(arg0);
  7174. warp_loc = warp.get(warp_name);
  7175. if(warp_loc == null) {
  7176. msg.prefix(player, prefix_commands, "Warpname doesn´t exist.");
  7177. goto("wait");
  7178. }
  7179. if(!perm.has("warp.create", player)) {
  7180. world_name = world.getName(loc.getWorld(entity.getLocation(player)));
  7181. if(world.isGamesName(world_name)) {
  7182. msg.prefix(player, prefix_commands, "You can´t teleport in this world.");
  7183. goto("wait");
  7184. }
  7185. world_name = world.getName(loc.getWorld(warp_loc));
  7186. if(world.isGamesName(world_name)) {
  7187. msg.prefix(player, prefix_commands, "You can´t teleport to this world.");
  7188. goto("wait");
  7189. }
  7190. }
  7191. if(player.teleport(player, warp_loc, true)) {
  7192. msg.prefix(player, prefix_commands, string.concat("You have been teleported to warp §7", warp_name, "."));
  7193. }
  7194. goto("wait");
  7195. @databank
  7196. if(size == 0) {
  7197. @databankhelp
  7198. msg.prefix(player, prefix_commands, "/databank...");
  7199. msg.string(player, "§6 - showtables §rShows all tables");
  7200. msg.string(player, "§6 - showfields §rShows fields from a table");
  7201. msg.string(player, "§6 - showdatatypes §rShows dataypes from a table");
  7202. goto("wait");
  7203. }
  7204. arg0 = string.toLowerCase(list.getIndex(args, 0));
  7205. if(arg0 == "showtables") {
  7206. msg.string(player, string.getSpacer());
  7207. stmt = databank.prepare("SHOW TABLES");
  7208. result = databank.execute(stmt);
  7209. while(databank.next(result)) {
  7210. msg.string(player, databank.getString(result, 1));
  7211. }
  7212. databank.close(result);
  7213. databank.close(stmt);
  7214. goto("wait");
  7215. }
  7216. if(arg0 == "showfields") {
  7217. if(size < 2) {
  7218. msg.prefix(player, prefix_commands, "/databank showfields <table>");
  7219. goto("wait");
  7220. }
  7221. table = list.getIndex(args, 1);
  7222. if(!databank.isExistingTable(table)) {
  7223. msg.prefix(player, prefix_commands, "This in no existing table.");
  7224. goto("wait");
  7225. }
  7226. msg.string(player, string.getSpacer());
  7227. fields = databank.getTableFields(table);
  7228. iter = iterator(fields);
  7229. while(hasNext(iter)) {
  7230. msg.string(player, next(iter));
  7231. }
  7232. goto("wait");
  7233. }
  7234. if(arg0 == "showdatatypes") {
  7235. if(size < 2) {
  7236. msg.prefix(player, prefix_commands, "/databank showdatatypes <table>");
  7237. goto("wait");
  7238. }
  7239. table = list.getIndex(args, 1);
  7240. if(!databank.isExistingTable(table)) {
  7241. msg.prefix(player, prefix_commands, "This in no existing table.");
  7242. goto("wait");
  7243. }
  7244. msg.string(player, string.getSpacer());
  7245. msg.string(player, databank.getTableDatatypes(table));
  7246. goto("wait");
  7247. }
  7248. goto("databankhelp");
  7249. @seen
  7250. if(size != 1) {
  7251. msg.prefix(player, prefix_commands, "/seen <player>");
  7252. goto("wait");
  7253. }
  7254. seen_name = list.getIndex(args, 0);
  7255. seen_uuid = player.getUuid(seen_name);
  7256. if(seen_uuid == null) {
  7257. msg.prefix(player, prefix_commands, "This player has never been online.");
  7258. goto("wait");
  7259. }
  7260. if(read.player(seen_name) != null) {
  7261. msg.prefix(player, prefix_commands, "This player is online.");
  7262. goto("wait");
  7263. }
  7264. seenStatement = databank.prepare("SELECT MAX(leave_time) FROM playtime WHERE player_id = ?;");
  7265. databank.setInt(seenStatement, 1, player.getId(seen_uuid));
  7266. result = databank.execute(seenStatement);
  7267. if(databank.next(result)) {
  7268. time = databank.getLong(result, 1);
  7269. msg.prefix(player, prefix_commands, string.concat(seen_name, " was seen at §e", time.getString(time), "."));
  7270. } else {
  7271. msg.prefix(player, prefix_commands, "Keine Daten vorhanden.");
  7272. }
  7273. databank.close(result);
  7274. databank.close(seenStatement);
  7275. goto("wait");
  7276. @lastseen
  7277. if(size != 1) {
  7278. msg.prefix(sender, prefix_commands, "/lastseen <amount>");
  7279. goto("wait");
  7280. }
  7281. amount = list.getIndex(args, 0);
  7282. if(!isDouble(amount)) {
  7283. msg.prefix(sender, prefix_commands, "Number expected.");
  7284. goto("wait");
  7285. }
  7286. if(amount < 1) {
  7287. msg.prefix(sender, prefix_commands, "Positive number expected.");
  7288. goto("wait");
  7289. }
  7290. modTimer(-5);
  7291. msg.prefix(sender, prefix_commands, "These players were last seen:");
  7292. table = table.new("§f", 12, 12);
  7293. msg.string(sender, table.getStart(table));
  7294. msg.string(sender, table.get(table, "Player", "Date"));
  7295. msg.string(sender, table.getMiddle(table));
  7296. lastseenStatement = databank.prepare("SELECT player_id, MAX(leave_time) AS max_time FROM playtime GROUP BY player_id ORDER BY max_time DESC LIMIT ?;");
  7297. databank.setInt(lastseenStatement, 1, amount);
  7298. result = databank.execute(lastseenStatement);
  7299. while(databank.next(result)) {
  7300. id = databank.getInt(result, 1);
  7301. time = databank.getLong(result, 2);
  7302. msg.string(sender, table.get(table, string.concat("§a", player.getNameFromId(id)), string.concat("§e", time.getString(time))));
  7303. }
  7304. msg.string(sender, table.getEnd(table));
  7305. databank.close(result);
  7306. databank.close(lastseenStatement);
  7307. goto("wait");
  7308. @feed
  7309. if(size > 1) {
  7310. msg.prefix(player, prefix_commands, "/feed [player]");
  7311. goto("wait");
  7312. }
  7313. if(size == 0) {
  7314. p = player;
  7315. }
  7316. if(size == 1) {
  7317. p_name = list.getIndex(args, 0);
  7318. p = read.player(p_name);
  7319. if(p == null) {
  7320. msg.prefix(player, prefix_commands, "This player is not online.");
  7321. goto("wait");
  7322. }
  7323. if(player != p) {
  7324. msg.prefix(player, prefix_commands, string.concat(player.getName(p), " has been feed."));
  7325. }
  7326. }
  7327. player.setHunger(p, 20);
  7328. player.setSaturation(p, 5);
  7329. msg.prefix(p, prefix_commands, "You have been feed.");
  7330. goto("wait");
  7331. @tempfly
  7332. if(size < 2) {
  7333. msg.prefix(sender, prefix_commands, "/tempfly <player> <sec>");
  7334. goto("wait");
  7335. }
  7336. p_name = list.getIndex(args, 0);
  7337. if(!checkIfEverOnline(p_name)) {
  7338. msg.prefix(sender, prefix_commands, "This player has never been online.");
  7339. goto("wait");
  7340. }
  7341. p = read.player(p_name);
  7342. if(p == null) {
  7343. msg.prefix(sender, prefix_commands, "This player is not online.");
  7344. goto("wait");
  7345. }
  7346. p_name = player.getName(player.getUuid(p_name));
  7347. if(player.hasMinigame(p)) {
  7348. msg.prefix(player, prefix_commands, "This player can´t fly now.");
  7349. goto("wait");
  7350. }
  7351. sec = list.getIndex(args, 1);
  7352. if(!isDouble(sec) || sec < 0) {
  7353. msg.prefix(sender, prefix_commands, "Positive number expected.");
  7354. goto("wait");
  7355. }
  7356. msg.prefix(sender, prefix_commands, string.concat(p_name, " can now fly for ", string.number(sec), " seconds."));
  7357. msg.prefix(p, prefix_commands, string.concat("You can now fly for ", string.number(sec), " seconds."));
  7358. player.setFly(p, true);
  7359. duration = sec * 20;
  7360. data.setTimer(p, "fly", duration);
  7361. //status.addTimed(player, 55, duration, "Fly");
  7362. goto("wait");
  7363. @fly
  7364. if(size > 2) {
  7365. msg.prefix(player, prefix_commands, "/fly [player] [on/off]");
  7366. goto("wait");
  7367. }
  7368. if(size >= 1) {
  7369. if(!perm.has("fly.other", player)) {
  7370. perm.no("fly.other", player);
  7371. goto("wait");
  7372. }
  7373. p_name = list.getIndex(args, 0);
  7374. p = read.player(p_name);
  7375. if(p == null) {
  7376. msg.prefix(player, prefix_commands, "This player is not online.");
  7377. goto("wait");
  7378. }
  7379. } else {
  7380. p = player;
  7381. }
  7382. world_name = world.getName(loc.getWorld(entity.getLocation(player)));
  7383. if(world.isGamesName(world_name)) {
  7384. if(player.hasMinigame(p) || (perm.has("fly", p) && !perm.has("isTeam", p))) {
  7385. if(size == 2) {
  7386. msg.prefix(player, prefix_commands, "This player can´t fly now.");
  7387. } else {
  7388. msg.prefix(player, prefix_commands, "You can´t fly now.");
  7389. }
  7390. goto("wait");
  7391. }
  7392. }
  7393. if(size < 2) {
  7394. new_state = player.toggleFly(p);
  7395. } else {
  7396. new_state = false;
  7397. if(list.getIndex(args, 1) == "on") {
  7398. new_state = true;
  7399. }
  7400. player.setFly(p, new_state);
  7401. }
  7402. if(new_state) {
  7403. msg.prefix(p, prefix_commands, "You can fly now.");
  7404. if(player != p) {
  7405. p_name = player.getName(p);
  7406. msg.prefix(player, prefix_commands, string.concat(p_name, " can fly now."));
  7407. }
  7408. } else {
  7409. msg.prefix(p, prefix_commands, "You can´t fly anymore.");
  7410. if(player != p) {
  7411. p_name = player.getName(p);
  7412. msg.prefix(player, prefix_commands, string.concat(p_name, " can´t fly anymore."));
  7413. }
  7414. }
  7415. goto("wait");
  7416. @tppos
  7417. if(size < 3 || size > 5) {
  7418. msg.prefix(player, prefix_commands, "/tppos <x> <y> <z> [world] [player]");
  7419. goto("wait");
  7420. }
  7421. x = list.getIndex(args, 0);
  7422. y = list.getIndex(args, 1);
  7423. z = list.getIndex(args, 2);
  7424. if(!isDouble(x) || !isDouble(y) || !isDouble(z)) {
  7425. msg.prefix(player, prefix_commands, "x/y/z müssen Zahlen sein.");
  7426. goto("wait");
  7427. }
  7428. if(size >= 4) {
  7429. worldname = list.getIndex(args, 3);
  7430. world = world.get(worldname);
  7431. if(world == null) {
  7432. msg.prefix(player, prefix_commands, "This world is not loaded.");
  7433. goto("wait");
  7434. }
  7435. } else {
  7436. world = loc.getWorld(entity.getLocation(player));
  7437. }
  7438. if(x < -32000) {
  7439. x = -32000;
  7440. } elseif(x > 32000) {
  7441. x = 32000;
  7442. }
  7443. if(y < -64) {
  7444. y = -64;
  7445. } elseif(y > 319) {
  7446. y = 319;
  7447. }
  7448. if(z < -32000) {
  7449. z = -32000;
  7450. } elseif(z > 32000) {
  7451. z = 32000;
  7452. }
  7453. location = loc.new(world, x, y, z);
  7454. if(size == 5) {
  7455. p_name = list.getIndex(args, 4);
  7456. p = read.player(p_name);
  7457. if(p == null) {
  7458. msg.prefix(player, prefix_commands, "This player is not online.");
  7459. goto("wait");
  7460. }
  7461. } else {
  7462. p = player;
  7463. }
  7464. if(player.hasMinigame(p)) {
  7465. if(size == 5) {
  7466. msg.prefix(player, prefix_commands, "This player can´t be teleported now.");
  7467. goto("wait");
  7468. }
  7469. msg.prefix(player, prefix_commands, "You can´t teleport now.");
  7470. goto("wait");
  7471. }
  7472. if(player.teleport(p, location, true)) {
  7473. if(player != p) {
  7474. msg.prefix(player, prefix_commands, string.concat(player.getName(p), " was teleported."));
  7475. }
  7476. }
  7477. goto("wait");
  7478. @back
  7479. if(size > 0) {
  7480. msg.prefix(player, prefix_commands, "/back");
  7481. goto("wait");
  7482. }
  7483. if(!player.canTeleport(player)) {
  7484. msg.prefix(player, prefix_commands, "You can´t teleport now.");
  7485. goto("wait");
  7486. }
  7487. hasPerms = perm.has("isTeam", player);
  7488. if(!hasPerms) {
  7489. world_name = world.getName(loc.getWorld(entity.getLocation(player)));
  7490. if(world.isGamesName(world_name)) {
  7491. msg.prefix(player, prefix_commands, "You can´t use /back in this world.");
  7492. goto("wait");
  7493. }
  7494. }
  7495. location = player.getBackPos(player);
  7496. if(location == null) {
  7497. msg.prefix(player, prefix_commands, "No back-location available.");
  7498. goto("wait");
  7499. }
  7500. world = loc.getWorld(location);
  7501. if(world == null) {
  7502. msg.prefix(player, prefix_commands, "This world is not loaded.");
  7503. goto("wait");
  7504. }
  7505. if(!hasPerms) {
  7506. world_name = world.getName(world);
  7507. if(world.isGamesName(world_name)) {
  7508. msg.prefix(player, prefix_commands, "You can´t teleport to this world.");
  7509. goto("wait");
  7510. }
  7511. }
  7512. player.teleport(player, location, true);
  7513. goto("wait");
  7514. @clan
  7515. if(size == 0) {
  7516. @clanhelp
  7517. msg.prefix(player, prefix_clan, "/clan...");
  7518. msg.string(player, "§2 - info [id/name/tag] §rReturns info about a clan");
  7519. msg.string(player, "§2 - list §rLists all clans");
  7520. msg.string(player, "");
  7521. msg.string(player, "§2 - create <name> <tag> §rCreates a clan. Costs §64096 §rsnuvis.");
  7522. msg.string(player, "§2 - invite <name> §rInvites a player");
  7523. msg.string(player, "§2 - accept <id/name/tag> §rAccepts an invitation");
  7524. msg.string(player, "");
  7525. msg.string(player, "§2 - kick <name> §rKicks a player");
  7526. msg.string(player, "§2 - leader <name> §rPromote to clan-leader");
  7527. msg.string(player, "§2 - mod <name> §rPromote to clan-mod");
  7528. msg.string(player, "§2 - degrade <name> §rDemote a clan-mod");
  7529. msg.string(player, "§2 - leave §rLeave a clan");
  7530. msg.string(player, "");
  7531. msg.string(player, "§2 - rename <name> <tag> §rRenames a clan. Costs §664 §rsnuvis.");
  7532. msg.string(player, "§2 - setspawn §rSets a clan-spawn");
  7533. msg.string(player, "§2 - spawn §rTeleports to clan-spawn");
  7534. msg.string(player, "§2 - disband §rDisband a clan");
  7535. msg.string(player, "");
  7536. msg.string(player, "§2 - deposit <money> §rDeposit money to the clan account");
  7537. msg.string(player, "§2 - withdraw <money> §rWithdraw money from the clan account");
  7538. msg.string(player, "§2 - msg <message> §rSends a clan-message");
  7539. msg.string(player, "§2 - mail <message> §rSends a clan-mail");
  7540. msg.string(player, "§2 - shout <message> §rSends a message to all online players. Costs §664 §rsnuvis.");
  7541. msg.string(player, "§2 - party §rInvites all online members to a party");
  7542. goto("wait");
  7543. }
  7544. arg0 = string.toLowerCase(list.getIndex(args, 0));
  7545. if(arg0 == "invite") {
  7546. if(size != 2) {
  7547. msg.prefix(player, prefix_commands, "/clan invite <name>");
  7548. goto("wait");
  7549. }
  7550. if(!player.isInClan(player)) {
  7551. msg.prefix(player, prefix_clan, "You are not in a clan.");
  7552. goto("wait");
  7553. }
  7554. if(!player.isClanLeader(player) && !player.isClanMod(player)) {
  7555. msg.prefix(player, prefix_clan, "You have no permission for this.");
  7556. goto("wait");
  7557. }
  7558. p_name = list.getIndex(args, 1);
  7559. if(string.toLowerCase(player.getName(player)) == string.toLowerCase(p_name)) {
  7560. msg.prefix(player, prefix_clan, "You can´t invite yourself.");
  7561. goto("wait");
  7562. }
  7563. if(!checkIfEverOnline(p_name)) {
  7564. msg.prefix(sender, prefix_clan, "This player has never been online.");
  7565. goto("wait");
  7566. }
  7567. if(!isOnline(p_name)) {
  7568. msg.prefix(player, prefix_clan, "This player has to be online.");
  7569. goto("wait");
  7570. }
  7571. p = read.player(p_name);
  7572. if(player.isClanMember(player)) {
  7573. msg.prefix(player, prefix_clan, "This player is already in a clan.");
  7574. goto("wait");
  7575. }
  7576. clan_id = player.getClanId(player);
  7577. p_id = player.getId(p);
  7578. if(player.hasClanInvitation(p_id, clan_id)) {
  7579. msg.prefix(player, prefix_clan, "This player already has an invitation from your clan.");
  7580. goto("wait");
  7581. }
  7582. player.addClanInvitation(p_id, clan_id);
  7583. clan_name = clan.getName(clan_id);
  7584. msg.prefix(player, prefix_clan, string.concat("You invited §7", p_name, "§r to your clan."));
  7585. msg.prefix(p, prefix_clan, string.concat("You got an clan invitation by §7", clan_name, "§r."));
  7586. msg.string(p, string.getClickText("§r[§aAccept§r]", string.concat("/clan accept ", clan_id)));
  7587. sgoto(6000, "remove_clan_invitation"); //5 Minuten
  7588. goto("wait");
  7589. }
  7590. if(arg0 == "accept") {
  7591. if(size != 2) {
  7592. msg.prefix(player, prefix_commands, "/clan accept <id/name/tag>");
  7593. goto("wait");
  7594. }
  7595. if(player.isInClan(player)) {
  7596. msg.prefix(player, prefix_clan, "You are already in a clan.");
  7597. goto("wait");
  7598. }
  7599. arg1 = list.getIndex(args, 1);
  7600. if(isDouble(arg1)) {
  7601. clan_id = arg1;
  7602. clan_name = clan.getName(clan_id);
  7603. if(clan_name == null) {
  7604. msg.prefix(player, prefix_clan, "Unknown clan.");
  7605. goto("wait");
  7606. }
  7607. } else {
  7608. clan_id = clan.getIdFromName(arg1);
  7609. if(clan_id == null) {
  7610. clan_id = clan.getIdFromTag(arg1);
  7611. if(clan_id == null) {
  7612. msg.prefix(player, prefix_clan, "Unknown clan.");
  7613. goto("wait");
  7614. }
  7615. }
  7616. }
  7617. player_id = player.getId(player);
  7618. if(!player.hasClanInvitation(player_id, clan_id)) {
  7619. msg.prefix(player, prefix_clan, "You have no invitation from this clan.");
  7620. goto("wait");
  7621. }
  7622. clan.addMember(clan_id, player, "member");
  7623. player.setHeadName(player);
  7624. clan.msg(clan_id, string.concat("§7", player.getName(player), "§r joined the clan."));
  7625. msg.prefix(player, prefix_clan, string.concat("You joined §7", clan_name, "§r."));
  7626. clan_size = clan.getMembersAmount(clan_id);
  7627. if(clan_size >= 15) {
  7628. rank.offerClan(clan_id, "rank.lord");
  7629. } elseif(clan_size >= 10) {
  7630. rank.offerClan(clan_id, "rank.chief");
  7631. } elseif(clan_size >= 5) {
  7632. rank.offerClan(clan_id, "rank.commander");
  7633. }
  7634. goto("wait");
  7635. }
  7636. if(arg0 == "create") {
  7637. if(size != 3) {
  7638. msg.prefix(player, prefix_commands, "/clan create <name> <tag>");
  7639. goto("wait");
  7640. }
  7641. if(player.isInClan(player)) {
  7642. msg.prefix(player, prefix_clan, "You are already in a clan.");
  7643. goto("wait");
  7644. }
  7645. clan_name = list.getIndex(args, 1);
  7646. if(string.length(clan_name) > 20) {
  7647. msg.prefix(player, prefix_clan, "Maximum 20 letters allowed for name.");
  7648. goto("wait");
  7649. }
  7650. if(!string.onlyletters(clan_name)) {
  7651. msg.prefix(player, prefix_clan, "Only letters are allowed.");
  7652. goto("wait");
  7653. }
  7654. if(clan.isExistingName(clan_name)) {
  7655. msg.prefix(player, prefix_clan, "This name already exists.");
  7656. goto("wait");
  7657. }
  7658. clan_tag = list.getIndex(args, 2);
  7659. tag_length = string.length(clan_tag);
  7660. if(tag_length < 3 || tag_length > 4) {
  7661. msg.prefix(player, prefix_clan, "3 to 4 letters allowed for tag.");
  7662. goto("wait");
  7663. }
  7664. if(!string.onlyletters(clan_tag)) {
  7665. msg.prefix(player, prefix_clan, "Only letters are allowed.");
  7666. goto("wait");
  7667. }
  7668. if(clan.isExistingTag(clan_tag)) {
  7669. msg.prefix(player, prefix_clan, "This tag already exists.");
  7670. goto("wait");
  7671. }
  7672. if(!hasEnoughMoney(player, 4096)) { //1 Goldmünze
  7673. msg.prefix(player, prefix_clan, "You need 4096 snuvis (1 gold coin).");
  7674. goto("wait");
  7675. }
  7676. money.sub(player, 4096);
  7677. clan_id = clan.create(clan_name, clan_tag);
  7678. clan.addMember(clan_id, player, "leader");
  7679. player.setHeadName(player);
  7680. msg.prefix(player, prefix_clan, "Clan successful created.");
  7681. goto("wait");
  7682. }
  7683. if(arg0 == "info") {
  7684. if(size == 1) {
  7685. if(!player.isInClan(player)) {
  7686. msg.prefix(player, prefix_commands, "/clan info <id/name/tag>");
  7687. goto("wait");
  7688. }
  7689. clan_id = player.getClanId(player);
  7690. clan_name = clan.getName(clan_id);
  7691. clan_tag = clan.getTag(clan_id);
  7692. }
  7693. if(size == 2) {
  7694. arg1 = list.getIndex(args, 1);
  7695. if(isDouble(arg1)) {
  7696. clan_id = arg1;
  7697. clan_name = clan.getName(clan_id);
  7698. if(clan_name == null) {
  7699. msg.prefix(player, prefix_clan, "Unknown clan.");
  7700. goto("wait");
  7701. }
  7702. } else {
  7703. clan_id = clan.getIdFromName(arg1);
  7704. if(clan_id == null) {
  7705. clan_id = clan.getIdFromTag(arg1);
  7706. if(clan_id == null) {
  7707. msg.prefix(player, prefix_clan, "Unknown clan.");
  7708. goto("wait");
  7709. }
  7710. }
  7711. clan_name = clan.getName(clan_id);
  7712. }
  7713. clan_tag = clan.getTag(clan_id);
  7714. }
  7715. list = clan.getMembersList(clan_id);
  7716. mod_list = list.new();
  7717. members_list = list.new();
  7718. iter = iterator(list);
  7719. while(hasNext(iter)) {
  7720. player_uuid = next(iter);
  7721. player_name = player.getName(player_uuid);
  7722. player_id = player.getId(player_uuid);
  7723. if(player.isClanLeader(player_id)) {
  7724. leader = player_name;
  7725. } else {
  7726. if(player.isClanMod(player_id)) {
  7727. list.add(mod_list, player_name);
  7728. } else {
  7729. list.add(members_list, player_name);
  7730. }
  7731. }
  7732. }
  7733. if(list.getSize(mod_list) == 0) {
  7734. mods = "-";
  7735. } else {
  7736. mods = string.concatList(mod_list, ", ", 0, list.getSize(mod_list) - 1);
  7737. }
  7738. if(list.getSize(members_list) == 0) {
  7739. members = "-";
  7740. } else {
  7741. members = string.concatList(members_list, ", ", 0, list.getSize(members_list) - 1);
  7742. }
  7743. msg.string(player, string.concat("§6§lClan §r", clan_name, " (", clan_tag, " #ID:", string.number(clan_id), ")"));
  7744. msg.string(player, "§6Leader");
  7745. msg.string(player, leader);
  7746. msg.string(player, "§6Mods");
  7747. msg.string(player, mods);
  7748. msg.string(player, "§6Members");
  7749. msg.string(player, members);
  7750. msg.string(player, "§6Money");
  7751. msg.string(player, string.number(clan.getMoney(clan_id)));
  7752. goto("wait");
  7753. }
  7754. if(arg0 == "rename") {
  7755. if(!player.isInClan(player)) {
  7756. msg.prefix(player, prefix_clan, "You are not in a clan.");
  7757. goto("wait");
  7758. }
  7759. if(!player.isClanLeader(player)) {
  7760. msg.prefix(player, prefix_clan, "You are not a clan leader.");
  7761. goto("wait");
  7762. }
  7763. if(size != 3) {
  7764. msg.prefix(player, prefix_commands, "/clan rename <name> <tag>");
  7765. goto("wait");
  7766. }
  7767. clan_name = list.getIndex(args, 1);
  7768. if(string.length(clan_name) > 20) {
  7769. msg.prefix(player, prefix_clan, "Maximum 20 letters allowed for name.");
  7770. goto("wait");
  7771. }
  7772. if(!string.onlyletters(clan_name)) {
  7773. msg.prefix(player, prefix_clan, "Only letters are allowed.");
  7774. goto("wait");
  7775. }
  7776. if(clan.isExistingName(clan_name)) {
  7777. msg.prefix(player, prefix_clan, "This name already exists.");
  7778. goto("wait");
  7779. }
  7780. clan_tag = list.getIndex(args, 2);
  7781. tag_length = string.length(clan_tag);
  7782. if(tag_length < 3 || tag_length > 4) {
  7783. msg.prefix(player, prefix_clan, "3 to 4 letters allowed for tag.");
  7784. goto("wait");
  7785. }
  7786. if(!string.onlyletters(clan_tag)) {
  7787. msg.prefix(player, prefix_clan, "Only letters are allowed.");
  7788. goto("wait");
  7789. }
  7790. if(clan.isExistingTag(clan_tag)) {
  7791. msg.prefix(player, prefix_clan, "This tag already exists.");
  7792. goto("wait");
  7793. }
  7794. clan_id = player.getClanId(player);
  7795. if(clan.getMoney(clan_id) < 64) {
  7796. msg.prefix(player, prefix_clan, "Your clan needs 64 snuvis.");
  7797. goto("wait");
  7798. }
  7799. clan.subMoney(clan_id, 64);
  7800. clan.setName(clan_id, clan_name);
  7801. clan.setTag(clan_id, clan_tag);
  7802. clan.msg(clan_id, string.concat("Clan renamed to §7", clan_name, "§r."));
  7803. //New tag for online players
  7804. clan.updateHeadNames(clan_id);
  7805. goto("wait");
  7806. }
  7807. if(arg0 == "msg") {
  7808. if(!player.isInClan(player)) {
  7809. msg.prefix(player, prefix_clan, "You are not in a clan.");
  7810. goto("wait");
  7811. }
  7812. if(size < 2) {
  7813. msg.prefix(player, prefix_commands, "/clan msg <message>");
  7814. goto("wait");
  7815. }
  7816. clan_id = player.getClanId(player);
  7817. clan.msg(clan_id, string.concat(player.getName(player), ": ", string.concatList(args, " ", 1, size - 1)));
  7818. goto("wait");
  7819. }
  7820. if(arg0 == "mail") {
  7821. if(!player.isInClan(player)) {
  7822. msg.prefix(player, prefix_clan, "You are not in a clan.");
  7823. goto("wait");
  7824. }
  7825. if(size < 2) {
  7826. msg.prefix(player, prefix_commands, "/clan mail <message>");
  7827. goto("wait");
  7828. }
  7829. if(player.isClanMember(player)) {
  7830. msg.prefix(player, prefix_commands, "You have no permission for this.");
  7831. goto("wait");
  7832. }
  7833. clan_id = player.getClanId(player);
  7834. clan.mail(clan_id, player.getName(player), string.concatList(args, " ", 1, size - 1));
  7835. goto("wait");
  7836. }
  7837. if(arg0 == "shout") {
  7838. if(!player.isInClan(player)) {
  7839. msg.prefix(player, prefix_clan, "You are not in a clan.");
  7840. goto("wait");
  7841. }
  7842. if(size < 2) {
  7843. msg.prefix(player, prefix_commands, "/clan shout <message>");
  7844. goto("wait");
  7845. }
  7846. if(player.isClanMember(player)) {
  7847. msg.prefix(player, prefix_commands, "You have no permission for this.");
  7848. goto("wait");
  7849. }
  7850. clan_id = player.getClanId(player);
  7851. if(clan.getMoney(clan_id) < 64) {
  7852. msg.prefix(player, prefix_clan, "Your clan needs 64 snuvis.");
  7853. goto("wait");
  7854. }
  7855. clan.subMoney(clan_id, 64);
  7856. msg.prefix("online", prefix_clan, string.concat(clan.getTag(clan_id), ": ", string.concatList(args, " ", 1, size - 1)));
  7857. goto("wait");
  7858. }
  7859. if(arg0 == "deposit") {
  7860. if(!player.isInClan(player)) {
  7861. msg.prefix(player, prefix_clan, "You are not in a clan.");
  7862. goto("wait");
  7863. }
  7864. if(size != 2) {
  7865. msg.prefix(player, prefix_commands, "/clan deposit <money>");
  7866. goto("wait");
  7867. }
  7868. money = list.getIndex(args, 1);
  7869. if(!isDouble(money) || money < 0) {
  7870. msg.prefix(player, prefix_clan, "Positive number expected.");
  7871. goto("wait");
  7872. }
  7873. if(!hasEnoughMoney(player, money)) {
  7874. msg.prefix(player, prefix_clan, "You can´t transfer more money than you have.");
  7875. goto("wait");
  7876. }
  7877. clan_id = player.getClanId(player);
  7878. clan.addMoney(clan_id, money);
  7879. money.sub(player, money);
  7880. clan.msg(clan_id, string.concat("§7", player.getName(player), "§r transferred §7", string.number(money), "§r snuvis."));
  7881. goto("wait");
  7882. }
  7883. if(arg0 == "party") {
  7884. counter = 0;
  7885. clan_id = player.getClanId(player);
  7886. list = clan.getMembersList(clan_id);
  7887. iter = iterator(list);
  7888. while(hasNext(iter)) {
  7889. p = player.get(next(iter));
  7890. if(p != null) {
  7891. temp = party.invitePlayer(player, p);
  7892. if(temp == true) {
  7893. counter++;
  7894. }
  7895. }
  7896. }
  7897. msg.prefix(player, prefix_clan, string.concat(string.number(counter), " online clan members invited to a party."));
  7898. goto("wait");
  7899. }
  7900. if(arg0 == "withdraw") {
  7901. if(!player.isInClan(player)) {
  7902. msg.prefix(player, prefix_clan, "You are not in a clan.");
  7903. goto("wait");
  7904. }
  7905. if(!player.isClanLeader(player)) {
  7906. msg.prefix(player, prefix_clan, "You are not a clan leader.");
  7907. goto("wait");
  7908. }
  7909. if(size != 2) {
  7910. msg.prefix(player, prefix_commands, "/clan withdraw <money>");
  7911. goto("wait");
  7912. }
  7913. money = list.getIndex(args, 1);
  7914. if(!isDouble(money) || money < 0) {
  7915. msg.prefix(player, prefix_clan, "Positive number expected.");
  7916. goto("wait");
  7917. }
  7918. clan_id = player.getClanId(player);
  7919. clan_money = clan.getMoney(clan_id);
  7920. if(clan_money < money) {
  7921. msg.prefix(player, prefix_clan, string.concat("There are only §7", string.number(clan_money), "§r snuvis on the clan account."));
  7922. goto("wait");
  7923. }
  7924. clan.subMoney(clan_id, money);
  7925. money.add(player, money);
  7926. msg.prefix(player, prefix_clan, string.concat("You have withdrawn §7", string.number(money), "§r snuvis."));
  7927. goto("wait");
  7928. }
  7929. if(arg0 == "leader") {
  7930. if(!player.isInClan(player)) {
  7931. msg.prefix(player, prefix_clan, "You are not in a clan.");
  7932. goto("wait");
  7933. }
  7934. if(!player.isClanLeader(player)) {
  7935. msg.prefix(player, prefix_clan, "You are not a clan leader.");
  7936. goto("wait");
  7937. }
  7938. if(size != 2) {
  7939. msg.prefix(player, prefix_commands, "/clan leader <name>");
  7940. goto("wait");
  7941. }
  7942. p_name = list.getIndex(args, 1);
  7943. if(!checkIfEverOnline(p_name)) {
  7944. msg.prefix(player, prefix_clan, "This player has never been online.");
  7945. goto("wait");
  7946. }
  7947. if(string.toLowerCase(player.getName(player)) == string.toLowerCase(p_name)) {
  7948. msg.prefix(player, prefix_clan, "You can´t do this for yourself.");
  7949. goto("wait");
  7950. }
  7951. p_uuid = player.getUuid(p_name);
  7952. p_id = player.getId(p_uuid);
  7953. if(!player.isSameClan(player, p_id)) {
  7954. msg.prefix(player, prefix_clan, "This player is not in your clan.");
  7955. goto("wait");
  7956. }
  7957. player.setClanRole(p_id, "leader");
  7958. player.setClanRole(player, "mod");
  7959. clan_id = player.getClanId(player);
  7960. clan.msg(clan_id, string.concat("§7", p_name, "§r was set to clan leader."));
  7961. goto("wait");
  7962. }
  7963. if(arg0 == "mod") {
  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, "mod");
  7992. clan_id = player.getClanId(player);
  7993. clan.msg(clan_id, string.concat("§7", p_name, "§r was set to clan mod."));
  7994. goto("wait");
  7995. }
  7996. if(arg0 == "degrade") {
  7997. if(!player.isInClan(player)) {
  7998. msg.prefix(player, prefix_clan, "You are not in a clan.");
  7999. goto("wait");
  8000. }
  8001. if(!player.isClanLeader(player)) {
  8002. msg.prefix(player, prefix_clan, "You are not a clan leader.");
  8003. goto("wait");
  8004. }
  8005. if(size != 2) {
  8006. msg.prefix(player, prefix_commands, "/clan degrade <name>");
  8007. goto("wait");
  8008. }
  8009. p_name = list.getIndex(args, 1);
  8010. if(!checkIfEverOnline(p_name)) {
  8011. msg.prefix(player, prefix_clan, "This player has never been online.");
  8012. goto("wait");
  8013. }
  8014. if(string.toLowerCase(player.getName(player)) == string.toLowerCase(p_name)) {
  8015. msg.prefix(player, prefix_clan, "You can´t do this for yourself.");
  8016. goto("wait");
  8017. }
  8018. p_uuid = player.getUuid(p_name);
  8019. p_id = player.getId(p_uuid);
  8020. if(!player.isSameClan(player, p_id)) {
  8021. msg.prefix(player, prefix_clan, "This player is not in your clan.");
  8022. goto("wait");
  8023. }
  8024. player.setClanRole(p_id, "member");
  8025. clan_id = player.getClanId(player);
  8026. clan.msg(clan_id, string.concat("§7", p_name, "§r was degraded."));
  8027. goto("wait");
  8028. }
  8029. if(arg0 == "kick") {
  8030. if(!player.isInClan(player)) {
  8031. msg.prefix(player, prefix_clan, "You are not in a clan.");
  8032. goto("wait");
  8033. }
  8034. if(!player.isClanLeader(player) && !player.isClanMod(player)) {
  8035. msg.prefix(player, prefix_clan, "You have no permission for this.");
  8036. goto("wait");
  8037. }
  8038. if(size != 2) {
  8039. msg.prefix(player, prefix_commands, "/clan kick <name>");
  8040. goto("wait");
  8041. }
  8042. p_name = list.getIndex(args, 1);
  8043. if(!checkIfEverOnline(p_name)) {
  8044. msg.prefix(player, prefix_clan, "This player has never been online.");
  8045. goto("wait");
  8046. }
  8047. if(string.toLowerCase(player.getName(player)) == string.toLowerCase(p_name)) {
  8048. msg.prefix(player, prefix_clan, "You can´t do this for yourself.");
  8049. goto("wait");
  8050. }
  8051. p_uuid = player.getUuid(p_name);
  8052. p_id = player.getId(p_uuid);
  8053. if(!player.isSameClan(player, p_id)) {
  8054. msg.prefix(player, prefix_clan, "This player is not in your clan.");
  8055. goto("wait");
  8056. }
  8057. if(player.isClanLeader(p_id)) {
  8058. msg.prefix(player, prefix_clan, "You can´t kick the leader.");
  8059. goto("wait");
  8060. }
  8061. if(player.isClanMod(player) && player.isClanMod(p_id)) {
  8062. msg.prefix(player, prefix_clan, "You can´t kick another mod.");
  8063. goto("wait");
  8064. }
  8065. clan_id = player.getClanId(player);
  8066. clan.msg(clan_id, string.concat("§7", p_name, "§r got kicked out of the clan."));
  8067. clan.removeMember(clan_id, p_id);
  8068. p = read.player(p_name);
  8069. if(p_name != null) {
  8070. player.setHeadName(p);
  8071. }
  8072. goto("wait");
  8073. }
  8074. if(arg0 == "disband") {
  8075. if(!player.isInClan(player)) {
  8076. msg.prefix(player, prefix_clan, "You are not in a clan.");
  8077. goto("wait");
  8078. }
  8079. if(!player.isClanLeader(player)) {
  8080. msg.prefix(player, prefix_clan, "You are not a clan leader.");
  8081. goto("wait");
  8082. }
  8083. clan_id = player.getClanId(player);
  8084. clan.msg(clan_id, "Clan disbanded.");
  8085. list = clan.getMembersList(clan_id);
  8086. clan.delete(clan_id);
  8087. iter = iterator(list);
  8088. while(hasNext(iter)) {
  8089. p = player.get(next(iter));
  8090. if(p != null) {
  8091. player.setHeadName(p);
  8092. }
  8093. }
  8094. goto("wait");
  8095. }
  8096. if(arg0 == "leave") {
  8097. if(!player.isInClan(player)) {
  8098. msg.prefix(player, prefix_clan, "You are not in a clan.");
  8099. goto("wait");
  8100. }
  8101. if(player.isClanLeader(player)) {
  8102. msg.prefix(player, prefix_clan, "You have to set another leader first.");
  8103. goto("wait");
  8104. }
  8105. clan_id = player.getClanId(player);
  8106. clan.msg(clan_id, string.concat("§7", player.getName(player), "§r left the clan."));
  8107. clan.removeMember(clan_id, player);
  8108. player.setHeadName(player);
  8109. goto("wait");
  8110. }
  8111. if(arg0 == "list") {
  8112. table = table.new("§b", 2, 6, 4, 5);
  8113. msg.string(player, table.getStart(table));
  8114. msg.string(player, table.get(table, "§2ID", "§2Name", "§2Tag", "§2Members"));
  8115. msg.string(player, table.getMiddle(table));
  8116. list = clan.getIdList();
  8117. iter = iterator(list);
  8118. while(hasNext(iter)) {
  8119. clan_id = next(iter);
  8120. name = clan.getName(clan_id);
  8121. tag = clan.getTag(clan_id);
  8122. amount = clan.getMembersAmount(clan_id);
  8123. msg.string(player, table.get(table, string.number(clan_id), name, tag, string.number(amount)));
  8124. }
  8125. msg.string(player, table.getEnd(table));
  8126. goto("wait");
  8127. }
  8128. if(arg0 == "setspawn") {
  8129. if(!player.isInClan(player)) {
  8130. msg.prefix(player, prefix_clan, "You are not in a clan.");
  8131. goto("wait");
  8132. }
  8133. if(!player.isClanLeader(player) && !player.isClanMod(player)) {
  8134. msg.prefix(player, prefix_clan, "You have no permission for this.");
  8135. goto("wait");
  8136. }
  8137. clan_id = player.getClanId(player);
  8138. clan.setSpawn(clan_id, entity.getLocation(player));
  8139. msg.prefix(player, prefix_clan, "New clan spawn set.");
  8140. goto("wait");
  8141. }
  8142. if(arg0 == "spawn") {
  8143. if(!player.isInClan(player)) {
  8144. msg.prefix(player, prefix_clan, "You are not in a clan.");
  8145. goto("wait");
  8146. }
  8147. clan_id = player.getClanId(player);
  8148. spawn_loc = clan.getSpawn(clan_id);
  8149. if(spawn_loc == null) {
  8150. msg.prefix(player, prefix_clan, "No clan spawn set.");
  8151. goto("wait");
  8152. }
  8153. if(!perm.has("isTeam", player)) {
  8154. world_name = world.getName(loc.getWorld(entity.getLocation(player)));
  8155. if(world.isGamesName(world_name)) {
  8156. msg.prefix(player, prefix_commands, "You can´t teleport in this world.");
  8157. goto("wait");
  8158. }
  8159. }
  8160. player.teleport(player, spawn_loc, true);
  8161. goto("wait");
  8162. }
  8163. goto("clanhelp");
  8164. @remove_clan_invitation
  8165. list.removeIndex(clan_invitations, 0);
  8166. goto("wait");
  8167. @color
  8168. msg.string(player, string.getSpacer());
  8169. msg.string(player, " §0&0 §1&1 §2&2 §3&3 §4&4 §5&5 §6&6 §7&7");
  8170. msg.string(player, " §8&8 §9&9 §a&a §b&b §c&c §d&d §e&e §f&f");
  8171. msg.string(player, " &l §l(bold)");
  8172. msg.string(player, " &m §m(strikethrough)");
  8173. msg.string(player, " &n §n(underline)");
  8174. msg.string(player, " &o §o(italic)");
  8175. goto("wait");
  8176. @comeback
  8177. if(player.isOnAdventure(player)) {
  8178. msg.prefix(player, prefix_skill, "Comeback not allowed during adventure.");
  8179. goto("wait");
  8180. }
  8181. amount = skill.getAmount(player, "skill.comeback");
  8182. if(amount <= 0) {
  8183. msg.prefix(player, prefix_skill, "You have not bought that skill.");
  8184. goto("wait");
  8185. }
  8186. loc = player.getDeathLoc(player);
  8187. if(loc == null) {
  8188. msg.prefix(player, prefix_skill, "No death location found.");
  8189. goto("wait");
  8190. }
  8191. new_amount = amount - 1;
  8192. skill.setAmount(player, "skill.comeback", new_amount);
  8193. msg.prefix(player, prefix_skill, string.concat("Used Comeback. New amount: ", string.number(new_amount)));
  8194. entity.teleport(player, loc);
  8195. player.resetDeathLoc(player);
  8196. goto("wait");
  8197. @setspawn
  8198. if(size != 1) {
  8199. @setspawnhelp
  8200. msg.prefix(player, prefix_commands, "/setspawn ...");
  8201. msg.string(player, "§6 - server");
  8202. msg.string(player, "§6 - games");
  8203. msg.string(player, "§6 - creative");
  8204. goto("wait");
  8205. }
  8206. arg0 = string.toLowerCase(list.getIndex(args, 0));
  8207. new_spawn = string.location(entity.getLocation(player));
  8208. config = getServerConfig();
  8209. if(arg0 == "games") {
  8210. config.set(config, "gamesspawn", new_spawn);
  8211. msg.prefix(player, prefix_commands, "New spawn for gaming world set.");
  8212. } elseif(arg0 == "server") {
  8213. config.set(config, "serverspawn", new_spawn);
  8214. msg.prefix(player, prefix_commands, "New main Spawn set.");
  8215. } elseif(arg0 == "creative") {
  8216. config.set(config, "creativespawn", new_spawn);
  8217. msg.prefix(player, prefix_commands, "New spawn for creative world set.");
  8218. } else {
  8219. goto("setspawnhelp");
  8220. }
  8221. config.saveAsync(config);
  8222. goto("wait");
  8223. @heal
  8224. if(size > 1) {
  8225. msg.prefix(player, prefix_commands, "/heal [player]");
  8226. goto("wait");
  8227. }
  8228. if(size == 0) {
  8229. p = player;
  8230. } elseif(size == 1) {
  8231. p_name = list.getIndex(args, 0);
  8232. p = read.player(p_name);
  8233. if(p == null) {
  8234. msg.prefix(player, prefix_commands, "This player is not online.");
  8235. goto("wait");
  8236. }
  8237. if(player != p) {
  8238. msg.prefix(player, prefix_commands, string.concat(player.getName(p), " was healed."));
  8239. }
  8240. }
  8241. living.heal(p, 50);
  8242. player.setHunger(p, 20);
  8243. player.setSaturation(p, 5);
  8244. living.clearEffects(p);
  8245. entity.setBurning(p, 0);
  8246. msg.prefix(p, prefix_commands, "You have been healed.");
  8247. goto("wait");
  8248. @inv
  8249. if(size == 0) {
  8250. @invhelp
  8251. msg.prefix(player, prefix_commands, "/inv ...");
  8252. if(perm.has("inv.backups", player)) {
  8253. msg.string(player, "§6 - backups <player> §rLists backup invs of a player");
  8254. }
  8255. if(perm.has("inv.ignore", player)) {
  8256. msg.string(player, "§6 - ignore §rToggles inventory change on world change");
  8257. }
  8258. if(perm.has("inv.see", player)) {
  8259. msg.string(player, "§6 - see <player> §rOpens an inventory of a player");
  8260. }
  8261. if(perm.has("inv.reload", player)) {
  8262. msg.string(player, "§6 - reload <player> §rReloads an inventory of a player");
  8263. }
  8264. if(perm.has("inv.saveFor", player)) {
  8265. msg.string(player, "§6 - saveFor <player> <world> §rSaves your inventory for a player");
  8266. }
  8267. if(perm.has("inv.loadFrom", player)) {
  8268. msg.string(player, "§6 - loadFrom <player> <world> §rLoads an inventory of a player for you");
  8269. }
  8270. goto("wait");
  8271. }
  8272. arg0 = string.toLowerCase(list.getIndex(args, 0));
  8273. if(arg0 == "backups") {
  8274. if(!perm.has("inv.backups", player)) {
  8275. perm.no("inv.backups", player);
  8276. goto("wait");
  8277. }
  8278. if(size < 2) {
  8279. msg.prefix(player, prefix_commands, "/inv backups <player>");
  8280. goto("wait");
  8281. }
  8282. p_name = list.getIndex(args, 1);
  8283. p_uuid = player.getUuid(p_name);
  8284. if(p_uuid == null) {
  8285. msg.prefix(player, prefix_commands, "This player has never been online.");
  8286. goto("wait");
  8287. }
  8288. player_id = player.getId(p_uuid);
  8289. dir = file.new(string.concat("scripts/configs/inv_data/backup/", player_id));
  8290. if(!file.exists(dir)) {
  8291. msg.prefix(player, prefix_commands, "No backups available.");
  8292. goto("wait");
  8293. }
  8294. file_list = file.getList(dir);
  8295. if(list.getSize(file_list) == 0) {
  8296. msg.prefix(player, prefix_commands, "No backups available.");
  8297. goto("wait");
  8298. }
  8299. f_map = map.new();
  8300. table = table.new("§b", 3, 14);
  8301. msg.string(player, table.getStart(table));
  8302. msg.string(player, table.get(table, "#", p_name));
  8303. msg.string(player, table.getMiddle(table));
  8304. iter = iterator(file_list);
  8305. while(hasNext(iter)) {
  8306. f = next(iter);
  8307. f_name = file.getName(f);
  8308. split_array = string.split("_", f_name);
  8309. time_array = string.split("-", split_array[2]);
  8310. year = time_array[0];
  8311. month = time.getStringFromNumber(read.number(time_array[1]));
  8312. day = time.getStringFromNumber(read.number(time_array[2]));
  8313. hour = time.getStringFromNumber(read.number(time_array[3]));
  8314. minute = time.getStringFromNumber(read.number(time_array[4]));
  8315. second = time.getStringFromNumber(read.number(time_array[5]));
  8316. time_string = string.concat(day, ".", month, ".", year, " ", hour, ":", minute, ":", second);
  8317. map.add(f_map, read.number(split_array[1]), time_string);
  8318. }
  8319. for(i = 1; i <= 10; i++) {
  8320. time_string = map.get(f_map, i);
  8321. msg.string(player, table.get(table, string.number(i), time_string));
  8322. }
  8323. msg.string(player, table.getEnd(table));
  8324. goto("wait");
  8325. }
  8326. if(arg0 == "ignore") {
  8327. if(!perm.has("inv.ignore", player)) {
  8328. perm.no("inv.ignore", player);
  8329. goto("wait");
  8330. }
  8331. ignore = player.hasInvIgnore(player);
  8332. if(ignore == null) {
  8333. ignore = false;
  8334. }
  8335. if(ignore) {
  8336. msg.prefix(player, prefix_commands, "Your inventory will change on joining another world.");
  8337. } else {
  8338. msg.prefix(player, prefix_commands, "You´ll keep your inventory on joining another world.");
  8339. }
  8340. player.invIgnore(player, !ignore);
  8341. goto("wait");
  8342. }
  8343. if(arg0 == "see") {
  8344. if(!perm.has("inv.see", player)) {
  8345. perm.no("inv.see", player);
  8346. goto("wait");
  8347. }
  8348. if(size < 2) {
  8349. msg.prefix(player, prefix_commands, "/inv see <player>");
  8350. goto("wait");
  8351. }
  8352. p_name = list.getIndex(args, 1);
  8353. p_uuid = player.getUuid(p_name);
  8354. if(p_uuid == null) {
  8355. msg.prefix(player, prefix_commands, "This player has never been online.");
  8356. goto("wait");
  8357. }
  8358. p = read.player(p_name);
  8359. if(p == null) {
  8360. msg.prefix(player, prefix_commands, "This player is not online.");
  8361. goto("wait");
  8362. }
  8363. inv.show(p, player);
  8364. goto("wait");
  8365. }
  8366. if(arg0 == "reload") {
  8367. if(!perm.has("inv.reload", player)) {
  8368. perm.no("inv.reload", player);
  8369. goto("wait");
  8370. }
  8371. if(size < 2) {
  8372. msg.prefix(player, prefix_commands, "/inv reload <player>");
  8373. goto("wait");
  8374. }
  8375. p_name = list.getIndex(args, 1);
  8376. p_uuid = player.getUuid(p_name);
  8377. if(p_uuid == null) {
  8378. msg.prefix(player, prefix_commands, "This player has never been online.");
  8379. goto("wait");
  8380. }
  8381. p = read.player(p_name);
  8382. if(p == null) {
  8383. msg.prefix(player, prefix_commands, "This player is not online.");
  8384. goto("wait");
  8385. }
  8386. world = loc.getWorld(entity.getLocation(p));
  8387. inv.loadFromPlayer(p, p, world);
  8388. msg.prefix(player, prefix_commands, "Inventory reloaded.");
  8389. goto("wait");
  8390. }
  8391. if(arg0 == "savefor") {
  8392. if(size != 1 && size != 3) {
  8393. msg.prefix(player, prefix_commands, "/inv saveFor <player> <world>");
  8394. goto("wait");
  8395. }
  8396. if(size == 1) {
  8397. for_player_or_id = player.getId(player);
  8398. world = loc.getWorld(entity.getLocation(player));
  8399. }
  8400. if(size == 3) {
  8401. if(!perm.has("inv.saveFor", player)) {
  8402. perm.no("inv.saveFor", player);
  8403. goto("wait");
  8404. }
  8405. p_name = list.getIndex(args, 1);
  8406. p_uuid = player.getUuid(p_name);
  8407. if(p_uuid == null) {
  8408. msg.prefix(player, prefix_commands, "This player has never been online.");
  8409. goto("wait");
  8410. }
  8411. p = read.player(p_name);
  8412. if(p != null) {
  8413. msg.prefix(player, prefix_commands, "This player is online. Use /inv see to change this inventory.");
  8414. goto("wait");
  8415. }
  8416. for_player_or_id = player.getId(p_uuid);
  8417. world_name = list.getIndex(args, 2);
  8418. world = world.get(world_name);
  8419. if(world == null) {
  8420. msg.prefix(player, prefix_world, "This world is not loaded.");
  8421. goto("wait");
  8422. }
  8423. }
  8424. inv.saveForPlayer(player, for_player_or_id, world);
  8425. msg.prefix(player, prefix_commands, "Inventory saved.");
  8426. goto("wait");
  8427. }
  8428. if(arg0 == "loadfrom") {
  8429. if(size != 1 && size != 3) {
  8430. msg.prefix(player, prefix_commands, "/inv loadFrom <player> <world>");
  8431. goto("wait");
  8432. }
  8433. if(size == 1) {
  8434. from_player_or_id = player.getId(player);
  8435. world = loc.getWorld(entity.getLocation(player));
  8436. }
  8437. if(size == 3) {
  8438. if(!perm.has("inv.loadFrom", player)) {
  8439. perm.no("inv.loadFrom", player);
  8440. goto("wait");
  8441. }
  8442. p_name = list.getIndex(args, 1);
  8443. p_uuid = player.getUuid(p_name);
  8444. if(p_uuid == null) {
  8445. msg.prefix(player, prefix_commands, "This player has never been online.");
  8446. goto("wait");
  8447. }
  8448. p = read.player(p_name);
  8449. if(p != null) {
  8450. msg.prefix(player, prefix_commands, "§cThis player is online. Loaded inventory can differ from /inv see!");
  8451. }
  8452. from_player_or_id = player.getId(p_uuid);
  8453. world_name = list.getIndex(args, 2);
  8454. world = world.get(world_name);
  8455. if(world == null) {
  8456. msg.prefix(player, prefix_world, "This world is not loaded.");
  8457. goto("wait");
  8458. }
  8459. }
  8460. inv.loadFromPlayer(player, from_player_or_id, world);
  8461. msg.prefix(player, prefix_commands, "Inventory loaded.");
  8462. goto("wait");
  8463. }
  8464. goto("wait");
  8465. @sponsor
  8466. msg.prefix(sender, prefix_commands, "Be a fancy sponsor and ...");
  8467. msg.string(sender, string.concat(" §a+ §cUse §dcolors §rand §bicons§r", icon.getGoldCoin(), icon.getCraftingTable(), icon.getHeart()));
  8468. msg.string(sender, " §a+ §rEquip your head with §b/hat");
  8469. msg.string(sender, " §a+ §rGet all online players in a party with §b/joinme");
  8470. msg.string(sender, " §a+ §rSet your own §bjoin, leave §rand §bdeath message");
  8471. goto("wait");
  8472. @dev
  8473. if(size == 0) {
  8474. @dev_syntax
  8475. msg.prefix(sender, prefix_commands, "/dev ...");
  8476. msg.string(sender, "§6 - boost §rBoosts you up to the clouds");
  8477. msg.string(sender, "§6 - debug <list/clear> §rManages logged debug messages");
  8478. msg.string(sender, "§6 - entities <world> §rLists all entities in a world");
  8479. msg.string(sender, "§6 - logo §rGives the Mundus Crassus logo on a banner");
  8480. msg.string(sender, "§6 - yeet §rThrows you in sight");
  8481. goto("wait");
  8482. }
  8483. arg0 = string.toLowerCase(list.getIndex(args, 0));
  8484. if(arg0 == "logo") {
  8485. player.giveItem(player, logo);
  8486. goto("wait");
  8487. }
  8488. if(arg0 == "boost") {
  8489. entity.setMotion(player, 0, 5, 0);
  8490. goto("wait");
  8491. }
  8492. if(arg0 == "yeet") {
  8493. if(size != 2){
  8494. msg.prefix(player, prefix_commands, "/dev yeet <strength>");
  8495. goto("wait");
  8496. }
  8497. yeet_strength = list.getIndex(args, 1);
  8498. yeet(player,math.abs(yeet_strength));
  8499. msg.string(player, "§4YEET");
  8500. goto("wait");
  8501. }
  8502. if(arg0 == "debug") {
  8503. arg1 = string.toLowerCase(list.getIndex(args, 1));
  8504. if(arg1 == "list") {
  8505. error_size = debug.getSize();
  8506. if(error_size == 0) {
  8507. msg.prefix(player, prefix_commands, "No debugs logged.");
  8508. goto("wait");
  8509. }
  8510. for(i = 0; i < error_size; i++) {
  8511. msg.string(player, debug.getIndex(i));
  8512. }
  8513. goto("wait");
  8514. }
  8515. if(arg1 == "clear") {
  8516. debug.clear();
  8517. msg.prefix(player, prefix_commands, "All logged debugs deleted.");
  8518. goto("wait");
  8519. }
  8520. goto("wait");
  8521. }
  8522. if(arg0 == "entities") {
  8523. if(size != 2) {
  8524. msg.prefix(player, prefix_commands, "/dev entities <world>");
  8525. goto("wait");
  8526. }
  8527. world_name = string.toLowerCase(list.getIndex(args, 1));
  8528. world = world.get(world_name);
  8529. if(world == null) {
  8530. msg.prefix(player, prefix_world, "This world is not loaded.");
  8531. goto("wait");
  8532. }
  8533. list = world.getEntities(world);
  8534. size = list.getSize(list);
  8535. map = map.new();
  8536. living = 0;
  8537. for(i = 0; i < size; i++) {
  8538. element = list.getIndex(list, i);
  8539. if(isLiving(element)) {
  8540. living++;
  8541. entity_type = entity.getType(element);
  8542. n = map.get(map, entity_type);
  8543. if(n == null) {
  8544. map.add(map, entity_type, 1);
  8545. } else {
  8546. map.add(map, entity_type, n + 1);
  8547. }
  8548. }
  8549. }
  8550. msg.string(player, "§0-------------------------------------------------");
  8551. msg.string(player, string.concat("Living: ", living));
  8552. iter = map.iterator(map);
  8553. table = table.new("§b", 14, 14);
  8554. msg.string(player, table.getStart(table));
  8555. while(hasNext(iter)) {
  8556. element1 = next(iter);
  8557. if(hasNext(iter)) {
  8558. element2 = next(iter);
  8559. } else {
  8560. element2 = "";
  8561. }
  8562. msg.string(player, table.get(table, element1, element2));
  8563. }
  8564. msg.string(player, table.getEnd(table));
  8565. goto("wait");
  8566. }
  8567. goto("dev_syntax");
  8568. function yeet(player, strength){
  8569. array = entity.getLook(player);
  8570. x = array[0] * (math.log(strength) + 1);
  8571. y = math.abs(array[1]) * (math.log(strength) + 1);
  8572. z = array[2] * (math.log(strength) + 1);
  8573. entity.setMotion(player, x, y, z);
  8574. }
  8575. @memory
  8576. msg.prefix(sender, prefix_commands, string.concat("Used RAM: ", string.number(usedMemory()), " / ", string.number(math.round(allocatedMemory())), " MB"));
  8577. goto("wait");
  8578. @world
  8579. if(size == 0) {
  8580. @world_syntax
  8581. msg.prefix(sender, prefix_world, "/world ...");
  8582. msg.string(sender, "§b - info [world] §rShows info about a world");
  8583. msg.string(sender, "§b - tp <world> [player] §rTeleports a player to a world");
  8584. msg.string(sender, "§b - list §rShows all loaded worlds");
  8585. msg.string(sender, "§b - setspawn §rSets the spawn of a world");
  8586. msg.string(sender, "§b - diffi <world> <diffi> §rSets the difficulty of a world");
  8587. goto("wait");
  8588. }
  8589. arg0 = string.toLowerCase(list.getIndex(args, 0));
  8590. if(arg0 == "info") {
  8591. if(size == 1) {
  8592. if(!isPlayer(sender)) {
  8593. msg.string(sender, "Not possible on console.");
  8594. goto("wait");
  8595. }
  8596. world = loc.getWorld(entity.getLocation(player));
  8597. } else {
  8598. worldname = list.getIndex(args, 1);
  8599. world = world.get(worldname);
  8600. if(world == null) {
  8601. msg.prefix(sender, prefix_world, "This world is not loaded.");
  8602. goto("wait");
  8603. }
  8604. }
  8605. msg.string(sender, string.getSpacer());
  8606. msg.string(sender, string.concat("§6World: §r", world.getName(world)));
  8607. msg.string(sender, string.concat("§6Thunder: §r", world.hasThunder(world)));
  8608. msg.string(sender, string.concat("§6Rain: §r", world.hasRain(world)));
  8609. chunks = world.getLoadedChunks(world);
  8610. forced = 0;
  8611. for(i = 0; i < array.getSize(chunks); i++) {
  8612. if(world.isForceLoadedChunk(chunks[i])) {
  8613. forced++;
  8614. }
  8615. }
  8616. msg.string(sender, string.concat("§6Chunks: §r", string.number(forced), "/", string.number(array.getSize(chunks))));
  8617. time = world.getTime(world);
  8618. while(time >= 24000) {
  8619. time -= 24000;
  8620. }
  8621. msg.string(sender, string.concat("§6Time: §r", string.number(time)));
  8622. goto("wait");
  8623. }
  8624. if(arg0 == "tp") {
  8625. if(size < 2 || size > 3) {
  8626. msg.prefix(sender, prefix_world, "/world tp <world> [player]");
  8627. goto("wait");
  8628. }
  8629. if(size >= 2) {
  8630. world_name = string.toLowerCase(list.getIndex(args, 1));
  8631. world = world.get(world_name);
  8632. if(world == null) {
  8633. msg.prefix(sender, prefix_world, "This world is not loaded.");
  8634. goto("wait");
  8635. }
  8636. }
  8637. if(size > 2) {
  8638. p_name = list.getIndex(args, 2);
  8639. p = read.player(p_name);
  8640. if(p == null) {
  8641. msg.prefix(sender, prefix_world, "This player is not online.");
  8642. goto("wait");
  8643. }
  8644. } else {
  8645. if(!isPlayer(sender)) {
  8646. msg.string(sender, "Not possible on console.");
  8647. goto("wait");
  8648. }
  8649. p = sender;
  8650. }
  8651. if(!player.canTeleport(p)) {
  8652. if(size == 3) {
  8653. msg.prefix(sender, prefix_commands, "This player can´t be teleported now.");
  8654. goto("wait");
  8655. }
  8656. msg.prefix(sender, prefix_commands, "You can´t teleport now.");
  8657. goto("wait");
  8658. }
  8659. if(sender != p) {
  8660. msg.prefix(sender, prefix_world, string.concat(player.getName(p), " was teleported to the spawn of the world ", world_name, "."));
  8661. }
  8662. if(world_name == "games") {
  8663. loc = world.getGamesSpawn();
  8664. } elseif(world_name == "creative") {
  8665. loc = world.getCreativeSpawn();
  8666. } else {
  8667. loc = world.getSpawn(world);
  8668. }
  8669. player.teleport(p, loc, true);
  8670. goto("wait");
  8671. }
  8672. if(arg0 == "list") {
  8673. msg.prefix(sender, prefix_world, "Loaded worlds:");
  8674. worldlist = world.getAll();
  8675. for(i = 0; i < list.getSize(worldlist); i++) {
  8676. msg.string(sender, string.concat(" - ", world.getName(list.getIndex(worldlist, i))));
  8677. }
  8678. msg.string(sender, string.getSpacer());
  8679. goto("wait");
  8680. }
  8681. if(arg0 == "setspawn") {
  8682. if(!isPlayer(sender)) {
  8683. msg.string(sender, "Not possible on console.");
  8684. goto("wait");
  8685. }
  8686. location = entity.getLocation(sender);
  8687. world = loc.getWorld(location);
  8688. world.setSpawn(location, world);
  8689. msg.prefix(sender, prefix_world, string.concat("New spawn of the world ", world.getName(world), " set."));
  8690. goto("wait");
  8691. }
  8692. if(arg0 == "diffi") {
  8693. if(size != 3) {
  8694. msg.prefix(sender, prefix_world, "/world diffi <world> <diffi>");
  8695. goto("wait");
  8696. }
  8697. worldname = list.getIndex(args, 1);
  8698. world = world.get(worldname);
  8699. if(world == null) {
  8700. msg.prefix(sender, prefix_world, "This world is not loaded.");
  8701. goto("wait");
  8702. }
  8703. diffi_string = list.getIndex(args, 2);
  8704. if(!(diffi_string == "PEACEFUL" || diffi_string == "EASY" || diffi_string == "NORMAL" || diffi_string == "HARD")) {
  8705. msg.prefix(sender, prefix_world, "False input.");
  8706. goto("wait");
  8707. }
  8708. world.setDifficulty(world, diffi_string);
  8709. msg.prefix(sender, prefix_world, "Difficulty changed.");
  8710. goto("wait");
  8711. }
  8712. goto("world_syntax");
  8713. @giveup
  8714. script_id = quest.getFromPlayer(player);
  8715. if(script_id == null) {
  8716. msg.prefix(player, prefix_quest, "You are not in a quest.");
  8717. goto("wait");
  8718. }
  8719. script = script.getFromId(script_id);
  8720. if(script == null) {
  8721. snuvi.debug("Player used giveup on corrupt quest");
  8722. quest.removePlayer(player); //in case of corrupt quest
  8723. msg.prefix(player, prefix_quest, "You have no quest.");
  8724. goto("wait");
  8725. }
  8726. setScriptVar("player", player);
  8727. modTimer.scriptCallEvent("quest_term", script);
  8728. quest.term(script, player);
  8729. msg.prefix(player, prefix_quest, "Quest termed.");
  8730. goto("wait");
  8731. @leave
  8732. set = player.getMinigameIds(player);
  8733. iter = iterator(set);
  8734. if(hasNext(iter)) {
  8735. script_id = next(iter);
  8736. script = script.getFromId(script_id);
  8737. if(script == null) {
  8738. snuvi.debug(string.concat("Player left game without existing gamescript ", set));
  8739. 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.");
  8740. player.resetMinigames(player);
  8741. entity.teleport(player, world.getGamesSpawn());
  8742. goto("wait");
  8743. }
  8744. minigame.hub(script, player);
  8745. goto("wait");
  8746. }
  8747. msg.prefix(player, "§dScript", "You are not in a minigame.");
  8748. goto("wait");
  8749. function minigame.hub(script, player) {
  8750. script.setVar(script, "player", player);
  8751. modTimer.scriptCallEvent("player_giveup", script);
  8752. }
  8753. @jail
  8754. if(size != 1) {
  8755. msg.prefix(player, prefix_commands, "/jail <player>");
  8756. } else {
  8757. p_name = list.getIndex(args, 0);
  8758. if(!checkIfEverOnline(p_name)) {
  8759. msg.prefix(player, prefix_jail, "This player has never been online.");
  8760. goto("wait");
  8761. }
  8762. p_uuid = player.getUuid(p_name);
  8763. if(isJailed(p_uuid)) {
  8764. msg.prefix(player, prefix_jail, "This player is already jailed.");
  8765. goto("wait");
  8766. }
  8767. player_name = player.getName(player);
  8768. if(player_name == p_name) {
  8769. msg.prefix(player, prefix_jail, "Self-Jailing isn´t a good idea.");
  8770. goto("wait");
  8771. }
  8772. if(!isOnline(p_name)) {
  8773. msg.prefix(player, prefix_jail, "This player is not online.");
  8774. goto("wait");
  8775. }
  8776. p = read.player(p_name);
  8777. if(perm.has("jail", p)) {
  8778. msg.prefix(player, prefix_jail, "You can´t jail this player.");
  8779. goto("wait");
  8780. }
  8781. list.add(jailed_list, p_uuid);
  8782. msg.prefix(player, prefix_jail, string.concat(p_name, " wurde gejailt"));
  8783. showJail(p_name);
  8784. if(!jail_loop_active) {
  8785. sgoto(5, "jailloop");
  8786. }
  8787. }
  8788. goto("wait");
  8789. @unjail
  8790. if(size != 1) {
  8791. msg.prefix(player, prefix_commands, "/unjail <player>");
  8792. } else {
  8793. p_name = list.getIndex(args, 0);
  8794. if(!checkIfEverOnline(p_name)) {
  8795. msg.prefix(player, prefix_jail, "This player has never been online.");
  8796. goto("wait");
  8797. }
  8798. p_uuid = player.getUuid(p_name);
  8799. if(!isJailed(p_uuid)) {
  8800. msg.prefix(player, prefix_jail, "This player is not jailed.");
  8801. goto("wait");
  8802. }
  8803. list.remove(jailed_list, p_uuid);
  8804. msg.prefix(player, prefix_jail, "You freed this player from jail.");
  8805. }
  8806. goto("wait");
  8807. function inv.show(from_player, to_player) {
  8808. player_inv = player.getInv(from_player);
  8809. inv = inv.new("222222222222222222222222222222222222222222222", text.new(string.concat("Inventory of ", player.getName(from_player))));
  8810. set.add($invseeids, inv.getId(inv));
  8811. setInvItem(inv, 0, living.getEquip(from_player, read.slot("HEAD")));
  8812. setInvItem(inv, 1, living.getEquip(from_player, read.slot("CHEST")));
  8813. setInvItem(inv, 2, living.getEquip(from_player, read.slot("LEGS")));
  8814. setInvItem(inv, 3, living.getEquip(from_player, read.slot("FEET")));
  8815. setInvItem(inv, 4, living.getOffHand(from_player));
  8816. for(slot = 0; slot <= 8; slot++) {
  8817. setInvItem(inv, slot + 36, inv.getItem(player_inv, slot));
  8818. }
  8819. for(slot = 9; slot <= 35; slot++) {
  8820. setInvItem(inv, slot, inv.getItem(player_inv, slot));
  8821. }
  8822. inv.open(inv, to_player);
  8823. }
  8824. function setInvItem(inv, slot, item) {
  8825. if(item == null || item.isAir(item)) {
  8826. return;
  8827. }
  8828. inv.setItem(inv, slot, item);
  8829. }
  8830. function rank.add(index, tech_rank, chat_rank) {
  8831. $rank_array[index, 0] = tech_rank;
  8832. $rank_array[index, 1] = chat_rank;
  8833. }
  8834. //--------------------------------------------------
  8835. //Vote-Utils
  8836. //--------------------------------------------------
  8837. function vote.register(name, time) {
  8838. uuid = player.getUuid(name);
  8839. if(uuid == null) {
  8840. stmt = databank.prepare("INSERT INTO votes (name, time) VALUES(?,?);");
  8841. databank.setString(stmt, 1, name);
  8842. databank.setLong(stmt, 2, time);
  8843. databank.workerExecute(stmt);
  8844. return;
  8845. }
  8846. stmt = databank.prepare("INSERT INTO votes (name, player_id, time) VALUES(?,?,?);");
  8847. id = player.getId(uuid);
  8848. databank.setString(stmt, 1, name);
  8849. databank.setInt(stmt, 2, id);
  8850. databank.setLong(stmt, 3, time);
  8851. databank.workerExecute(stmt);
  8852. }
  8853. //--------------------------------------------------
  8854. //LoginRequests-Utils
  8855. //--------------------------------------------------
  8856. function loginrequests.getPlayer(player_id, amount, result) {
  8857. list = list.new();
  8858. if(result == null) {
  8859. stmt = databank.prepare("SELECT player_id,time,result FROM login_requests WHERE player_id = ? ORDER BY TIME DESC LIMIT ?;");
  8860. databank.setInt(stmt, 1, player_id);
  8861. databank.setInt(stmt, 2, amount);
  8862. } else {
  8863. stmt = databank.prepare("SELECT player_id,time,result FROM login_requests WHERE player_id = ? AND result = ? ORDER BY TIME DESC LIMIT ?;");
  8864. databank.setInt(stmt, 1, player_id);
  8865. databank.setString(stmt, 2, result);
  8866. databank.setInt(stmt, 3, amount);
  8867. }
  8868. result = databank.execute(stmt);
  8869. while(databank.next(result)) {
  8870. a = array.new(3);
  8871. a[0] = databank.getInt(result, 1); //player_id
  8872. a[1] = databank.getLong(result, 2); //time
  8873. a[2] = databank.getString(result, 3); //result
  8874. list.add(list, a);
  8875. }
  8876. databank.close(stmt);
  8877. databank.close(result);
  8878. return list;
  8879. }
  8880. function loginrequests.getAll(amount, result) {
  8881. list = list.new();
  8882. if(result == null) {
  8883. stmt = databank.prepare("SELECT player_id,time,result FROM login_requests ORDER BY TIME DESC LIMIT ?;");
  8884. databank.setInt(stmt, 1, amount);
  8885. } else {
  8886. stmt = databank.prepare("SELECT player_id,time,result FROM login_requests WHERE result = ? ORDER BY TIME DESC LIMIT ?;");
  8887. databank.setString(stmt, 1, result);
  8888. databank.setInt(stmt, 2, amount);
  8889. }
  8890. result = databank.execute(stmt);
  8891. while(databank.next(result)) {
  8892. a = array.new(3);
  8893. a[0] = databank.getInt(result, 1); //player_id
  8894. a[1] = databank.getLong(result, 2); //time
  8895. a[2] = databank.getString(result, 3); //result
  8896. list.add(list, a);
  8897. }
  8898. databank.close(stmt);
  8899. databank.close(result);
  8900. return list;
  8901. }
  8902. //--------------------------------------------------
  8903. //Tip-Utils
  8904. //--------------------------------------------------
  8905. function tip.setLoop(tipp_key, boolean) {
  8906. stmt = databank.prepare("UPDATE tipps SET tipp_loop = ? WHERE tipp_key = ?;");
  8907. databank.setBool(stmt, 1, boolean);
  8908. databank.setString(stmt, 2, tipp_key);
  8909. databank.workerExecute(stmt);
  8910. }
  8911. function tip.remove(tipp_key) {
  8912. stmt = databank.prepare("DELETE FROM tipps WHERE tipp_key = ?;");
  8913. databank.setString(stmt, 1, tipp_key);
  8914. databank.workerExecute(stmt);
  8915. }
  8916. function tip.getAll() {
  8917. list = list.new();
  8918. stmt = databank.prepare("SELECT * FROM tipps;");
  8919. result = databank.execute(stmt);
  8920. while(databank.next(result)) {
  8921. a = array.new(3);
  8922. a[0] = databank.getString(result, 1);
  8923. a[1] = databank.getString(result, 2);
  8924. a[2] = databank.getBool(result, 3);
  8925. list.add(list, a);
  8926. }
  8927. databank.close(stmt);
  8928. databank.close(result);
  8929. return list;
  8930. }
  8931. //--------------------------------------------------
  8932. //Databank-Utils
  8933. //--------------------------------------------------
  8934. function databank.isExistingTable(table) {
  8935. temp = false;
  8936. stmt = databank.prepare("SHOW TABLES");
  8937. result = databank.execute(stmt);
  8938. while(databank.next(result)) {
  8939. if(table == databank.getString(result, 1)) {
  8940. temp = true;
  8941. break;
  8942. }
  8943. }
  8944. databank.close(result);
  8945. databank.close(stmt);
  8946. return temp;
  8947. }
  8948. function databank.getTableFields(table) {
  8949. fields = list.new();
  8950. stmt = databank.prepare(string.concat("SHOW FIELDS FROM ", table));
  8951. result = databank.execute(stmt);
  8952. while(databank.next(result)) {
  8953. list.add(fields, databank.getString(result, 1));
  8954. }
  8955. databank.close(result);
  8956. databank.close(stmt);
  8957. return fields;
  8958. }
  8959. function databank.getTableDatatypes(table) {
  8960. stmt = databank.prepare(string.concat("SHOW CREATE TABLE ", table));
  8961. result = databank.execute(stmt);
  8962. if(databank.next(result)) {
  8963. temp = databank.getString(result, 2);
  8964. }
  8965. databank.close(result);
  8966. databank.close(stmt);
  8967. return temp;
  8968. }
  8969. //--------------------------------------------------
  8970. //Tipp-Utils
  8971. //--------------------------------------------------
  8972. function tipp.register(tipp_key, tipp_value) {
  8973. stmt = databank.prepare("INSERT INTO tipps (tipp_key, tipp_value) VALUES (?,?) ON DUPLICATE KEY UPDATE tipp_value = ?");
  8974. databank.setString(stmt, 1, tipp_key);
  8975. databank.setString(stmt, 2, tipp_value);
  8976. databank.setString(stmt, 3, tipp_value);
  8977. databank.workerExecute(stmt);
  8978. }
  8979. function tipp.get(tipp_key) {
  8980. tipp_value = null;
  8981. stmt = databank.prepare("SELECT tipp_value FROM tipps WHERE tipp_key = ?;");
  8982. databank.setString(stmt, 1, tipp_key);
  8983. result = databank.execute(stmt);
  8984. if(databank.next(result)) {
  8985. tipp_value = databank.getString(result, 1);
  8986. }
  8987. databank.close(result);
  8988. databank.close(stmt);
  8989. return tipp_value;
  8990. }
  8991. function tipp.exists(tipp_key) {
  8992. stmt = databank.prepare("SELECT tipp_key FROM tipps WHERE tipp_key = ?;");
  8993. databank.setString(stmt, 1, tipp_key);
  8994. result = databank.execute(stmt);
  8995. temp = false;
  8996. if(databank.next(result)) {
  8997. temp = true;
  8998. }
  8999. databank.close(result);
  9000. databank.close(stmt);
  9001. return temp;
  9002. }
  9003. //--------------------------------------------------
  9004. //Warp-Utils
  9005. //--------------------------------------------------
  9006. function warp.create(warp_name, location) {
  9007. config = config.new(string.concat("scripts/configs/warps"), warp_name);
  9008. config.set(config, "world", world.getName(loc.getWorld(location)));
  9009. config.set(config, "x", loc.getX(location));
  9010. config.set(config, "y", loc.getY(location));
  9011. config.set(config, "z", loc.getZ(location));
  9012. config.set(config, "yaw", loc.getYaw(location));
  9013. config.set(config, "pitch", loc.getPitch(location));
  9014. config.saveAsync(config);
  9015. }
  9016. function warp.exists(warp_name) {
  9017. config = config.new(string.concat("scripts/configs/warps"), warp_name);
  9018. return config.exists(config);
  9019. }
  9020. function warp.get(warp_name) {
  9021. config = config.new(string.concat("scripts/configs/warps"), warp_name);
  9022. if(config.exists(config)) {
  9023. config.load(config);
  9024. }
  9025. world_name = config.getString(config, "world", "null");
  9026. if(world_name == "null") {
  9027. return null;
  9028. }
  9029. world = world.get(world_name);
  9030. x = config.getDouble(config, "x", 0);
  9031. y = config.getDouble(config, "y", 100);
  9032. z = config.getDouble(config, "z", 0);
  9033. yaw = config.getDouble(config, "yaw", 0);
  9034. pitch = config.getDouble(config, "pitch", 0);
  9035. return loc.new(world, x, y, z, yaw, pitch);
  9036. }
  9037. function warp.delete(warp_name) {
  9038. config = config.new(string.concat("scripts/configs/warps"), warp_name);
  9039. if(!config.exists(config)) {
  9040. return false;
  9041. }
  9042. config.delete(config);
  9043. return true;
  9044. }
  9045. function warp.getList() {
  9046. dir = file.new(string.concat("scripts/configs/warps"));
  9047. warps_list = list.new();
  9048. if(file.exists(dir)) {
  9049. file_list = file.getList(dir);
  9050. iter = iterator(file_list);
  9051. while(hasNext(iter)) {
  9052. warp = file.getName(next(iter));
  9053. warp = string.replace(warp, ".snuvic", "");
  9054. list.add(warps_list, warp);
  9055. }
  9056. }
  9057. return warps_list;
  9058. }
  9059. //--------------------------------------------------
  9060. //Home-Utils
  9061. //--------------------------------------------------
  9062. function home.set(player_id, home_name, location) {
  9063. stmt = databank.prepare("INSERT INTO new_homes (player_id, name, world_name, x, y, z, yaw, pitch) VALUES (?,?,?,?,?,?,?,?);");
  9064. databank.setInt(stmt, 1, player_id);
  9065. databank.setString(stmt, 2, home_name);
  9066. databank.setString(stmt, 3, world.getName(loc.getWorld(location)));
  9067. databank.setInt(stmt, 4, loc.getX(location));
  9068. databank.setInt(stmt, 5, loc.getY(location));
  9069. databank.setInt(stmt, 6, loc.getZ(location));
  9070. databank.setInt(stmt, 7, loc.getYaw(location));
  9071. databank.setInt(stmt, 8, loc.getPitch(location));
  9072. databank.workerExecute(stmt);
  9073. }
  9074. function home.delete(player_id, home_name) {
  9075. stmt = databank.prepare("DELETE FROM new_homes WHERE player_id = ? AND name = ?;");
  9076. databank.setInt(stmt, 1, player_id);
  9077. databank.setString(stmt, 2, home_name);
  9078. databank.workerExecute(stmt);
  9079. }
  9080. function home.getLocation(player_id, home_name) {
  9081. stmt = databank.prepare("SELECT world_name, x, y, z, yaw, pitch FROM new_homes WHERE player_id = ? AND name = ?;");
  9082. databank.setInt(stmt, 1, player_id);
  9083. databank.setString(stmt, 2, home_name);
  9084. result = databank.execute(stmt);
  9085. if(databank.next(result)) {
  9086. world = world.get(databank.getString(result, 1));
  9087. if(world == null) {
  9088. return null;
  9089. }
  9090. x = databank.getDouble(result, 2);
  9091. y = databank.getDouble(result, 3);
  9092. z = databank.getDouble(result, 4);
  9093. yaw = databank.getDouble(result, 5);
  9094. pitch = databank.getDouble(result, 6);
  9095. location = loc.new(world, x, y, z, yaw, pitch);
  9096. }
  9097. databank.close(result);
  9098. databank.close(stmt);
  9099. return location;
  9100. }
  9101. function home.exists(player_id, home_name) {
  9102. stmt = databank.prepare("SELECT player_id FROM new_homes WHERE player_id = ? AND name = ?;");
  9103. databank.setInt(stmt, 1, player_id);
  9104. databank.setString(stmt, 2, home_name);
  9105. result = databank.execute(stmt);
  9106. if(databank.next(result)) {
  9107. temp = true;
  9108. } else {
  9109. temp = false;
  9110. }
  9111. databank.close(result);
  9112. databank.close(stmt);
  9113. return temp;
  9114. }
  9115. function home.getList(player_id) {
  9116. homes_list = list.new();
  9117. stmt = databank.prepare("SELECT name FROM new_homes WHERE player_id = ?;");
  9118. databank.setInt(stmt, 1, player_id);
  9119. result = databank.execute(stmt);
  9120. while(databank.next(result)) {
  9121. list.add(homes_list, databank.getString(result, 1));
  9122. }
  9123. databank.close(result);
  9124. databank.close(stmt);
  9125. return homes_list;
  9126. }
  9127. function hasTpaRequest(player_uuid, aim_uuid) {
  9128. for(i = 0; i < list.getSize($tpa_request); i++) {
  9129. array = list.getIndex($tpa_request, i);
  9130. if(array[0] == player_uuid && array[1] == aim_uuid) {
  9131. list.removeIndex($tpa_request, i);
  9132. return true;
  9133. }
  9134. }
  9135. return false;
  9136. }
  9137. function addTpaRequest(player_uuid, aim_uuid) {
  9138. array = array.new(2);
  9139. array[0] = player_uuid;
  9140. array[1] = aim_uuid;
  9141. list.add($tpa_request, array);
  9142. }
  9143. function showJail(player_name) {
  9144. if(isOnline(player_name)) {
  9145. inv.open($jailmenu, read.player(player_name));
  9146. }
  9147. }
  9148. function isJailed(player_uuid) {
  9149. return(list.contains($jailed_list, player_uuid));
  9150. }
  9151. function command.register(command, description) {
  9152. command.add(command);
  9153. list.add($command_list, command);
  9154. map.add($command_map, command, description);
  9155. }
  9156. function command.registerAlias(alias, command) {
  9157. command.add(alias);
  9158. map.add($alias_map, alias, command);
  9159. }
  9160. //--------------------------------------------------
  9161. //Time-Utils
  9162. //--------------------------------------------------
  9163. //Spielzeit aller Online-Spieler
  9164. function playtime.getTotalOnlineMinutes() {
  9165. minutes = 0;
  9166. iter = iterator(players.toList());
  9167. while(hasNext(iter)) {
  9168. minutes += playtime.getPlayerOnlineMinutes(player.getId(next(iter)));
  9169. }
  9170. return minutes;
  9171. }
  9172. //Spielzeit in einem Zeitraum exkl. der Spielzeit der Online-Spieler
  9173. function playtime.getInterval(from_cal, to_cal) {
  9174. stmt = databank.prepare("SELECT SUM(leave_time - join_time) FROM playtime WHERE join_time > ? AND join_time < ?;");
  9175. databank.setLong(stmt, 1, time.from(from_cal));
  9176. databank.setLong(stmt, 2, time.from(to_cal));
  9177. result = databank.execute(stmt);
  9178. if(databank.next(result)) {
  9179. minutes = databank.getLong(result, 1) / 1000 / 60;
  9180. } else {
  9181. minutes = 0;
  9182. }
  9183. databank.close(result);
  9184. databank.close(stmt);
  9185. return minutes;
  9186. }
  9187. //Gesamte Spielzeit inkl. der Spielzeit der Online-Spieler
  9188. function playtime.getTotal() {
  9189. minutes = playtime.getTotalOnlineMinutes();
  9190. stmt = databank.prepare("SELECT SUM(leave_time - join_time) FROM playtime;");
  9191. result = databank.execute(stmt);
  9192. if(databank.next(result)) {
  9193. minutes += databank.getLong(result, 1) / 1000 / 60;
  9194. }
  9195. databank.close(result);
  9196. databank.close(stmt);
  9197. return minutes;
  9198. }
  9199. //Spielzeit eines Spielers in einem Zeitraum exkl. der Online-Spielzeit
  9200. function playtime.getPlayerInterval(player_id, from_cal, to_cal) {
  9201. stmt = databank.prepare("SELECT SUM(leave_time - join_time) FROM playtime WHERE player_id = ? AND join_time > ? AND join_time < ?;");
  9202. databank.setInt(stmt, 1, player_id);
  9203. databank.setLong(stmt, 2, time.from(from_cal));
  9204. databank.setLong(stmt, 3, time.from(to_cal));
  9205. result = databank.execute(stmt);
  9206. if(databank.next(result)) {
  9207. minutes = databank.getLong(result, 1) / 1000 / 60;
  9208. } else {
  9209. minutes = 0;
  9210. }
  9211. databank.close(result);
  9212. databank.close(stmt);
  9213. return minutes;
  9214. }
  9215. function playtime.getPlayersPerInterval(from_cal, to_cal) {
  9216. set = set.new();
  9217. stmt = databank.prepare("SELECT player_id FROM playtime WHERE join_time > ? AND join_time < ?;");
  9218. databank.setLong(stmt, 1, time.from(from_cal));
  9219. databank.setLong(stmt, 2, time.from(to_cal));
  9220. result = databank.execute(stmt);
  9221. while(databank.next(result)) {
  9222. set.add(set, databank.getInt(result, 1));
  9223. }
  9224. databank.close(result);
  9225. databank.close(stmt);
  9226. return set.getSize(set);
  9227. }
  9228. function time.getYearDays(year) {
  9229. days = 365;
  9230. if(year % 4 == 0) {
  9231. days++;
  9232. }
  9233. return days;
  9234. }
  9235. function time.getMonthDays(month, year) {
  9236. days = month.getDays(month);
  9237. //Schaltjahre
  9238. if(month == 2 && year % 4 == 0) {
  9239. days++;
  9240. }
  9241. return days;
  9242. }
  9243. function month.register(month_index, shortname, days) {
  9244. $month_array[month_index, 0] = shortname;
  9245. $month_array[month_index, 1] = days;
  9246. }
  9247. function month.getShortName(month) {
  9248. return $month_array[month - 1, 0];
  9249. }
  9250. function month.getDays(month) {
  9251. return $month_array[month - 1, 1];
  9252. }
  9253. //--------------------------------------------------
  9254. //Player-Utils
  9255. //--------------------------------------------------
  9256. function player.hasClanInvitation(player_or_id, clan_id) {
  9257. if(isPlayer(player_or_id)) {
  9258. player_id = player.getId(player_or_id);
  9259. } else {
  9260. player_id = player_or_id;
  9261. }
  9262. iter = iterator($clan_invitations);
  9263. while(hasNext(iter)) {
  9264. invitation = next(iter);
  9265. p_id = invitation[0];
  9266. c_id = invitation[1];
  9267. if(player_id == p_id && clan_id == c_id) {
  9268. return true;
  9269. }
  9270. }
  9271. return false;
  9272. }
  9273. function player.addClanInvitation(player_id, clan_id) {
  9274. invitation = array.new(2);
  9275. invitation[0] = player_id;
  9276. invitation[1] = clan_id;
  9277. list.add($clan_invitations, invitation);
  9278. }
  9279. //--------------------------------------------------
  9280. //Party-Utils
  9281. //--------------------------------------------------
  9282. function party.invitePlayer(inviter, invitee) {
  9283. //Wenn bereits ein Party besteht, diese Party-ID verwenden.
  9284. //Ansonsten überprüfen, ob der Einlader bereits andere Spieler eingeladen hat. Dann diese Party-ID verwenden.
  9285. //Ansonsten neue Party-ID vergeben.
  9286. inviter_uuid = player.getUuid(inviter);
  9287. if(player.isInParty(inviter)) {
  9288. party_id = player.getPartyId(inviter);
  9289. } else {
  9290. party_id = map.get($party_invite_ids, inviter_uuid);
  9291. if(party_id == null) {
  9292. party_id = ++$party_counter;
  9293. }
  9294. }
  9295. if(invitee == null) {
  9296. return "inviteeNotOnline";
  9297. }
  9298. if(inviter == invitee) {
  9299. return "inviterEqualsInvitee";
  9300. }
  9301. if(player.isInParty(inviter)) {
  9302. if(!player.isPartyLeaderOrMod(inviter)) {
  9303. return "inviterNotPermitted";
  9304. }
  9305. }
  9306. if(player.isInParty(invitee)) {
  9307. return "inviteeAlreadyInParty";
  9308. }
  9309. invitee_uuid = player.getUuid(invitee);
  9310. list = map.get($party_invitations, invitee_uuid);
  9311. if(list == null) {
  9312. list = list.new();
  9313. map.add($party_invitations, invitee_uuid, list);
  9314. }
  9315. if(list.contains(list, inviter_uuid)) {
  9316. return "inviteeAlreadyInvited";
  9317. }
  9318. list.add(list, inviter_uuid);
  9319. list.add($deluuid, inviter_uuid);
  9320. list.add($delkeytime, time.getMillis());
  9321. list = map.get($delkeytimes, invitee_uuid);
  9322. if(list == null) {
  9323. list = list.new();
  9324. map.add($delkeytimes, invitee_uuid, list);
  9325. }
  9326. list.add(list, time.getMillis());
  9327. map.add($party_invite_ids, inviter_uuid, party_id);
  9328. inviter_name = player.getName(inviter);
  9329. msg.prefix(invitee, $prefix_party, string.concat(inviter_name, " invites you to a party."));
  9330. 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))));
  9331. sgoto(200, "deletePartyInvitation"); //Einladung bleibt 1 Minute lang erhalten
  9332. return true;
  9333. }
  9334. function party.kickPlayer(player, reason) {
  9335. party_id = player.getPartyId(player);
  9336. //Nachrichten
  9337. player_name = player.getName(player);
  9338. if(reason == "kick") {
  9339. message = string.concat("§r", player_name, " has been kicked out of the party.");
  9340. } else {
  9341. message = string.concat("§r", player_name, " has left the party.");
  9342. }
  9343. party.sendMessage(party_id, message);
  9344. player_uuid = player.getUuid(player_name);
  9345. //aus Partyliste entfernen
  9346. party_list = party.getList(party_id);
  9347. list.remove(party_list, player_uuid);
  9348. //ID und Rang entfernen
  9349. rank = player.getPartyRank(player);
  9350. player.delPartyRank(player);
  9351. player.delPartyId(player);
  9352. //Einladungen löschen
  9353. map.remove($party_invitations, player_uuid);
  9354. map.remove($delkeytimes, player_uuid);
  9355. //Wenn Party keine zwei Spieler mehr hat, dann Party auflösen
  9356. if(list.getSize(party_list) < 2) {
  9357. party.delete(party_id);
  9358. return;
  9359. }
  9360. //Wenn Spieler Partyleiter war, neuen Partyleiter ernennen
  9361. if(rank == "Leader") {
  9362. new_player = player.get(list.getIndex(party_list, 0));
  9363. player.setPartyRank(new_player, "Leader");
  9364. party.sendMessage(party_id, string.concat("§r", player.getName(new_player), " is now Leader."));
  9365. }
  9366. }
  9367. function party.sendMessage(party_id, message) {
  9368. iter = iterator(party.getList(party_id));
  9369. while(hasNext(iter)) {
  9370. msg.prefix(player.get(next(iter)), $prefix_party, message);
  9371. }
  9372. }
  9373. function party.delete(party_id) {
  9374. party.sendMessage(party_id, "Party disbanded.");
  9375. iter = iterator(party.getList(party_id));
  9376. while(hasNext(iter)) {
  9377. player = player.get(next(iter));
  9378. player.delPartyRank(player);
  9379. player.delPartyId(player);
  9380. }
  9381. }
  9382. @deletePartyInvitation
  9383. player_uuid = list.getIndex(deluuid, 0);
  9384. invitations = map.get(party_invitations, player_uuid);
  9385. keytimes = map.get(delkeytimes, player_uuid);
  9386. if(invitations != null) {
  9387. if(list.getSize(invitations) != 0) {
  9388. keytime = list.getIndex(delkeytime, 0);
  9389. keytime2 = list.getIndex(keytimes, 0);
  9390. list.remove(delkeytime, keytime);
  9391. if(keytime == keytime2) {
  9392. index = list.getIndexOf(keytimes, keytime2);
  9393. list.remove(keytimes, keytime2);
  9394. list.removeIndex(invitations, index);
  9395. }
  9396. }
  9397. }
  9398. goto("wait");
  9399. //--------------------------------------------------
  9400. //Plot-Utils
  9401. //--------------------------------------------------
  9402. function plot.registerMoveEvents(world) {
  9403. if(world == null) {
  9404. return;
  9405. }
  9406. iter = plot.iterator(world);
  9407. while(hasNext(iter)) {
  9408. plot = next(iter);
  9409. plot.setMoveEvent(plot, world);
  9410. }
  9411. }
  9412. function plot.delMoveEvent(plot) {
  9413. plot_id = plot.getId(plot);
  9414. for(i = 0; i < list.getSize($plot_move_ids_list); i++) {
  9415. a = list.getIndex($plot_move_ids_list, i);
  9416. if(a[1] == plot_id) {
  9417. event.removeMoveData(a[0]);
  9418. list.removeIndex($plot_move_ids_list, i);
  9419. break;
  9420. }
  9421. }
  9422. }
  9423. function plot.setMoveEvent(plot, world) {
  9424. if(!plot.isCity(plot) && !plot.isPlot(plot)) {
  9425. return;
  9426. }
  9427. x1 = plot.getMinX(plot);
  9428. y1 = plot.getMinY(plot);
  9429. z1 = plot.getMinZ(plot);
  9430. x2 = plot.getMaxX(plot);
  9431. y2 = plot.getMaxY(plot);
  9432. z2 = plot.getMaxZ(plot);
  9433. loc1 = loc.new(world, x1, y1, z1);
  9434. loc2 = loc.new(world, x2, y2, z2);
  9435. move_id = event.addMoveData(loc1, loc2, 100, -1);
  9436. plot_id = plot.getId(plot);
  9437. a = array.new(2);
  9438. a[0] = move_id;
  9439. a[1] = plot_id;
  9440. list.add($plot_move_ids_list, a);
  9441. }
  9442. function plot.getPlotIdFromMoveId(move_id) {
  9443. iter = iterator($plot_move_ids_list);
  9444. while(hasNext(iter)) {
  9445. a = next(iter);
  9446. if(a[0] == move_id) {
  9447. return a[1];
  9448. }
  9449. }
  9450. return null;
  9451. }
  9452. function plot.getMoveIdFromPlotId(plot_id) {
  9453. iter = iterator($plot_move_ids_list);
  9454. while(hasNext(iter)) {
  9455. a = next(iter);
  9456. if(a[1] == plot_id) {
  9457. return a[0];
  9458. }
  9459. }
  9460. return null;
  9461. }
  9462. @checkForPlot
  9463. player_uuid = list.getIndex(check_for_plot_list, 0);
  9464. list.removeIndex(check_for_plot_list, 0);
  9465. player = player.get(player_uuid);
  9466. if(player == null) {
  9467. map.remove(actual_move_id, player_uuid);
  9468. goto("wait");
  9469. }
  9470. player_loc = entity.getLocation(player);
  9471. plot_list = plot.get(player_loc);
  9472. if(list.getSize(plot_list) == 0) {
  9473. map.remove(actual_move_id, player_uuid);
  9474. } else {
  9475. list.add(check_for_plot_list, player_uuid);
  9476. sgoto(100, "checkForPlot");
  9477. }
  9478. goto("wait");
  9479. function tpBottom(player) {
  9480. player_loc = entity.getLocation(player);
  9481. y = loc.getY(player_loc);
  9482. while(y > -64 && block.isAir(block.get(player_loc))) {
  9483. loc.setY(player_loc, y);
  9484. y--;
  9485. }
  9486. if(y <= 0) {
  9487. return;
  9488. }
  9489. loc.addY(player_loc, 1);
  9490. entity.teleport(player, player_loc);
  9491. }
  9492. //--------------------------------------------------
  9493. //Mailbox-Utils
  9494. //--------------------------------------------------
  9495. function mailbox.sendItem(player_id, item) {
  9496. index = mailbox.getFreeIndex(player_id);
  9497. if(index == -1) {
  9498. return false;
  9499. }
  9500. mailbox.setItem(player_id, index, item);
  9501. return true;
  9502. }
  9503. function mailbox.clear(player_id) {
  9504. pfad = "scripts/configs/inv_data/mailbox";
  9505. config = config.new(pfad, player_id);
  9506. if(config.exists(config)) {
  9507. config.load(config);
  9508. }
  9509. for(index = 0; index < 27; index++) {
  9510. config.set(config, string.concat("item-", string.number(index)), "null");
  9511. }
  9512. config.saveAsync(config);
  9513. }
  9514. function mailbox.setItem(player_id, index, item) {
  9515. pfad = "scripts/configs/inv_data/mailbox";
  9516. config = config.new(pfad, player_id);
  9517. if(config.exists(config)) {
  9518. config.load(config);
  9519. }
  9520. item_string = string.item(item);
  9521. config.set(config, string.concat("item-", string.number(index)), item_string);
  9522. config.saveAsync(config);
  9523. }
  9524. function mailbox.removeItem(player_id, index) {
  9525. pfad = "scripts/configs/inv_data/mailbox";
  9526. config = config.new(pfad, player_id);
  9527. if(config.exists(config)) {
  9528. config.load(config);
  9529. }
  9530. config.set(config, string.concat("item-", string.number(index)), "null");
  9531. config.saveAsync(config);
  9532. }
  9533. function mailbox.getFreeIndex(player_id) {
  9534. pfad = "scripts/configs/inv_data/mailbox";
  9535. config = config.new(pfad, player_id);
  9536. if(config.exists(config)) {
  9537. config.load(config);
  9538. }
  9539. for(i = 0; i < 27; i++) {
  9540. item_string = config.getString(config, string.concat("item-", string.number(i)), "null");
  9541. if(item_string == "null") {
  9542. return i;
  9543. }
  9544. }
  9545. return -1;
  9546. }
  9547. function mailbox.show(to_player, player_id, bool) {
  9548. pfad = "scripts/configs/inv_data/mailbox";
  9549. config = config.new(pfad, player_id);
  9550. if(config.exists(config)) {
  9551. config.load(config);
  9552. }
  9553. if(bool) {
  9554. inv = inv.new("222222222222222222222222222", text.new(string.concat("Mailbox from ", player.getNameFromId(player_id))));
  9555. } else {
  9556. inv = inv.new("111111111111111111111111111", text.new(string.concat("Mailbox from ", player.getNameFromId(player_id))));
  9557. }
  9558. for(i = 0; i < 27; i++) {
  9559. item_string = config.getString(config, string.concat("item-", string.number(i)), "null");
  9560. if(item_string == "null") {
  9561. continue;
  9562. }
  9563. item = read.item(item_string);
  9564. if(item == null) {
  9565. continue;
  9566. }
  9567. setInvItem(inv, i, item);
  9568. }
  9569. inv.open(inv, to_player);
  9570. }
  9571. function updateVoteInv() {
  9572. lore_list = list.new();
  9573. list.add(lore_list, text.new("§fCost: §e1 VP"));
  9574. list.add(lore_list, text.new(string.concat("§fCounter: §e", string.number(getHomeBoost()))));
  9575. list.add(lore_list, text.new("§5Every 20 VP the possible homes increase by one."));
  9576. list.add(lore_list, text.new("§5Counter automatically shrinks by one every day."));
  9577. inv.setItem($vote_inv, 2, item.create("RED_BED", 1, "§aMore Homes", lore_list));
  9578. }
  9579. function getAdditionalVoteHomes() {
  9580. return math.roundDown(getHomeBoost() / 20);
  9581. }
  9582. function getHomeBoost() {
  9583. config = getServerConfig();
  9584. return config.getDouble(config, "homeBoostPoints", 0);
  9585. }
  9586. function increaseHomeBoost() {
  9587. config = getServerConfig();
  9588. points = config.getDouble(config, "homeBoostPoints", 0) + 1;
  9589. config.set(config, "homeBoostPoints", points);
  9590. config.saveAsync(config);
  9591. updateVoteInv();
  9592. }
  9593. function decreaseHomeBoost() {
  9594. config = getServerConfig();
  9595. points = config.getDouble(config, "homeBoostPoints", 0) - 1;
  9596. if(points < 0) {
  9597. points = 0;
  9598. }
  9599. config.set(config, "homeBoostPoints", points);
  9600. config.saveAsync(config);
  9601. updateVoteInv();
  9602. }