1 Star 0 Fork 9

mengtest/mir2

forked from pyq19/mir2 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Common.cs 183.64 KB
一键复制 编辑 原始数据 按行查看 历史
pyq19 提交于 2020-06-26 00:30 . 重要更新 UserItem 兼容 mirgo
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Reflection;
using System.Text.RegularExpressions;
using C = ClientPackets;
using S = ServerPackets;
using System.Linq;
public enum PanelType : byte
{
Buy = 0,
Sell,
Repair,
SpecialRepair,
Consign,
Craft,
Refine,
CheckRefine,
Disassemble,
Downgrade,
Reset,
CollectRefine,
ReplaceWedRing,
}
public enum BlendMode : sbyte
{
NONE = -1,
NORMAL = 0,
LIGHT = 1,
LIGHTINV = 2,
INVNORMAL = 3,
INVLIGHT = 4,
INVLIGHTINV = 5,
INVCOLOR = 6,
INVBACKGROUND = 7
}
public enum DamageType : byte
{
Hit = 0,
Miss = 1,
Critical = 2
}
[Flags]
public enum GMOptions : byte
{
None = 0,
GameMaster = 0x0001,
Observer = 0x0002,
Superman = 0x0004
}
public enum AwakeType : byte
{
None = 0,
DC,
MC,
SC,
AC,
MAC,
HPMP,
}
[Flags]
public enum LevelEffects : byte
{
None = 0,
Mist = 0x0001,
RedDragon = 0x0002,
BlueDragon = 0x0004
}
public enum OutputMessageType : byte
{
Normal,
Quest,
Guild
}
public enum ItemGrade : byte
{
None = 0,
Common = 1,
Rare = 2,
Legendary = 3,
Mythical = 4,
}
public enum StatType : byte
{
AC = 0,
MAC = 1,
DC = 2,
MC = 3,
SC = 4,
HP = 5,
MP = 6,
HP_Percent = 7,
MP_Percent = 8,
HP_Regen = 9,
MP_Regen = 10,
ASpeed = 11,
Luck = 12,
Strong = 13,
Accuracy = 14,
Agility = 15,
MagicResist = 16,
PoisonResist = 17,
PoisonAttack = 18,
PoisonRegen = 19,
Freezing = 20,
Holy = 21,
Durability = 22,
Unknown = 23
}
public enum RefinedValue : byte
{
None = 0,
DC = 1,
MC = 2,
SC = 3,
}
public enum QuestType : byte
{
General = 0,
Daily = 1,
Repeatable = 2,
Story = 3
}
public enum QuestIcon : byte
{
None = 0,
QuestionWhite = 1,
ExclamationYellow = 2,
QuestionYellow = 3,
ExclamationBlue = 5,
QuestionBlue = 6,
ExclamationGreen = 52,
QuestionGreen = 53
}
public enum QuestState : byte
{
Add,
Update,
Remove
}
public enum DefaultNPCType : byte
{
Login,
LevelUp,
UseItem,
MapCoord,
MapEnter,
Die,
Trigger,
CustomCommand,
OnAcceptQuest,
OnFinishQuest,
Daily,
TalkMonster
}
public enum IntelligentCreatureType : byte
{
None = 99,
BabyPig = 0,
Chick = 1,
Kitten = 2,
BabySkeleton = 3,
Baekdon = 4,
Wimaen = 5,
BlackKitten = 6,
BabyDragon = 7,
OlympicFlame = 8,
BabySnowMan = 9,
Frog = 10,
BabyMonkey = 11,
AngryBird = 12,
Foxey = 13,
}
//1 blank mob files
//7 mob frames not added
//2 blank frame sets (92, 173)
//4 mob frames duplicate of other frame sets
//TODO: add 2 missing frames in to blank frames, remove 2 duplicate frames (leaving no blanks and 2 duplicates)
public enum Monster : ushort
{
Guard = 0,
TaoistGuard = 1,
Guard2 = 2,
Hen = 3,
Deer = 4,
Scarecrow = 5,
HookingCat = 6,
RakingCat = 7,
Yob = 8,
Oma = 9,
CannibalPlant = 10,
ForestYeti = 11,
SpittingSpider = 12,
ChestnutTree = 13,
EbonyTree = 14,
LargeMushroom = 15,
CherryTree = 16,
OmaFighter = 17,
OmaWarrior = 18,
CaveBat = 19,
CaveMaggot = 20,
Scorpion = 21,
Skeleton = 22,
BoneFighter = 23,
AxeSkeleton = 24,
BoneWarrior = 25,
BoneElite = 26,
Dung = 27,
Dark = 28,
WoomaSoldier = 29,
WoomaFighter = 30,
WoomaWarrior = 31,
FlamingWooma = 32,
WoomaGuardian = 33,
WoomaTaurus = 34,
WhimperingBee = 35,
GiantWorm = 36,
Centipede = 37,
BlackMaggot = 38,
Tongs = 39,
EvilTongs = 40,
EvilCentipede = 41,
BugBat = 42,
BugBatMaggot = 43,
WedgeMoth = 44,
RedBoar = 45,
BlackBoar = 46,
SnakeScorpion = 47,
WhiteBoar = 48,
EvilSnake = 49,
BombSpider = 50,
RootSpider = 51,
SpiderBat = 52,
VenomSpider = 53,
GangSpider = 54,
GreatSpider = 55,
LureSpider = 56,
BigApe = 57,
EvilApe = 58,
GrayEvilApe = 59,
RedEvilApe = 60,
CrystalSpider = 61,
RedMoonEvil = 62,
BigRat = 63,
ZumaArcher = 64,
ZumaStatue = 65,
ZumaGuardian = 66,
RedThunderZuma = 67,
ZumaTaurus = 68,
DigOutZombie = 69,
ClZombie = 70,
NdZombie = 71,
CrawlerZombie = 72,
ShamanZombie = 73,
Ghoul = 74,
KingScorpion = 75,
KingHog = 76,
DarkDevil = 77,
BoneFamiliar = 78,
Shinsu = 79,
Shinsu1 = 80,
SpiderFrog = 81,
HoroBlaster = 82,
BlueHoroBlaster = 83,
KekTal = 84,
VioletKekTal = 85,
Khazard = 86,
RoninGhoul = 87,
ToxicGhoul = 88,
BoneCaptain = 89,
BoneSpearman = 90,
BoneBlademan = 91,
BoneArcher = 92,
BoneLord = 93,
Minotaur = 94,
IceMinotaur = 95,
ElectricMinotaur = 96,
WindMinotaur = 97,
FireMinotaur = 98,
RightGuard = 99,
LeftGuard = 100,
MinotaurKing = 101,
FrostTiger = 102,
Sheep = 103,
Wolf = 104,
ShellNipper = 105,
Keratoid = 106,
GiantKeratoid = 107,
SkyStinger = 108,
SandWorm = 109,
VisceralWorm = 110,
RedSnake = 111,
TigerSnake = 112,
Yimoogi = 113,
GiantWhiteSnake = 114,
BlueSnake = 115,
YellowSnake = 116,
HolyDeva = 117,
AxeOma = 118,
SwordOma = 119,
CrossbowOma = 120,
WingedOma = 121,
FlailOma = 122,
OmaGuard = 123,
YinDevilNode = 124,
YangDevilNode = 125,
OmaKing = 126,
BlackFoxman = 127,
RedFoxman = 128,
WhiteFoxman = 129,
TrapRock = 130,
GuardianRock = 131,
ThunderElement = 132,
CloudElement = 133,
GreatFoxSpirit = 134,
HedgeKekTal = 135,
BigHedgeKekTal = 136,
RedFrogSpider = 137,
BrownFrogSpider = 138,
ArcherGuard = 139,
KatanaGuard = 140,
ArcherGuard2 = 141,
Pig = 142,
Bull = 143,
Bush = 144,
ChristmasTree = 145,
HighAssassin = 146,
DarkDustPile = 147,
DarkBrownWolf = 148,
Football = 149,
GingerBreadman = 150,
HalloweenScythe = 151,
GhastlyLeecher = 152,
CyanoGhast = 153,
MutatedManworm = 154,
CrazyManworm = 155,
MudPile = 156,
TailedLion = 157,
Behemoth = 158,//done BOSS
DarkDevourer = 159,//done
PoisonHugger = 160,//done
Hugger = 161,//done
MutatedHugger = 162,//done
DreamDevourer = 163,//done
Treasurebox = 164,//done
SnowPile = 165,//done
Snowman = 166,//done
SnowTree = 167,//done
GiantEgg = 168,//done
RedTurtle = 169,//done
GreenTurtle = 170,//done
BlueTurtle = 171,//done
Catapult = 172, //not added frames //special 3 states in 1
SabukWallSection = 173, //not added frames
NammandWallSection = 174, //not added frames
SiegeRepairman = 175, //not added frames
BlueSanta = 176,//done
BattleStandard = 177,//done
//ArcherGuard2 = 178,//done
RedYimoogi = 179,//done
LionRiderMale = 180, //frames not added
LionRiderFemale = 181, //frames not added
Tornado = 182,//done
FlameTiger = 183,//done
WingedTigerLord = 184,//done BOSS
TowerTurtle = 185,//done
FinialTurtle = 186,//done
TurtleKing = 187,//done BOSS
DarkTurtle = 188,//done
LightTurtle = 189,//done
DarkSwordOma = 190,//done
DarkAxeOma = 191,//done
DarkCrossbowOma = 192,//done
DarkWingedOma = 193,//done
BoneWhoo = 194,//done
DarkSpider = 195,//done
ViscusWorm = 196,//done
ViscusCrawler = 197,//done
CrawlerLave = 198,//done
DarkYob = 199,//done
FlamingMutant = 200,//FINISH
StoningStatue = 201,//FINISH BOSS
FlyingStatue = 202,//FINISH
ValeBat = 203,//done
Weaver = 204,//done
VenomWeaver = 205,//done
CrackingWeaver = 206,//done
ArmingWeaver = 207,//done
CrystalWeaver = 208,//done
FrozenZumaStatue = 209,//done
FrozenZumaGuardian = 210,//done
FrozenRedZuma = 211,//done
GreaterWeaver = 212,//done
SpiderWarrior = 213,//done
SpiderBarbarian = 214,//done
HellSlasher = 215,//done
HellPirate = 216,//done
HellCannibal = 217,//done
HellKeeper = 218, //done BOSS
HellBolt = 219, //done
WitchDoctor = 220,//done
ManectricHammer = 221,//done
ManectricClub = 222,//done
ManectricClaw = 223,//done
ManectricStaff = 224,//done
NamelessGhost = 225,//done
DarkGhost = 226,//done
ChaosGhost = 227,//done
ManectricBlest = 228,//done
ManectricKing = 229,//done
FrozenDoor = 230,//done
IcePillar = 231,//done
FrostYeti = 232,//done
ManectricSlave = 233,//done
TrollHammer = 234,//done
TrollBomber = 235,//done
TrollStoner = 236,//done
TrollKing = 237,//done BOSS
FlameSpear = 238,//done
FlameMage = 239,//done
FlameScythe = 240,//done
FlameAssassin = 241,//done
FlameQueen = 242, //finish BOSS
HellKnight1 = 243,//done
HellKnight2 = 244,//done
HellKnight3 = 245,//done
HellKnight4 = 246,//done
HellLord = 247,//done BOSS
WaterGuard = 248,//done
IceGuard = 249,
ElementGuard = 250,
DemonGuard = 251,
KingGuard = 252,
Snake10 = 253,//done
Snake11 = 254,//done
Snake12 = 255,//done
Snake13 = 256,//done
Snake14 = 257,//done
Snake15 = 258,//done
Snake16 = 259,//done
Snake17 = 260,//done
DeathCrawler = 261,
BurningZombie = 262,
MudZombie = 263,
FrozenZombie = 264,
UndeadWolf = 265,
Demonwolf = 266,
WhiteMammoth = 267,
DarkBeast = 268,
LightBeast = 269,
BloodBaboon = 270,
HardenRhino = 271,
AncientBringer = 272,
FightingCat = 273,
FireCat = 274,
CatWidow = 275,
StainHammerCat = 276,
BlackHammerCat = 277,
StrayCat = 278,
CatShaman = 279,
Jar1 = 280,
Jar2 = 281,
SeedingsGeneral = 282,
RestlessJar = 283,
GeneralJinmYo = 284,
Bunny = 285,
Tucson = 286,
TucsonFighter = 287,
TucsonMage = 288,
TucsonWarrior = 289,
Armadillo = 290,
ArmadilloElder = 291,
TucsonEgg = 292,
PlaguedTucson = 293,
SandSnail = 294,
CannibalTentacles = 295,
TucsonGeneral = 296,
GasToad = 297,
Mantis = 298,
SwampWarrior = 299,
AssassinBird = 300,
RhinoWarrior = 301,
RhinoPriest = 302,
SwampSlime = 303,
RockGuard = 304,
MudWarrior = 305,
SmallPot = 306,
TreeQueen = 307,
ShellFighter = 308,
DarkBaboon = 309,
TwinHeadBeast = 310,
OmaCannibal = 311,
OmaBlest = 312,
OmaSlasher = 313,
OmaAssassin = 314,
OmaMage = 315,
OmaWitchDoctor = 316,
LightningBead = 317,
HealingBead = 318,
PowerUpBead = 319,
DarkOmaKing = 320,
CaveMage = 321,
Mandrill = 322,
PlagueCrab = 323,
CreeperPlant = 324,
FloatingWraith = 325,
ArmedPlant = 326,
AvengerPlant = 327,
Nadz = 328,
AvengingSpirit = 329,
AvengingWarrior = 330,
AxePlant = 331,
WoodBox = 332,
ClawBeast = 333,
KillerPlant = 334,
SackWarrior = 335,
WereTiger = 336,
KingHydrax = 337,
Hydrax = 338,
HornedMage = 339,
Basiloid = 340,
HornedArcher = 341,
ColdArcher = 342,
HornedWarrior = 343,
FloatingRock = 344,
ScalyBeast = 345,
HornedSorceror = 346,
BoulderSpirit = 347,
HornedCommander = 348,
MoonStone = 349,
SunStone = 350,
LightningStone = 351,
Turtlegrass = 352,
Mantree = 353,
Bear = 354,
Leopard = 355,
ChieftainArcher = 356,
ChieftainSword = 357,
StoningSpider = 358, //Archer Spell mob (not yet coded)
VampireSpider = 359, //Archer Spell mob
SpittingToad = 360, //Archer Spell mob
SnakeTotem = 361, //Archer Spell mob
CharmedSnake = 362, //Archer Spell mob
FrozenSoldier = 363,
FrozenFighter = 364,
FrozenArcher = 365,
FrozenKnight = 366,
FrozenGolem = 367,
IcePhantom = 368,
SnowWolf = 369,
SnowWolfKing = 370,
WaterDragon = 371,
BlackTortoise = 372,
Manticore = 373,
DragonWarrior = 374,
DragonArcher = 375,
Kirin = 376,
Guard3 = 377,
ArcherGuard3 = 378,
Bunny2 = 379,
FrozenMiner = 380,
FrozenAxeman = 381,
FrozenMagician = 382,
SnowYeti = 383,
IceCrystalSoldier = 384,
DarkWraith = 385,
DarkSpirit = 386,
CrystalBeast = 387,
RedOrb = 388,
BlueOrb = 389,
YellowOrb = 390,
GreenOrb = 391,
WhiteOrb = 392,
FatalLotus = 393,
AntCommander = 394,
CargoBoxwithlogo = 395,
Doe = 396,
Reindeer = 397, //frames not added
AngryReindeer = 398,
CargoBox = 399,
Ram1 = 400,
Ram2 = 401,
Kite = 402,
EvilMir = 900,
EvilMirBody = 901,
DragonStatue = 902,
HellBomb1 = 903,
HellBomb2 = 904,
HellBomb3 = 905,
SabukGate = 950,
PalaceWallLeft = 951,
PalaceWall1 = 952,
PalaceWall2 = 953,
GiGateSouth = 954,
GiGateEast = 955,
GiGateWest = 956,
SSabukWall1 = 957,
SSabukWall2 = 958,
SSabukWall3 = 959,
BabyPig = 10000,//Permanent
Chick = 10001,//Special
Kitten = 10002,//Permanent
BabySkeleton = 10003,//Special
Baekdon = 10004,//Special
Wimaen = 10005,//Event
BlackKitten = 10006,//unknown
BabyDragon = 10007,//unknown
OlympicFlame = 10008,//unknown
BabySnowMan = 10009,//unknown
Frog = 10010,//unknown
BabyMonkey = 10011,//unknown
AngryBird = 10012,
Foxey = 10013,
}
public enum MirAction : byte
{
Standing,
Walking,
Running,
Pushed,
DashL,
DashR,
DashFail,
Stance,
Stance2,
Attack1,
Attack2,
Attack3,
Attack4,
Attack5,
AttackRange1,
AttackRange2,
AttackRange3,
Special,
Struck,
Harvest,
Spell,
Die,
Dead,
Skeleton,
Show,
Hide,
Stoned,
Appear,
Revive,
SitDown,
Mine,
Sneek,
DashAttack,
Lunge,
WalkingBow,
RunningBow,
Jump,
MountStanding,
MountWalking,
MountRunning,
MountStruck,
MountAttack,
FishingCast,
FishingWait,
FishingReel
}
public enum CellAttribute : byte
{
Walk = 0,
HighWall = 1,
LowWall = 2,
}
public enum LightSetting : byte
{
Normal = 0,
Dawn = 1,
Day = 2,
Evening = 3,
Night = 4
}
[Obfuscation(Feature = "renaming", Exclude = true)]
public enum MirGender : byte
{
Male = 0,
Female = 1
}
[Obfuscation(Feature = "renaming", Exclude = true)]
public enum MirClass : byte
{
Warrior = 0,
Wizard = 1,
Taoist = 2,
Assassin = 3,
Archer = 4
}
public enum MirDirection : byte
{
Up = 0,
UpRight = 1,
Right = 2,
DownRight = 3,
Down = 4,
DownLeft = 5,
Left = 6,
UpLeft = 7
}
public enum ObjectType : byte
{
None= 0,
Player = 1,
Item = 2,
Merchant = 3,
Spell = 4,
Monster = 5,
Deco = 6,
Creature = 7
}
public enum ChatType : byte
{
Normal = 0,
Shout = 1,
System = 2,
Hint = 3,
Announcement = 4,
Group = 5,
WhisperIn = 6,
WhisperOut = 7,
Guild = 8,
Trainer = 9,
LevelUp = 10,
System2 = 11,
Relationship = 12,
Mentor = 13,
Shout2 = 14,
Shout3 = 15
}
public enum ItemType : byte
{
Nothing = 0,
Weapon = 1,
Armour = 2,
Helmet = 4,
Necklace = 5,
Bracelet = 6,
Ring = 7,
Amulet = 8,
Belt = 9,
Boots = 10,
Stone = 11,
Torch = 12,
Potion = 13,
Ore = 14,
Meat = 15,
CraftingMaterial = 16,
Scroll = 17,
Gem = 18,
Mount = 19,
Book = 20,
Script = 21,
Reins = 22,
Bells = 23,
Saddle = 24,
Ribbon = 25,
Mask = 26,
Food = 27,
Hook = 28,
Float = 29,
Bait = 30,
Finder = 31,
Reel = 32,
Fish = 33,
Quest = 34,
Awakening = 35,
Pets = 36,
Transform = 37,
}
public enum MirGridType : byte
{
None = 0,
Inventory = 1,
Equipment = 2,
Trade = 3,
Storage = 4,
BuyBack = 5,
DropPanel = 6,
Inspect = 7,
TrustMerchant = 8,
GuildStorage = 9,
GuestTrade = 10,
Mount = 11,
Fishing = 12,
QuestInventory = 13,
AwakenItem = 14,
Mail = 15,
Refine = 16,
Renting = 17,
GuestRenting = 18,
Craft = 19
}
public enum EquipmentSlot : byte
{
Weapon = 0,
Armour = 1,
Helmet = 2,
Torch = 3,
Necklace = 4,
BraceletL = 5,
BraceletR = 6,
RingL = 7,
RingR = 8,
Amulet = 9,
Belt = 10,
Boots = 11,
Stone = 12,
Mount = 13
}
public enum MountSlot : byte
{
Reins = 0,
Bells = 1,
Saddle = 2,
Ribbon = 3,
Mask = 4
}
public enum FishingSlot : byte
{
Hook = 0,
Float = 1,
Bait = 2,
Finder = 3,
Reel = 4
}
[Obfuscation(Feature = "renaming", Exclude = true)]
public enum AttackMode : byte
{
Peace = 0,
Group = 1,
Guild = 2,
EnemyGuild = 3,
RedBrown = 4,
All = 5
}
[Obfuscation(Feature = "renaming", Exclude = true)]
public enum PetMode : byte
{
Both = 0,
MoveOnly = 1,
AttackOnly = 2,
None = 3,
}
[Flags]
[Obfuscation(Feature = "renaming", Exclude = true)]
public enum PoisonType : ushort
{
None = 0,
Green = 1,
Red = 2,
Slow = 4,
Frozen = 8,
Stun = 16,
Paralysis = 32,
DelayedExplosion = 64,
Bleeding = 128,
LRParalysis = 256
}
[Flags]
[Obfuscation(Feature = "renaming", Exclude = true)]
public enum BindMode : short
{
none = 0,
DontDeathdrop = 1,//0x0001
DontDrop = 2,//0x0002
DontSell = 4,//0x0004
DontStore = 8,//0x0008
DontTrade = 16,//0x0010
DontRepair = 32,//0x0020
DontUpgrade = 64,//0x0040
DestroyOnDrop = 128,//0x0080
BreakOnDeath = 256,//0x0100
BindOnEquip = 512,//0x0200
NoSRepair = 1024,//0x0400
NoWeddingRing = 2048,//0x0800
UnableToRent = 4096,
UnableToDisassemble = 8192
}
[Flags]
[Obfuscation(Feature = "renaming", Exclude = true)]
public enum SpecialItemMode : short
{
None = 0,
Paralize = 0x0001,
Teleport = 0x0002,
Clearring = 0x0004,
Protection = 0x0008,
Revival = 0x0010,
Muscle = 0x0020,
Flame = 0x0040,
Healing = 0x0080,
Probe = 0x0100,
Skill = 0x0200,
NoDuraLoss = 0x0400,
Blink = 0x800,
}
[Flags]
[Obfuscation(Feature = "renaming", Exclude = true)]
public enum RequiredClass : byte
{
Warrior = 1,
Wizard = 2,
Taoist = 4,
Assassin = 8,
Archer = 16,
WarWizTao = Warrior | Wizard | Taoist,
None = WarWizTao | Assassin | Archer
}
[Flags]
[Obfuscation(Feature = "renaming", Exclude = true)]
public enum RequiredGender : byte
{
Male = 1,
Female = 2,
None = Male | Female
}
[Obfuscation(Feature = "renaming", Exclude = true)]
public enum RequiredType : byte
{
Level = 0,
MaxAC = 1,
MaxMAC = 2,
MaxDC = 3,
MaxMC = 4,
MaxSC = 5,
MaxLevel = 6,
MinAC = 7,
MinMAC = 8,
MinDC = 9,
MinMC = 10,
MinSC = 11,
}
[Obfuscation(Feature = "renaming", Exclude = true)]
public enum ItemSet : byte
{
None = 0,
Spirit = 1,
Recall = 2,
RedOrchid = 3,
RedFlower = 4,
Smash = 5,
HwanDevil = 6,
Purity = 7,
FiveString = 8,
Mundane = 9,
NokChi = 10,
TaoProtect = 11,
Mir = 12,
Bone = 13,
Bug = 14,
WhiteGold = 15,
WhiteGoldH = 16,
RedJade = 17,
RedJadeH = 18,
Nephrite = 19,
NephriteH = 20,
Whisker1 = 21,
Whisker2 = 22,
Whisker3 = 23,
Whisker4 = 24,
Whisker5 = 25,
Hyeolryong = 26,
Monitor = 27,
Oppressive = 28,
Paeok = 29,
Sulgwan = 30
}
[Obfuscation(Feature = "renaming", Exclude = true)]
public enum Spell : byte
{
None = 0,
//Warrior
Fencing = 1,
Slaying = 2,
Thrusting = 3,
HalfMoon = 4,
ShoulderDash = 5,
TwinDrakeBlade = 6,
Entrapment = 7,
FlamingSword = 8,
LionRoar = 9,
CrossHalfMoon = 10,
BladeAvalanche = 11,
ProtectionField = 12,
Rage = 13,
CounterAttack = 14,
SlashingBurst = 15,
Fury = 16,
ImmortalSkin = 17,
//Wizard
FireBall = 31,
Repulsion = 32,
ElectricShock = 33,
GreatFireBall = 34,
HellFire = 35,
ThunderBolt = 36,
Teleport = 37,
FireBang = 38,
FireWall = 39,
Lightning = 40,
FrostCrunch = 41,
ThunderStorm = 42,
MagicShield = 43,
TurnUndead = 44,
Vampirism = 45,
IceStorm = 46,
FlameDisruptor = 47,
Mirroring = 48,
FlameField = 49,
Blizzard = 50,
MagicBooster = 51,
MeteorStrike = 52,
IceThrust = 53,
FastMove = 54,
StormEscape = 55,
//Taoist
Healing = 61,
SpiritSword = 62,
Poisoning = 63,
SoulFireBall = 64,
SummonSkeleton = 65,
Hiding = 67,
MassHiding = 68,
SoulShield = 69,
Revelation = 70,
BlessedArmour = 71,
EnergyRepulsor = 72,
TrapHexagon = 73,
Purification = 74,
MassHealing = 75,
Hallucination = 76,
UltimateEnhancer = 77,
SummonShinsu = 78,
Reincarnation = 79,
SummonHolyDeva = 80,
Curse = 81,
Plague = 82,
PoisonCloud = 83,
EnergyShield = 84,
PetEnhancer = 85,
HealingCircle = 86,
//Assassin
FatalSword = 91,
DoubleSlash = 92,
Haste = 93,
FlashDash = 94,
LightBody = 95,
HeavenlySword = 96,
FireBurst = 97,
Trap = 98,
PoisonSword = 99,
MoonLight = 100,
MPEater = 101,
SwiftFeet = 102,
DarkBody = 103,
Hemorrhage = 104,
CrescentSlash = 105,
MoonMist = 106,
//Archer
Focus = 121,
StraightShot = 122,
DoubleShot = 123,
ExplosiveTrap = 124,
DelayedExplosion = 125,
Meditation = 126,
BackStep = 127,
ElementalShot = 128,
Concentration = 129,
Stonetrap = 130,
ElementalBarrier = 131,
SummonVampire = 132,
VampireShot = 133,
SummonToad = 134,
PoisonShot = 135,
CrippleShot = 136,
SummonSnakes = 137,
NapalmShot = 138,
OneWithNature = 139,
BindingShot = 140,
MentalState = 141,
//Custom
Blink = 151,
Portal = 152,
BattleCry = 153,
//Map Events
DigOutZombie = 200,
Rubble = 201,
MapLightning = 202,
MapLava = 203,
MapQuake1 = 204,
MapQuake2 = 205
}
public enum SpellEffect : byte
{
None,
FatalSword,
Teleport,
Healing,
RedMoonEvil,
TwinDrakeBlade,
MagicShieldUp,
MagicShieldDown,
GreatFoxSpirit,
Entrapment,
Reflect,
Critical,
Mine,
ElementalBarrierUp,
ElementalBarrierDown,
DelayedExplosion,
MPEater,
Hemorrhage,
Bleeding,
AwakeningSuccess,
AwakeningFail,
AwakeningMiss,
AwakeningHit,
StormEscape,
TurtleKing,
Behemoth,
Stunned,
IcePillar
}
public enum BuffType : byte
{
None = 0,
//magics
TemporalFlux,
Hiding,
Haste,
SwiftFeet,
Fury,
SoulShield,
BlessedArmour,
LightBody,
UltimateEnhancer,
ProtectionField,
Rage,
Curse,
MoonLight,
DarkBody,
Concentration,
VampireShot,
PoisonShot,
CounterAttack,
MentalState,
EnergyShield,
MagicBooster,
PetEnhancer,
ImmortalSkin,
MagicShield,
//special
GameMaster = 100,
General,
Exp,
Drop,
Gold,
BagWeight,
Transform,
RelationshipEXP,
Mentee,
Mentor,
Guild,
Prison,
Rested,
//stats
Impact = 200,
Magic,
Taoist,
Storm,
HealthAid,
ManaAid,
Defence,
MagicDefence,
WonderDrug,
Knapsack
}
public enum DefenceType : byte
{
ACAgility,
AC,
MACAgility,
MAC,
Agility,
Repulsion,
None
}
public enum ServerPacketIds : short
{
Connected,
ClientVersion,
Disconnect,
KeepAlive,
NewAccount,
ChangePassword,
ChangePasswordBanned,
Login,
LoginBanned,
LoginSuccess,
NewCharacter,
NewCharacterSuccess,
DeleteCharacter,
DeleteCharacterSuccess,
StartGame,
StartGameBanned,
StartGameDelay,
MapInformation,
UserInformation,
UserLocation,
ObjectPlayer,
ObjectRemove,
ObjectTurn,
ObjectWalk,
ObjectRun,
Chat,
ObjectChat,
NewItemInfo,
MoveItem,
EquipItem,
MergeItem,
RemoveItem,
RemoveSlotItem,
TakeBackItem,
StoreItem,
SplitItem,
SplitItem1,
DepositRefineItem,
RetrieveRefineItem,
RefineCancel,
RefineItem,
DepositTradeItem,
RetrieveTradeItem,
UseItem,
DropItem,
PlayerUpdate,
PlayerInspect,
LogOutSuccess,
LogOutFailed,
TimeOfDay,
ChangeAMode,
ChangePMode,
ObjectItem,
ObjectGold,
GainedItem,
GainedGold,
LoseGold,
GainedCredit,
LoseCredit,
ObjectMonster,
ObjectAttack,
Struck,
ObjectStruck,
DamageIndicator,
DuraChanged,
HealthChanged,
DeleteItem,
Death,
ObjectDied,
ColourChanged,
ObjectColourChanged,
ObjectGuildNameChanged,
GainExperience,
LevelChanged,
ObjectLeveled,
ObjectHarvest,
ObjectHarvested,
ObjectNpc,
NPCResponse,
ObjectHide,
ObjectShow,
Poisoned,
ObjectPoisoned,
MapChanged,
ObjectTeleportOut,
ObjectTeleportIn,
TeleportIn,
NPCGoods,
NPCSell,
NPCRepair,
NPCSRepair,
NPCRefine,
NPCCheckRefine,
NPCCollectRefine,
NPCReplaceWedRing,
NPCStorage,
SellItem,
CraftItem,
RepairItem,
ItemRepaired,
NewMagic,
RemoveMagic,
MagicLeveled,
Magic,
MagicDelay,
MagicCast,
ObjectMagic,
ObjectEffect,
RangeAttack,
Pushed,
ObjectPushed,
ObjectName,
UserStorage,
SwitchGroup,
DeleteGroup,
DeleteMember,
GroupInvite,
AddMember,
Revived,
ObjectRevived,
SpellToggle,
ObjectHealth,
MapEffect,
ObjectRangeAttack,
AddBuff,
RemoveBuff,
ObjectHidden,
RefreshItem,
ObjectSpell,
UserDash,
ObjectDash,
UserDashFail,
ObjectDashFail,
NPCConsign,
NPCMarket,
NPCMarketPage,
ConsignItem,
MarketFail,
MarketSuccess,
ObjectSitDown,
InTrapRock,
BaseStatsInfo,
UserName,
ChatItemStats,
GuildNoticeChange,
GuildMemberChange,
GuildStatus,
GuildInvite,
GuildExpGain,
GuildNameRequest,
GuildStorageGoldChange,
GuildStorageItemChange,
GuildStorageList,
GuildRequestWar,
DefaultNPC,
NPCUpdate,
NPCImageUpdate,
MarriageRequest,
DivorceRequest,
MentorRequest,
TradeRequest,
TradeAccept,
TradeGold,
TradeItem,
TradeConfirm,
TradeCancel,
MountUpdate,
EquipSlotItem,
FishingUpdate,
ChangeQuest,
CompleteQuest,
ShareQuest,
NewQuestInfo,
GainedQuestItem,
DeleteQuestItem,
CancelReincarnation,
RequestReincarnation,
UserBackStep,
ObjectBackStep,
UserDashAttack,
ObjectDashAttack,
UserAttackMove,
CombineItem,
ItemUpgraded,
SetConcentration,
SetObjectConcentration,
SetElemental,
SetObjectElemental,
RemoveDelayedExplosion,
ObjectDeco,
ObjectSneaking,
ObjectLevelEffects,
SetBindingShot,
SendOutputMessage,
NPCAwakening,
NPCDisassemble,
NPCDowngrade,
NPCReset,
AwakeningNeedMaterials,
AwakeningLockedItem,
Awakening,
ReceiveMail,
MailLockedItem,
MailSendRequest,
MailSent,
ParcelCollected,
MailCost,
ResizeInventory,
ResizeStorage,
NewIntelligentCreature,
UpdateIntelligentCreatureList,
IntelligentCreatureEnableRename,
IntelligentCreaturePickup,
NPCPearlGoods,
TransformUpdate,
FriendUpdate,
LoverUpdate,
MentorUpdate,
GuildBuffList,
NPCRequestInput,
GameShopInfo,
GameShopStock,
Rankings,
Opendoor,
GetRentedItems,
ItemRentalRequest,
ItemRentalFee,
ItemRentalPeriod,
DepositRentalItem,
RetrieveRentalItem,
UpdateRentalItem,
CancelItemRental,
ItemRentalLock,
ItemRentalPartnerLock,
CanConfirmItemRental,
ConfirmItemRental,
NewRecipeInfo
}
public enum ClientPacketIds : short
{
ClientVersion,
Disconnect,
KeepAlive,
NewAccount,
ChangePassword,
Login,
NewCharacter,
DeleteCharacter,
StartGame,
LogOut,
Turn,
Walk,
Run,
Chat,
MoveItem,
StoreItem,
TakeBackItem,
MergeItem,
EquipItem,
RemoveItem,
RemoveSlotItem,
SplitItem,
UseItem,
DropItem,
DepositRefineItem,
RetrieveRefineItem,
RefineCancel,
RefineItem,
CheckRefine,
ReplaceWedRing,
DepositTradeItem,
RetrieveTradeItem,
DropGold,
PickUp,
Inspect,
ChangeAMode,
ChangePMode,
ChangeTrade,
Attack,
RangeAttack,
Harvest,
CallNPC,
TalkMonsterNPC,
BuyItem,
SellItem,
CraftItem,
RepairItem,
BuyItemBack,
SRepairItem,
MagicKey,
Magic,
SwitchGroup,
AddMember,
DellMember,
GroupInvite,
TownRevive,
SpellToggle,
ConsignItem,
MarketSearch,
MarketRefresh,
MarketPage,
MarketBuy,
MarketGetBack,
RequestUserName,
RequestChatItem,
EditGuildMember,
EditGuildNotice,
GuildInvite,
GuildNameReturn,
RequestGuildInfo,
GuildStorageGoldChange,
GuildStorageItemChange,
GuildWarReturn,
MarriageRequest,
MarriageReply,
ChangeMarriage,
DivorceRequest,
DivorceReply,
AddMentor,
MentorReply,
AllowMentor,
CancelMentor,
TradeRequest,
TradeReply,
TradeGold,
TradeConfirm,
TradeCancel,
EquipSlotItem,
FishingCast,
FishingChangeAutocast,
AcceptQuest,
FinishQuest,
AbandonQuest,
ShareQuest,
AcceptReincarnation,
CancelReincarnation,
CombineItem,
SetConcentration,
AwakeningNeedMaterials,
AwakeningLockedItem,
Awakening,
DisassembleItem,
DowngradeAwakening,
ResetAddedItem,
SendMail,
ReadMail,
CollectParcel,
DeleteMail,
LockMail,
MailLockedItem,
MailCost,
UpdateIntelligentCreature,
IntelligentCreaturePickup,
AddFriend,
RemoveFriend,
RefreshFriends,
AddMemo,
GuildBuffUpdate,
NPCConfirmInput,
GameshopBuy,
ReportIssue,
GetRanking,
Opendoor,
GetRentedItems,
ItemRentalRequest,
ItemRentalFee,
ItemRentalPeriod,
DepositRentalItem,
RetrieveRentalItem,
CancelItemRental,
ItemRentalLockFee,
ItemRentalLockItem,
ConfirmItemRental
}
public enum ConquestType : byte
{
Request = 0,
Auto = 1,
Forced = 2,
}
public enum ConquestGame : byte
{
CapturePalace = 0,
KingOfHill = 1,
Random = 2,
Classic = 3,
ControlPoints = 4
}
public class InIReader
{
#region Fields
private readonly List<string> _contents;
private readonly string _fileName;
#endregion
#region Constructor
public InIReader(string fileName)
{
_fileName = fileName;
_contents = new List<string>();
try
{
if (File.Exists(_fileName))
_contents.AddRange(File.ReadAllLines(_fileName));
}
catch
{
}
}
#endregion
#region Functions
private string FindValue(string section, string key)
{
for (int a = 0; a < _contents.Count; a++)
if (String.CompareOrdinal(_contents[a], "[" + section + "]") == 0)
for (int b = a + 1; b < _contents.Count; b++)
if (String.CompareOrdinal(_contents[b].Split('=')[0], key) == 0)
return _contents[b].Split('=')[1];
else if (_contents[b].StartsWith("[") && _contents[b].EndsWith("]"))
return null;
return null;
}
private int FindIndex(string section, string key)
{
for (int a = 0; a < _contents.Count; a++)
if (String.CompareOrdinal(_contents[a], "[" + section + "]") == 0)
for (int b = a + 1; b < _contents.Count; b++)
if (String.CompareOrdinal(_contents[b].Split('=')[0], key) == 0)
return b;
else if (_contents[b].StartsWith("[") && _contents[b].EndsWith("]"))
{
_contents.Insert(b - 1, key + "=");
return b - 1;
}
else if (_contents.Count - 1 == b)
{
_contents.Add(key + "=");
return _contents.Count - 1;
}
if (_contents.Count > 0)
_contents.Add("");
_contents.Add("[" + section + "]");
_contents.Add(key + "=");
return _contents.Count - 1;
}
public void Save()
{
try
{
File.WriteAllLines(_fileName, _contents);
}
catch
{
}
}
#endregion
#region Read
public bool ReadBoolean(string section, string key, bool Default)
{
bool result;
if (!bool.TryParse(FindValue(section, key), out result))
{
result = Default;
Write(section, key, Default);
}
return result;
}
public byte ReadByte(string section, string key, byte Default)
{
byte result;
if (!byte.TryParse(FindValue(section, key), out result))
{
result = Default;
Write(section, key, Default);
}
return result;
}
public sbyte ReadSByte(string section, string key, sbyte Default)
{
sbyte result;
if (!sbyte.TryParse(FindValue(section, key), out result))
{
result = Default;
Write(section, key, Default);
}
return result;
}
public ushort ReadUInt16(string section, string key, ushort Default)
{
ushort result;
if (!ushort.TryParse(FindValue(section, key), out result))
{
result = Default;
Write(section, key, Default);
}
return result;
}
public short ReadInt16(string section, string key, short Default)
{
short result;
if (!short.TryParse(FindValue(section, key), out result))
{
result = Default;
Write(section, key, Default);
}
return result;
}
public uint ReadUInt32(string section, string key, uint Default)
{
uint result;
if (!uint.TryParse(FindValue(section, key), out result))
{
result = Default;
Write(section, key, Default);
}
return result;
}
public int ReadInt32(string section, string key, int Default)
{
int result;
if (!int.TryParse(FindValue(section, key), out result))
{
result = Default;
Write(section, key, Default);
}
return result;
}
public ulong ReadUInt64(string section, string key, ulong Default)
{
ulong result;
if (!ulong.TryParse(FindValue(section, key), out result))
{
result = Default;
Write(section, key, Default);
}
return result;
}
public long ReadInt64(string section, string key, long Default)
{
long result;
if (!long.TryParse(FindValue(section, key), out result))
{
result = Default;
Write(section, key, Default);
}
return result;
}
public float ReadSingle(string section, string key, float Default)
{
float result;
if (!float.TryParse(FindValue(section, key), out result))
{
result = Default;
Write(section, key, Default);
}
return result;
}
public double ReadDouble(string section, string key, double Default)
{
double result;
if (!double.TryParse(FindValue(section, key), out result))
{
result = Default;
Write(section, key, Default);
}
return result;
}
public decimal ReadDecimal(string section, string key, decimal Default)
{
decimal result;
if (!decimal.TryParse(FindValue(section, key), out result))
{
result = Default;
Write(section, key, Default);
}
return result;
}
public string ReadString(string section, string key, string Default)
{
string result = FindValue(section, key);
if (string.IsNullOrEmpty(result))
{
result = Default;
Write(section, key, Default);
}
return result;
}
public char ReadChar(string section, string key, char Default)
{
char result;
if (!char.TryParse(FindValue(section, key), out result))
{
result = Default;
Write(section, key, Default);
}
return result;
}
public Point ReadPoint(string section, string key, Point Default)
{
string temp = FindValue(section, key);
int tempX, tempY;
if (temp == null || !int.TryParse(temp.Split(',')[0], out tempX))
{
Write(section, key, Default);
return Default;
}
if (!int.TryParse(temp.Split(',')[1], out tempY))
{
Write(section, key, Default);
return Default;
}
return new Point(tempX, tempY);
}
public Size ReadSize(string section, string key, Size Default)
{
string temp = FindValue(section, key);
int tempX, tempY;
if (!int.TryParse(temp.Split(',')[0], out tempX))
{
Write(section, key, Default);
return Default;
}
if (!int.TryParse(temp.Split(',')[1], out tempY))
{
Write(section, key, Default);
return Default;
}
return new Size(tempX, tempY);
}
public TimeSpan ReadTimeSpan(string section, string key, TimeSpan Default)
{
TimeSpan result;
if (!TimeSpan.TryParse(FindValue(section, key), out result))
{
result = Default;
Write(section, key, Default);
}
return result;
}
public float ReadFloat(string section, string key, float Default)
{
float result;
if (!float.TryParse(FindValue(section, key), out result))
{
result = Default;
Write(section, key, Default);
}
return result;
}
#endregion
#region Write
public void Write(string section, string key, bool value)
{
_contents[FindIndex(section, key)] = key + "=" + value;
Save();
}
public void Write(string section, string key, byte value)
{
_contents[FindIndex(section, key)] = key + "=" + value;
Save();
}
public void Write(string section, string key, sbyte value)
{
_contents[FindIndex(section, key)] = key + "=" + value;
Save();
}
public void Write(string section, string key, ushort value)
{
_contents[FindIndex(section, key)] = key + "=" + value;
Save();
}
public void Write(string section, string key, short value)
{
_contents[FindIndex(section, key)] = key + "=" + value;
Save();
}
public void Write(string section, string key, uint value)
{
_contents[FindIndex(section, key)] = key + "=" + value;
Save();
}
public void Write(string section, string key, int value)
{
_contents[FindIndex(section, key)] = key + "=" + value;
Save();
}
public void Write(string section, string key, ulong value)
{
_contents[FindIndex(section, key)] = key + "=" + value;
Save();
}
public void Write(string section, string key, long value)
{
_contents[FindIndex(section, key)] = key + "=" + value;
Save();
}
public void Write(string section, string key, float value)
{
_contents[FindIndex(section, key)] = key + "=" + value;
Save();
}
public void Write(string section, string key, double value)
{
_contents[FindIndex(section, key)] = key + "=" + value;
Save();
}
public void Write(string section, string key, decimal value)
{
_contents[FindIndex(section, key)] = key + "=" + value;
Save();
}
public void Write(string section, string key, string value)
{
_contents[FindIndex(section, key)] = key + "=" + value;
Save();
}
public void Write(string section, string key, char value)
{
_contents[FindIndex(section, key)] = key + "=" + value;
Save();
}
public void Write(string section, string key, Point value)
{
_contents[FindIndex(section, key)] = key + "=" + value.X + "," + value.Y;
Save();
}
public void Write(string section, string key, Size value)
{
_contents[FindIndex(section, key)] = key + "=" + value.Width + "," + value.Height;
Save();
}
public void Write(string section, string key, TimeSpan value)
{
_contents[FindIndex(section, key)] = key + "=" + value;
Save();
}
#endregion
}
public static class Globals
{
public const int
MinAccountIDLength = 3,
MaxAccountIDLength = 15,
MinPasswordLength = 5,
MaxPasswordLength = 15,
MinCharacterNameLength = 3,
MaxCharacterNameLength = 15,
MaxCharacterCount = 4,
MaxChatLength = 80,
MaxGroup = 15,
MaxAttackRange = 9,
MaxDragonLevel = 13,
FlagIndexCount = 1999,
MaxConcurrentQuests = 20,
LogDelay = 10000,
DataRange = 16;//Was 24
public static float Commission = 0.05F;
public const uint SearchDelay = 500,
ConsignmentLength = 7,
ConsignmentCost = 5000,
MinConsignment = 5000,
MaxConsignment = 50000000;
}
public static class Functions
{
public static bool CompareBytes(byte[] a, byte[] b)
{
if (a == b) return true;
if (a == null || b == null || a.Length != b.Length) return false;
for (int i = 0; i < a.Length; i++) if (a[i] != b[i]) return false;
return true;
}
public static bool TryParse(string s, out Point temp)
{
temp = Point.Empty;
int tempX, tempY;
if (String.IsNullOrWhiteSpace(s)) return false;
string[] data = s.Split(',');
if (data.Length <= 1) return false;
if (!Int32.TryParse(data[0], out tempX))
return false;
if (!Int32.TryParse(data[1], out tempY))
return false;
temp = new Point(tempX, tempY);
return true;
}
public static Point Subtract(this Point p1, Point p2)
{
return new Point(p1.X - p2.X, p1.Y - p2.Y);
}
public static Point Subtract(this Point p1, int x, int y)
{
return new Point(p1.X - x, p1.Y - y);
}
public static Point Add(this Point p1, Point p2)
{
return new Point(p1.X + p2.X, p1.Y + p2.Y);
}
public static Point Add(this Point p1, int x, int y)
{
return new Point(p1.X + x, p1.Y + y);
}
public static string PointToString(Point p)
{
return String.Format("{0}, {1}", p.X, p.Y);
}
public static bool InRange(Point a, Point b, int i)
{
return Math.Abs(a.X - b.X) <= i && Math.Abs(a.Y - b.Y) <= i;
}
public static bool FacingEachOther(MirDirection dirA, Point pointA, MirDirection dirB, Point pointB)
{
if (dirA == DirectionFromPoint(pointA, pointB) && dirB == DirectionFromPoint(pointB, pointA))
{
return true;
}
return false;
}
public static string PrintTimeSpanFromSeconds(double secs, bool accurate = true)
{
TimeSpan t = TimeSpan.FromSeconds(secs);
string answer;
if (t.TotalMinutes < 1.0)
{
answer = string.Format("{0}s", t.Seconds);
}
else if (t.TotalHours < 1.0)
{
answer = accurate ? string.Format("{0}m {1:D2}s", t.Minutes, t.Seconds) : string.Format("{0}m", t.Minutes);
}
else if (t.TotalDays < 1.0)
{
answer = accurate ? string.Format("{0}h {1:D2}m {2:D2}s", (int)t.Hours, t.Minutes, t.Seconds) : string.Format("{0}h {1:D2}m", (int)t.TotalHours, t.Minutes);
}
else // more than 1 day
{
answer = accurate ? string.Format("{0}d {1:D2}h {2:D2}m {3:D2}s", (int)t.Days, (int)t.Hours, t.Minutes, t.Seconds) : string.Format("{0}d {1}h {2:D2}m", (int)t.TotalDays, (int)t.Hours, t.Minutes);
}
return answer;
}
public static string PrintTimeSpanFromMilliSeconds(double milliSeconds)
{
TimeSpan t = TimeSpan.FromMilliseconds(milliSeconds);
string answer;
if (t.TotalMinutes < 1.0)
{
answer = string.Format("{0}.{1}s", t.Seconds, (decimal)(t.Milliseconds / 100));
}
else if (t.TotalHours < 1.0)
{
answer = string.Format("{0}m {1:D2}s", t.TotalMinutes, t.Seconds);
}
else if (t.TotalDays < 1.0)
{
answer = string.Format("{0}h {1:D2}m {2:D2}s", (int)t.TotalHours, t.Minutes, t.Seconds);
}
else
{
answer = string.Format("{0}d {1}h {2:D2}m {3:D2}s", (int)t.Days, (int)t.Hours, t.Minutes, t.Seconds);
}
return answer;
}
public static MirDirection PreviousDir(MirDirection d)
{
switch (d)
{
case MirDirection.Up:
return MirDirection.UpLeft;
case MirDirection.UpRight:
return MirDirection.Up;
case MirDirection.Right:
return MirDirection.UpRight;
case MirDirection.DownRight:
return MirDirection.Right;
case MirDirection.Down:
return MirDirection.DownRight;
case MirDirection.DownLeft:
return MirDirection.Down;
case MirDirection.Left:
return MirDirection.DownLeft;
case MirDirection.UpLeft:
return MirDirection.Left;
default: return d;
}
}
public static MirDirection NextDir(MirDirection d)
{
switch (d)
{
case MirDirection.Up:
return MirDirection.UpRight;
case MirDirection.UpRight:
return MirDirection.Right;
case MirDirection.Right:
return MirDirection.DownRight;
case MirDirection.DownRight:
return MirDirection.Down;
case MirDirection.Down:
return MirDirection.DownLeft;
case MirDirection.DownLeft:
return MirDirection.Left;
case MirDirection.Left:
return MirDirection.UpLeft;
case MirDirection.UpLeft:
return MirDirection.Up;
default: return d;
}
}
public static MirDirection DirectionFromPoint(Point source, Point dest)
{
if (source.X < dest.X)
{
if (source.Y < dest.Y)
return MirDirection.DownRight;
if (source.Y > dest.Y)
return MirDirection.UpRight;
return MirDirection.Right;
}
if (source.X > dest.X)
{
if (source.Y < dest.Y)
return MirDirection.DownLeft;
if (source.Y > dest.Y)
return MirDirection.UpLeft;
return MirDirection.Left;
}
return source.Y < dest.Y ? MirDirection.Down : MirDirection.Up;
}
public static Size Add(this Size p1, Size p2)
{
return new Size(p1.Width + p2.Width, p1.Height + p2.Height);
}
public static Size Add(this Size p1, int width, int height)
{
return new Size(p1.Width + width, p1.Height + height);
}
public static Point PointMove(Point p, MirDirection d, int i)
{
switch (d)
{
case MirDirection.Up:
p.Offset(0, -i);
break;
case MirDirection.UpRight:
p.Offset(i, -i);
break;
case MirDirection.Right:
p.Offset(i, 0);
break;
case MirDirection.DownRight:
p.Offset(i, i);
break;
case MirDirection.Down:
p.Offset(0, i);
break;
case MirDirection.DownLeft:
p.Offset(-i, i);
break;
case MirDirection.Left:
p.Offset(-i, 0);
break;
case MirDirection.UpLeft:
p.Offset(-i, -i);
break;
}
return p;
}
public static Point Left(Point p, MirDirection d)
{
switch (d)
{
case MirDirection.Up:
p.Offset(-1, 0);
break;
case MirDirection.UpRight:
p.Offset(-1, -1);
break;
case MirDirection.Right:
p.Offset(0, -1);
break;
case MirDirection.DownRight:
p.Offset(1, -1);
break;
case MirDirection.Down:
p.Offset(1, 0);
break;
case MirDirection.DownLeft:
p.Offset(1, 1);
break;
case MirDirection.Left:
p.Offset(0, 1);
break;
case MirDirection.UpLeft:
p.Offset(-1, 1);
break;
}
return p;
}
public static Point Right(Point p, MirDirection d)
{
switch (d)
{
case MirDirection.Up:
p.Offset(1, 0);
break;
case MirDirection.UpRight:
p.Offset(1, 1);
break;
case MirDirection.Right:
p.Offset(0, 1);
break;
case MirDirection.DownRight:
p.Offset(-1, 1);
break;
case MirDirection.Down:
p.Offset(-1, 0);
break;
case MirDirection.DownLeft:
p.Offset(-1,-1);
break;
case MirDirection.Left:
p.Offset(0, -1);
break;
case MirDirection.UpLeft:
p.Offset(1, -1);
break;
}
return p;
}
public static int MaxDistance(Point p1, Point p2)
{
return Math.Max(Math.Abs(p1.X - p2.X), Math.Abs(p1.Y - p2.Y));
}
public static MirDirection ReverseDirection(MirDirection dir)
{
switch (dir)
{
case MirDirection.Up:
return MirDirection.Down;
case MirDirection.UpRight:
return MirDirection.DownLeft;
case MirDirection.Right:
return MirDirection.Left;
case MirDirection.DownRight:
return MirDirection.UpLeft;
case MirDirection.Down:
return MirDirection.Up;
case MirDirection.DownLeft:
return MirDirection.UpRight;
case MirDirection.Left:
return MirDirection.Right;
case MirDirection.UpLeft:
return MirDirection.DownRight;
default:
return dir;
}
}
public static ItemInfo GetRealItem(ItemInfo Origin, ushort Level, MirClass job, List<ItemInfo> ItemList)
{
if (Origin.ClassBased && Origin.LevelBased)
return GetClassAndLevelBasedItem(Origin, job, Level, ItemList);
if (Origin.ClassBased)
return GetClassBasedItem(Origin, job, ItemList);
if (Origin.LevelBased)
return GetLevelBasedItem(Origin, Level, ItemList);
return Origin;
}
public static ItemInfo GetLevelBasedItem(ItemInfo Origin, ushort level, List<ItemInfo> ItemList)
{
ItemInfo output = Origin;
for (int i = 0; i < ItemList.Count; i++)
{
ItemInfo info = ItemList[i];
if (info.Name.StartsWith(Origin.Name))
if ((info.RequiredType == RequiredType.Level) && (info.RequiredAmount <= level) && (output.RequiredAmount < info.RequiredAmount) && (Origin.RequiredGender == info.RequiredGender))
output = info;
}
return output;
}
public static ItemInfo GetClassBasedItem(ItemInfo Origin, MirClass job, List<ItemInfo> ItemList)
{
for (int i = 0; i < ItemList.Count; i++)
{
ItemInfo info = ItemList[i];
if (info.Name.StartsWith(Origin.Name))
if (((byte)info.RequiredClass == (1 << (byte)job)) && (Origin.RequiredGender == info.RequiredGender))
return info;
}
return Origin;
}
public static ItemInfo GetClassAndLevelBasedItem(ItemInfo Origin, MirClass job, ushort level, List<ItemInfo> ItemList)
{
ItemInfo output = Origin;
for (int i = 0; i < ItemList.Count; i++)
{
ItemInfo info = ItemList[i];
if (info.Name.StartsWith(Origin.Name))
if ((byte)info.RequiredClass == (1 << (byte)job))
if ((info.RequiredType == RequiredType.Level) && (info.RequiredAmount <= level) && (output.RequiredAmount <= info.RequiredAmount) && (Origin.RequiredGender == info.RequiredGender))
output = info;
}
return output;
}
public static string StringOverLines(string line, int maxWordsPerLine, int maxLettersPerLine)
{
string newString = string.Empty;
string[] words = line.Split(' ');
int lineLength = 0;
for (int i = 0; i < words.Length; i++)
{
lineLength += words[i].Length + 1;
newString += words[i] + " ";
if (i > 0 && i % maxWordsPerLine == 0 && lineLength > maxLettersPerLine)
{
lineLength = 0;
newString += "\r\n";
}
}
return newString;
}
public static byte[] ImageToByteArray(Image imageIn)
{
MemoryStream ms = new MemoryStream();
imageIn.Save(ms, ImageFormat.Gif);
return ms.ToArray();
}
public static Image ByteArrayToImage(byte[] byteArrayIn)
{
MemoryStream ms = new MemoryStream(byteArrayIn);
Image returnImage = Image.FromStream(ms);
return returnImage;
}
public static IEnumerable<byte[]> SplitArray(byte[] value, int bufferLength)
{
int countOfArray = value.Length / bufferLength;
if (value.Length % bufferLength > 0)
countOfArray++;
for (int i = 0; i < countOfArray; i++)
{
yield return value.Skip(i * bufferLength).Take(bufferLength).ToArray();
}
}
public static byte[] CombineArray(List<byte[]> arrays)
{
byte[] rv = new byte[arrays.Sum(x => x.Length)];
int offset = 0;
foreach (byte[] array in arrays)
{
System.Buffer.BlockCopy(array, 0, rv, offset, array.Length);
offset += array.Length;
}
return rv;
}
}
public class SelectInfo
{
public int Index;
public string Name = string.Empty;
public ushort Level;
public MirClass Class;
public MirGender Gender;
public DateTime LastAccess;
public SelectInfo()
{ }
public SelectInfo(BinaryReader reader)
{
Index = reader.ReadInt32();
Name = reader.ReadString();
Level = reader.ReadUInt16();
Class = (MirClass)reader.ReadByte();
Gender = (MirGender)reader.ReadByte();
LastAccess = DateTime.FromBinary(reader.ReadInt64());
}
public void Save(BinaryWriter writer)
{
writer.Write(Index);
writer.Write(Name);
writer.Write(Level);
writer.Write((byte)Class);
writer.Write((byte)Gender);
writer.Write(LastAccess.ToBinary());
}
}
public class ItemInfo
{
public int Index;
public string Name = string.Empty;
public ItemType Type;
public ItemGrade Grade;
public RequiredType RequiredType = RequiredType.Level;
public RequiredClass RequiredClass = RequiredClass.None;
public RequiredGender RequiredGender = RequiredGender.None;
public ItemSet Set;
public short Shape;
public byte Weight, Light, RequiredAmount;
public ushort Image, Durability;
public uint Price, StackSize = 1;
public byte MinAC, MaxAC, MinMAC, MaxMAC, MinDC, MaxDC, MinMC, MaxMC, MinSC, MaxSC, Accuracy, Agility;
public ushort HP, MP;
public sbyte AttackSpeed, Luck;
public byte BagWeight, HandWeight, WearWeight;
public bool StartItem;
public byte Effect;
public byte Strong;
public byte MagicResist, PoisonResist, HealthRecovery, SpellRecovery, PoisonRecovery, HPrate, MPrate;
public byte CriticalRate, CriticalDamage;
public bool NeedIdentify, ShowGroupPickup, GlobalDropNotify;
public bool ClassBased;
public bool LevelBased;
public bool CanMine;
public bool CanFastRun;
public bool CanAwakening;
public byte MaxAcRate, MaxMacRate, Holy, Freezing, PoisonAttack, HpDrainRate;
public BindMode Bind = BindMode.none;
public byte Reflect;
public SpecialItemMode Unique = SpecialItemMode.None;
public byte RandomStatsId;
public RandomItemStat RandomStats;
public string ToolTip = string.Empty;
public bool IsConsumable
{
get { return Type == ItemType.Potion || Type == ItemType.Scroll || Type == ItemType.Food || Type == ItemType.Transform || Type == ItemType.Script; }
}
public string FriendlyName
{
get
{
string temp = Name;
temp = Regex.Replace(temp, @"\d+$", string.Empty); //hides end numbers
temp = Regex.Replace(temp, @"\[[^]]*\]", string.Empty); //hides square brackets
return temp;
}
}
public ItemInfo()
{
}
public ItemInfo(BinaryReader reader, int version = int.MaxValue, int Customversion = int.MaxValue)
{
Index = reader.ReadInt32();
Name = reader.ReadString();
Type = (ItemType) reader.ReadByte();
if (version >= 40) Grade = (ItemGrade)reader.ReadByte();
RequiredType = (RequiredType) reader.ReadByte();
RequiredClass = (RequiredClass) reader.ReadByte();
RequiredGender = (RequiredGender) reader.ReadByte();
if(version >= 17) Set = (ItemSet)reader.ReadByte();
Shape = version >= 30 ? reader.ReadInt16() : reader.ReadSByte();
Weight = reader.ReadByte();
Light = reader.ReadByte();
RequiredAmount = reader.ReadByte();
Image = reader.ReadUInt16();
Durability = reader.ReadUInt16();
StackSize = reader.ReadUInt32();
Price = reader.ReadUInt32();
MinAC = reader.ReadByte();
MaxAC = reader.ReadByte();
MinMAC = reader.ReadByte();
MaxMAC = reader.ReadByte();
MinDC = reader.ReadByte();
MaxDC = reader.ReadByte();
MinMC = reader.ReadByte();
MaxMC = reader.ReadByte();
MinSC = reader.ReadByte();
MaxSC = reader.ReadByte();
if (version < 25)
{
HP = reader.ReadByte();
MP = reader.ReadByte();
}
else
{
HP = reader.ReadUInt16();
MP = reader.ReadUInt16();
}
Accuracy = reader.ReadByte();
Agility = reader.ReadByte();
Luck = reader.ReadSByte();
AttackSpeed = reader.ReadSByte();
StartItem = reader.ReadBoolean();
BagWeight = reader.ReadByte();
HandWeight = reader.ReadByte();
WearWeight = reader.ReadByte();
if (version >= 9) Effect = reader.ReadByte();
if (version >= 20)
{
Strong = reader.ReadByte();
MagicResist = reader.ReadByte();
PoisonResist = reader.ReadByte();
HealthRecovery = reader.ReadByte();
SpellRecovery = reader.ReadByte();
PoisonRecovery = reader.ReadByte();
HPrate = reader.ReadByte();
MPrate = reader.ReadByte();
CriticalRate = reader.ReadByte();
CriticalDamage = reader.ReadByte();
byte bools = reader.ReadByte();
NeedIdentify = (bools & 0x01) == 0x01;
ShowGroupPickup = (bools & 0x02) == 0x02;
ClassBased = (bools & 0x04) == 0x04;
LevelBased = (bools & 0x08) == 0x08;
CanMine = (bools & 0x10) == 0x10;
if (version >= 77)
GlobalDropNotify = (bools & 0x20) == 0x20;
MaxAcRate = reader.ReadByte();
MaxMacRate = reader.ReadByte();
Holy = reader.ReadByte();
Freezing = reader.ReadByte();
PoisonAttack = reader.ReadByte();
if (version < 55)
{
Bind = (BindMode)reader.ReadByte();
}
else
{
Bind = (BindMode)reader.ReadInt16();
}
}
if (version >= 21)
{
Reflect = reader.ReadByte();
HpDrainRate = reader.ReadByte();
Unique = (SpecialItemMode)reader.ReadInt16();
}
if (version >= 24)
{
RandomStatsId = reader.ReadByte();
}
else
{
RandomStatsId = 255;
if ((Type == ItemType.Weapon) || (Type == ItemType.Armour) || (Type == ItemType.Helmet) || (Type == ItemType.Necklace) || (Type == ItemType.Bracelet) || (Type == ItemType.Ring) || (Type == ItemType.Mount))
RandomStatsId = (byte)Type;
if ((Type == ItemType.Belt) || (Type == ItemType.Boots))
RandomStatsId = 7;
}
if (version >= 40) CanFastRun = reader.ReadBoolean();
if (version >= 41)
{
CanAwakening = reader.ReadBoolean();
bool isTooltip = reader.ReadBoolean();
if (isTooltip)
ToolTip = reader.ReadString();
}
if (version < 70) //before db version 70 all specialitems had wedding rings disabled, after that it became a server option
{
if ((Type == ItemType.Ring) && (Unique != SpecialItemMode.None))
Bind |= BindMode.NoWeddingRing;
}
}
public void Save(BinaryWriter writer)
{
writer.Write(Index);
writer.Write(Name);
writer.Write((byte) Type);
writer.Write((byte) Grade);
writer.Write((byte) RequiredType);
writer.Write((byte) RequiredClass);
writer.Write((byte) RequiredGender);
writer.Write((byte) Set);
writer.Write(Shape);
writer.Write(Weight);
writer.Write(Light);
writer.Write(RequiredAmount);
writer.Write(Image);
writer.Write(Durability);
writer.Write(StackSize);
writer.Write(Price);
writer.Write(MinAC);
writer.Write(MaxAC);
writer.Write(MinMAC);
writer.Write(MaxMAC);
writer.Write(MinDC);
writer.Write(MaxDC);
writer.Write(MinMC);
writer.Write(MaxMC);
writer.Write(MinSC);
writer.Write(MaxSC);
writer.Write(HP);
writer.Write(MP);
writer.Write(Accuracy);
writer.Write(Agility);
writer.Write(Luck);
writer.Write(AttackSpeed);
writer.Write(StartItem);
writer.Write(BagWeight);
writer.Write(HandWeight);
writer.Write(WearWeight);
writer.Write(Effect);
writer.Write(Strong);
writer.Write(MagicResist);
writer.Write(PoisonResist);
writer.Write(HealthRecovery);
writer.Write(SpellRecovery);
writer.Write(PoisonRecovery);
writer.Write(HPrate);
writer.Write(MPrate);
writer.Write(CriticalRate);
writer.Write(CriticalDamage);
byte bools = 0;
if (NeedIdentify) bools |= 0x01;
if (ShowGroupPickup) bools |= 0x02;
if (ClassBased) bools |= 0x04;
if (LevelBased) bools |= 0x08;
if (CanMine) bools |= 0x10;
if (GlobalDropNotify) bools |= 0x20;
writer.Write(bools);
writer.Write(MaxAcRate);
writer.Write(MaxMacRate);
writer.Write(Holy);
writer.Write(Freezing);
writer.Write(PoisonAttack);
writer.Write((short)Bind);
writer.Write(Reflect);
writer.Write(HpDrainRate);
writer.Write((short)Unique);
writer.Write(RandomStatsId);
writer.Write(CanFastRun);
writer.Write(CanAwakening);
writer.Write(ToolTip != null);
if (ToolTip != null)
writer.Write(ToolTip);
}
public static ItemInfo FromText(string text)
{
string[] data = text.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
if (data.Length < 33) return null;
ItemInfo info = new ItemInfo { Name = data[0] };
if (!Enum.TryParse(data[1], out info.Type)) return null;
if (!Enum.TryParse(data[2], out info.Grade)) return null;
if (!Enum.TryParse(data[3], out info.RequiredType)) return null;
if (!Enum.TryParse(data[4], out info.RequiredClass)) return null;
if (!Enum.TryParse(data[5], out info.RequiredGender)) return null;
if (!Enum.TryParse(data[6], out info.Set)) return null;
if (!short.TryParse(data[7], out info.Shape)) return null;
if (!byte.TryParse(data[8], out info.Weight)) return null;
if (!byte.TryParse(data[9], out info.Light)) return null;
if (!byte.TryParse(data[10], out info.RequiredAmount)) return null;
if (!byte.TryParse(data[11], out info.MinAC)) return null;
if (!byte.TryParse(data[12], out info.MaxAC)) return null;
if (!byte.TryParse(data[13], out info.MinMAC)) return null;
if (!byte.TryParse(data[14], out info.MaxMAC)) return null;
if (!byte.TryParse(data[15], out info.MinDC)) return null;
if (!byte.TryParse(data[16], out info.MaxDC)) return null;
if (!byte.TryParse(data[17], out info.MinMC)) return null;
if (!byte.TryParse(data[18], out info.MaxMC)) return null;
if (!byte.TryParse(data[19], out info.MinSC)) return null;
if (!byte.TryParse(data[20], out info.MaxSC)) return null;
if (!byte.TryParse(data[21], out info.Accuracy)) return null;
if (!byte.TryParse(data[22], out info.Agility)) return null;
if (!ushort.TryParse(data[23], out info.HP)) return null;
if (!ushort.TryParse(data[24], out info.MP)) return null;
if (!sbyte.TryParse(data[25], out info.AttackSpeed)) return null;
if (!sbyte.TryParse(data[26], out info.Luck)) return null;
if (!byte.TryParse(data[27], out info.BagWeight)) return null;
if (!byte.TryParse(data[28], out info.HandWeight)) return null;
if (!byte.TryParse(data[29], out info.WearWeight)) return null;
if (!bool.TryParse(data[30], out info.StartItem)) return null;
if (!ushort.TryParse(data[31], out info.Image)) return null;
if (!ushort.TryParse(data[32], out info.Durability)) return null;
if (!uint.TryParse(data[33], out info.Price)) return null;
if (!uint.TryParse(data[34], out info.StackSize)) return null;
if (!byte.TryParse(data[35], out info.Effect)) return null;
if (!byte.TryParse(data[36], out info.Strong)) return null;
if (!byte.TryParse(data[37], out info.MagicResist)) return null;
if (!byte.TryParse(data[38], out info.PoisonResist)) return null;
if (!byte.TryParse(data[39], out info.HealthRecovery)) return null;
if (!byte.TryParse(data[40], out info.SpellRecovery)) return null;
if (!byte.TryParse(data[41], out info.PoisonRecovery)) return null;
if (!byte.TryParse(data[42], out info.HPrate)) return null;
if (!byte.TryParse(data[43], out info.MPrate)) return null;
if (!byte.TryParse(data[44], out info.CriticalRate)) return null;
if (!byte.TryParse(data[45], out info.CriticalDamage)) return null;
if (!bool.TryParse(data[46], out info.NeedIdentify)) return null;
if (!bool.TryParse(data[47], out info.ShowGroupPickup)) return null;
if (!byte.TryParse(data[48], out info.MaxAcRate)) return null;
if (!byte.TryParse(data[49], out info.MaxMacRate)) return null;
if (!byte.TryParse(data[50], out info.Holy)) return null;
if (!byte.TryParse(data[51], out info.Freezing)) return null;
if (!byte.TryParse(data[52], out info.PoisonAttack)) return null;
if (!bool.TryParse(data[53], out info.ClassBased)) return null;
if (!bool.TryParse(data[54], out info.LevelBased)) return null;
if (!Enum.TryParse(data[55], out info.Bind)) return null;
if (!byte.TryParse(data[56], out info.Reflect)) return null;
if (!byte.TryParse(data[57], out info.HpDrainRate)) return null;
if (!Enum.TryParse(data[58], out info.Unique)) return null;
if (!byte.TryParse(data[59], out info.RandomStatsId)) return null;
if (!bool.TryParse(data[60], out info.CanMine)) return null;
if (!bool.TryParse(data[61], out info.CanFastRun)) return null;
if (!bool.TryParse(data[62], out info.CanAwakening)) return null;
if (data[63] == "-")
info.ToolTip = "";
else
{
info.ToolTip = data[63];
info.ToolTip = info.ToolTip.Replace("&^&", "\r\n");
}
return info;
}
public string ToText()
{
string TransToolTip = ToolTip;
int length = TransToolTip.Length;
if (TransToolTip == null || TransToolTip.Length == 0)
{
TransToolTip = "-";
}
else
{
TransToolTip = TransToolTip.Replace("\r\n", "&^&");
}
return string.Format("{0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11},{12},{13},{14},{15},{16},{17},{18},{19},{20},{21},{22},{23},{24},{25},{26}," +
"{27},{28},{29},{30},{31},{32},{33},{34},{35},{36},{37},{38},{39},{40},{41},{42},{43},{44},{45},{46},{47},{48},{49},{50},{51}," +
"{52},{53},{54},{55},{56},{57},{58},{59},{60},{61},{62},{63}",
Name, (byte)Type, (byte)Grade, (byte)RequiredType, (byte)RequiredClass, (byte)RequiredGender, (byte)Set, Shape, Weight, Light, RequiredAmount, MinAC, MaxAC, MinMAC, MaxMAC, MinDC, MaxDC,
MinMC, MaxMC, MinSC, MaxSC, Accuracy, Agility, HP, MP, AttackSpeed, Luck, BagWeight, HandWeight, WearWeight, StartItem, Image, Durability, Price,
StackSize, Effect, Strong, MagicResist, PoisonResist, HealthRecovery, SpellRecovery, PoisonRecovery, HPrate, MPrate, CriticalRate, CriticalDamage, NeedIdentify,
ShowGroupPickup, MaxAcRate, MaxMacRate, Holy, Freezing, PoisonAttack, ClassBased, LevelBased, (short)Bind, Reflect, HpDrainRate, (short)Unique,
RandomStatsId, CanMine, CanFastRun, CanAwakening, TransToolTip);
}
public override string ToString()
{
return string.Format("{0}: {1}", Index, Name);
}
}
public class UserItem
{
public ulong UniqueID;
public int ItemIndex;
public ItemInfo Info;
public ushort CurrentDura, MaxDura;
public uint Count = 1, GemCount = 0;
public byte AC, MAC, DC, MC, SC, Accuracy, Agility, HP, MP, Strong, MagicResist, PoisonResist, HealthRecovery, ManaRecovery, PoisonRecovery, CriticalRate, CriticalDamage, Freezing, PoisonAttack;
public sbyte AttackSpeed, Luck;
public RefinedValue RefinedValue = RefinedValue.None;
public byte RefineAdded = 0;
public bool DuraChanged;
public int SoulBoundId = -1;
public bool Identified = false;
public bool Cursed = false;
public int WeddingRing = -1;
public UserItem[] Slots = new UserItem[5];
public DateTime BuybackExpiryDate;
public ExpireInfo ExpireInfo;
public RentalInformation RentalInformation;
public Awake Awake = new Awake();
public bool IsAdded
{
get
{
return AC != 0 || MAC != 0 || DC != 0 || MC != 0 || SC != 0 || Accuracy != 0 || Agility != 0 || HP != 0 || MP != 0 || AttackSpeed != 0 || Luck != 0 || Strong != 0 || MagicResist != 0 || PoisonResist != 0 ||
HealthRecovery != 0 || ManaRecovery != 0 || PoisonRecovery != 0 || CriticalRate != 0 || CriticalDamage != 0 || Freezing != 0 || PoisonAttack != 0;
}
}
public uint Weight
{
get { return Info.Type == ItemType.Amulet ? Info.Weight : Info.Weight*Count; }
}
public string Name
{
get { return Count > 1 ? string.Format("{0} ({1})", Info.Name, Count) : Info.Name; }
}
public string FriendlyName
{
get { return Count > 1 ? string.Format("{0} ({1})", Info.FriendlyName, Count) : Info.FriendlyName; }
}
public UserItem(ItemInfo info)
{
SoulBoundId = -1;
ItemIndex = info.Index;
Info = info;
SetSlotSize();
}
public UserItem(BinaryReader reader, int version = int.MaxValue, int Customversion = int.MaxValue)
{
UniqueID = reader.ReadUInt64();
ItemIndex = reader.ReadInt32();
CurrentDura = reader.ReadUInt16();
MaxDura = reader.ReadUInt16();
Count = reader.ReadUInt32();
AC = reader.ReadByte();
MAC = reader.ReadByte();
DC = reader.ReadByte();
MC = reader.ReadByte();
SC = reader.ReadByte();
Accuracy = reader.ReadByte();
Agility = reader.ReadByte();
HP = reader.ReadByte();
MP = reader.ReadByte();
AttackSpeed = reader.ReadSByte();
Luck = reader.ReadSByte();
if (version <= 19) return;
SoulBoundId = reader.ReadInt32();
byte Bools = reader.ReadByte();
Identified = (Bools & 0x01) == 0x01;
Cursed = (Bools & 0x02) == 0x02;
Strong = reader.ReadByte();
MagicResist = reader.ReadByte();
PoisonResist = reader.ReadByte();
HealthRecovery = reader.ReadByte();
ManaRecovery = reader.ReadByte();
PoisonRecovery = reader.ReadByte();
CriticalRate = reader.ReadByte();
CriticalDamage = reader.ReadByte();
Freezing = reader.ReadByte();
PoisonAttack = reader.ReadByte();
return;
if (version <= 31) return;
int count = reader.ReadInt32();
for (int i = 0; i < count; i++)
{
if (reader.ReadBoolean()) continue;
UserItem item = new UserItem(reader, version, Customversion);
Slots[i] = item;
}
if (version <= 38) return;
GemCount = reader.ReadUInt32();
if (version <= 40) return;
Awake = new Awake(reader);
if (version <= 56) return;
RefinedValue = (RefinedValue)reader.ReadByte();
RefineAdded = reader.ReadByte();
if (version < 60) return;
WeddingRing = reader.ReadInt32();
if (version < 65) return;
if (reader.ReadBoolean())
ExpireInfo = new ExpireInfo(reader, version, Customversion);
if (version < 76)
return;
if (reader.ReadBoolean())
RentalInformation = new RentalInformation(reader, version, Customversion);
}
public void Save(BinaryWriter writer)
{
writer.Write(UniqueID);
writer.Write(ItemIndex);
writer.Write(CurrentDura);
writer.Write(MaxDura);
writer.Write(Count);
writer.Write(AC);
writer.Write(MAC);
writer.Write(DC);
writer.Write(MC);
writer.Write(SC);
writer.Write(Accuracy);
writer.Write(Agility);
writer.Write(HP);
writer.Write(MP);
writer.Write(AttackSpeed);
writer.Write(Luck);
writer.Write(SoulBoundId);
byte Bools=0;
if (Identified) Bools |= 0x01;
if (Cursed) Bools |= 0x02;
writer.Write(Bools);
writer.Write(Strong);
writer.Write(MagicResist);
writer.Write(PoisonResist);
writer.Write(HealthRecovery);
writer.Write(ManaRecovery);
writer.Write(PoisonRecovery);
writer.Write(CriticalRate);
writer.Write(CriticalDamage);
writer.Write(Freezing);
writer.Write(PoisonAttack);
return;
writer.Write(Slots.Length);
for (int i = 0; i < Slots.Length; i++)
{
writer.Write(Slots[i] == null);
if (Slots[i] == null) continue;
Slots[i].Save(writer);
}
writer.Write(GemCount);
Awake.Save(writer);
writer.Write((byte)RefinedValue);
writer.Write(RefineAdded);
writer.Write(WeddingRing);
writer.Write(ExpireInfo != null);
ExpireInfo?.Save(writer);
writer.Write(RentalInformation != null);
RentalInformation?.Save(writer);
}
public uint Price()
{
if (Info == null) return 0;
uint p = Info.Price;
if (Info.Durability > 0)
{
float r = ((Info.Price / 2F) / Info.Durability);
p = (uint)(MaxDura * r);
if (MaxDura > 0)
r = CurrentDura / (float)MaxDura;
else
r = 0;
p = (uint)Math.Floor(p / 2F + ((p / 2F) * r) + Info.Price / 2F);
}
p = (uint)(p * ((AC + MAC + DC + MC + SC + Accuracy + Agility + HP + MP + AttackSpeed + Luck + Strong + MagicResist + PoisonResist + HealthRecovery + ManaRecovery + PoisonRecovery + CriticalRate + CriticalDamage + Freezing + PoisonAttack) * 0.1F + 1F));
return p * Count;
}
public uint RepairPrice()
{
if (Info == null || Info.Durability == 0)
return 0;
var p = Info.Price;
if (Info.Durability > 0)
{
p = (uint)Math.Floor(MaxDura * ((Info.Price / 2F) / Info.Durability) + Info.Price / 2F);
p = (uint)(p * ((AC + MAC + DC + MC + SC + Accuracy + Agility + HP + MP + AttackSpeed + Luck + Strong + MagicResist + PoisonResist + HealthRecovery + ManaRecovery + PoisonRecovery + CriticalRate + CriticalDamage + Freezing + PoisonAttack) * 0.1F + 1F));
}
var cost = p * Count - Price();
if (RentalInformation == null)
return cost;
return cost * 2;
}
public uint Quality()
{
uint q = (uint)(AC + MAC + DC + MC + SC + Accuracy + Agility + HP + MP + AttackSpeed + Luck + Strong + MagicResist + PoisonResist + HealthRecovery + ManaRecovery + PoisonRecovery + CriticalRate + CriticalDamage + Freezing + PoisonAttack + Awake.getAwakeLevel() + 1);
return q;
}
public uint AwakeningPrice()
{
if (Info == null) return 0;
uint p = 1500;
p = (uint)((p * (1 + Awake.getAwakeLevel() * 2)) * (uint)Info.Grade);
return p;
}
public uint DisassemblePrice()
{
if (Info == null) return 0;
uint p = 1500 * (uint)Info.Grade;
p = (uint)(p * ((AC + MAC + DC + MC + SC + Accuracy + Agility + HP + MP + AttackSpeed + Luck + Strong + MagicResist + PoisonResist + HealthRecovery + ManaRecovery + PoisonRecovery + CriticalRate + CriticalDamage + Freezing + PoisonAttack + Awake.getAwakeLevel()) * 0.1F + 1F));
return p;
}
public uint DowngradePrice()
{
if (Info == null) return 0;
uint p = 3000;
p = (uint)((p * (1 + (Awake.getAwakeLevel() + 1) * 2)) * (uint)Info.Grade);
return p;
}
public uint ResetPrice()
{
if (Info == null) return 0;
uint p = 3000 * (uint)Info.Grade;
p = (uint)(p * ((AC + MAC + DC + MC + SC + Accuracy + Agility + HP + MP + AttackSpeed + Luck + Strong + MagicResist + PoisonResist + HealthRecovery + ManaRecovery + PoisonRecovery + CriticalRate + CriticalDamage + Freezing + PoisonAttack) * 0.2F + 1F));
return p;
}
public void SetSlotSize() //set slot size in db?
{
int amount = 0;
switch (Info.Type)
{
case ItemType.Mount:
if (Info.Shape < 7)
amount = 4;
else if (Info.Shape < 12)
amount = 5;
break;
case ItemType.Weapon:
if (Info.Shape == 49 || Info.Shape == 50)
amount = 5;
break;
}
if (amount == Slots.Length) return;
Array.Resize(ref Slots, amount);
}
public ushort Image
{
get
{
switch (Info.Type)
{
#region Amulet and Poison Stack Image changes
case ItemType.Amulet:
if (Info.StackSize > 0)
{
switch (Info.Shape)
{
case 0: //Amulet
if (Count >= 300) return 3662;
if (Count >= 200) return 3661;
if (Count >= 100) return 3660;
return 3660;
case 1: //Grey Poison
if (Count >= 150) return 3675;
if (Count >= 100) return 2960;
if (Count >= 50) return 3674;
return 3673;
case 2: //Yellow Poison
if (Count >= 150) return 3672;
if (Count >= 100) return 2961;
if (Count >= 50) return 3671;
return 3670;
}
}
break;
}
#endregion
return Info.Image;
}
}
public UserItem Clone()
{
UserItem item = new UserItem(Info)
{
UniqueID = UniqueID,
CurrentDura = CurrentDura,
MaxDura = MaxDura,
Count = Count,
GemCount = GemCount, //18.12.5
AC = AC,
MAC = MAC,
DC = DC,
MC = MC,
SC = SC,
Accuracy = Accuracy,
Agility = Agility,
HP = HP,
MP = MP,
AttackSpeed = AttackSpeed,
Luck = Luck,
DuraChanged = DuraChanged,
SoulBoundId = SoulBoundId,
Identified = Identified,
Cursed = Cursed,
Strong = Strong,
MagicResist = MagicResist,
PoisonResist = PoisonResist,
HealthRecovery = HealthRecovery,
ManaRecovery = ManaRecovery,
PoisonRecovery = PoisonRecovery,
CriticalRate = CriticalRate,
CriticalDamage = CriticalDamage,
Freezing = Freezing,
PoisonAttack = PoisonAttack,
Slots = Slots,
Awake = Awake,
RefinedValue = RefinedValue,
RefineAdded = RefineAdded,
ExpireInfo = ExpireInfo,
RentalInformation = RentalInformation
};
return item;
}
}
public class ExpireInfo
{
public DateTime ExpiryDate;
public ExpireInfo()
{
}
public ExpireInfo(BinaryReader reader, int version = int.MaxValue, int Customversion = int.MaxValue)
{
ExpiryDate = DateTime.FromBinary(reader.ReadInt64());
}
public void Save(BinaryWriter writer)
{
writer.Write(ExpiryDate.ToBinary());
}
}
public class RentalInformation
{
public string OwnerName;
public BindMode BindingFlags = BindMode.none;
public DateTime ExpiryDate;
public bool RentalLocked;
public RentalInformation()
{ }
public RentalInformation(BinaryReader reader, int version = int.MaxValue, int CustomVersion = int.MaxValue)
{
OwnerName = reader.ReadString();
BindingFlags = (BindMode)reader.ReadInt16();
ExpiryDate = DateTime.FromBinary(reader.ReadInt64());
RentalLocked = reader.ReadBoolean();
}
public void Save(BinaryWriter writer)
{
writer.Write(OwnerName);
writer.Write((short)BindingFlags);
writer.Write(ExpiryDate.ToBinary());
writer.Write(RentalLocked);
}
}
public class GameShopItem
{
public int ItemIndex;
public int GIndex;
public ItemInfo Info;
public uint GoldPrice = 0;
public uint CreditPrice = 0;
public uint Count = 1;
public string Class = "";
public string Category = "";
public int Stock = 0;
public bool iStock = false;
public bool Deal = false;
public bool TopItem = false;
public DateTime Date;
public GameShopItem()
{
}
public GameShopItem(BinaryReader reader, int version = int.MaxValue, int Customversion = int.MaxValue)
{
ItemIndex = reader.ReadInt32();
GIndex = reader.ReadInt32();
GoldPrice = reader.ReadUInt32();
CreditPrice = reader.ReadUInt32();
Count = reader.ReadUInt32();
Class = reader.ReadString();
Category = reader.ReadString();
Stock = reader.ReadInt32();
iStock = reader.ReadBoolean();
Deal = reader.ReadBoolean();
TopItem = reader.ReadBoolean();
Date = DateTime.FromBinary(reader.ReadInt64());
}
public GameShopItem(BinaryReader reader, bool packet = false)
{
ItemIndex = reader.ReadInt32();
GIndex = reader.ReadInt32();
Info = new ItemInfo(reader);
GoldPrice = reader.ReadUInt32();
CreditPrice = reader.ReadUInt32();
Count = reader.ReadUInt32();
Class = reader.ReadString();
Category = reader.ReadString();
Stock = reader.ReadInt32();
iStock = reader.ReadBoolean();
Deal = reader.ReadBoolean();
TopItem = reader.ReadBoolean();
Date = DateTime.FromBinary(reader.ReadInt64());
}
public void Save(BinaryWriter writer, bool packet = false)
{
writer.Write(ItemIndex);
writer.Write(GIndex);
if (packet) Info.Save(writer);
writer.Write(GoldPrice);
writer.Write(CreditPrice);
writer.Write(Count);
writer.Write(Class);
writer.Write(Category);
writer.Write(Stock);
writer.Write(iStock);
writer.Write(Deal);
writer.Write(TopItem);
writer.Write(Date.ToBinary());
}
public override string ToString()
{
return string.Format("{0}: {1}", GIndex, Info.Name);
}
}
public class Awake
{
//Awake Option
public static byte AwakeSuccessRate = 70;
public static byte AwakeHitRate = 70;
public static int MaxAwakeLevel = 5;
public static byte Awake_WeaponRate = 1;
public static byte Awake_HelmetRate = 1;
public static byte Awake_ArmorRate = 5;
public static byte AwakeChanceMin = 1;
public static float[] AwakeMaterialRate = new float[4] { 1.0F, 1.0F, 1.0F, 1.0F };
public static byte[] AwakeChanceMax = new byte[4] { 1, 2, 3, 4 };
public static List<List<byte>[]> AwakeMaterials = new List<List<byte>[]>();
public AwakeType type;
List<byte> listAwake = new List<byte>();
public Awake(BinaryReader reader)
{
type = (AwakeType)reader.ReadByte();
int count = reader.ReadInt32();
for (int i = 0; i < count; i++)
{
listAwake.Add(reader.ReadByte());
}
}
public void Save(BinaryWriter writer)
{
writer.Write((byte)type);
writer.Write(listAwake.Count);
foreach (byte value in listAwake)
{
writer.Write(value);
}
}
public Awake()
{
type = AwakeType.None;
}
public bool IsMaxLevel() { return listAwake.Count == Awake.MaxAwakeLevel; }
public int getAwakeLevel() { return listAwake.Count; }
public byte getAwakeValue()
{
byte total = 0;
foreach (byte value in listAwake)
{
total += value;
}
return total;
}
public bool CheckAwakening(UserItem item, AwakeType type)
{
if (item.Info.Bind.HasFlag(BindMode.DontUpgrade))
return false;
if (item.Info.CanAwakening != true)
return false;
if (item.Info.Grade == ItemGrade.None)
return false;
if (IsMaxLevel()) return false;
if (this.type == AwakeType.None)
{
if (item.Info.Type == ItemType.Weapon)
{
if (type == AwakeType.DC ||
type == AwakeType.MC ||
type == AwakeType.SC)
{
this.type = type;
return true;
}
else
return false;
}
else if (item.Info.Type == ItemType.Helmet)
{
if (type == AwakeType.AC ||
type == AwakeType.MAC)
{
this.type = type;
return true;
}
else
return false;
}
else if (item.Info.Type == ItemType.Armour)
{
if (type == AwakeType.HPMP)
{
this.type = type;
return true;
}
else
return false;
}
else
return false;
}
else
{
if (this.type == type)
return true;
else
return false;
}
}
public int UpgradeAwake(UserItem item, AwakeType type, out bool[] isHit)
{
//return -1 condition error, -1 = dont upgrade, 0 = failed, 1 = Succeed,
isHit = null;
if (CheckAwakening(item, type) != true)
return -1;
Random rand = new Random(DateTime.Now.Millisecond);
if (rand.Next(0, 100) <= AwakeSuccessRate)
{
isHit = Awakening(item);
return 1;
}
else
{
int idx;
isHit = makeHit(1, out idx);
return 0;
}
}
public int RemoveAwake()
{
if (listAwake.Count > 0)
{
listAwake.Remove(listAwake[listAwake.Count - 1]);
if (listAwake.Count == 0)
type = AwakeType.None;
return 1;
}
else
{
type = AwakeType.None;
return 0;
}
}
public int getAwakeLevelValue(int i) { return listAwake[i]; }
public byte getDC() { return (type == AwakeType.DC ? getAwakeValue() : (byte)0); }
public byte getMC() { return (type == AwakeType.MC ? getAwakeValue() : (byte)0); }
public byte getSC() { return (type == AwakeType.SC ? getAwakeValue() : (byte)0); }
public byte getAC() { return (type == AwakeType.AC ? getAwakeValue() : (byte)0); }
public byte getMAC() { return (type == AwakeType.MAC ? getAwakeValue() : (byte)0); }
public byte getHPMP() { return (type == AwakeType.HPMP ? getAwakeValue() : (byte)0); }
private bool[] makeHit(int maxValue, out int makeValue)
{
float stepValue = (float)maxValue / 5.0f;
float totalValue = 0.0f;
bool[] isHit = new bool[5];
Random rand = new Random(DateTime.Now.Millisecond);
for (int i = 0; i < 5; i++)
{
if (rand.Next(0, 100) < AwakeHitRate)
{
totalValue += stepValue;
isHit[i] = true;
}
else
{
isHit[i] = false;
}
}
makeValue = totalValue <= 1.0f ? 1 : (int)totalValue;
return isHit;
}
private bool[] Awakening(UserItem item)
{
int minValue = AwakeChanceMin;
int maxValue = (AwakeChanceMax[(int)item.Info.Grade - 1] < AwakeChanceMin) ? AwakeChanceMin : AwakeChanceMax[(int)item.Info.Grade - 1];
int result;
bool[] returnValue = makeHit(maxValue, out result);
switch (item.Info.Type)
{
case ItemType.Weapon:
result *= (int)Awake_WeaponRate;
break;
case ItemType.Armour:
result *= (int)Awake_ArmorRate;
break;
case ItemType.Helmet:
result *= (int)Awake_HelmetRate;
break;
default:
result = 0;
break;
}
listAwake.Add((byte)result);
return returnValue;
}
}
public class ClientMagic
{
public Spell Spell;
public byte BaseCost, LevelCost, Icon;
public byte Level1, Level2, Level3;
public ushort Need1, Need2, Need3;
public byte Level, Key, Range;
public ushort Experience;
public bool IsTempSpell;
public long CastTime, Delay;
public string[] SpellString = new string[]
{
"None",// = 0,
//Warrior
"基本剑术",// = 1,
"攻杀剑术",// = 2,
"刺杀剑术",// = 3,
"半月弯刀",// = 4,
"野蛮冲撞",// = 5,
"双龙斩",// = 6,
"捕绳剑",// = 7,
"烈火剑法",// = 8,
"狮子吼",// = 9,
"圆月弯刀",// = 10,
"攻破斩",// = 11,
"护身气幕",// = 12,
"剑气爆",// = 13,
"反击",// = 14,
"日闪",// = 15,
"血龙剑法",// = 16,
"ImmortalSkin",// = 17,
"","","",//20
"","","","","","","","","","",//30
//Wizard
"火球术",// = 31,
"抗拒火环",// = 32,
"诱惑之光",// = 33,
"大火球",// = 34,
"地狱火",// = 35,
"雷电术",// = 36,
"瞬息移动",// = 37,
"爆裂火焰",// = 38,
"火墙",// = 39,
"疾光电影",// = 40,
"寒冰掌",// = 41,
"地狱雷光",// = 42,
"魔法盾",// = 43,
"圣言术",// = 44,
"嗜血术",// = 45,
"冰咆哮",// = 46,
"火龙术",// = 47,
"分身术",// = 48,
"火龙气焰",// = 49,
"天霜冰环",// = 50,
"深延术",// = 51,
"流星火雨",// = 52,
"冰焰术",// = 53,
"FastMove",// = 54,
"StormEscape",// = 55,
"","","","","",//60
//Taoist
"治愈术",// = 61,
"精神力战法",// = 62,
"施毒术",// = 63,
"灵魂火符",// = 64,
"召唤骷髅",// = 65,
"",
"隐身术",// = 67,
"集体隐身术",// = 68,
"幽灵盾",// = 69,
"心灵启示",// = 70,
"神圣战甲术",// = 71,
"气功波",// = 72,
"困魔咒",// = 73,
"净化术",// = 74,
"群体治疗术",// = 75,
"迷魂术",// = 76,
"无极真气",// = 77,
"召唤神兽",// = 78,
"复活术",// = 79,
"召唤月灵",// = 80,
"诅咒术",// = 81,
"瘟疫",// = 82,
"毒云",// = 83,
"阴阳盾",// = 84,
"血龙水",// = 85,
"HealingCircle",// = 86,
"","","","",//90
//Assassin
"绝命剑法",// = 91,
"双刀术",// = 92,
"体迅风",// = 93,
"拔刀术",// = 94,
"风身术",// = 95,
"迁移剑",// = 96,
"烈风击",// = 97,
"捕缚术",// = 98,
"猛毒剑气",// = 99,
"月影术",// = 100,
"吸气",// = 101,
"轻身步",// = 102,
"烈火身",// = 103,
"血风击",// = 104,
"猫舌兰",// = 105,
"MoonMist",// = 106,
"","","","",//110
//Archer
"Focus",// = 121,
"StraightShot",// = 122,
"DoubleShot",// = 123,
"ExplosiveTrap",// = 124,
"DelayedExplosion",// = 125,
"Meditation",// = 126,
"BackStep",// = 127,
"ElementalShot",// = 128,
"Concentration",// = 129,
"Stonetrap",// = 130,
"ElementalBarrier",// = 131,
"SummonVampire",// = 132,
"VampireShot",// = 133,
"SummonToad",// = 134,
"PoisonShot",// = 135,
"CrippleShot",// = 136,
"SummonSnakes",// = 137,
"NapalmShot",// = 138,
"OneWithNature",// = 139,
"BindingShot",// = 140,
"MentalState",// = 141,
"","","","","","","","","",//150
//Custom
"Blink",// = 151,
"Portal",// = 152,
"","","","","","","","",//160
"","","","","","","","","","",//170
"","","","","","","","","","",//180
"","","","","","","","","","",//190
"","","","","","","","","",//199
//Map Events
"DigOutZombie",// = 200,
"Rubble",// = 201,
"MapLightning",// = 202,
"MapLava",// = 203,
"MapQuake1",// = 204,
"MapQuake2",// = 205
};
public ClientMagic()
{
}
public ClientMagic(BinaryReader reader)
{
Spell = (Spell)reader.ReadByte();
BaseCost = reader.ReadByte();
LevelCost = reader.ReadByte();
Icon = reader.ReadByte();
Level1 = reader.ReadByte();
Level2 = reader.ReadByte();
Level3 = reader.ReadByte();
Need1 = reader.ReadUInt16();
Need2 = reader.ReadUInt16();
Need3 = reader.ReadUInt16();
Level = reader.ReadByte();
Key = reader.ReadByte();
Experience = reader.ReadUInt16();
Delay = reader.ReadInt64();
Range = reader.ReadByte();
CastTime = reader.ReadInt64();
}
public void Save(BinaryWriter writer)
{
writer.Write((byte)Spell);
writer.Write(BaseCost);
writer.Write(LevelCost);
writer.Write(Icon);
writer.Write(Level1);
writer.Write(Level2);
writer.Write(Level3);
writer.Write(Need1);
writer.Write(Need2);
writer.Write(Need3);
writer.Write(Level);
writer.Write(Key);
writer.Write(Experience);
writer.Write(Delay);
writer.Write(Range);
writer.Write(CastTime);
}
}
public class ClientAuction
{
public ulong AuctionID;
public UserItem Item;
public string Seller = string.Empty;
public uint Price;
public DateTime ConsignmentDate;
public ClientAuction()
{
}
public ClientAuction(BinaryReader reader)
{
AuctionID = reader.ReadUInt64();
Item = new UserItem(reader);
Seller = reader.ReadString();
Price = reader.ReadUInt32();
ConsignmentDate = DateTime.FromBinary(reader.ReadInt64());
}
public void Save(BinaryWriter writer)
{
writer.Write(AuctionID);
Item.Save(writer);
writer.Write(Seller);
writer.Write(Price);
writer.Write(ConsignmentDate.ToBinary());
}
}
public class ClientQuestInfo
{
public int Index;
public uint NPCIndex;
public string Name, Group;
public List<string> Description = new List<string>();
public List<string> TaskDescription = new List<string>();
public List<string> CompletionDescription = new List<string>();
public int MinLevelNeeded, MaxLevelNeeded;
public int QuestNeeded;
public RequiredClass ClassNeeded;
public QuestType Type;
public uint RewardGold;
public uint RewardExp;
public uint RewardCredit;
public List<QuestItemReward> RewardsFixedItem = new List<QuestItemReward>();
public List<QuestItemReward> RewardsSelectItem = new List<QuestItemReward>();
public uint FinishNPCIndex;
public bool SameFinishNPC
{
get { return NPCIndex == FinishNPCIndex; }
}
public ClientQuestInfo() { }
public ClientQuestInfo(BinaryReader reader)
{
Index = reader.ReadInt32();
NPCIndex = reader.ReadUInt32();
Name = reader.ReadString();
Group = reader.ReadString();
int count = reader.ReadInt32();
for (int i = 0; i < count; i++)
Description.Add(reader.ReadString());
count = reader.ReadInt32();
for (int i = 0; i < count; i++)
TaskDescription.Add(reader.ReadString());
count = reader.ReadInt32();
for (int i = 0; i < count; i++)
CompletionDescription.Add(reader.ReadString());
MinLevelNeeded = reader.ReadInt32();
MaxLevelNeeded = reader.ReadInt32();
QuestNeeded = reader.ReadInt32();
ClassNeeded = (RequiredClass)reader.ReadByte();
Type = (QuestType)reader.ReadByte();
RewardGold = reader.ReadUInt32();
RewardExp = reader.ReadUInt32();
RewardCredit = reader.ReadUInt32();
count = reader.ReadInt32();
for (int i = 0; i < count; i++ )
RewardsFixedItem.Add(new QuestItemReward(reader));
count = reader.ReadInt32();
for (int i = 0; i < count; i++)
RewardsSelectItem.Add(new QuestItemReward(reader));
FinishNPCIndex = reader.ReadUInt32();
}
public void Save(BinaryWriter writer)
{
writer.Write(Index);
writer.Write(NPCIndex);
writer.Write(Name);
writer.Write(Group);
writer.Write(Description.Count);
for (int i = 0; i < Description.Count; i++)
writer.Write(Description[i]);
writer.Write(TaskDescription.Count);
for (int i = 0; i < TaskDescription.Count; i++)
writer.Write(TaskDescription[i]);
writer.Write(CompletionDescription.Count);
for (int i = 0; i < CompletionDescription.Count; i++)
writer.Write(CompletionDescription[i]);
writer.Write(MinLevelNeeded);
writer.Write(MaxLevelNeeded);
writer.Write(QuestNeeded);
writer.Write((byte)ClassNeeded);
writer.Write((byte)Type);
writer.Write(RewardGold);
writer.Write(RewardExp);
writer.Write(RewardCredit);
writer.Write(RewardsFixedItem.Count);
for (int i = 0; i < RewardsFixedItem.Count; i++)
RewardsFixedItem[i].Save(writer);
writer.Write(RewardsSelectItem.Count);
for (int i = 0; i < RewardsSelectItem.Count; i++)
RewardsSelectItem[i].Save(writer);
writer.Write(FinishNPCIndex);
}
public QuestIcon GetQuestIcon(bool taken = false, bool completed = false)
{
QuestIcon icon = QuestIcon.None;
switch (Type)
{
case QuestType.General:
case QuestType.Repeatable:
if (completed)
icon = QuestIcon.QuestionYellow;
else if (taken)
icon = QuestIcon.QuestionWhite;
else
icon = QuestIcon.ExclamationYellow;
break;
case QuestType.Daily:
if (completed)
icon = QuestIcon.QuestionBlue;
else if (taken)
icon = QuestIcon.QuestionWhite;
else
icon = QuestIcon.ExclamationBlue;
break;
case QuestType.Story:
if (completed)
icon = QuestIcon.QuestionGreen;
else if (taken)
icon = QuestIcon.QuestionWhite;
else
icon = QuestIcon.ExclamationGreen;
break;
}
return icon;
}
}
public class ClientQuestProgress
{
public int Id;
public ClientQuestInfo QuestInfo;
public List<string> TaskList = new List<string>();
public bool Taken;
public bool Completed;
public bool New;
public QuestIcon Icon
{
get
{
return QuestInfo.GetQuestIcon(Taken, Completed);
}
}
public ClientQuestProgress(){ }
public ClientQuestProgress(BinaryReader reader)
{
Id = reader.ReadInt32();
int count = reader.ReadInt32();
for (int i = 0; i < count; i++)
TaskList.Add(reader.ReadString());
Taken = reader.ReadBoolean();
Completed = reader.ReadBoolean();
New = reader.ReadBoolean();
}
public void Save(BinaryWriter writer)
{
writer.Write(Id);
writer.Write(TaskList.Count);
for (int i = 0; i < TaskList.Count; i++)
writer.Write(TaskList[i]);
writer.Write(Taken);
writer.Write(Completed);
writer.Write(New);
}
}
public class QuestItemReward
{
public ItemInfo Item;
public uint Count = 1;
public QuestItemReward() { }
public QuestItemReward(BinaryReader reader)
{
Item = new ItemInfo(reader);
Count = reader.ReadUInt32();
}
public void Save(BinaryWriter writer)
{
Item.Save(writer);
writer.Write(Count);
}
}
public class ClientMail
{
public ulong MailID;
public string SenderName;
public string Message;
public bool Opened, Locked, CanReply, Collected;
public DateTime DateSent;
public uint Gold;
public List<UserItem> Items = new List<UserItem>();
public ClientMail() { }
public ClientMail(BinaryReader reader)
{
MailID = reader.ReadUInt64();
SenderName = reader.ReadString();
Message = reader.ReadString();
Opened = reader.ReadBoolean();
Locked = reader.ReadBoolean();
CanReply = reader.ReadBoolean();
Collected = reader.ReadBoolean();
DateSent = DateTime.FromBinary(reader.ReadInt64());
Gold = reader.ReadUInt32();
int count = reader.ReadInt32();
for (int i = 0; i < count; i++)
Items.Add(new UserItem(reader));
}
public void Save(BinaryWriter writer)
{
writer.Write(MailID);
writer.Write(SenderName);
writer.Write(Message);
writer.Write(Opened);
writer.Write(Locked);
writer.Write(CanReply);
writer.Write(Collected);
writer.Write(DateSent.ToBinary());
writer.Write(Gold);
writer.Write(Items.Count);
for (int i = 0; i < Items.Count; i++)
Items[i].Save(writer);
}
}
public class ClientFriend
{
public int Index;
public string Name;
public string Memo = "";
public bool Blocked;
public bool Online;
public ClientFriend() { }
public ClientFriend(BinaryReader reader)
{
Index = reader.ReadInt32();
Name = reader.ReadString();
Memo = reader.ReadString();
Blocked = reader.ReadBoolean();
Online = reader.ReadBoolean();
}
public void Save(BinaryWriter writer)
{
writer.Write(Index);
writer.Write(Name);
writer.Write(Memo);
writer.Write(Blocked);
writer.Write(Online);
}
}
public enum IntelligentCreaturePickupMode : byte
{
Automatic = 0,
SemiAutomatic = 1,
}
public class IntelligentCreatureRules
{
public int MinimalFullness = 1;
public bool MousePickupEnabled = false;
public int MousePickupRange = 0;
public bool AutoPickupEnabled = false;
public int AutoPickupRange = 0;
public bool SemiAutoPickupEnabled = false;
public int SemiAutoPickupRange = 0;
public bool CanProduceBlackStone = false;
public string Info = "";
public string Info1 = "";
public string Info2 = "";
public IntelligentCreatureRules()
{
}
public IntelligentCreatureRules(BinaryReader reader)
{
MinimalFullness = reader.ReadInt32();
MousePickupEnabled = reader.ReadBoolean();
MousePickupRange = reader.ReadInt32();
AutoPickupEnabled = reader.ReadBoolean();
AutoPickupRange = reader.ReadInt32();
SemiAutoPickupEnabled = reader.ReadBoolean();
SemiAutoPickupRange = reader.ReadInt32();
CanProduceBlackStone = reader.ReadBoolean();
Info = reader.ReadString();
Info1 = reader.ReadString();
Info2 = reader.ReadString();
}
public void Save(BinaryWriter writer)
{
writer.Write(MinimalFullness);
writer.Write(MousePickupEnabled);
writer.Write(MousePickupRange);
writer.Write(AutoPickupEnabled);
writer.Write(AutoPickupRange);
writer.Write(SemiAutoPickupEnabled);
writer.Write(SemiAutoPickupRange);
writer.Write(CanProduceBlackStone);
writer.Write(Info);
writer.Write(Info1);
writer.Write(Info2);
}
}
public class IntelligentCreatureItemFilter
{
public bool PetPickupAll = true;
public bool PetPickupGold = false;
public bool PetPickupWeapons = false;
public bool PetPickupArmours = false;
public bool PetPickupHelmets = false;
public bool PetPickupBoots = false;
public bool PetPickupBelts = false;
public bool PetPickupAccessories = false;
public bool PetPickupOthers = false;
public ItemGrade PickupGrade = ItemGrade.None;
public IntelligentCreatureItemFilter()
{
}
public void SetItemFilter(int idx)
{
switch (idx)
{
case 0://all items
PetPickupAll = true;
PetPickupGold = false;
PetPickupWeapons = false;
PetPickupArmours = false;
PetPickupHelmets = false;
PetPickupBoots = false;
PetPickupBelts = false;
PetPickupAccessories = false;
PetPickupOthers = false;
break;
case 1://gold
PetPickupAll = false;
PetPickupGold = !PetPickupGold;
break;
case 2://weapons
PetPickupAll = false;
PetPickupWeapons = !PetPickupWeapons;
break;
case 3://armours
PetPickupAll = false;
PetPickupArmours = !PetPickupArmours;
break;
case 4://helmets
PetPickupAll = false;
PetPickupHelmets = !PetPickupHelmets;
break;
case 5://boots
PetPickupAll = false;
PetPickupBoots = !PetPickupBoots;
break;
case 6://belts
PetPickupAll = false;
PetPickupBelts = !PetPickupBelts;
break;
case 7://jewelry
PetPickupAll = false;
PetPickupAccessories = !PetPickupAccessories;
break;
case 8://others
PetPickupAll = false;
PetPickupOthers = !PetPickupOthers;
break;
}
if (PetPickupGold && PetPickupWeapons && PetPickupArmours && PetPickupHelmets && PetPickupBoots && PetPickupBelts && PetPickupAccessories && PetPickupOthers)
{
PetPickupAll = true;
PetPickupGold = false;
PetPickupWeapons = false;
PetPickupArmours = false;
PetPickupHelmets = false;
PetPickupBoots = false;
PetPickupBelts = false;
PetPickupAccessories = false;
PetPickupOthers = false;
}
else
if (!PetPickupGold && !PetPickupWeapons && !PetPickupArmours && !PetPickupHelmets && !PetPickupBoots && !PetPickupBelts && !PetPickupAccessories && !PetPickupOthers)
{
PetPickupAll = true;
}
}
public IntelligentCreatureItemFilter(BinaryReader reader)
{
PetPickupAll = reader.ReadBoolean();
PetPickupGold = reader.ReadBoolean();
PetPickupWeapons = reader.ReadBoolean();
PetPickupArmours = reader.ReadBoolean();
PetPickupHelmets = reader.ReadBoolean();
PetPickupBoots = reader.ReadBoolean();
PetPickupBelts = reader.ReadBoolean();
PetPickupAccessories = reader.ReadBoolean();
PetPickupOthers = reader.ReadBoolean();
//PickupGrade = (ItemGrade)reader.ReadByte();
}
public void Save(BinaryWriter writer)
{
writer.Write(PetPickupAll);
writer.Write(PetPickupGold);
writer.Write(PetPickupWeapons);
writer.Write(PetPickupArmours);
writer.Write(PetPickupHelmets);
writer.Write(PetPickupBoots);
writer.Write(PetPickupBelts);
writer.Write(PetPickupAccessories);
writer.Write(PetPickupOthers);
//writer.Write((byte)PickupGrade);
}
}
public class ClientIntelligentCreature
{
public IntelligentCreatureType PetType;
public int Icon;
public string CustomName;
public int Fullness;
public int SlotIndex;
public long ExpireTime;//in days
public long BlackstoneTime;
public long MaintainFoodTime;
public IntelligentCreaturePickupMode petMode = IntelligentCreaturePickupMode.SemiAutomatic;
public IntelligentCreatureRules CreatureRules;
public IntelligentCreatureItemFilter Filter;
public ClientIntelligentCreature()
{
}
public ClientIntelligentCreature(BinaryReader reader)
{
PetType = (IntelligentCreatureType)reader.ReadByte();
Icon = reader.ReadInt32();
CustomName = reader.ReadString();
Fullness = reader.ReadInt32();
SlotIndex = reader.ReadInt32();
ExpireTime = reader.ReadInt64();
BlackstoneTime = reader.ReadInt64();
petMode = (IntelligentCreaturePickupMode)reader.ReadByte();
CreatureRules = new IntelligentCreatureRules(reader);
Filter = new IntelligentCreatureItemFilter(reader);
Filter.PickupGrade = (ItemGrade)reader.ReadByte();
MaintainFoodTime = reader.ReadInt64();
}
public void Save(BinaryWriter writer)
{
writer.Write((byte)PetType);
writer.Write(Icon);
writer.Write(CustomName);
writer.Write(Fullness);
writer.Write(SlotIndex);
writer.Write(ExpireTime);
writer.Write(BlackstoneTime);
writer.Write((byte)petMode);
CreatureRules.Save(writer);
Filter.Save(writer);
writer.Write((byte)Filter.PickupGrade);
writer.Write(MaintainFoodTime);
}
}
public abstract class Packet
{
public static bool IsServer;
public abstract short Index { get; }
public static Packet ReceivePacket(byte[] rawBytes, out byte[] extra)
{
extra = rawBytes;
Packet p;
if (rawBytes.Length < 4) return null; //| 2Bytes: Packet Size | 2Bytes: Packet ID |
int length = (rawBytes[1] << 8) + rawBytes[0];
if (length > rawBytes.Length || length < 2) return null;
using (MemoryStream stream = new MemoryStream(rawBytes, 2, length - 2))
using (BinaryReader reader = new BinaryReader(stream))
{
try
{
short id = reader.ReadInt16();
p = IsServer ? GetClientPacket(id) : GetServerPacket(id);
if (p == null) return null;
p.ReadPacket(reader);
}
catch
{
return null;
//return new C.Disconnect();
}
}
extra = new byte[rawBytes.Length - length];
Buffer.BlockCopy(rawBytes, length, extra, 0, rawBytes.Length - length);
return p;
}
public IEnumerable<byte> GetPacketBytes()
{
if (Index < 0) return new byte[0];
byte[] data;
using (MemoryStream stream = new MemoryStream())
{
stream.SetLength(2);
stream.Seek(2, SeekOrigin.Begin);
using (BinaryWriter writer = new BinaryWriter(stream))
{
writer.Write(Index);
WritePacket(writer);
stream.Seek(0, SeekOrigin.Begin);
writer.Write((short)stream.Length);
stream.Seek(0, SeekOrigin.Begin);
data = new byte[stream.Length];
stream.Read(data, 0, data.Length);
}
}
return data;
}
protected abstract void ReadPacket(BinaryReader reader);
protected abstract void WritePacket(BinaryWriter writer);
private static Packet GetClientPacket(short index)
{
switch (index)
{
case (short)ClientPacketIds.ClientVersion:
return new C.ClientVersion();
case (short)ClientPacketIds.Disconnect:
return new C.Disconnect();
case (short)ClientPacketIds.KeepAlive:
return new C.KeepAlive();
case (short)ClientPacketIds.NewAccount:
return new C.NewAccount();
case (short)ClientPacketIds.ChangePassword:
return new C.ChangePassword();
case (short)ClientPacketIds.Login:
return new C.Login();
case (short)ClientPacketIds.NewCharacter:
return new C.NewCharacter();
case (short)ClientPacketIds.DeleteCharacter:
return new C.DeleteCharacter();
case (short)ClientPacketIds.StartGame:
return new C.StartGame();
case (short)ClientPacketIds.LogOut:
return new C.LogOut();
case (short)ClientPacketIds.Turn:
return new C.Turn();
case (short)ClientPacketIds.Walk:
return new C.Walk();
case (short)ClientPacketIds.Run:
return new C.Run();
case (short)ClientPacketIds.Chat:
return new C.Chat();
case (short)ClientPacketIds.MoveItem:
return new C.MoveItem();
case (short)ClientPacketIds.StoreItem:
return new C.StoreItem();
case (short)ClientPacketIds.TakeBackItem:
return new C.TakeBackItem();
case (short)ClientPacketIds.MergeItem:
return new C.MergeItem();
case (short)ClientPacketIds.EquipItem:
return new C.EquipItem();
case (short)ClientPacketIds.RemoveItem:
return new C.RemoveItem();
case (short)ClientPacketIds.RemoveSlotItem:
return new C.RemoveSlotItem();
case (short)ClientPacketIds.SplitItem:
return new C.SplitItem();
case (short)ClientPacketIds.UseItem:
return new C.UseItem();
case (short)ClientPacketIds.DropItem:
return new C.DropItem();
case (short)ClientPacketIds.DepositRefineItem:
return new C.DepositRefineItem();
case (short)ClientPacketIds.RetrieveRefineItem:
return new C.RetrieveRefineItem();
case (short)ClientPacketIds.RefineCancel:
return new C.RefineCancel();
case (short)ClientPacketIds.RefineItem:
return new C.RefineItem();
case (short)ClientPacketIds.CheckRefine:
return new C.CheckRefine();
case (short)ClientPacketIds.ReplaceWedRing:
return new C.ReplaceWedRing();
case (short)ClientPacketIds.DepositTradeItem:
return new C.DepositTradeItem();
case (short)ClientPacketIds.RetrieveTradeItem:
return new C.RetrieveTradeItem();
case (short)ClientPacketIds.DropGold:
return new C.DropGold();
case (short)ClientPacketIds.PickUp:
return new C.PickUp();
case (short)ClientPacketIds.Inspect:
return new C.Inspect();
case (short)ClientPacketIds.ChangeAMode:
return new C.ChangeAMode();
case (short)ClientPacketIds.ChangePMode:
return new C.ChangePMode();
case (short)ClientPacketIds.ChangeTrade:
return new C.ChangeTrade();
case (short)ClientPacketIds.Attack:
return new C.Attack();
case (short)ClientPacketIds.RangeAttack:
return new C.RangeAttack();
case (short)ClientPacketIds.Harvest:
return new C.Harvest();
case (short)ClientPacketIds.CallNPC:
return new C.CallNPC();
case (short)ClientPacketIds.TalkMonsterNPC:
return new C.TalkMonsterNPC();
case (short)ClientPacketIds.BuyItem:
return new C.BuyItem();
case (short)ClientPacketIds.SellItem:
return new C.SellItem();
case (short)ClientPacketIds.CraftItem:
return new C.CraftItem();
case (short)ClientPacketIds.RepairItem:
return new C.RepairItem();
case (short)ClientPacketIds.BuyItemBack:
return new C.BuyItemBack();
case (short)ClientPacketIds.SRepairItem:
return new C.SRepairItem();
case (short)ClientPacketIds.MagicKey:
return new C.MagicKey();
case (short)ClientPacketIds.Magic:
return new C.Magic();
case (short)ClientPacketIds.SwitchGroup:
return new C.SwitchGroup();
case (short)ClientPacketIds.AddMember:
return new C.AddMember();
case (short)ClientPacketIds.DellMember:
return new C.DelMember();
case (short)ClientPacketIds.GroupInvite:
return new C.GroupInvite();
case (short)ClientPacketIds.TownRevive:
return new C.TownRevive();
case (short)ClientPacketIds.SpellToggle:
return new C.SpellToggle();
case (short)ClientPacketIds.ConsignItem:
return new C.ConsignItem();
case (short)ClientPacketIds.MarketSearch:
return new C.MarketSearch();
case (short)ClientPacketIds.MarketRefresh:
return new C.MarketRefresh();
case (short)ClientPacketIds.MarketPage:
return new C.MarketPage();
case (short)ClientPacketIds.MarketBuy:
return new C.MarketBuy();
case (short)ClientPacketIds.MarketGetBack:
return new C.MarketGetBack();
case (short)ClientPacketIds.RequestUserName:
return new C.RequestUserName();
case (short)ClientPacketIds.RequestChatItem:
return new C.RequestChatItem();
case (short)ClientPacketIds.EditGuildMember:
return new C.EditGuildMember();
case (short)ClientPacketIds.EditGuildNotice:
return new C.EditGuildNotice();
case (short)ClientPacketIds.GuildInvite:
return new C.GuildInvite();
case (short)ClientPacketIds.GuildNameReturn:
return new C.GuildNameReturn();
case (short)ClientPacketIds.RequestGuildInfo:
return new C.RequestGuildInfo();
case (short)ClientPacketIds.GuildStorageGoldChange:
return new C.GuildStorageGoldChange();
case (short)ClientPacketIds.GuildStorageItemChange:
return new C.GuildStorageItemChange();
case (short)ClientPacketIds.GuildWarReturn:
return new C.GuildWarReturn();
case (short)ClientPacketIds.MarriageRequest:
return new C.MarriageRequest();
case (short)ClientPacketIds.MarriageReply:
return new C.MarriageReply();
case (short)ClientPacketIds.ChangeMarriage:
return new C.ChangeMarriage();
case (short)ClientPacketIds.DivorceRequest:
return new C.DivorceRequest();
case (short)ClientPacketIds.DivorceReply:
return new C.DivorceReply();
case (short)ClientPacketIds.AddMentor:
return new C.AddMentor();
case (short)ClientPacketIds.MentorReply:
return new C.MentorReply();
case (short)ClientPacketIds.AllowMentor:
return new C.AllowMentor();
case (short)ClientPacketIds.CancelMentor:
return new C.CancelMentor();
case (short)ClientPacketIds.TradeRequest:
return new C.TradeRequest();
case (short)ClientPacketIds.TradeReply:
return new C.TradeReply();
case (short)ClientPacketIds.TradeGold:
return new C.TradeGold();
case (short)ClientPacketIds.TradeConfirm:
return new C.TradeConfirm();
case (short)ClientPacketIds.TradeCancel:
return new C.TradeCancel();
case (short)ClientPacketIds.EquipSlotItem:
return new C.EquipSlotItem();
case (short)ClientPacketIds.FishingCast:
return new C.FishingCast();
case (short)ClientPacketIds.FishingChangeAutocast:
return new C.FishingChangeAutocast();
case (short)ClientPacketIds.AcceptQuest:
return new C.AcceptQuest();
case (short)ClientPacketIds.FinishQuest:
return new C.FinishQuest();
case (short)ClientPacketIds.AbandonQuest:
return new C.AbandonQuest();
case (short)ClientPacketIds.ShareQuest:
return new C.ShareQuest();
case (short)ClientPacketIds.AcceptReincarnation:
return new C.AcceptReincarnation();
case (short)ClientPacketIds.CancelReincarnation:
return new C.CancelReincarnation();
case (short)ClientPacketIds.CombineItem:
return new C.CombineItem();
case (short)ClientPacketIds.SetConcentration:
return new C.SetConcentration();
case (short)ClientPacketIds.AwakeningNeedMaterials:
return new C.AwakeningNeedMaterials();
case (short)ClientPacketIds.AwakeningLockedItem:
return new C.AwakeningLockedItem();
case (short)ClientPacketIds.Awakening:
return new C.Awakening();
case (short)ClientPacketIds.DisassembleItem:
return new C.DisassembleItem();
case (short)ClientPacketIds.DowngradeAwakening:
return new C.DowngradeAwakening();
case (short)ClientPacketIds.ResetAddedItem:
return new C.ResetAddedItem();
case (short)ClientPacketIds.SendMail:
return new C.SendMail();
case (short)ClientPacketIds.ReadMail:
return new C.ReadMail();
case (short)ClientPacketIds.CollectParcel:
return new C.CollectParcel();
case (short)ClientPacketIds.DeleteMail:
return new C.DeleteMail();
case (short)ClientPacketIds.LockMail:
return new C.LockMail();
case (short)ClientPacketIds.MailLockedItem:
return new C.MailLockedItem();
case (short)ClientPacketIds.MailCost:
return new C.MailCost();
case (short)ClientPacketIds.UpdateIntelligentCreature://IntelligentCreature
return new C.UpdateIntelligentCreature();
case (short)ClientPacketIds.IntelligentCreaturePickup://IntelligentCreature
return new C.IntelligentCreaturePickup();
case (short)ClientPacketIds.AddFriend:
return new C.AddFriend();
case (short)ClientPacketIds.RemoveFriend:
return new C.RemoveFriend();
case (short)ClientPacketIds.RefreshFriends:
return new C.RefreshFriends();
case (short)ClientPacketIds.AddMemo:
return new C.AddMemo();
case (short)ClientPacketIds.GuildBuffUpdate:
return new C.GuildBuffUpdate();
case (short)ClientPacketIds.GameshopBuy:
return new C.GameshopBuy();
case (short)ClientPacketIds.NPCConfirmInput:
return new C.NPCConfirmInput();
case (short)ClientPacketIds.ReportIssue:
return new C.ReportIssue();
case (short)ClientPacketIds.GetRanking:
return new C.GetRanking();
case (short)ClientPacketIds.Opendoor:
return new C.Opendoor();
case (short)ClientPacketIds.GetRentedItems:
return new C.GetRentedItems();
case (short)ClientPacketIds.ItemRentalRequest:
return new C.ItemRentalRequest();
case (short)ClientPacketIds.ItemRentalFee:
return new C.ItemRentalFee();
case (short)ClientPacketIds.ItemRentalPeriod:
return new C.ItemRentalPeriod();
case (short)ClientPacketIds.DepositRentalItem:
return new C.DepositRentalItem();
case (short)ClientPacketIds.RetrieveRentalItem:
return new C.RetrieveRentalItem();
case (short)ClientPacketIds.CancelItemRental:
return new C.CancelItemRental();
case (short)ClientPacketIds.ItemRentalLockFee:
return new C.ItemRentalLockFee();
case (short)ClientPacketIds.ItemRentalLockItem:
return new C.ItemRentalLockItem();
case (short)ClientPacketIds.ConfirmItemRental:
return new C.ConfirmItemRental();
default:
return null;
}
}
public static Packet GetServerPacket(short index)
{
switch (index)
{
case (short)ServerPacketIds.Connected:
return new S.Connected();
case (short)ServerPacketIds.ClientVersion:
return new S.ClientVersion();
case (short)ServerPacketIds.Disconnect:
return new S.Disconnect();
case (short)ServerPacketIds.KeepAlive:
return new S.KeepAlive();
case (short)ServerPacketIds.NewAccount:
return new S.NewAccount();
case (short)ServerPacketIds.ChangePassword:
return new S.ChangePassword();
case (short)ServerPacketIds.ChangePasswordBanned:
return new S.ChangePasswordBanned();
case (short)ServerPacketIds.Login:
return new S.Login();
case (short)ServerPacketIds.LoginBanned:
return new S.LoginBanned();
case (short)ServerPacketIds.LoginSuccess:
return new S.LoginSuccess();
case (short)ServerPacketIds.NewCharacter:
return new S.NewCharacter();
case (short)ServerPacketIds.NewCharacterSuccess:
return new S.NewCharacterSuccess();
case (short)ServerPacketIds.DeleteCharacter:
return new S.DeleteCharacter();
case (short)ServerPacketIds.DeleteCharacterSuccess:
return new S.DeleteCharacterSuccess();
case (short)ServerPacketIds.StartGame:
return new S.StartGame();
case (short)ServerPacketIds.StartGameBanned:
return new S.StartGameBanned();
case (short)ServerPacketIds.StartGameDelay:
return new S.StartGameDelay();
case (short)ServerPacketIds.MapInformation:
return new S.MapInformation();
case (short)ServerPacketIds.UserInformation:
return new S.UserInformation();
case (short)ServerPacketIds.UserLocation:
return new S.UserLocation();
case (short)ServerPacketIds.ObjectPlayer:
return new S.ObjectPlayer();
case (short)ServerPacketIds.ObjectRemove:
return new S.ObjectRemove();
case (short)ServerPacketIds.ObjectTurn:
return new S.ObjectTurn();
case (short)ServerPacketIds.ObjectWalk:
return new S.ObjectWalk();
case (short)ServerPacketIds.ObjectRun:
return new S.ObjectRun();
case (short)ServerPacketIds.Chat:
return new S.Chat();
case (short)ServerPacketIds.ObjectChat:
return new S.ObjectChat();
case (short)ServerPacketIds.NewItemInfo:
return new S.NewItemInfo();
case (short)ServerPacketIds.MoveItem:
return new S.MoveItem();
case (short)ServerPacketIds.EquipItem:
return new S.EquipItem();
case (short)ServerPacketIds.MergeItem:
return new S.MergeItem();
case (short)ServerPacketIds.RemoveItem:
return new S.RemoveItem();
case (short)ServerPacketIds.RemoveSlotItem:
return new S.RemoveSlotItem();
case (short)ServerPacketIds.TakeBackItem:
return new S.TakeBackItem();
case (short)ServerPacketIds.StoreItem:
return new S.StoreItem();
case (short)ServerPacketIds.DepositRefineItem:
return new S.DepositRefineItem();
case (short)ServerPacketIds.RetrieveRefineItem:
return new S.RetrieveRefineItem();
case (short)ServerPacketIds.RefineItem:
return new S.RefineItem();
case (short)ServerPacketIds.DepositTradeItem:
return new S.DepositTradeItem();
case (short)ServerPacketIds.RetrieveTradeItem:
return new S.RetrieveTradeItem();
case (short)ServerPacketIds.SplitItem:
return new S.SplitItem();
case (short)ServerPacketIds.SplitItem1:
return new S.SplitItem1();
case (short)ServerPacketIds.UseItem:
return new S.UseItem();
case (short)ServerPacketIds.DropItem:
return new S.DropItem();
case (short)ServerPacketIds.PlayerUpdate:
return new S.PlayerUpdate();
case (short)ServerPacketIds.PlayerInspect:
return new S.PlayerInspect();
case (short)ServerPacketIds.LogOutSuccess:
return new S.LogOutSuccess();
case (short)ServerPacketIds.LogOutFailed:
return new S.LogOutFailed();
case (short)ServerPacketIds.TimeOfDay:
return new S.TimeOfDay();
case (short)ServerPacketIds.ChangeAMode:
return new S.ChangeAMode();
case (short)ServerPacketIds.ChangePMode:
return new S.ChangePMode();
case (short)ServerPacketIds.ObjectItem:
return new S.ObjectItem();
case (short)ServerPacketIds.ObjectGold:
return new S.ObjectGold();
case (short)ServerPacketIds.GainedItem:
return new S.GainedItem();
case (short)ServerPacketIds.GainedGold:
return new S.GainedGold();
case (short)ServerPacketIds.LoseGold:
return new S.LoseGold();
case (short)ServerPacketIds.GainedCredit:
return new S.GainedCredit();
case (short)ServerPacketIds.LoseCredit:
return new S.LoseCredit();
case (short)ServerPacketIds.ObjectMonster:
return new S.ObjectMonster();
case (short)ServerPacketIds.ObjectAttack:
return new S.ObjectAttack();
case (short)ServerPacketIds.Struck:
return new S.Struck();
case (short)ServerPacketIds.DamageIndicator:
return new S.DamageIndicator();
case (short)ServerPacketIds.ObjectStruck:
return new S.ObjectStruck();
case (short)ServerPacketIds.DuraChanged:
return new S.DuraChanged();
case (short)ServerPacketIds.HealthChanged:
return new S.HealthChanged();
case (short)ServerPacketIds.DeleteItem:
return new S.DeleteItem();
case (short)ServerPacketIds.Death:
return new S.Death();
case (short)ServerPacketIds.ObjectDied:
return new S.ObjectDied();
case (short)ServerPacketIds.ColourChanged:
return new S.ColourChanged();
case (short)ServerPacketIds.ObjectColourChanged:
return new S.ObjectColourChanged();
case (short)ServerPacketIds.ObjectGuildNameChanged:
return new S.ObjectGuildNameChanged();
case (short)ServerPacketIds.GainExperience:
return new S.GainExperience();
case (short)ServerPacketIds.LevelChanged:
return new S.LevelChanged();
case (short)ServerPacketIds.ObjectLeveled:
return new S.ObjectLeveled();
case (short)ServerPacketIds.ObjectHarvest:
return new S.ObjectHarvest();
case (short)ServerPacketIds.ObjectHarvested:
return new S.ObjectHarvested();
case (short)ServerPacketIds.ObjectNpc:
return new S.ObjectNPC();
case (short)ServerPacketIds.NPCResponse:
return new S.NPCResponse();
case (short)ServerPacketIds.ObjectHide:
return new S.ObjectHide();
case (short)ServerPacketIds.ObjectShow:
return new S.ObjectShow();
case (short)ServerPacketIds.Poisoned:
return new S.Poisoned();
case (short)ServerPacketIds.ObjectPoisoned:
return new S.ObjectPoisoned();
case (short)ServerPacketIds.MapChanged:
return new S.MapChanged();
case (short)ServerPacketIds.ObjectTeleportOut:
return new S.ObjectTeleportOut();
case (short)ServerPacketIds.ObjectTeleportIn:
return new S.ObjectTeleportIn();
case (short)ServerPacketIds.TeleportIn:
return new S.TeleportIn();
case (short)ServerPacketIds.NPCGoods:
return new S.NPCGoods();
case (short)ServerPacketIds.NPCSell:
return new S.NPCSell();
case (short)ServerPacketIds.NPCRepair:
return new S.NPCRepair();
case (short)ServerPacketIds.NPCSRepair:
return new S.NPCSRepair();
case (short)ServerPacketIds.NPCRefine:
return new S.NPCRefine();
case (short)ServerPacketIds.NPCCheckRefine:
return new S.NPCCheckRefine();
case (short)ServerPacketIds.NPCCollectRefine:
return new S.NPCCollectRefine();
case (short)ServerPacketIds.NPCReplaceWedRing:
return new S.NPCReplaceWedRing();
case (short)ServerPacketIds.NPCStorage:
return new S.NPCStorage();
case (short)ServerPacketIds.SellItem:
return new S.SellItem();
case (short)ServerPacketIds.CraftItem:
return new S.CraftItem();
case (short)ServerPacketIds.RepairItem:
return new S.RepairItem();
case (short)ServerPacketIds.ItemRepaired:
return new S.ItemRepaired();
case (short)ServerPacketIds.NewMagic:
return new S.NewMagic();
case (short)ServerPacketIds.MagicLeveled:
return new S.MagicLeveled();
case (short)ServerPacketIds.Magic:
return new S.Magic();
case (short)ServerPacketIds.MagicDelay:
return new S.MagicDelay();
case (short)ServerPacketIds.MagicCast:
return new S.MagicCast();
case (short)ServerPacketIds.ObjectMagic:
return new S.ObjectMagic();
case (short)ServerPacketIds.ObjectEffect:
return new S.ObjectEffect();
case (short)ServerPacketIds.RangeAttack:
return new S.RangeAttack();
case (short)ServerPacketIds.Pushed:
return new S.Pushed();
case (short)ServerPacketIds.ObjectPushed:
return new S.ObjectPushed();
case (short)ServerPacketIds.ObjectName:
return new S.ObjectName();
case (short)ServerPacketIds.UserStorage:
return new S.UserStorage();
case (short)ServerPacketIds.SwitchGroup:
return new S.SwitchGroup();
case (short)ServerPacketIds.DeleteGroup:
return new S.DeleteGroup();
case (short)ServerPacketIds.DeleteMember:
return new S.DeleteMember();
case (short)ServerPacketIds.GroupInvite:
return new S.GroupInvite();
case (short)ServerPacketIds.AddMember:
return new S.AddMember();
case (short)ServerPacketIds.Revived:
return new S.Revived();
case (short)ServerPacketIds.ObjectRevived:
return new S.ObjectRevived();
case (short)ServerPacketIds.SpellToggle:
return new S.SpellToggle();
case (short)ServerPacketIds.ObjectHealth:
return new S.ObjectHealth();
case (short)ServerPacketIds.MapEffect:
return new S.MapEffect();
case (short)ServerPacketIds.ObjectRangeAttack:
return new S.ObjectRangeAttack();
case (short)ServerPacketIds.AddBuff:
return new S.AddBuff();
case (short)ServerPacketIds.RemoveBuff:
return new S.RemoveBuff();
case (short)ServerPacketIds.ObjectHidden:
return new S.ObjectHidden();
case (short)ServerPacketIds.RefreshItem:
return new S.RefreshItem();
case (short)ServerPacketIds.ObjectSpell:
return new S.ObjectSpell();
case (short)ServerPacketIds.UserDash:
return new S.UserDash();
case (short)ServerPacketIds.ObjectDash:
return new S.ObjectDash();
case (short)ServerPacketIds.UserDashFail:
return new S.UserDashFail();
case (short)ServerPacketIds.ObjectDashFail:
return new S.ObjectDashFail();
case (short)ServerPacketIds.NPCConsign:
return new S.NPCConsign();
case (short)ServerPacketIds.NPCMarket:
return new S.NPCMarket();
case (short)ServerPacketIds.NPCMarketPage:
return new S.NPCMarketPage();
case (short)ServerPacketIds.ConsignItem:
return new S.ConsignItem();
case (short)ServerPacketIds.MarketFail:
return new S.MarketFail();
case (short)ServerPacketIds.MarketSuccess:
return new S.MarketSuccess();
case (short)ServerPacketIds.ObjectSitDown:
return new S.ObjectSitDown();
case (short)ServerPacketIds.InTrapRock:
return new S.InTrapRock();
case (short)ServerPacketIds.RemoveMagic:
return new S.RemoveMagic();
case (short)ServerPacketIds.BaseStatsInfo:
return new S.BaseStatsInfo();
case (short)ServerPacketIds.UserName:
return new S.UserName();
case (short)ServerPacketIds.ChatItemStats:
return new S.ChatItemStats();
case (short)ServerPacketIds.GuildMemberChange:
return new S.GuildMemberChange();
case (short)ServerPacketIds.GuildNoticeChange:
return new S.GuildNoticeChange();
case (short)ServerPacketIds.GuildStatus:
return new S.GuildStatus();
case (short)ServerPacketIds.GuildInvite:
return new S.GuildInvite();
case (short)ServerPacketIds.GuildExpGain:
return new S.GuildExpGain();
case (short)ServerPacketIds.GuildNameRequest:
return new S.GuildNameRequest();
case (short)ServerPacketIds.GuildStorageGoldChange:
return new S.GuildStorageGoldChange();
case (short)ServerPacketIds.GuildStorageItemChange:
return new S.GuildStorageItemChange();
case (short)ServerPacketIds.GuildStorageList:
return new S.GuildStorageList();
case (short)ServerPacketIds.GuildRequestWar:
return new S.GuildRequestWar();
case (short)ServerPacketIds.DefaultNPC:
return new S.DefaultNPC();
case (short)ServerPacketIds.NPCUpdate:
return new S.NPCUpdate();
case (short)ServerPacketIds.NPCImageUpdate:
return new S.NPCImageUpdate();
case (short)ServerPacketIds.MarriageRequest:
return new S.MarriageRequest();
case (short)ServerPacketIds.DivorceRequest:
return new S.DivorceRequest();
case (short)ServerPacketIds.MentorRequest:
return new S.MentorRequest();
case (short)ServerPacketIds.TradeRequest:
return new S.TradeRequest();
case (short)ServerPacketIds.TradeAccept:
return new S.TradeAccept();
case (short)ServerPacketIds.TradeGold:
return new S.TradeGold();
case (short)ServerPacketIds.TradeItem:
return new S.TradeItem();
case (short)ServerPacketIds.TradeConfirm:
return new S.TradeConfirm();
case (short)ServerPacketIds.TradeCancel:
return new S.TradeCancel();
case (short)ServerPacketIds.MountUpdate:
return new S.MountUpdate();
case (short)ServerPacketIds.TransformUpdate:
return new S.TransformUpdate();
case (short)ServerPacketIds.EquipSlotItem:
return new S.EquipSlotItem();
case (short)ServerPacketIds.FishingUpdate:
return new S.FishingUpdate();
case (short)ServerPacketIds.ChangeQuest:
return new S.ChangeQuest();
case (short)ServerPacketIds.CompleteQuest:
return new S.CompleteQuest();
case (short)ServerPacketIds.ShareQuest:
return new S.ShareQuest();
case (short)ServerPacketIds.NewQuestInfo:
return new S.NewQuestInfo();
case (short)ServerPacketIds.GainedQuestItem:
return new S.GainedQuestItem();
case (short)ServerPacketIds.DeleteQuestItem:
return new S.DeleteQuestItem();
case (short)ServerPacketIds.CancelReincarnation:
return new S.CancelReincarnation();
case (short)ServerPacketIds.RequestReincarnation:
return new S.RequestReincarnation();
case (short)ServerPacketIds.UserBackStep:
return new S.UserBackStep();
case (short)ServerPacketIds.ObjectBackStep:
return new S.ObjectBackStep();
case (short)ServerPacketIds.UserDashAttack:
return new S.UserDashAttack();
case (short)ServerPacketIds.ObjectDashAttack:
return new S.ObjectDashAttack();
case (short)ServerPacketIds.UserAttackMove://Warrior Skill - SlashingBurst
return new S.UserAttackMove();
case (short)ServerPacketIds.CombineItem:
return new S.CombineItem();
case (short)ServerPacketIds.ItemUpgraded:
return new S.ItemUpgraded();
case (short)ServerPacketIds.SetConcentration:
return new S.SetConcentration();
case (short)ServerPacketIds.SetObjectConcentration:
return new S.SetObjectConcentration();
case (short)ServerPacketIds.SetElemental:
return new S.SetElemental();
case (short)ServerPacketIds.SetObjectElemental:
return new S.SetObjectElemental();
case (short)ServerPacketIds.RemoveDelayedExplosion:
return new S.RemoveDelayedExplosion();
case (short)ServerPacketIds.ObjectDeco:
return new S.ObjectDeco();
case (short)ServerPacketIds.ObjectSneaking:
return new S.ObjectSneaking();
case (short)ServerPacketIds.ObjectLevelEffects:
return new S.ObjectLevelEffects();
case (short)ServerPacketIds.SetBindingShot:
return new S.SetBindingShot();
case (short)ServerPacketIds.SendOutputMessage:
return new S.SendOutputMessage();
case (short)ServerPacketIds.NPCAwakening:
return new S.NPCAwakening();
case (short)ServerPacketIds.NPCDisassemble:
return new S.NPCDisassemble();
case (short)ServerPacketIds.NPCDowngrade:
return new S.NPCDowngrade();
case (short)ServerPacketIds.NPCReset:
return new S.NPCReset();
case (short)ServerPacketIds.AwakeningNeedMaterials:
return new S.AwakeningNeedMaterials();
case (short)ServerPacketIds.AwakeningLockedItem:
return new S.AwakeningLockedItem();
case (short)ServerPacketIds.Awakening:
return new S.Awakening();
case (short)ServerPacketIds.ReceiveMail:
return new S.ReceiveMail();
case (short)ServerPacketIds.MailLockedItem:
return new S.MailLockedItem();
case (short)ServerPacketIds.MailSent:
return new S.MailSent();
case (short)ServerPacketIds.MailSendRequest:
return new S.MailSendRequest();
case (short)ServerPacketIds.ParcelCollected:
return new S.ParcelCollected();
case (short)ServerPacketIds.MailCost:
return new S.MailCost();
case (short)ServerPacketIds.ResizeInventory:
return new S.ResizeInventory();
case (short)ServerPacketIds.ResizeStorage:
return new S.ResizeStorage();
case (short)ServerPacketIds.NewIntelligentCreature:
return new S.NewIntelligentCreature();
case (short)ServerPacketIds.UpdateIntelligentCreatureList:
return new S.UpdateIntelligentCreatureList();
case (short)ServerPacketIds.IntelligentCreatureEnableRename:
return new S.IntelligentCreatureEnableRename();
case (short)ServerPacketIds.IntelligentCreaturePickup:
return new S.IntelligentCreaturePickup();
case (short)ServerPacketIds.NPCPearlGoods:
return new S.NPCPearlGoods();
case (short)ServerPacketIds.FriendUpdate:
return new S.FriendUpdate();
case (short)ServerPacketIds.LoverUpdate:
return new S.LoverUpdate();
case (short)ServerPacketIds.MentorUpdate:
return new S.MentorUpdate();
case (short)ServerPacketIds.GuildBuffList:
return new S.GuildBuffList();
case (short)ServerPacketIds.GameShopInfo:
return new S.GameShopInfo();
case (short)ServerPacketIds.GameShopStock:
return new S.GameShopStock();
case (short)ServerPacketIds.NPCRequestInput:
return new S.NPCRequestInput();
case (short)ServerPacketIds.Rankings:
return new S.Rankings();
case (short)ServerPacketIds.Opendoor:
return new S.Opendoor();
case (short)ServerPacketIds.GetRentedItems:
return new S.GetRentedItems();
case (short)ServerPacketIds.ItemRentalRequest:
return new S.ItemRentalRequest();
case (short)ServerPacketIds.ItemRentalFee:
return new S.ItemRentalFee();
case (short)ServerPacketIds.ItemRentalPeriod:
return new S.ItemRentalPeriod();
case (short)ServerPacketIds.DepositRentalItem:
return new S.DepositRentalItem();
case (short)ServerPacketIds.RetrieveRentalItem:
return new S.RetrieveRentalItem();
case (short)ServerPacketIds.UpdateRentalItem:
return new S.UpdateRentalItem();
case (short)ServerPacketIds.CancelItemRental:
return new S.CancelItemRental();
case (short)ServerPacketIds.ItemRentalLock:
return new S.ItemRentalLock();
case (short)ServerPacketIds.ItemRentalPartnerLock:
return new S.ItemRentalPartnerLock();
case (short)ServerPacketIds.CanConfirmItemRental:
return new S.CanConfirmItemRental();
case (short)ServerPacketIds.ConfirmItemRental:
return new S.ConfirmItemRental();
case (short)ServerPacketIds.NewRecipeInfo:
return new S.NewRecipeInfo();
default:
return null;
}
}
}
public class BaseStats
{
public float HpGain, HpGainRate, MpGainRate, BagWeightGain, WearWeightGain, HandWeightGain;
public byte MinAc, MaxAc, MinMac, MaxMac, MinDc, MaxDc, MinMc, MaxMc, MinSc, MaxSc, StartAgility, StartAccuracy, StartCriticalRate, StartCriticalDamage, CritialRateGain, CriticalDamageGain;
public BaseStats(MirClass Job)
{
switch (Job)
{
case MirClass.Warrior:
HpGain = 4F;
HpGainRate = 4.5F;
MpGainRate = 0;
BagWeightGain = 3F;
WearWeightGain = 20F;
HandWeightGain = 13F;
MinAc = 0;
MaxAc = 7;
MinMac = 0;
MaxMac = 0;
MinDc = 5;
MaxDc = 5;
MinMc = 0;
MaxMc = 0;
MinSc = 0;
MaxSc = 0;
StartAgility = 15;
StartAccuracy = 5;
StartCriticalRate = 0;
StartCriticalDamage = 0;
CritialRateGain = 0;
CriticalDamageGain = 0;
break;
case MirClass.Wizard:
HpGain = 15F;
HpGainRate = 1.8F;
MpGainRate = 0;
BagWeightGain = 5F;
WearWeightGain = 100F;
HandWeightGain = 90F;
MinAc = 0;
MaxAc = 0;
MinMac = 0;
MaxMac = 0;
MinDc = 7;
MaxDc = 7;
MinMc = 7;
MaxMc = 7;
MinSc = 0;
MaxSc = 0;
StartAgility = 15;
StartAccuracy = 5;
StartCriticalRate = 0;
StartCriticalDamage = 0;
CritialRateGain = 0;
CriticalDamageGain = 0;
break;
case MirClass.Taoist:
HpGain = 6F;
HpGainRate = 2.5F;
MpGainRate = 0;
BagWeightGain = 4F;
WearWeightGain = 50F;
HandWeightGain = 42F;
MinAc = 0;
MaxAc = 0;
MinMac = 12;
MaxMac = 6;
MinDc = 7;
MaxDc = 7;
MinMc = 0;
MaxMc = 0;
MinSc = 7;
MaxSc = 7;
StartAgility = 18;
StartAccuracy = 5;
StartCriticalRate = 0;
StartCriticalDamage = 0;
CritialRateGain = 0;
CriticalDamageGain = 0;
break;
case MirClass.Assassin:
HpGain = 4F;
HpGainRate = 3.25F;
MpGainRate = 0;
BagWeightGain = 3.5F;
WearWeightGain = 33F;
HandWeightGain = 30F;
MinAc = 0;
MaxAc = 0;
MinMac = 0;
MaxMac = 0;
MinDc = 8;
MaxDc = 8;
MinMc = 0;
MaxMc = 0;
MinSc = 0;
MaxSc = 0;
StartAgility = 20;
StartAccuracy = 5;
StartCriticalRate = 0;
StartCriticalDamage = 0;
CritialRateGain = 0;
CriticalDamageGain = 0;
break;
case MirClass.Archer:
HpGain = 4F;
HpGainRate = 3.25F;
MpGainRate = 0;
BagWeightGain = 4F; //done
WearWeightGain = 33F;
HandWeightGain = 30F;
MinAc = 0;
MaxAc = 0;
MinMac = 0;
MaxMac = 0;
MinDc = 8;
MaxDc = 8;
MinMc = 8;
MaxMc = 8;
MinSc = 0;
MaxSc = 0;
StartAgility = 15;
StartAccuracy = 8;
StartCriticalRate = 0;
StartCriticalDamage = 0;
CritialRateGain = 0;
CriticalDamageGain = 0;
break;
}
}
public BaseStats(BinaryReader reader)
{
HpGain = reader.ReadSingle();
HpGainRate = reader.ReadSingle();
MpGainRate = reader.ReadSingle();
MinAc = reader.ReadByte();
MaxAc = reader.ReadByte();
MinMac = reader.ReadByte();
MaxMac = reader.ReadByte();
MinDc = reader.ReadByte();
MaxDc = reader.ReadByte();
MinMc = reader.ReadByte();
MaxMc = reader.ReadByte();
MinSc = reader.ReadByte();
MaxSc = reader.ReadByte();
StartAccuracy = reader.ReadByte();
StartAgility = reader.ReadByte();
StartCriticalRate = reader.ReadByte();
StartCriticalDamage = reader.ReadByte();
CritialRateGain = reader.ReadByte();
CriticalDamageGain = reader.ReadByte();
BagWeightGain = reader.ReadSingle();
WearWeightGain = reader.ReadSingle();
HandWeightGain = reader.ReadSingle();
}
public void Save(BinaryWriter writer)
{
writer.Write(HpGain);
writer.Write(HpGainRate);
writer.Write(MpGainRate);
writer.Write(MinAc);
writer.Write(MaxAc);
writer.Write(MinMac);
writer.Write(MaxMac);
writer.Write(MinDc);
writer.Write(MaxDc);
writer.Write(MinMc);
writer.Write(MaxMc);
writer.Write(MinSc);
writer.Write(MaxSc);
writer.Write(StartAccuracy);
writer.Write(StartAgility);
writer.Write(StartCriticalRate);
writer.Write(StartCriticalDamage);
writer.Write(CritialRateGain);
writer.Write(CriticalDamageGain);
writer.Write(BagWeightGain);
writer.Write(WearWeightGain);
writer.Write(HandWeightGain);
}
}
public class RandomItemStat
{
public byte MaxDuraChance, MaxDuraStatChance, MaxDuraMaxStat;
public byte MaxAcChance, MaxAcStatChance, MaxAcMaxStat, MaxMacChance, MaxMacStatChance, MaxMacMaxStat, MaxDcChance, MaxDcStatChance, MaxDcMaxStat, MaxMcChance, MaxMcStatChance, MaxMcMaxStat, MaxScChance, MaxScStatChance, MaxScMaxStat;
public byte AccuracyChance, AccuracyStatChance, AccuracyMaxStat, AgilityChance, AgilityStatChance, AgilityMaxStat, HpChance, HpStatChance, HpMaxStat, MpChance, MpStatChance, MpMaxStat, StrongChance, StrongStatChance, StrongMaxStat;
public byte MagicResistChance, MagicResistStatChance, MagicResistMaxStat, PoisonResistChance, PoisonResistStatChance, PoisonResistMaxStat;
public byte HpRecovChance, HpRecovStatChance, HpRecovMaxStat, MpRecovChance, MpRecovStatChance, MpRecovMaxStat, PoisonRecovChance, PoisonRecovStatChance, PoisonRecovMaxStat;
public byte CriticalRateChance, CriticalRateStatChance, CriticalRateMaxStat, CriticalDamageChance, CriticalDamageStatChance, CriticalDamageMaxStat;
public byte FreezeChance, FreezeStatChance, FreezeMaxStat, PoisonAttackChance, PoisonAttackStatChance, PoisonAttackMaxStat;
public byte AttackSpeedChance, AttackSpeedStatChance, AttackSpeedMaxStat, LuckChance, LuckStatChance, LuckMaxStat;
public byte CurseChance;
public RandomItemStat(ItemType Type = ItemType.Book)
{
switch (Type)
{
case ItemType.Weapon:
SetWeapon();
break;
case ItemType.Armour:
SetArmour();
break;
case ItemType.Helmet:
SetHelmet();
break;
case ItemType.Belt:
case ItemType.Boots:
SetBeltBoots();
break;
case ItemType.Necklace:
SetNecklace();
break;
case ItemType.Bracelet:
SetBracelet();
break;
case ItemType.Ring:
SetRing();
break;
case ItemType.Mount:
SetMount();
break;
}
}
public void SetWeapon()
{
MaxDuraChance = 2;
MaxDuraStatChance = 13;
MaxDuraMaxStat = 13;
MaxDcChance = 15;
MaxDcStatChance = 15;
MaxDcMaxStat = 13;
MaxMcChance = 20;
MaxMcStatChance = 15;
MaxMcMaxStat = 13;
MaxScChance = 20;
MaxScStatChance = 15;
MaxScMaxStat = 13;
AttackSpeedChance = 60;
AttackSpeedStatChance = 30;
AttackSpeedMaxStat = 3;
StrongChance = 24;
StrongStatChance = 20;
StrongMaxStat = 2;
AccuracyChance = 30;
AccuracyStatChance = 20;
AccuracyMaxStat = 2;
}
public void SetArmour()
{
MaxDuraChance = 2;
MaxDuraStatChance = 10;
MaxDuraMaxStat = 3;
MaxAcChance = 30;
MaxAcStatChance = 15;
MaxAcMaxStat = 7;
MaxMacChance = 30;
MaxMacStatChance = 15;
MaxMacMaxStat = 7;
MaxDcChance = 40;
MaxDcStatChance = 20;
MaxDcMaxStat = 7;
MaxMcChance = 40;
MaxMcStatChance = 20;
MaxMcMaxStat = 7;
MaxScChance = 40;
MaxScStatChance = 20;
MaxScMaxStat = 7;
}
public void SetHelmet()
{
MaxDuraChance = 2;
MaxDuraStatChance = 10;
MaxDuraMaxStat = 3;
MaxAcChance = 30;
MaxAcStatChance = 15;
MaxAcMaxStat = 7;
MaxMacChance = 30;
MaxMacStatChance = 15;
MaxMacMaxStat = 7;
MaxDcChance = 40;
MaxDcStatChance = 20;
MaxDcMaxStat = 7;
MaxMcChance = 40;
MaxMcStatChance = 20;
MaxMcMaxStat = 7;
MaxScChance = 40;
MaxScStatChance = 20;
MaxScMaxStat = 7;
}
public void SetBeltBoots()
{
MaxDuraChance = 2;
MaxDuraStatChance = 10;
MaxDuraMaxStat = 3;
MaxAcChance = 30;
MaxAcStatChance = 30;
MaxAcMaxStat = 3;
MaxMacChance = 30;
MaxMacStatChance = 30;
MaxMacMaxStat = 3;
MaxDcChance = 30;
MaxDcStatChance = 30;
MaxDcMaxStat = 3;
MaxMcChance = 30;
MaxMcStatChance = 30;
MaxMcMaxStat = 3;
MaxScChance = 30;
MaxScStatChance = 30;
MaxScMaxStat = 3;
AgilityChance = 60;
AgilityStatChance = 30;
AgilityMaxStat = 3;
}
public void SetNecklace()
{
MaxDuraChance = 2;
MaxDuraStatChance = 10;
MaxDuraMaxStat = 3;
MaxDcChance = 15;
MaxDcStatChance = 30;
MaxDcMaxStat = 7;
MaxMcChance = 15;
MaxMcStatChance = 30;
MaxMcMaxStat = 7;
MaxScChance = 15;
MaxScStatChance = 30;
MaxScMaxStat = 7;
AccuracyChance = 60;
AccuracyStatChance = 30;
AccuracyMaxStat = 7;
AgilityChance = 60;
AgilityStatChance = 30;
AgilityMaxStat = 7;
}
public void SetBracelet()
{
MaxDuraChance = 2;
MaxDuraStatChance = 10;
MaxDuraMaxStat = 3;
MaxAcChance = 20;
MaxAcStatChance = 30;
MaxAcMaxStat = 6;
MaxMacChance = 20;
MaxMacStatChance = 30;
MaxMacMaxStat = 6;
MaxDcChance = 30;
MaxDcStatChance = 30;
MaxDcMaxStat = 6;
MaxMcChance = 30;
MaxMcStatChance = 30;
MaxMcMaxStat = 6;
MaxScChance = 30;
MaxScStatChance = 30;
MaxScMaxStat = 6;
}
public void SetRing()
{
MaxDuraChance = 2;
MaxDuraStatChance = 10;
MaxDuraMaxStat = 3;
MaxAcChance = 25;
MaxAcStatChance = 20;
MaxAcMaxStat = 6;
MaxMacChance = 25;
MaxMacStatChance = 20;
MaxMacMaxStat = 6;
MaxDcChance = 15;
MaxDcStatChance = 30;
MaxDcMaxStat = 6;
MaxMcChance = 15;
MaxMcStatChance = 30;
MaxMcMaxStat = 6;
MaxScChance = 15;
MaxScStatChance = 30;
MaxScMaxStat = 6;
}
public void SetMount()
{
SetRing();
}
}
public class ChatItem
{
public long RecievedTick = 0;
public ulong ID = 0;
public UserItem ItemStats;
}
public class UserId
{
public long Id = 0;
public string UserName = "";
}
#region ItemSets
public class ItemSets
{
public ItemSet Set;
public List<ItemType> Type;
private byte Amount
{
get
{
switch (Set)
{
case ItemSet.Mundane:
case ItemSet.NokChi:
case ItemSet.TaoProtect:
case ItemSet.Whisker1:
case ItemSet.Whisker2:
case ItemSet.Whisker3:
case ItemSet.Whisker4:
case ItemSet.Whisker5:
return 2;
case ItemSet.RedOrchid:
case ItemSet.RedFlower:
case ItemSet.Smash:
case ItemSet.HwanDevil:
case ItemSet.Purity:
case ItemSet.FiveString:
case ItemSet.Bone:
case ItemSet.Bug:
return 3;
case ItemSet.Recall:
return 4;
case ItemSet.Spirit:
case ItemSet.WhiteGold:
case ItemSet.WhiteGoldH:
case ItemSet.RedJade:
case ItemSet.RedJadeH:
case ItemSet.Nephrite:
case ItemSet.NephriteH:
case ItemSet.Hyeolryong:
case ItemSet.Monitor:
case ItemSet.Oppressive:
case ItemSet.Paeok:
case ItemSet.Sulgwan:
return 5;
default:
return 0;
}
}
}
public byte Count;
public bool SetComplete
{
get
{
return Count == Amount;
}
}
}
#endregion
#region "Mine Related"
public class MineSet
{
public string Name = string.Empty;
public byte SpotRegenRate = 5;
public byte MaxStones = 80;
public byte HitRate = 25;
public byte DropRate = 10;
public byte TotalSlots = 100;
public List<MineDrop> Drops = new List<MineDrop>();
private bool DropsSet = false;
public MineSet(byte MineType = 0)
{
switch (MineType)
{
case 1:
TotalSlots = 120;
Drops.Add(new MineDrop(){ItemName = "GoldOre", MinSlot = 1, MaxSlot = 2, MinDura = 3, MaxDura = 16, BonusChance = 20, MaxBonusDura = 10});
Drops.Add(new MineDrop() { ItemName = "SilverOre", MinSlot = 3, MaxSlot = 20, MinDura = 3, MaxDura = 16, BonusChance = 20, MaxBonusDura = 10 });
Drops.Add(new MineDrop() { ItemName = "CopperOre", MinSlot = 21, MaxSlot = 45, MinDura = 3, MaxDura = 16, BonusChance = 20, MaxBonusDura = 10 });
Drops.Add(new MineDrop() { ItemName = "BlackIronOre", MinSlot = 46, MaxSlot = 56, MinDura = 3, MaxDura = 16, BonusChance = 20, MaxBonusDura = 10 });
break;
case 2:
TotalSlots = 100;
Drops.Add(new MineDrop(){ItemName = "PlatinumOre", MinSlot = 1, MaxSlot = 2, MinDura = 3, MaxDura = 16, BonusChance = 20, MaxBonusDura = 10});
Drops.Add(new MineDrop() { ItemName = "RubyOre", MinSlot = 3, MaxSlot = 20, MinDura = 3, MaxDura = 16, BonusChance = 20, MaxBonusDura = 10 });
Drops.Add(new MineDrop() { ItemName = "NephriteOre", MinSlot = 21, MaxSlot = 45, MinDura = 3, MaxDura = 16, BonusChance = 20, MaxBonusDura = 10 });
Drops.Add(new MineDrop() { ItemName = "AmethystOre", MinSlot = 46, MaxSlot = 56, MinDura = 3, MaxDura = 16, BonusChance = 20, MaxBonusDura = 10 });
break;
}
}
public void SetDrops(List<ItemInfo> items)
{
if (DropsSet) return;
for (int i = 0; i < Drops.Count; i++)
{
for (int j = 0; j < items.Count; j++)
{
ItemInfo info = items[j];
if (String.Compare(info.Name.Replace(" ", ""), Drops[i].ItemName, StringComparison.OrdinalIgnoreCase) != 0) continue;
Drops[i].Item = info;
break;
}
}
DropsSet = true;
}
}
public class MineSpot
{
public byte StonesLeft = 0;
public long LastRegenTick = 0;
public MineSet Mine;
}
public class MineDrop
{
public string ItemName;
public ItemInfo Item;
public byte MinSlot = 0;
public byte MaxSlot = 0;
public byte MinDura = 1;
public byte MaxDura = 1;
public byte BonusChance = 0;
public byte MaxBonusDura = 1;
}
public class MineZone
{
public byte Mine;
public Point Location;
public ushort Size;
public MineZone()
{
}
public MineZone(BinaryReader reader)
{
Location = new Point(reader.ReadInt32(), reader.ReadInt32());
Size = reader.ReadUInt16();
Mine = reader.ReadByte();
}
public void Save(BinaryWriter writer)
{
writer.Write(Location.X);
writer.Write(Location.Y);
writer.Write(Size);
writer.Write(Mine);
}
public override string ToString()
{
return string.Format("Mine: {0}- {1}", Functions.PointToString(Location), Mine);
}
}
#endregion
#region "Guild Related"
public class ItemVolume
{
public ItemInfo Item;
public string ItemName;
public uint Amount;
}
public class Rank
{
public List<GuildMember> Members = new List<GuildMember>();
public string Name = "";
public int Index = 0;
public RankOptions Options = (RankOptions)0;
public Rank()
{
}
public Rank(BinaryReader reader, bool Offline = false)
{
Name = reader.ReadString();
Options = (RankOptions)reader.ReadByte();
if (!Offline)
Index = reader.ReadInt32();
int Membercount = reader.ReadInt32();
for (int j = 0; j < Membercount; j++)
Members.Add(new GuildMember(reader, Offline));
}
public void Save(BinaryWriter writer, bool Save = false)
{
writer.Write(Name);
writer.Write((byte)Options);
if (!Save)
writer.Write(Index);
writer.Write(Members.Count);
for (int j = 0; j < Members.Count; j++)
Members[j].save(writer);
}
}
public class GuildStorageItem
{
public UserItem Item;
public long UserId = 0;
public GuildStorageItem()
{
}
public GuildStorageItem(BinaryReader reader)
{
Item = new UserItem(reader);
UserId = reader.ReadInt64();
}
public void save(BinaryWriter writer)
{
Item.Save(writer);
writer.Write(UserId);
}
}
public class GuildMember
{
public string name = "";
public int Id;
public object Player;
public DateTime LastLogin;
public bool hasvoted;
public bool Online;
public GuildMember()
{}
public GuildMember(BinaryReader reader, bool Offline = false)
{
name = reader.ReadString();
Id = reader.ReadInt32();
LastLogin = DateTime.FromBinary(reader.ReadInt64());
hasvoted = reader.ReadBoolean();
Online = reader.ReadBoolean();
Online = Offline ? false: Online;
}
public void save(BinaryWriter writer)
{
writer.Write(name);
writer.Write(Id);
writer.Write(LastLogin.ToBinary());
writer.Write(hasvoted);
writer.Write(Online);
}
}
[Flags]
[Obfuscation(Feature = "renaming", Exclude = true)]
public enum RankOptions : byte
{
CanChangeRank = 1,
CanRecruit = 2,
CanKick = 4,
CanStoreItem = 8,
CanRetrieveItem = 16,
CanAlterAlliance = 32,
CanChangeNotice = 64,
CanActivateBuff = 128
}
public class GuildBuffInfo
{
public int Id;
public int Icon = 0;
public string name = "";
public byte LevelRequirement;
public byte PointsRequirement = 1;
public int TimeLimit;
public int ActivationCost;
public byte BuffAc;
public byte BuffMac;
public byte BuffDc;
public byte BuffMc;
public byte BuffSc;
public byte BuffAttack;
public int BuffMaxHp;
public int BuffMaxMp;
public byte BuffMineRate;
public byte BuffGemRate;
public byte BuffFishRate;
public byte BuffExpRate;
public byte BuffCraftRate;
public byte BuffSkillRate;
public byte BuffHpRegen;
public byte BuffMPRegen;
public byte BuffDropRate;
public byte BuffGoldRate;
public GuildBuffInfo()
{
}
public GuildBuffInfo(BinaryReader reader)
{
Id = reader.ReadInt32();
Icon = reader.ReadInt32();
name = reader.ReadString();
LevelRequirement = reader.ReadByte();
PointsRequirement = reader.ReadByte();
TimeLimit = reader.ReadInt32();
ActivationCost = reader.ReadInt32();
BuffAc = reader.ReadByte();
BuffMac = reader.ReadByte();
BuffDc = reader.ReadByte();
BuffMc = reader.ReadByte();
BuffSc = reader.ReadByte();
BuffMaxHp = reader.ReadInt32();
BuffMaxMp = reader.ReadInt32();
BuffMineRate = reader.ReadByte();
BuffGemRate = reader.ReadByte();
BuffFishRate = reader.ReadByte();
BuffExpRate = reader.ReadByte();
BuffCraftRate = reader.ReadByte();
BuffSkillRate = reader.ReadByte();
BuffHpRegen = reader.ReadByte();
BuffMPRegen = reader.ReadByte();
BuffAttack = reader.ReadByte();
BuffDropRate = reader.ReadByte();
BuffGoldRate = reader.ReadByte();
}
public GuildBuffInfo(InIReader reader, int i)
{
Id = reader.ReadInt32("Buff-" + i.ToString(), "Id",0);
Icon = reader.ReadInt32("Buff-" + i.ToString(), "Icon", 0);
name = reader.ReadString("Buff-" + i.ToString(), "Name","");
LevelRequirement = reader.ReadByte("Buff-" + i.ToString(), "LevelReq",0);
PointsRequirement = reader.ReadByte("Buff-" + i.ToString(), "PointsReq",1);
TimeLimit = reader.ReadInt32("Buff-" + i.ToString(), "TimeLimit",0);;
ActivationCost = reader.ReadInt32("Buff-" + i.ToString(), "ActivationCost",0);
BuffAc = reader.ReadByte("Buff-" + i.ToString(), "BuffAc",0);
BuffMac = reader.ReadByte("Buff-" + i.ToString(), "BuffMAC",0);
BuffDc = reader.ReadByte("Buff-" + i.ToString(), "BuffDc",0);
BuffMc = reader.ReadByte("Buff-" + i.ToString(), "BuffMc",0);
BuffSc = reader.ReadByte("Buff-" + i.ToString(), "BuffSc",0);
BuffMaxHp = reader.ReadInt32("Buff-" + i.ToString(), "BuffMaxHp",0);
BuffMaxMp = reader.ReadInt32("Buff-" + i.ToString(), "BuffMaxMp",0);
BuffMineRate = reader.ReadByte("Buff-" + i.ToString(), "BuffMineRate",0);
BuffGemRate = reader.ReadByte("Buff-" + i.ToString(), "BuffGemRate",0);
BuffFishRate = reader.ReadByte("Buff-" + i.ToString(), "BuffFishRate",0);
BuffExpRate = reader.ReadByte("Buff-" + i.ToString(), "BuffExpRate",0);
BuffCraftRate = reader.ReadByte("Buff-" + i.ToString(), "BuffCraftRate",0);
BuffSkillRate = reader.ReadByte("Buff-" + i.ToString(), "BuffSkillRate",0);
BuffHpRegen = reader.ReadByte("Buff-" + i.ToString(), "BuffHpRegen",0);
BuffMPRegen = reader.ReadByte("Buff-" + i.ToString(), "BuffMpRegen",0);
BuffAttack = reader.ReadByte("Buff-" + i.ToString(), "BuffAttack",0);
BuffDropRate = reader.ReadByte("Buff-" + i.ToString(), "BuffDropRate",0);
BuffGoldRate = reader.ReadByte("Buff-" + i.ToString(), "BuffGoldRate",0);
}
public void Save(InIReader reader, int i)
{
reader.Write("Buff-" + i.ToString(), "Id", Id);
reader.Write("Buff-" + i.ToString(), "Icon", Icon);
reader.Write("Buff-" + i.ToString(), "Name", name);
reader.Write("Buff-" + i.ToString(), "LevelReq", LevelRequirement);
reader.Write("Buff-" + i.ToString(), "PointsReq", PointsRequirement);
reader.Write("Buff-" + i.ToString(), "TimeLimit", TimeLimit); ;
reader.Write("Buff-" + i.ToString(), "ActivationCost", ActivationCost); ;
reader.Write("Buff-" + i.ToString(), "BuffAc", BuffAc); ;
reader.Write("Buff-" + i.ToString(), "BuffMAC", BuffMac); ;
reader.Write("Buff-" + i.ToString(), "BuffDc", BuffDc); ;
reader.Write("Buff-" + i.ToString(), "BuffMc", BuffMc); ;
reader.Write("Buff-" + i.ToString(), "BuffSc", BuffSc); ;
reader.Write("Buff-" + i.ToString(), "BuffMaxHp", BuffMaxHp); ;
reader.Write("Buff-" + i.ToString(), "BuffMaxMp", BuffMaxMp); ;
reader.Write("Buff-" + i.ToString(), "BuffMineRate", BuffMineRate); ;
reader.Write("Buff-" + i.ToString(), "BuffGemRate", BuffGemRate); ;
reader.Write("Buff-" + i.ToString(), "BuffFishRate", BuffFishRate); ;
reader.Write("Buff-" + i.ToString(), "BuffExpRate", BuffExpRate); ;
reader.Write("Buff-" + i.ToString(), "BuffCraftRate", BuffCraftRate); ;
reader.Write("Buff-" + i.ToString(), "BuffSkillRate", BuffSkillRate); ;
reader.Write("Buff-" + i.ToString(), "BuffHpRegen", BuffHpRegen); ;
reader.Write("Buff-" + i.ToString(), "BuffMpRegen", BuffMPRegen); ;
reader.Write("Buff-" + i.ToString(), "BuffAttack", BuffAttack); ;
reader.Write("Buff-" + i.ToString(), "BuffDropRate", BuffDropRate); ;
reader.Write("Buff-" + i.ToString(), "BuffGoldRate", BuffGoldRate); ;
}
public void Save(BinaryWriter writer)
{
writer.Write(Id);
writer.Write(Icon);
writer.Write(name);
writer.Write(LevelRequirement);
writer.Write(PointsRequirement);
writer.Write(TimeLimit);
writer.Write(ActivationCost);
writer.Write(BuffAc);
writer.Write(BuffMac);
writer.Write(BuffDc);
writer.Write(BuffMc);
writer.Write(BuffSc);
writer.Write(BuffMaxHp);
writer.Write(BuffMaxMp);
writer.Write(BuffMineRate);
writer.Write(BuffGemRate);
writer.Write(BuffFishRate);
writer.Write(BuffExpRate);
writer.Write(BuffCraftRate);
writer.Write(BuffSkillRate);
writer.Write(BuffHpRegen);
writer.Write(BuffMPRegen);
writer.Write(BuffAttack);
writer.Write(BuffDropRate);
writer.Write(BuffGoldRate);
}
public override string ToString()
{
return string.Format("{0}: {1}", Id, name);
}
public string ShowStats()
{
string text = string.Empty;
//text = name + "\n";
if (BuffAc > 0)
{
text += string.Format("Increases AC by: 0-{0}.", BuffAc);
if (text != "") text += "\n";
}
if (BuffMac > 0)
{
text += string.Format("Increases MAC by: 0-{0}.", BuffMac);
if (text != "") text += "\n";
}
if (BuffDc > 0)
{
text += string.Format("Increases DC by: 0-{0}.", BuffDc);
if (text != "") text += "\n";
}
if (BuffMc > 0)
{
text += string.Format("Increases MC by: 0-{0}.", BuffMc);
if (text != "") text += "\n";
}
if (BuffSc > 0)
{
text += string.Format("Increases SC by: 0-{0}.", BuffSc);
if (text != "") text += "\n";
}
if (BuffMaxHp > 0)
{
text += string.Format("Increases Hp by: {0}.", BuffMaxHp);
if (text != "") text += "\n";
}
if (BuffMaxMp > 0)
{
text += string.Format("Increases MP by: {0}.", BuffMaxMp);
if (text != "") text += "\n";
}
if (BuffHpRegen > 0)
{
text += string.Format("Increases Health regen by: {0}.", BuffHpRegen);
if (text != "") text += "\n";
}
if (BuffMPRegen > 0)
{
text += string.Format("Increases Mana regen by: {0}.", BuffMPRegen);
if (text != "") text += "\n";
}
if (BuffMineRate > 0)
{
text += string.Format("Increases Mining success by: {0}%.", BuffMineRate * 5);
if (text != "") text += "\n";
}
if (BuffGemRate > 0)
{
text += string.Format("Increases Gem success by: {0}%.", BuffGemRate * 5);
if (text != "") text += "\n";
}
if (BuffFishRate > 0)
{
text += string.Format("Increases Fishing success by: {0}%.", BuffFishRate * 5);
if (text != "") text += "\n";
}
if (BuffExpRate > 0)
{
text += string.Format("Increases Experience by: {0}%.", BuffExpRate);
if (text != "") text += "\n";
}
if (BuffCraftRate > 0)
{
text += string.Format("Increases Crafting success by: {0}%.", BuffCraftRate * 5);
if (text != "") text += "\n";
}
if (BuffSkillRate > 0)
{
text += string.Format("Increases Skill training by: {0}.", BuffSkillRate);
if (text != "") text += "\n";
}
if (BuffAttack > 0)
{
text += string.Format("Increases Damage by: {0}.", BuffAttack);
if (text != "") text += "\n";
}
if (BuffDropRate > 0)
{
text += string.Format("Droprate increased by: {0}%.", BuffDropRate);
if (text != "") text += "\n";
}
if (BuffGoldRate > 0)
{
text += string.Format("Goldrate increased by: 0-{0}.", BuffGoldRate);
if (text != "") text += "\n";
}
return text;
}
}
public class GuildBuff
{
public int Id;
public GuildBuffInfo Info;
public bool Active = false;
public int ActiveTimeRemaining;
public bool UsingGuildSkillIcon
{
get { return Info != null && Info.Icon < 1000; }
}
public GuildBuff()
{
}
public GuildBuff(BinaryReader reader)
{
Id = reader.ReadInt32();
Active = reader.ReadBoolean();
ActiveTimeRemaining = reader.ReadInt32();
}
public void Save(BinaryWriter writer)
{
writer.Write(Id);
writer.Write(Active);
writer.Write(ActiveTimeRemaining);
}
public string PrintTimeSpan(double secs)
{
TimeSpan t = TimeSpan.FromMinutes(secs);
string answer;
if (t.TotalMinutes < 1.0)
{
answer = string.Format("{0}s", t.Seconds);
}
else if (t.TotalHours < 1.0)
{
answer = string.Format("{0}ms", t.Minutes);
}
else // more than 1 hour
{
answer = string.Format("{0}h {1:D2}m ", (int)t.TotalHours, t.Minutes);
}
return answer;
}
public string ShowStats()
{
if (Info == null) return "";
return Info.ShowStats();
}
}
//outdated but cant delete it or old db's wont load
public class GuildBuffOld
{
public GuildBuffOld()
{ }
public GuildBuffOld(BinaryReader reader)
{
reader.ReadByte();
reader.ReadInt64();
}
}
#endregion
#region Ranking Pete107|Petesn00beh 15/1/2016
public class Rank_Character_Info
{
public long PlayerId;
public string Name;
public MirClass Class;
public int level;
//public int rank;
public long Experience;//clients shouldnt care about this only server
public object info;//again only keep this on server!
public Rank_Character_Info()
{
}
public Rank_Character_Info(BinaryReader reader)
{
//rank = reader.ReadInt32();
PlayerId = reader.ReadInt64();
Name = reader.ReadString();
level = reader.ReadInt32();
Class = (MirClass)reader.ReadByte();
}
public void Save(BinaryWriter writer)
{
//writer.Write(rank);
writer.Write(PlayerId);
writer.Write(Name);
writer.Write(level);
writer.Write((byte)Class);
}
}
#endregion
public class Door
{
public byte index;
public byte DoorState;//0: closed, 1: opening, 2: open, 3: closing
public byte ImageIndex;
public long LastTick;
public Point Location;
}
public class ItemRentalInformation
{
public ulong ItemId;
public string ItemName;
public string RentingPlayerName;
public DateTime ItemReturnDate;
public ItemRentalInformation()
{ }
public ItemRentalInformation(BinaryReader reader)
{
ItemId = reader.ReadUInt64();
ItemName = reader.ReadString();
RentingPlayerName = reader.ReadString();
ItemReturnDate = DateTime.FromBinary(reader.ReadInt64());
}
public void Save(BinaryWriter writer)
{
writer.Write(ItemId);
writer.Write(ItemName);
writer.Write(RentingPlayerName);
writer.Write(ItemReturnDate.ToBinary());
}
}
public class ClientRecipeInfo
{
public UserItem Item;
public List<UserItem> Ingredients = new List<UserItem>();
public ClientRecipeInfo()
{
}
public ClientRecipeInfo(BinaryReader reader)
{
Item = new UserItem(reader);
int count = reader.ReadInt32();
for (int i = 0; i < count; i++)
{
Ingredients.Add(new UserItem(reader));
}
}
public void Save(BinaryWriter writer)
{
Item.Save(writer);
writer.Write(Ingredients.Count);
foreach (var ingredient in Ingredients)
{
ingredient.Save(writer);
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mengtest/mir2.git
git@gitee.com:mengtest/mir2.git
mengtest
mir2
mir2
master

搜索帮助