123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247 |
- using MySql.Data.MySqlClient;
- using Newtonsoft.Json;
- using System;
- using System.Collections.Generic;
- using System.Diagnostics;
- using System.Drawing;
- //using System.Drawing.Imaging;
- using System.IO;
- using System.Linq;
- using System.Reflection;
- using System.Text.RegularExpressions;
- using C = ClientPackets;
- using S = ServerPackets;
- public class ExchangeConfigGroup
- {
- public string Name;
- public List<ExchangeConfigGroupInfo> ExchangeConfigGroupInfos = new List<ExchangeConfigGroupInfo>();
- public bool IsTypeGroup=false;
- public string GroupDescription;
- public override string ToString()
- {
- return Name;
- }
- }
- public class ExchangeConfigGroupInfo
- {
- public string Description { get; set; } = "默认";
- [Newtonsoft.Json.JsonIgnore]
- public int InputGold { get { return ItemCounts[6]; } set { ItemCounts[6] = value; } }
- [Newtonsoft.Json.JsonIgnore]
- public int InputZanzhu { get { return ItemCounts[7]; } set { ItemCounts[7] = value; } }
- [Newtonsoft.Json.JsonIgnore]
- public int InputItem1Index { get { return ItemIndexs[0]; } set { ItemIndexs[0] = value; } }
- [Newtonsoft.Json.JsonIgnore]
- public int InputItem1Count { get { return ItemCounts[0]; } set { ItemCounts[0] = value; } }
- [Newtonsoft.Json.JsonIgnore]
- public int InputItem2Index { get { return ItemIndexs[1]; } set { ItemIndexs[1] = value; } }
- [Newtonsoft.Json.JsonIgnore]
- public int InputItem2Count { get { return ItemCounts[1]; } set { ItemCounts[1] = value; } }
- [Newtonsoft.Json.JsonIgnore]
- public int InputItem3Index { get { return ItemIndexs[2]; } set { ItemIndexs[2] = value; } }
- [Newtonsoft.Json.JsonIgnore]
- public int InputItem3Count { get { return ItemCounts[2]; } set { ItemCounts[2] = value; } }
- [Newtonsoft.Json.JsonIgnore]
- public int OutputGold { get { return ItemCounts[8]; } set { ItemCounts[8] = value; } }
- [Newtonsoft.Json.JsonIgnore]
- public int OutputZanzhu { get { return ItemCounts[9]; } set { ItemCounts[9] = value; } }
- [Newtonsoft.Json.JsonIgnore]
- public int OutputItem1Index { get { return ItemIndexs[3]; } set { ItemIndexs[3] = value; } }
- [Newtonsoft.Json.JsonIgnore]
- public int OutputItem1Count { get { return ItemCounts[3]; } set { ItemCounts[3] = value; } }
- [Newtonsoft.Json.JsonIgnore]
- public int OutputItem2Index { get { return ItemIndexs[4]; } set { ItemIndexs[4] = value; } }
- [Newtonsoft.Json.JsonIgnore]
- public int OutputItem2Count { get { return ItemCounts[4]; } set { ItemCounts[4] = value; } }
- [Newtonsoft.Json.JsonIgnore]
- public int OutputItem3Index { get { return ItemIndexs[5]; } set { ItemIndexs[5] = value; } }
- [Newtonsoft.Json.JsonIgnore]
- public int OutputItem3Count { get { return ItemCounts[5]; } set { ItemCounts[5] = value; } }
- public List<int> ItemIndexs { get; set; }
- public List<int> ItemCounts { get; set; }
- public override string ToString()
- {
- return Description;
- }
- public bool IsAvaliable
- {
- get {
- return (InputGold > 0 || InputZanzhu > 0 || (InputItem1Index != -1 && InputItem1Count > 0) || (InputItem2Index != -1 && InputItem2Count > 0) || (InputItem3Index != -1 && InputItem3Count > 0))
- && (OutputGold > 0 || OutputZanzhu > 0 || (OutputItem1Index != -1 && OutputItem1Count > 0) || (OutputItem2Index != -1 && OutputItem2Count > 0) || (OutputItem3Index != -1 && OutputItem3Count > 0));
- }
- }
- }
- public class ExchangeConfigGroupInfoNew
- {
- public string Description { get; set; } = "默认";
- public int InputGold { get; set; } = 0;
- public int InputZanzhu { get; set; } = 0;
- public int InputItem1Index { get { return ItemIndexs[0]; } set{ ItemIndexs[0] = value; } }
- public int InputItem1Count { get { return ItemCounts[0]; } set { ItemCounts[0] = value; } }
- public int InputItem2Index { get { return ItemIndexs[1]; } set { ItemIndexs[1] = value; } }
- public int InputItem2Count { get { return ItemCounts[1]; } set { ItemCounts[1] = value; } }
- public int InputItem3Index { get { return ItemIndexs[2]; } set { ItemIndexs[2] = value; } }
- public int InputItem3Count { get { return ItemCounts[2]; } set { ItemCounts[2] = value; } }
- public int OutputGold { get; set; } = 0;
- public int OutputZanzhu { get; set; } = 0;
- public int OutputItem1Index { get { return ItemIndexs[3]; } set { ItemIndexs[3] = value; } }
- public int OutputItem1Count { get { return ItemCounts[3]; } set { ItemCounts[3] = value; } }
- public int OutputItem2Index { get { return ItemIndexs[4]; } set { ItemIndexs[4] = value; } }
- public int OutputItem2Count { get { return ItemCounts[4]; } set { ItemCounts[4] = value; } }
- public int OutputItem3Index { get { return ItemIndexs[5]; } set { ItemIndexs[5] = value; } }
- public int OutputItem3Count { get { return ItemCounts[5]; } set { ItemCounts[5] = value; } }
- public List<int> ItemIndexs { get; set; }
- public List<int> ItemCounts { get; set; }
- public override string ToString()
- {
- return Description;
- }
- public bool IsAvaliable
- {
- get
- {
- return (InputGold > 0 || InputZanzhu > 0 || (InputItem1Index != -1 && InputItem1Count > 0) || (InputItem2Index != -1 && InputItem2Count > 0) || (InputItem3Index != -1 && InputItem3Count > 0))
- && (OutputGold > 0 || OutputZanzhu > 0 || (OutputItem1Index != -1 && OutputItem1Count > 0) || (OutputItem2Index != -1 && OutputItem2Count > 0) || (OutputItem3Index != -1 && OutputItem3Count > 0));
- }
- }
- }
- public class TreasureOutput
- {
- public int ItemIndex;
- public uint Count;
- }
- public class GameShopItemInfo
- {
- public int ImageIndex { get; set; } = -1;
- public int ItemIndex { get; set; }
- public int ItemCount { get; set; }
- public int Price { get; set; }
- }
- public class GameShopGroupInfo
- {
- public string Name { get; set; }
- public List<GameShopItemInfo> GameShopItemInfos { get; set; }
- }
- public class AwakeInfos
- {
- public List<AwakeInfo> AwakeInfoList = new List<AwakeInfo>();
- public int Grade1AwakeLevel = 3;
- public int Grade2AwakeLevel = 4;
- public int Grade3AwakeLevel = 6;
- public int Grade4AwakeLevel = 6;
- }
- public class AwakeInfo
- {
- public AwakeType AwakeType { get; set; }
- public ItemType ItemType { get; set; }
- public List<int> LevelValues { get; set; }
- public override string ToString()
- {
- return AwakeType.ToString();
- }
- }
- public static class Scope
- {
- public readonly static Stopwatch Timer = Stopwatch.StartNew();
- }
- public enum ManagerUUID : short
- {
- MirCommand = -1,
- MirReturn = 1,
- MirConfig,
- SwitchPort,
- }
- 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,
- Recovery = 3,
- Poison = 4,
- Parry = 5
- }
- [Flags]
- public enum GMOptions : byte
- {
- None = 0,
- GameMaster = 0x0001,
- Observer = 0x0002,
- Superman = 0x0004
- }
- public enum AwakeType : byte
- {
- None = 0,
- 物防,
- 法防,
- 暴击伤害,
- 冰冻,
- 毒攻击,
- 准确,
- 伤害反弹,
- 增加血量,
- 毒物抵抗,
- 中毒恢复,
- 生命恢复,
- 魔法恢复,
- 暴击率,
- 魔法免疫,
- 幸运,
- 物理防御率,
- 魔法防御率,
- 无视物防,
- 无视魔防御,
- 格挡
- }
- [Flags]
- public enum LevelEffects : byte
- {
- None = 0,
- Mist = 0x0001,
- RedDragon = 0x0002,
- BlueDragon = 0x0004
- }
- public enum OutputMessageType : byte
- {
- Normal,
- Quest,
- }
- enum Element : byte
- {
- 火 = 0,
- 冰 = 1,
- 雷 = 2,
- 风 = 3,
- 神圣 = 4,
- 暗黑 = 5,
- 幻影 = 6,
- }
- enum Elementss : byte
- {
- 火焰 = 0,
- 冰寒 = 1,
- 雷击 = 2,
- 风 = 3,
- 神圣 = 4,
- 暗黑 = 5,
- 幻影 = 6,
- }
- public class EquipCombineConfig
- {
- public List<string> Names;
- public uint GoldNeed;
- public Dictionary<string, uint> ItemNeeds;
- }
- public enum ItemGrade : byte
- {
- None = 0,
- 一般 = 1,//Common
- 高级 = 2,//Rare
- 稀有 = 3,//Legendary
- 神器 = 4,//Mythical
- }
- 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,
- FireAC = 4,
- IceAC = 5,
- WindAC = 6,
- LightAC = 7,
- HolyAC = 8,
- DarkAC = 9,
- PhantomAC = 10,
- }
- public enum QuestType : byte
- {
- General = 0,
- Daily = 1,
- Repeatable = 2,
- Story = 3,
- Random = 4,
- Season = 5,
- WanShiTong=6
- }
- public enum QuestIcon : byte
- {
- None = 0,
- QuestionWhite = 1,
- ExclamationYellow = 2,
- QuestionYellow = 3,
- ExclamationBlue = 5,
- QuestionBlue = 6,
- ExclamationGreen = 7,
- QuestionGreen = 8
- }
- public enum QuestState : byte
- {
- Add,
- Update,
- Remove,
- None,
- }
- 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
- }
- //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
- {
- 沙漠蜥蜴 = 0,
- 夜行鬼 = 1,
- 触角神魔 = 2,
- 沙鬼0 = 3,
- 沙漠石人 = 4,
- 异界之门 = 5,
- 轻甲守卫 = 6,
- 蚂蚁道士 = 7,
- 盔甲蚂蚁 = 8,
- 海神将领 = 9,
- 霸王守卫 = 10,
- 犬猴魔 = 12,
- 大法老 = 13,
- 蚂蚁战士 = 14,
- 劳动蚂蚁 = 16,
- 诺玛将士 = 17,
- 诺玛0 = 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,
- 僵尸1 = 48,
- 僵尸2 = 49,
- 僵尸3 = 50,
- 僵尸4 = 51,
- 僵尸5 = 52,
- 尸王 = 53,
- 红蛇 = 54,
- 练功师 = 55,
- 变异骷髅 = 56,
- 虎蛇 = 57,
- 羊 = 58,
- 猎鹰 = 59,
- 盔甲虫 = 60,
- 威思而小虫 = 62,
- 多角虫 = 63,
- 巨型多角虫 = 64,
- 狼 = 65,
- 蜈蚣 = 66,
- 触龙神 = 67,
- 黑色恶蛆 = 68,
- 钳虫 = 69,
- 邪恶钳虫 = 70,
- 跳跳蜂 = 71,
- 蝴蝶虫 = 72,
- 角蝇 = 73,
- 蝙蝠 = 74,
- 楔蛾 = 75,
- 红野猪 = 76,
- 黑野猪 = 77,
- 白野猪 = 78,
- 蝎蛇 = 79,
- 邪恶毒蛇 = 80,
- 大老鼠 = 81,
- 祖玛弓箭手 = 82,
- 祖玛雕像 = 83,
- 祖玛卫士 = 84,
- 祖玛教主 = 85,
- 弓箭手 = 86,
- 神兽 = 89,
- 神兽1 = 90,
- 沃玛战将 = 91,
- 恶形鬼 = 92,
- 爆毒神魔 = 93,
- 沙漠鱼魔 = 94,
- 沙漠树魔 = 95,
- 爆毒蚂蚁 = 96,
- 沙漠风魔 = 97,
- 驽马王 = 98,
- 神舰守卫 = 99,
- 月魔蜘蛛 = 101,
- 独眼蜘蛛 = 102,
- 天狼蜘蛛 = 103,
- 赤月恶魔 = 104,
- 爆裂蜘蛛 = 105,
- 幻影蜘蛛 = 106,
- 血巨人 = 107,
- 血金刚 = 108,
- 赤血恶魔 = 109,
- 灰血恶魔 = 110,
- 花色蜘蛛 = 111,
- 黑角蜘蛛1 = 112,
- 卫士1 = 113,
- 图书馆护卫 = 114,
- 沙漠战士 = 115,
- 褐色马 = 116,
- 白马 = 117,
- 黑马 = 118,
- 赤兔马 = 118,
- 猪 = 119,
- 霸王教主 = 120,
- 牛 = 121,
- 诺玛1 = 122,
- 篮球 = 123,
- 新人女助手 = 124,
- 新人男助手 = 125,
- 七点白蛇 = 126,
- 栗子树 = 127,
- 诺玛2 = 128,
- 诺玛3 = 129,
- 潘夜右护卫 = 130,
- 潘夜左护卫 = 131,
- 腐蚀人鬼 = 132,
- 潘夜冰魔 = 133,
- 潘夜云魔 = 134,
- 潘夜风魔 = 135,
- 潘夜火魔 = 136,
- 潘夜战士 = 137,
- 年兽 = 137,
- 浪子人鬼 = 138,
- 潘夜牛魔王 = 139,
- 骷髅武将 = 140,
- 骷髅教主 = 141,
- 骷髅士兵 = 142,
- 骷髅武士 = 143,
- 骷髅弓箭手 = 144,
- 多脚虫1 = 145,
- 多脚虫2 = 146,
- 胞眼虫1 = 147,
- 胞眼虫2 = 148,
- 蜘蛛娃 = 149,
- 赤黄猪王 = 150,
- 圣诞鹿 = 151,
- 怒龙神 = 152,
- 圣诞树 = 153,
- 猿猴战士 = 154,
- 圣诞老人 = 155,
- 魔神怪1 = 156,
- 魔神怪2 = 157,
- 巨象兽 = 158,
- 火焰狮子 = 159,
- 石像狮子 = 160,
- 武力神将 = 161,
- 地牢女神1 = 162,
- 地牢女神2 = 163,
- 震天魔神 = 164,
- 丛林战士1 = 165,
- 丛林战士2 = 166,
- 投石车 = 167,
- 弩车 = 169,
- 冰魄女神 = 170,
- 野猪 = 171,
- 寒冰守护神 = 172,
- 木障 = 173,
- 雄诺玛 = 174,
- 雌诺玛 = 175,
- 溪谷法师 = 175,
- 溪谷战士 = 176,
- 溪谷使者 = 177,
- 溪谷邪神 = 178,
- 诺玛卫士 = 179,
- 木栅栏8 = 179,
- 诺玛骑兵 = 180,
- 诺玛装甲兵 = 181,
- 诺玛抛石兵 = 183,
- 诺玛司令 = 184,
- 诺玛斧兵 = 185,
- 诺玛教主 = 186,
- 聚宝箱1 = 188,
- 木栅栏7 = 189,
- 寒冰射手 = 200,
- 寒冰半兽战士 = 201,
- 寒冰巫师 = 202,
- 寒冰法师 = 203,
- 寒冰无头骑士 = 204,
- 寒冰帝王 = 205,
- 寒冰斧兵 = 206,
- 寒冰狼人 = 207,
- 寒冰白狼 = 208,
- 寒冰链手 = 209,
- 绝情护卫 = 210,
- 绝情战士 = 211,
- 绝情红姬 = 212,
- 绝情绿姬 = 213,
- 熔岩战士 = 220,
- 熔岩魔龙 = 221,
- 熔岩祭司 = 222,
- 熔岩魔兵 = 223,
- 熔岩穿甲兵 = 224,
- 熔岩收割者 = 225,
- 熔岩魔法师 = 226,
- 月河变异者 = 227,
- 月河巫师 = 228,
- 月河大门 = 229,
- 月河野蛮人 = 230,
- 月河勇士 = 231,
- 月河死神 = 232,
- 月河刺客 = 233,
- 月河树妖 = 234,
- 月河门卫 = 235,
- 月河剑客 = 236,
- 圣殿左护卫 = 240,
- 圣殿右护卫 = 241,
- 圣殿左守卫 = 242,
- 圣殿右守卫 = 243,
- 圣殿左判官 = 244,
- 圣殿右判官 = 245,
- 圣殿阴魂 = 246,
- 圣殿阳魂 = 247,
- 圣兽1 = 250,
- 圣兽2 = 252,
- 圣兽3 = 253,
- 丛林掠夺者 = 260,
- 丛林魔法师 = 261,
- 丛林潜行者 = 262,
- 丛林之王 = 263,
- 丛林穿刺者 = 264,
- 丛林金罐子 = 265,
- 潜行男 = 266,
- 潜行女 = 267,
- 沃玛锤兵 = 268,
- 沙漠蜥蜴新 = 270,
- 沙鬼新 = 271,
- 诺玛将军 = 272,
- 蚂蚁战士新 = 273,
- 半兽人新 = 274,
- 蛤蟆新 = 275,
- 钉耙猫新 = 276,
- 蛤蟆新二 = 277,
- 独眼蜘蛛1 = 278,
- 天狼蜘蛛1 = 279,
- 石头人 = 280,
- 诺玛守卫 = 281,
- 诺玛祭司 = 282,
- 霸王幽灵 = 283,
- 黑衣法师 = 284,
- 神舰鳄鱼 = 285,
- 虹魔教主 = 286,
- 诺马小怪 = 287,
- 野蛮人 = 288,
- 绿色半兽战士 = 289,
- 猿猴战将 = 290,
- 白色森林雪人 = 291,
- 盘龙柱 = 292,
- 鸭子 = 293,
- 兔子 = 294,
- 骨头堆 = 295,
- 足球 = 296,
- 小巫师 = 297,
- 红巫师 = 298,
- 卧龙教主=300,
- 月河巡逻使=301,
- 月河督抚使=302,
- 变异迅猛蜥 = 311,
- 变异刺骨蜥 = 312,
- 变异丑蜥 = 313,
- 变异毒蜥 = 314,
- 变异利爪蜥 = 319,
- 魔石咆哮者 = 315,
- 魔石狂热者 = 316,
- 魔石守护神 = 317,
- 地天灭王 = 318,
- 冰魂弓箭手 = 320,
- 冰魂半兽战士 = 321,
- 冰魂武将0 = 322,
- 冰魂武将 = 323,
- 冰魂骑手 = 324,
- 冰城帝王 = 325,
- 冰魂武士 = 326,
- 狼人 = 327,
- 雪狼 = 328,
- 冰魂斧兵 = 329,
- 狂兽人猎手=330,
- 狂兽人萨满0=331,
- 嗜魂兽=332,
- 骷髅翼龙=333,
- 骷髅狂兽=334,
- 狂兽人萨满=335,
- 狂兽人骑兵=336,
- 护卫将军 =340,
- 黎明女王=341,
- 舞姬=342,
- 绿姬=343,
- 蚩尤将军=350,
- 赤龙魔王=351,
- 赤龙女王=352,
- 无影魔卒 = 353,
- 无影魔将 = 354,
- 阎昆将军 = 355,
- 阎昆魔女 = 356,
- 真幻鬼 = 357,
- 真幻魔将 = 358,
- 千年白虎王= 368,
- 霸王虎= 367,
- 白翼虎= 366,
- 黑翼虎= 365,
- 黑虎= 364,
- 冰虎= 363,
- 血虎= 362,
- 黄虎= 361,
- 纯虎= 360,
- 皇陵将军俑 =379,
- 皇陵护卫兵俑= 378,
- 皇陵戟骑兵俑= 377,
- 皇陵刀骑兵俑= 376,
- 皇陵戟兵俑= 375,
- 皇陵刀兵俑= 374,
- 石化金刚= 371,
- 真炎剑魔= 370,
- 赤岩龙= 388,
- 赤岩龙将军 =385,
- 赤岩龙战士 =384,
- 红爪之龙 =383,
- 破趾之龙 =382,
- 月下莲= 381,
- 月莲树= 380,
- 月河教主= 435,
- 堕落幻影使= 434,
- 堕落勾魂使 =433,
- 堕落禁卫= 432,
- 堕落勇士 =431,
- 堕落红毛 =426,
- 堕落马面 =425,
- 树人精灵 =424,
- 堕落战士 =423,
- 堕落鼠仙 =422,
- 堕落罗汉 =421,
- 堕落幽灵 =420,
- 六角魔王 =413,
- 银猴= 412,
- 雪兔= 411,
- 红兔=410,
- 沼泽石鬼 =409,
- 弧形鬼= 408,
- 灵验鬼= 407,
- 斩鬼 =406,
- 猛犸象= 405,
- 铁甲犀牛 =404,
- 黑鬃虎 =403,
- 白鬃虎 =402,
- 赤耳狼= 401,
- 白耳狼 =400,
- 幻影禁卫= 399,
- 混沌禁卫= 398,
- 灭绝禁卫= 397,
- 破坏禁卫= 396,
- 禁卫将军= 395,
- 蝙蝠怪2= 394,
- 蝙蝠怪= 393,
- 青岩龙= 392,
- 禁卫队长= 391,
- 禁卫战士 =390,
- 黑蟒= 458,
- 山贼运宝车队= 456,
- 盗贼运宝车队= 455,
- 暗影鬼迹= 454,
- 巨型鼹鼠= 453,
- 剧毒蝎子= 452,
- 沙尘暴= 451,
- 烈炎眼镜蛇= 450,
- 山贼头领= 449,
- 山贼= 448,
- 盗贼= 447,
- 女刺客 =446,
- 修道僧 =445,
- 泰山战狼= 444,
- 变卦法师= 443,
- 伏兵= 442,
- 石人怪 =441,
- 爆炎石人怪 =440,
- 沙巴克城门1 = 530,
- 沙巴克城门2 = 531,
- 沙巴克城门3 = 532,
- 沙巴克城门4 = 533,
- 木栅栏1 = 534,
- 木栅栏2 = 535,
- 木栅栏3 = 536,
- 木栅栏4 = 537,
- 诺玛城门 = 538,
- 白眼钳虫 = 2000,
- 青铜钳虫 = 2004,
- 沃角钳虫 = 2005,
- 白月黑色恶蛆 = 2030,
- 金刚黑色恶蛆 = 2033,
- 沃毒黑色恶蛆 = 2034,
- 洞穴蜈蚣 = 2042,
- 沃毒蜈蚣 = 2045,
- 邪恶蜈蚣61 = 2046,
- 我的宝宝6 = 3078,
- 我的宝宝2 = 3591,
- 我的宝宝4 = 4104,
- 金龙神
- }
- public enum MirAction : byte
- {
- Standing,
- Walking,
- Running,
- Pushed,
- DashL,
- DashR,
- DashFail,
- Stance,
- Stance2,
- Attack1,
- Attack2,
- Attack3,
- Attack4,
- Attack5,
- Attack6,
- Attack7,
- AttackRange1,
- AttackRange2,
- AttackRange3,
- Special,
- Struck,
- Harvest,
- Spell,
- Spell2,
- 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,
- AutoBoss = 16,
- AutoItem = 17,
- ItemNoice = 18,
- Grade3=19,
- Grade4=20
- }
- 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,
- Recipe = 38,
- Treasure=39 //宝箱礼盒
- }
- 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,
- UnAwakenItem = 17,
- MailShow = 18,
- GameShop=19,
- Taobao=20,
- TrustMerchantSign=21,
- MACUpgrade=22
- }
- 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,
- Curse = 3,
- 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
- MustDrop = 4096,//0X1000
- }
- [Flags]
- [Obfuscation(Feature = "renaming", Exclude = true)]
- public enum MakeMode
- {
- NODamaged = 0,
- Ordinary = 1,
- Perfect = 2,
- Luminous = 4,
- }
- [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,
- }
- [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,
- AC = 1,
- MAC = 2,
- DC = 3,
- MC = 4,
- SC = 5,
- }
- //[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,
- // 虹膜 = 31,
- // 魔血 = 32,
- // 金刚 = 33,
- // 魔令 = 34,
- // 祈祷 = 35,
- // 诺玛 = 36,
- // 祖玛战 = 37,
- // 祖玛法 = 38,
- // 祖玛道 = 39,
- // 诺玛火 = 40,
- // 诺玛冰 = 41,
- // 诺玛风 = 42,
- // 诺玛电 = 43,
- // 诺玛神圣 = 44,
- // 诺玛暗黑 = 45,
- // 诺玛幻影 = 46,
- //}
- [Obfuscation(Feature = "renaming", Exclude = true)]
- public enum Spell : byte
- {
- None = 0,
- 基本剑术 = 1,//基本剑术
- 攻杀剑术 = 2,//Slaying
- 刺杀剑术 = 3,//Thrusting
- 半月弯刀 = 4,//HalfMoon
- 野蛮冲撞 = 5,//ShoulderDash
- //双龙斩 = 6,//TwinDrakeBlade
- 莲月剑法 = 6,//TwinDrakeBlade
- 捕绳剑 = 7,//Entrapment
- 烈火剑法 = 8,//FlamingSword
- 狮子吼 = 9,//LionRoar
- //狂风斩 = 10,//CrossHalfMoon
- 十方斩 = 10,//CrossHalfMoon
- 空破闪 = 11,//BladeAvalanche
- //护身气幕 = 12,//ProtectionField
- 铁布衫 = 12,//ProtectionField
- // 剑气爆 = 13,//Rage
- 破血狂杀 = 13,//Rage
- 天务 = 14,//CounterAttack
- 日闪 = 15,//SlashingBurst
- 血龙剑法 = 16,//Fury
- 金刚不坏 = 17,//ImmortalSkin
- 翔空剑法 = 18, //Swordsle
- 斗转星移 = 19, //PassingNight
- 乾坤大挪移 = 20, //HellMoving
- //Wizard
- 火球术 = 31,//FireBall //OK
- 抗拒火环 = 32,//Repulsion
- 诱惑之光 = 33,//ElectricShock
- 大火球 = 34,//GreatFireBall //OK
- 地狱火 = 35,//HellFire //OK
- 雷电术 = 36,//ThunderBolt
- 瞬息移动 = 37,//Teleport
- 爆裂火焰 = 38,//FireBang //OK
- 火墙 = 39,//FireWall //OK
- 疾光电影 = 40,//Lightning
- 冰月神掌 = 41,//FrostCrunch
- 地狱雷光 = 42,//ThunderStorm
- 魔法盾 = 43,//MagicShield
- 圣言术 = 44,//TurnUndead
- 噬血术 = 45,//Vampirism
- 冰咆哮 = 46,//IceStorm
- 灭天火 = 47,//FlameDisruptor
- 分身术 = 48,//Mirroring
- 火龙气焰 = 49,//FlameField
- 天霜冰环 = 50,//Blizzard
- 凝血离魂 = 51,//MagicBooster
- 天上落焰 = 52,//MeteorStrike
- 冰焰术 = 53,//IceThrust
- FastMove = 54,//FastMove
- StormEscape = 55,//StormEscape
- 焰天火雨 = 56, //FlameRain
- 冰月震天 = 57, //IceMoon
- 冰沙掌 = 58, //IceMpalms
- 魄冰刺 = 59, //PiercSpines
- 风掌 = 60, //Windpalms
- 击风 = 161, //WindBlow
- 风震天 = 162, //WindEarth
- 龙卷风 = 163, //WindTornado
- 霹雳掌 = 164, //Thunderpalms
- 怒神霹雳 = 165, //ThunderClap
- 移行换位 = 151,//Blink
- //Taoist
- 治愈术 = 61,//Healing
- 精神力战法 = 62,//SpiritSword
- 施毒术 = 63,//Poisoning
- 灵魂火符 = 64,//SoulFireBall
- 召唤骷髅 = 65,//SummonSkeleton
- 隐身术 = 67,//Hiding
- 集体隐身术 = 68,//MassHiding
- 幽灵盾 = 69,//SoulShield
- 心灵启示 = 70,//Revelation
- 神圣战甲术 = 71,//BlessedArmour
- 气功波 = 72,//EnergyRepulsor
- 困魔咒 = 73,//TrapHexagon
- 云寂术 = 74,//Purification
- 群体治疗术 = 75,//MassHealing
- 迷魂术 = 76,//Hallucination
- 无极真气 = 77,//UltimateEnhancer
- 召唤神兽 = 78,//SummonShinsu
- 回生术 = 79,//Reincarnation
- 超强召唤骷髅 = 80,//SummonHolyDeva
- 诅咒术 = 81,//Curse
- 烦恼 = 82,//Plague
- 毒云 = 83,//PoisonCloud
- 阴阳法环 = 84,//EnergyShield
- 移花接玉 = 85,//PetEnhancer
- 阴阳五行阵 = 86, //HealingCircle
- 月魂断玉 = 87, //BrokenJade
- 月魂灵波 = 88, //BrokenWavezx
- 强魔震法 = 89,//MagicShock
- 猛虎强势 = 90,//TigerStrong
- 妙影无踪 = 166, //GoodShadow
- 空拳刀法 = 167, //EmptyFist
- //Assassin
- 绝命剑法 = 91,//FatalSword
- 风剑术 = 92,//DoubleSlash
- 体迅风 = 93,//Haste
- 拔刀术 = 94,//FlashDash
- 风身术 = 95,//LightBody
- 迁移剑 = 96,//HeavenlySword
- 烈风击 = 97,//FireBurst
- 捕缚术 = 98,//Trap
- 猛毒剑气 = 99,//PoisonSword
- 月影术 = 100,//MoonLight
- 吸气 = 101,//MPEater
- 轻身步 = 102,//SwiftFeet
- 烈火身 = 103,//DarkBody
- 血风击 = 104,//Hemorrhage
- 月华乱舞 = 105,//CrescentSlash
- MoonMist = 106,//MoonMist
- //Archer
- 必中闪 = 121,//Focus
- 天日闪 = 122,//StraightShot
- 无我闪 = 123,//DoubleShot
- 爆阱 = 124,//ExplosiveTrap
- 爆闪 = 125,//DelayedExplosion
- 气功术 = 126,//Meditation
- 风弹步 = 127,//BackStep
- 万斤闪 = 128,//ElementalShot
- 气流术 = 129,//Concentration
- 金刚术 = 130,//Stonetrap
- 元素护盾 = 131,//ElementalBarrier
- 吸血地精 = 132,//SummonVampire
- 吸血地闪 = 133,//VampireShot
- 痹魔阱 = 134,//SummonToad
- 毒魔闪 = 135,//PoisonShot
- 邪爆闪 = 136,//CrippleShot
- 蛇柱阱 = 137,//SummonSnakes
- 血龙闪 = 138,//NapalmShot
- 血龙闪秘籍 = 139,//OneWithNature
- 地柱钉 = 140,//BindingShot
- 精神状态 = 141,//MentalState
- //Custom
- 空间转移 = 152,//Portal
- //
- //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,
- GoodShadow,
- Haste,
- SwiftFeet,
- Fury,
- SoulShield,
- BlessedArmour,
- MagicShock,
- TigerStrong,
- LightBody,
- UltimateEnhancer,
- ProtectionField,
- Rage,
- WeakCurse,
- 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,
- GroupHp,
- PowerBlessing,
- Impact = 200,
- Magic,
- Taoist,
- Storm,
- HealthAid,
- ManaAid,
- Defence,
- MagicDefence,
- WonderDrug,
- Knapsack,
- AutoGetItem,
- AutoBoss,
- AutoShowItem,
- PetMaster,
- LuckProtector,
- LadyBlessing,
- NewGuildEXP,
- }
- public enum DefenceType : byte
- {
- ACAgility,
- AC,
- MACAgility,
- MAC,
- Agility,
- Repulsion,
- None
- }
- // 1-30000 客户包 30001-60000 服务包 60000-65535 通讯包
- public enum ServerPacketIds : ushort
- {
- ClientVersion = 30001,
- Disconnect,
- KeepAlive,
- HookSuspicionMsg,
- HookSuspicionMsgFailure,
- Connected,
- EnterAlive,
- NewAccount,
- ChangePassword,
- ChangePasswordBanned,
- Login,
- LoginAccount,
- 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,
- SureBuyStorage,
- StorPasswordAuthResult,
- ReceiveMessageBox,
- SetStoragePassword,
- StorPasswordAsk,
- SplitItem,
- SplitItem1,
- DepositRefineItem,
- RetrieveRefineItem,
- RefineCancel,
- RefineItem,
- Mir3RefineItem,
- ClientHP,
- Mir3AtkRefine,
- FindBlackItem,
- DepositTradeItem,
- RetrieveTradeItem,
- UseItem,
- DropItem,
- PlayerUpdate,
- PlayerInspect,
- LogOutSuccess,
- LogOutFailed,
- TimeOfDay,
- ChangeAMode,
- ChangePMode,
- ObjectItem,
- ObjectUseItem,
- DropProtectSuccess,
- ObjectGold,
- GainedItem,
- GainedGold,
- LoseGold,
- GainedCredit,
- LoseCredit,
- ObjectMonster,
- ObjectAttack,
- Struck,
- ObjectStruck,
- DamageIndicator,
- DuraChanged,
- PoisonChangaChanged,
- HealthChanged,
- DeleteItem,
- Death,
- ObjectDied,
- ColorChanged,
- ObjectColorChanged,
- ObjectGuildNameChanged,
- GainExperience,
- SubExperience,
- LevelChanged,
- ExtraChanged,
- ObjectLeveled,
- ObjectWpLeveled,
- ObjectShowHelmet,
- ObjectHarvest,
- ObjectHarvested,
- ObjectNpc,
- QueryMapNPCs,
- QueryAllMaps,
- NPCResponse,
- ObjectHide,
- ObjectShow,
- Poisoned,
- ObjectPoisoned,
- MapChanged,
- ObjectTeleportOut,
- ObjectTeleportIn,
- TeleportIn,
- NPCGoods,
- NPCSelectGoods,
- NPCSell,
- NPCRepair,
- NPCSRepair,
- NPCRefine,
- NPCCheckRefine,
- NPCCollectRefine,
- NPCReplaceWedRing,
- NPCStorage,
- StartMACUpgrade,
- ClearMACUpgrade,
- MACUpgradeResult,
- SellItem,
- RepairItem,
- ItemRepaired,
- NewMagic,
- RemoveMagic,
- MagicLeveled,
- Magic,
- MagicDelay,
- MagicCast,
- ObjectMagic,
- ObjectEffect,
- RangeAttack,
- Pushed,
- ObjectPushed,
- ObjectName,
- UserStorage,
- SwitchGroup,
- DeleteGroup,
- DeleteMember,
- MemberLocation,
- GroupInvite,
- AddMember,
- Revived,
- ObjectRevived,
- SpellToggle,
- ObjectHealth,
- MapEffect,
- ObjectRangeAttack,
- AddBuff,
- RemoveBuff,
- ObjectHidden,
- ObjectSpHidden,
- RefreshItem,
- RefreshHair,
- ObjectRefreshHair,
- ObjectSpell,
- UserDash,
- ObjectDash,
- UserDashFail,
- ObjectDashFail,
- NPCConsign,
- NPCMarket,
- ZanZhuChangeName,
- AuctionGroups,
- GameShopSearch,
- ItemProtectStart,
- ExchangeConfigSearch,
- ItemAuctionSearch,
- MyAuctionSearch,
- // GNPCMarket,
- NPCMarketPage,
- ConsignItem,
- MarketFail,
- MarketSuccess,
- ObjectSitDown,
- RefreshSeasonExitTime,
- InTrapRock,
- BaseStatsInfo,
- UserName,
- ChatItemStats,
- GuildNoticeChange,
- GuildMemberChange,
- GuildStatus,
- GetAllGuild,
- GetAllJoinRequest,
- GuildInvite,
- GuildExpGain,
- GuildNameRequest,
- GuildStorageGoldChange,
- GuildStorageItemChange,
- GuildStorageList,
- GuildRequestWar,
- DefaultNPC,
- NPCUpdate,
- MarriageRequest,
- DivorceRequest,
- MentorRequest,
- TradeRequest,
- TradeAccept,
- TradeGold,
- TradeItem,
- TradeCost,
- 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,
- DropProtectNeedMaterials,
- AwakeningLockedItem,
- Awakening,
- ReceiveMail,
- MailLockedItem,
- MailSendRequest,
- MailSent,
- ParcelCollected,
- MailCost,
- ResizeInventory,
- NewIntelligentCreature,
- UpdateIntelligentCreatureList,
- IntelligentCreatureEnableRename,
- IntelligentCreaturePickup,
- NPCPearlGoods,
- TransformUpdate,
- FriendUpdate,
- FriendRequest,
- LoverUpdate,
- MentorUpdate,
- GuildBuffList,
- NPCRequestInput,
- GameShopInfo,
- GameShopStock,
- Rankings,
- Opendoor,
- ReshRecipes,
- AboutToQuest,
- ServerArea,
- NPCUnAwaken,
- NPCDocument,
- NPCUnAwakening,
- UnAwakening,
- OpenJyxt,
- InitialItem,
- MoveShield,
- }
- public enum ClientPacketIds : ushort
- {
- ClientVersion = 1,
- Disconnect,
- KeepAlive,
- EnterAlive,
- NewAccount,
- ChangePassword,
- Login,
- LoginAccount,
- NewCharacter,
- DeleteCharacter,
- StartGame,
- LogOut,
- Turn,
- Walk,
- Run,
- Chat,
- MoveItem,
- StoreItem,
- SendStorPassword,
- SetStorPassword,
- CancelPassword,
- BuyStorage,
- UseHorn,
- TakeBackItem,
- MergeItem,
- EquipItem,
- RemoveItem,
- RemoveSlotItem,
- SplitItem,
- UseItem,
- DropItem,
- DepositRefineItem,
- RetrieveRefineItem,
- RefineCancel,
- RefineItem,
- CheckRefine,
- ReplaceWedRing,
- DepositTradeItem,
- RetrieveTradeItem,
- DropGold,
- PickUp,
- Inspect,
- ChangeAMode,
- ChangePMode,
- ChangeTrade,
- ChangeHelmetoff,
- Attack,
- RangeAttack,
- Harvest,
- CallNPC,
- TalkMonsterNPC,
- BuyItem,
- GetSelectItem,
- SellItem,
- RepairItem,
- BuyItemBack,
- FindItem,
- PoisonChangaChanged,
- SRepairItem,
- MagicKey,
- Magic,
- SwitchGroup,
- AddMember,
- DellMember,
- GroupInvite,
- TownRevive,
- SpellToggle,
- ConsignItem,
- MarketSearch,
- MarketSearch2,
- ItemAuctionSearch,
- MyAuctionSearch,
- MarketGroupSearch,
- GameShopSearch,
- ExchangeSend,
- MACUpgradeSend,
- ClearMACUpgradeSend,
- DropProtectUpgradeSend,
- BuyGameShopItem,
- MarketRefresh,
- MarketPage,
- MarketBuy,
- MarketGetBack,
- RequestUserName,
- RequestChatItem,
- HookQuestionRespose,
- EditGuildMember,
- GetAllGuild,
- GetAllJoinRequest,
- ResposeJoinGuild,
- RequestJoinGuild,
- EditGuildNotice,
- GuildInvite,
- GuildNameReturn,
- RequestGuildInfo,
- GuildStorageGoldChange,
- GuildStorageItemChange,
- GuildWarReturn,
- MarriageRequest,
- MarriageReply,
- ChangeMarriage,
- ChangeName,
- DivorceRequest,
- DivorceReply,
- AddMentor,
- MentorReply,
- AllowMentor,
- CancelMentor,
- TradeRequest,
- TradeReply,
- TradeGold,
- TradeConfirm,
- TradeCancel,
- EquipSlotItem,
- FishingCast,
- FishingChangeAutocast,
- AcceptQuest,
- FinishQuest,
- AbandonQuest,
- ShareQuest,
- AcceptReincarnation,
- CancelReincarnation,
- CombineItem,
- SetConcentration,
- AwakeningNeedMaterials,
- DropProtectNeedMaterials,
- AwakeningLockedItem,
- Awakening,
- DisassembleItem,
- DowngradeAwakening,
- ResetAddedItem,
- SendMail,
- ReadMail,
- CollectParcel,
- DeleteMail,
- LockMail,
- MailLockedItem,
- MailCost,
- GetAllhp,
- UpdateIntelligentCreature,
- IntelligentCreaturePickup,
- AddFriend,
- AddFriendRespose,
- RemoveFriend,
- RefreshFriends,
- AddMemo,
- GuildBuffUpdate,
- NPCConfirmInput,
- QueryMapNPCs,
- QueryAllMaps,
- GameshopBuy,
- ReportIssue,
- GetRanking,
- Opendoor,
- PayMail,
- RefreshRecipe,
- VersionName,
- UnAwakening,
- InitialItem,
- MoveShield,
- PrepareMoveShield,
- }
- public enum CustomPacketIds : ushort
- {
- Manager = 60001,
- }
- public enum ConquestType : byte
- {
- Request = 0,
- Auto = 1,
- Forced = 2,
- }
- public enum ConquestGame : byte
- {
- CapturePalace = 0,
- KingOfHill = 1,
- Random = 2,
- Classic = 3,
- }
- 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 = 10,
- MinPasswordLength = 5,
- MaxPasswordLength = 12,
- MinCharacterNameLength = 2,
- MaxCharacterNameLength = 8,
- MaxCharacterCount = 4,
- MaxChatLength = 80,
- MaxGroup = 15,
- MaxAttackRange = 9,
- MaxDragonLevel = 13,
- FlagIndexCount = 999,
- MaxConcurrentQuests = 20,
- LogDelay = 0,
- DataRange = 16;//Was 24
- public static float Commission = 0.05F;
- public const uint SearchDelay = 500,
- ConsignmentLength = 7,
- ConsignmentCost = 5000,
- MinConsignment = 10,
- MaxConsignment = 99999999;
- public static ushort[,] HpLevel = {
- {21,26,33,41,48,57,66,76,87,98,110,122,135,150,164,179,195,211,229,246,265,284,304,325,345,367,389,413,437,461,486,512,538,565,593,622,650,680,711,741,773,805,838,872,906,942,977,1013,1051,1090,1130,1170,1210,1250,1290,1330,1370,1410,1450,1490},
- {22,25,28,31,35,38,42,46,50,55,59,63,69,73,78,84,90,95,101,108,113,120,127,134,141,148,155,164,171,179,188,196,204,213,223,231,241,251,260,270,280,290,301,311,322,333,344,356,367,379,391,403,415,427,439,451,463,475,487,499},
- {19,22,25,30,34,39,44,50,55,62,68,75,83,90,98,107,116,124,134,144,154,165,176,187,199,211,223,237,250,263,277,292,306,321,337,352,369,385,402,419,437,454,473,492,510,530,550,570,591,612,633,654,675,696,717,738,759,780,801,822}
- };
- public static ushort[,] MpLevel = {
- {17,20,24,28,32,35,40,43,47,51,55,58,63,66,70,74,78,81,86,89,94,97,101,105,109,112,117,120,124,128,132,135,140,143,147,151,155,158,163,166,171,174,178,182,186,189,194,197,201,205,209,213,217,221,225,229,234,239,244,249},
- {21,28,35,44,53,63,75,87,101,116,132,148,167,185,205,225,247,270,293,319,344,371,399,428,458,489,521,553,588,622,658,695,733,772,812,853,895,938,982,1027,1073,1120,1168,1217,1267,1318,1371,1424,1478,1533,1588,1643,1698,1753,1808,1863,1918,1973,2028,2083},
- {14,15,17,19,22,25,29,34,39,45,51,58,65,74,83,91,101,112,123,135,147,161,174,188,204,219,234,252,268,287,305,325,343,364,385,406,428,451,474,498,523,548,573,600,627,655,682,712,740,771,802,833,864,895,926,957,988,1019,1050,1081}
- };
- public static uint[] WpLevelExp ={
- 60000, 60000, 60000, 90000, 90000, 90000, 90000, 120000, 120000, 120000, 120000,150000, 150000, 150000, 150000, 180000, 420000, 420000, 420000, 480000, 480000, 480000, 480000,
- 540000, 540000, 540000, 540000, 600000, 600000, 600000, 600000, 660000, 660000, 660000, 660000, 720000
- };
- public static Color[] EIColor =
- {
- Color.White,
- Color.FromArgb(255, 240, 180, 100),
- Color.FromArgb(255, 100, 140, 190),
- Color.FromArgb(255, 140, 200, 150),
- Color.FromArgb(255, 50, 70, 200),
- Color.FromArgb(255, 200, 200, 200),
- Color.FromArgb(255, 160, 100, 180),
- Color.FromArgb(255, 200, 220, 130),
- };
- public static string[] OrdMystery = { "神秘头盔(普通)",
- "神秘战戒(普通)",
- "神秘法戒(普通)",
- "神秘道戒(普通)",
- "神秘战镯(普通)",
- "神秘法镯(普通)",
- "神秘道镯(普通)",
- "神秘战链(普通)",
- "神秘法链(普通)",
- "神秘道链(普通)"};
- public static string[] SenMystery = { "神秘头盔(高级)",
- "神秘战戒(高级)",
- "神秘法戒(高级)",
- "神秘道戒(高级)",
- "神秘战镯(高级)",
- "神秘法镯(高级)",
- "神秘道镯(高级)",
- "神秘战链(高级)",
- "神秘法链(高级)",
- "神秘道链(高级)"};
- //保存到数据库的BUFF类型
- public static BuffType[] SaveBuff = { BuffType.Drop ,
- BuffType.Exp,
- BuffType.General,
- BuffType.Transform,
- BuffType.Impact,
- BuffType.Magic,
- BuffType.Taoist,
- BuffType.Storm,
- BuffType.HealthAid,
- BuffType.ManaAid,
- BuffType.Defence,
- BuffType.MagicDefence,
- BuffType.LuckProtector,
- BuffType.Rested,
- BuffType.PowerBlessing,
- BuffType.LadyBlessing
- };
- public static int[] RefinProemolecule = { 500, 100, 20, 5, 5, 3,2,2,2 };
- public static int[] NotRefinIndex = { };
- public static List<MagicLevelPro> Magicelevelps = LoadMagicelevelps();
- public static void SaveMagicelevelps()
- {
- File.WriteAllText("./Configs/Magicelevelps.json", JsonConvert.SerializeObject(Magicelevelps));
- }
- public static List<MagicLevelPro> LoadMagicelevelps()
- {
- if (File.Exists("./Configs/Magicelevelps.json"))
- {
- var str = File.ReadAllText("./Configs/Magicelevelps.json");
- return JsonConvert.DeserializeObject<List<MagicLevelPro>>(str);
- }
- else
- {
- return new List<MagicLevelPro>() ;
- }
- }
- public static ExtraDamageItem[] DamageItems =
- {
- new ExtraDamageItem
- {
- // 黑天暗云 自然系魔法伤害加成 20%
- // type; 1 物理攻击伤害加成 2 自然系魔法伤害加成 3 灵魂系魔法伤害加成 4 攻击双倍伤害 Rate 表示概率 5 灵魂系魔法伤害双倍 Rate 表示概率 6 反弹所收到的5%魔法和物理伤害回敬给对方 106 施加3级施毒术的绿毒效果
- Type = 2,
- ItemIndex=1018,
- Rate=0.2
- }, new ExtraDamageItem
- {
- // 九宫云雾:10%魔法躲避 有14份之一的概率灵魂系攻击双倍伤害
- ItemIndex=1019,
- Type=4,
- Rate=1.0/14.0
- }, new ExtraDamageItem
- {
- // 万里碧海:10%暴击几率 有14份之一的概率攻击双倍伤害
- ItemIndex=1020,
- Type=4,
- Rate=1.0/14.0
- }, new ExtraDamageItem
- {
- // 血花落照:反弹所收到的魔法和物理伤害回敬给对方
- ItemIndex=1017,
- Type=6,
- Rate=0.05
- }
- };
- public static SpecialEffectItem[] SpecialEffects =
- {
- new SpecialEffectItem
- {
- // 血花落照:15%几率给人或怪施加3级施毒术的绿毒效果
- ItemIndex=1017,
- Type=106,
- Rate=0.15
- }
- };
- public static string[] AmulTtpye = { "普通符",
- "火符",
- "冰符",
- "风符",
- "雷符",
- "神圣",
- "暗黑",
- "幻影",};
- }
- public static class Functions
- {
- /// <summary>
- /// 时间戳转为C#格式时间
- /// </summary>
- /// <param name="timeStamp">Unix时间戳格式</param>
- /// <returns>C#格式时间</returns>
- public static DateTime GetTime(string timeStamp)
- {
- DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
- long lTime = long.Parse(timeStamp + "0000000");
- TimeSpan toNow = new TimeSpan(lTime);
- return dtStart.Add(toNow);
- }
- /// <summary>
- /// DateTime时间格式转换为Unix时间戳格式
- /// </summary>
- /// <param name="time"> DateTime时间格式</param>
- /// <returns>Unix时间戳格式</returns>
- public static int ConvertDateTimeInt(System.DateTime time)
- {
- System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1));
- return (int)(time - startTime).TotalSeconds;
- }
- 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 MirDirection leftDirection(MirDirection d)
- {
- switch (d)
- {
- case MirDirection.Up:
- d = MirDirection.UpLeft;
- break;
- case MirDirection.UpRight:
- d = MirDirection.Up;
- break;
- case MirDirection.Right:
- d = MirDirection.UpRight;
- break;
- case MirDirection.DownRight:
- d = MirDirection.Right;
- break;
- case MirDirection.Down:
- d = MirDirection.DownRight;
- break;
- case MirDirection.DownLeft:
- d = MirDirection.Down;
- break;
- case MirDirection.Left:
- d = MirDirection.DownLeft;
- break;
- case MirDirection.UpLeft:
- d = MirDirection.Left;
- break;
- }
- return d;
- }
- public static string ToArrow1(this MirDirection dir)
- {
- switch (dir)
- {
- case MirDirection.Up:
- return "↑";
- case MirDirection.UpRight:
- return "↗";
- case MirDirection.Right:
- return "→";
- case MirDirection.DownRight:
- return "↘";
- case MirDirection.Down:
- return "↓";
- case MirDirection.DownLeft:
- return "↙";
- case MirDirection.Left:
- return "←";
- case MirDirection.UpLeft:
- return "↖";
- default:
- return "㊥";
- }
- }
- public static string ToArrow(this MirDirection dir)
- {
- switch (dir)
- {
- case MirDirection.Up:
- return "正上↑";
- case MirDirection.UpRight:
- return "左上↗";
- case MirDirection.Right:
- return "正右→";
- case MirDirection.DownRight:
- return "左下↘";
- case MirDirection.Down:
- return "正下↓";
- case MirDirection.DownLeft:
- return "左下↙";
- case MirDirection.Left:
- return "正左←";
- case MirDirection.UpLeft:
- return "左上↖";
- default:
- return "正中㊥";
- }
- }
- public static MirDirection GetGlobalDirection(Point source, Point target)
- {
- var offset=source.Subtract(target);
- if (target.X>0)
- {
- if (target.Y>0)
- {
- return MirDirection.UpLeft;
- }
- else if (target.Y<0)
- {
- return MirDirection.DownLeft;
- }
- else
- {
- return MirDirection.Left;
- }
- }
- else if (target.X < 0)
- {
- if (target.Y > 0)
- {
- return MirDirection.UpRight;
- }
- else if (target.Y < 0)
- {
- return MirDirection.DownRight;
- }
- else
- {
- return MirDirection.Right;
- }
- }
- else
- {
- if (target.Y > 0)
- {
- return MirDirection.Up;
- }
- else
- {
- return MirDirection.Down;
- }
- }
-
- }
- public static MirDirection rightDirection(MirDirection d) //找到方向的朝右边上方方向
- {
- switch (d)
- {
- case MirDirection.Up:
- d = MirDirection.UpRight;
- break;
- case MirDirection.UpRight:
- d = MirDirection.Right;
- break;
- case MirDirection.Right:
- d = MirDirection.DownRight;
- break;
- case MirDirection.DownRight:
- d = MirDirection.Down;
- break;
- case MirDirection.Down:
- d = MirDirection.DownLeft;
- break;
- case MirDirection.DownLeft:
- d = MirDirection.Left;
- break;
- case MirDirection.Left:
- d = MirDirection.UpLeft;
- break;
- case MirDirection.UpLeft:
- d = MirDirection.Up;
- break;
- }
- return d;
- }
- public static MirDirection rightRowDirection(MirDirection d)
- {
- switch (d)
- {
- case MirDirection.Up:
- d = MirDirection.Right;
- break;
- case MirDirection.UpRight:
- d = MirDirection.DownRight;
- break;
- case MirDirection.Right:
- d = MirDirection.Down;
- break;
- case MirDirection.DownRight:
- d = MirDirection.DownLeft;
- break;
- case MirDirection.Down:
- d = MirDirection.Left;
- break;
- case MirDirection.DownLeft:
- d = MirDirection.UpLeft;
- break;
- case MirDirection.Left:
- d = MirDirection.Up;
- break;
- case MirDirection.UpLeft:
- d = MirDirection.UpRight;
- break;
- }
- return d;
- }
- public static MirDirection leftRowDirection(MirDirection d)
- {
- switch (d)
- {
- case MirDirection.Up:
- d = MirDirection.Left;
- break;
- case MirDirection.UpRight:
- d = MirDirection.UpLeft;
- break;
- case MirDirection.Right:
- d = MirDirection.Up;
- break;
- case MirDirection.DownRight:
- d = MirDirection.UpRight;
- break;
- case MirDirection.Down:
- d = MirDirection.Right;
- break;
- case MirDirection.DownLeft:
- d = MirDirection.DownRight;
- break;
- case MirDirection.Left:
- d = MirDirection.Down;
- break;
- case MirDirection.UpLeft:
- d = MirDirection.DownLeft;
- break;
- }
- return d;
- }
- 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 static short MaxMineimac(short num)
- {
- if (num >= 5)
- return 5;
- else if (num <= -5)
- return -5;
- else
- return num;
- }
- public static List<MagicLevelPro> FindSpellPro(int index)
- {
- List<MagicLevelPro> templist = new List<MagicLevelPro>();
- for (int i = 0; i < Globals.Magicelevelps.Count; i++)
- {
- if (Globals.Magicelevelps[i].Itemindex == index)
- templist.Add(Globals.Magicelevelps[i]);
- }
- return templist;
- }
- public static ExtraDamageItem FindDamageItem(int index)
- {
- foreach (ExtraDamageItem item in Globals.DamageItems)
- {
- if (item.ItemIndex == index)
- return item;
- }
- return null;
- }
- public static SpecialEffectItem FindEffectItem(int index)
- {
- foreach (SpecialEffectItem item in Globals.SpecialEffects)
- {
- if (item.ItemIndex == index)
- return item;
- }
- return null;
- }
- }
- // 附加属性 -- 直接给角色属性做加成
- public class ExtraDamageItem
- {
- public int ItemIndex;
- public double Rate;
- public byte Type;
- }
- // 特殊效果 -- 在特定条件下触发
- public class SpecialEffectItem
- {
- public int ItemIndex;
- public double Rate;
- public byte Type;
- }
- public class IgnoreItem
- {
- public int Itemindex;
- public byte IgnoreACnum;
- public byte IgnoreMACnum;
- }
- public class MagicLevelPro
- {
- public Spell Spell;
- public int Itemindex;
- public byte LevelPro;
- }
- public class SelectInfo
- {
- public int Index;
- public string Name = string.Empty;
- public ushort Level;
- public MirClass Class;
- public MirGender Gender;
- public DateTime LastAccess;
- public string LocationDown;
- 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());
- LocationDown = reader.ReadString();
- }
- 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());
- writer.Write(LocationDown);
- }
- }
- 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 int 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 short FireAC, WindAC, IceAC, LightAC, HolyAC, DarkAC, PhantomAC;
- public short FireMAC, WindMAC, IceMAC, LightMAC, HolyMAC, DarkMAC, PhantomMAC;
- public ushort HP, MP;
- public sbyte AttackSpeed, Luck;
- public short 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;
- 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,Parry,IgnoreAC,IgnoreMAC;
- public SpecialItemMode Unique = SpecialItemMode.None;
- public byte RandomStatsId;
- public RandomItemStat RandomStats;
- public string ToolTip = string.Empty;
- public byte HideMinAC, HideMaxAC, HideMinMAC, HideMaxMAC, HideMinDC, HideMaxDC, HideMinMC, HideMaxMC, HideMinSC, HideMaxSC, HideAccuracy, HideAgility;
- public byte HideMagicResist, HidePoisonResist, HideHealthRecovery, HideSpellRecovery, HidePoisonRecovery;
- public byte HideMaxAcRate, HideMaxMacRate, HideHoly, HideFreezing, HidePoisonAttack, HideHpDrainRate;
- public byte HideCriticalRate, HideCriticalDamage;
- public short HideFireAC, HideWindAC, HideIceAC, HideLightAC, HideHolyAC, HideDarkAC, HidePhantomAC;
- public short HideFireMAC, HideWindMAC, HideIceMAC, HideLightMAC, HideHolyMAC, HideDarkMAC, HidePhantomMAC;
- public sbyte HideAttackSpeed, HideLuck;
- public byte HideStrong, HideReflect,HideParry, HideIgnoreAC, HideIgnoreMAC;
- public byte Bt;
- public bool IsConsumable
- {
- get { return Type == ItemType.Potion || Type == ItemType.Scroll || Type == ItemType.Food || Type == ItemType.Transform; }
- }
- 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(MySqlDataReader readerItemInfo)
- {
- Index = Convert.ToInt32(readerItemInfo["IndexID"]);
- Name = readerItemInfo["Name"].ToString();
- Type = (ItemType)Convert.ToByte(readerItemInfo["Type"]);
- Grade = (ItemGrade)Convert.ToUInt16(readerItemInfo["Grade"]);
- RequiredType = (RequiredType)Convert.ToByte(readerItemInfo["RequiredType"]);
- RequiredClass = (RequiredClass)Convert.ToByte(readerItemInfo["RequiredClass"]);
- RequiredGender = (RequiredGender)Convert.ToByte(readerItemInfo["RequiredGender"]);
- Set = (int)Convert.ToByte(readerItemInfo["Set_"]);
- Shape = Convert.ToInt16(readerItemInfo["Shape"]);
- Weight = Convert.ToByte(readerItemInfo["Weight"]);
- Light = Convert.ToByte(readerItemInfo["Light"]);
- RequiredAmount = Convert.ToByte(readerItemInfo["RequiredAmount"]);
- Image = Convert.ToUInt16(readerItemInfo["Image"]);
- Durability = Convert.ToUInt16(readerItemInfo["Durability"]);
- StackSize = Convert.ToUInt32(readerItemInfo["StackSize"]);
- Price = Convert.ToUInt32(readerItemInfo["Price"]);
- MinAC = Convert.ToByte(readerItemInfo["MinAC"]);
- MaxAC = Convert.ToByte(readerItemInfo["MaxAC"]);
- MinMAC = Convert.ToByte(readerItemInfo["MinMAC"]);
- MaxMAC = Convert.ToByte(readerItemInfo["MaxMAC"]);
- MinDC = Convert.ToByte(readerItemInfo["MinDC"]);
- MaxDC = Convert.ToByte(readerItemInfo["MaxDC"]);
- MinMC = Convert.ToByte(readerItemInfo["MinMC"]);
- MaxMC = Convert.ToByte(readerItemInfo["MaxMC"]);
- MinSC = Convert.ToByte(readerItemInfo["MinSC"]);
- MaxSC = Convert.ToByte(readerItemInfo["MaxSC"]);
- HP = Convert.ToUInt16(readerItemInfo["HP"]);
- MP = Convert.ToUInt16(readerItemInfo["MP"]);
- Accuracy = Convert.ToByte(readerItemInfo["Accuracy"]);
- Agility = Convert.ToByte(readerItemInfo["Agility"]);
- FireAC = Convert.ToInt16(readerItemInfo["FireAC"]);
- WindAC = Convert.ToInt16(readerItemInfo["WindAC"]);
- IceAC = Convert.ToInt16(readerItemInfo["IceAC"]);
- LightAC = Convert.ToInt16(readerItemInfo["LightAC"]);
- HolyAC = Convert.ToInt16(readerItemInfo["HolyAC"]);
- DarkAC = Convert.ToInt16(readerItemInfo["DarkAC"]);
- PhantomAC = Convert.ToInt16(readerItemInfo["PhantomAC"]);
- FireMAC = Convert.ToInt16(readerItemInfo["FireMAC"]);
- WindMAC = Convert.ToInt16(readerItemInfo["WindMAC"]);
- IceMAC = Convert.ToInt16(readerItemInfo["IceMAC"]);
- LightMAC = Convert.ToInt16(readerItemInfo["LightMAC"]);
- HolyMAC = Convert.ToInt16(readerItemInfo["HolyMAC"]);
- DarkMAC = Convert.ToInt16(readerItemInfo["DarkMAC"]);
- PhantomMAC = Convert.ToInt16(readerItemInfo["PhantomMAC"]);
- Luck = Convert.ToSByte(readerItemInfo["Luck"]);
- AttackSpeed = Convert.ToSByte(readerItemInfo["AttackSpeed"]);
- StartItem = Convert.ToBoolean(readerItemInfo["StartItem"]);
- BagWeight = Convert.ToInt16(readerItemInfo["BagWeight"]);
- HandWeight = Convert.ToInt16(readerItemInfo["HandWeight"]);
- WearWeight = Convert.ToInt16(readerItemInfo["WearWeight"]);
- Effect = Convert.ToByte(readerItemInfo["Effect"]);
- Strong = Convert.ToByte(readerItemInfo["Strong"]);
- MagicResist = Convert.ToByte(readerItemInfo["MagicResist"]);
- PoisonResist = Convert.ToByte(readerItemInfo["PoisonResist"]);
- HealthRecovery = Convert.ToByte(readerItemInfo["HealthRecovery"]);
- SpellRecovery = Convert.ToByte(readerItemInfo["SpellRecovery"]);
- PoisonRecovery = Convert.ToByte(readerItemInfo["PoisonRecovery"]);
- HPrate = Convert.ToByte(readerItemInfo["HPrate"]);
- MPrate = Convert.ToByte(readerItemInfo["MPrate"]);
- CriticalRate = Convert.ToByte(readerItemInfo["CriticalRate"]);
- CriticalDamage = Convert.ToByte(readerItemInfo["CriticalDamage"]);
- NeedIdentify = Convert.ToBoolean(readerItemInfo["NeedIdentify"]);
- ShowGroupPickup = Convert.ToBoolean(readerItemInfo["ShowGroupPickup"]);
- ClassBased = Convert.ToBoolean(readerItemInfo["ClassBased"]);
- LevelBased = Convert.ToBoolean(readerItemInfo["LevelBased"]);
- CanMine = Convert.ToBoolean(readerItemInfo["CanMine"]);
- MaxAcRate = Convert.ToByte(readerItemInfo["MaxAcRate"]);
- MaxMacRate = Convert.ToByte(readerItemInfo["MaxMacRate"]);
- Holy = Convert.ToByte(readerItemInfo["Holy"]);
- Freezing = Convert.ToByte(readerItemInfo["Freezing"]);
- PoisonAttack = Convert.ToByte(readerItemInfo["PoisonAttack"]);
- Bind = (BindMode)Convert.ToUInt16(readerItemInfo["Bind"]);
- Reflect = Convert.ToByte(readerItemInfo["Reflect"]);
- Parry = Convert.ToByte(readerItemInfo["Parry"]);
- HideParry = Convert.ToByte(readerItemInfo["HideParry"]);
- IgnoreAC = Convert.ToByte(readerItemInfo["IgnoreAC"]);
- HideIgnoreAC = Convert.ToByte(readerItemInfo["HideIgnoreAC"]);
- IgnoreMAC = Convert.ToByte(readerItemInfo["IgnoreMAC"]);
- HideIgnoreMAC = Convert.ToByte(readerItemInfo["HideIgnoreMAC"]);
- HpDrainRate = Convert.ToByte(readerItemInfo["HpDrainRate"]);
- Unique = (SpecialItemMode)Convert.ToUInt16(readerItemInfo["Unique_"]);
- RandomStatsId = Convert.ToByte(readerItemInfo["RandomStatsId"]);
- CanFastRun = Convert.ToBoolean(readerItemInfo["CanFastRun"]);
- CanAwakening = Convert.ToBoolean(readerItemInfo["CanAwakening"]);
- // RandomStats = (RandomItemStat)readerItemInfo["RandomStats"];
- ToolTip = readerItemInfo["ToolTip"].ToString();
- //if ((readerItemInfo != null) && (RandomStatsId < Server.Settings.RandomItemStatsList.Count))
- //{
- // RandomStats = Server.Settings.RandomItemStatsList[RandomStatsId];
- //}
- HideMinAC = Convert.ToByte(readerItemInfo["HideMinAC"]);
- HideMaxAC = Convert.ToByte(readerItemInfo["HideMaxAC"]);
- HideMinMAC = Convert.ToByte(readerItemInfo["HideMinMAC"]);
- HideMaxMAC = Convert.ToByte(readerItemInfo["HideMaxMAC"]);
- HideMinDC = Convert.ToByte(readerItemInfo["HideMinDC"]);
- HideMaxDC = Convert.ToByte(readerItemInfo["HideMaxDC"]);
- HideMinMC = Convert.ToByte(readerItemInfo["HideMinMC"]);
- HideMaxMC = Convert.ToByte(readerItemInfo["HideMaxMC"]);
- HideMinSC = Convert.ToByte(readerItemInfo["HideMinSC"]);
- HideMaxSC = Convert.ToByte(readerItemInfo["HideMaxSC"]);
- HideAccuracy = Convert.ToByte(readerItemInfo["HideAccuracy"]);
- HideAgility = Convert.ToByte(readerItemInfo["HideAgility"]);
- HideFireAC = Convert.ToInt16(readerItemInfo["HideFireAC"]);
- HideWindAC = Convert.ToInt16(readerItemInfo["HideWindAC"]);
- HideIceAC = Convert.ToInt16(readerItemInfo["HideIceAC"]);
- HideLightAC = Convert.ToInt16(readerItemInfo["HideLightAC"]);
- HideHolyAC = Convert.ToInt16(readerItemInfo["HideHolyAC"]);
- HideDarkAC = Convert.ToInt16(readerItemInfo["HideDarkAC"]);
- HidePhantomAC = Convert.ToInt16(readerItemInfo["HidePhantomAC"]);
- HideFireMAC = Convert.ToInt16(readerItemInfo["HideFireMAC"]);
- HideWindMAC = Convert.ToInt16(readerItemInfo["HideWindMAC"]);
- HideIceMAC = Convert.ToInt16(readerItemInfo["HideIceMAC"]);
- HideLightMAC = Convert.ToInt16(readerItemInfo["HideLightMAC"]);
- HideHolyMAC = Convert.ToInt16(readerItemInfo["HideHolyMAC"]);
- HideDarkMAC = Convert.ToInt16(readerItemInfo["HideDarkMAC"]);
- HidePhantomMAC = Convert.ToInt16(readerItemInfo["HidePhantomMAC"]);
- HideMagicResist = Convert.ToByte(readerItemInfo["HideMagicResist"]);
- HidePoisonResist = Convert.ToByte(readerItemInfo["HidePoisonResist"]);
- HideHealthRecovery = Convert.ToByte(readerItemInfo["HideHealthRecovery"]);
- HideSpellRecovery = Convert.ToByte(readerItemInfo["HideSpellRecovery"]);
- HidePoisonRecovery = Convert.ToByte(readerItemInfo["HidePoisonRecovery"]);
- HideMaxAcRate = Convert.ToByte(readerItemInfo["HideMaxAcRate"]);
- HideHpDrainRate = Convert.ToByte(readerItemInfo["HideHpDrainRate"]);
- HideMaxMacRate = Convert.ToByte(readerItemInfo["HideMaxMacRate"]);
- HideHoly = Convert.ToByte(readerItemInfo["HideHoly"]);
- HideFreezing = Convert.ToByte(readerItemInfo["HideFreezing"]);
- HidePoisonAttack = Convert.ToByte(readerItemInfo["HidePoisonAttack"]);
- HideCriticalRate = Convert.ToByte(readerItemInfo["HideCriticalRate"]);
- HideCriticalDamage = Convert.ToByte(readerItemInfo["HideCriticalDamage"]);
- HideLuck = Convert.ToSByte(readerItemInfo["HideLuck"]);
- HideAttackSpeed = Convert.ToSByte(readerItemInfo["HideAttackSpeed"]);
- HideStrong = Convert.ToByte(readerItemInfo["HideStrong"]);
- HideReflect = Convert.ToByte(readerItemInfo["HideReflect"]);
- Bt = Convert.ToByte(readerItemInfo["Bt"]);
- }
- public ItemInfo(BinaryReader reader, int version = int.MaxValue, int Customversion = int.MaxValue)
- {
- Index = reader.ReadInt32();
- Name = reader.ReadString(); //1
- Type = (ItemType)reader.ReadByte(); //2
- if (version >= 40) Grade = (ItemGrade)reader.ReadByte(); //3
- RequiredType = (RequiredType)reader.ReadByte();
- RequiredClass = (RequiredClass)reader.ReadByte();
- RequiredGender = (RequiredGender)reader.ReadByte();
- if (version >= 17) Set = (int)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();
- FireAC = reader.ReadInt16();
- WindAC = reader.ReadInt16();
- IceAC = reader.ReadInt16();
- LightAC = reader.ReadInt16();
- HolyAC = reader.ReadInt16();
- DarkAC = reader.ReadInt16();
- PhantomAC = reader.ReadInt16();
- FireMAC = reader.ReadInt16();
- WindMAC = reader.ReadInt16();
- IceMAC = reader.ReadInt16();
- LightMAC = reader.ReadInt16();
- HolyMAC = reader.ReadInt16();
- DarkMAC = reader.ReadInt16();
- PhantomMAC = reader.ReadInt16();
- Luck = reader.ReadSByte();
- AttackSpeed = reader.ReadSByte();
- StartItem = reader.ReadBoolean();
- BagWeight = reader.ReadInt16();
- HandWeight = reader.ReadInt16();
- WearWeight = reader.ReadInt16();
- 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;
- 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;
- }
- Parry=reader.ReadByte();
- IgnoreAC=reader.ReadByte();
- IgnoreMAC=reader.ReadByte();
- }
- 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(FireAC);
- writer.Write(WindAC);
- writer.Write(IceAC);
- writer.Write(LightAC);
- writer.Write(HolyAC);
- writer.Write(DarkAC);
- writer.Write(PhantomAC);
- writer.Write(FireMAC);
- writer.Write(WindMAC);
- writer.Write(IceMAC);
- writer.Write(LightMAC);
- writer.Write(HolyMAC);
- writer.Write(DarkMAC);
- writer.Write(PhantomMAC);
- 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;
- 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);
- writer.Write(Parry);
- writer.Write(IgnoreAC);
- writer.Write(IgnoreMAC);
- }
- 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 (!int.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 (!short.TryParse(data[23], out info.FireAC)) return null;
- if (!short.TryParse(data[24], out info.WindAC)) return null;
- if (!short.TryParse(data[25], out info.IceAC)) return null;
- if (!short.TryParse(data[26], out info.LightAC)) return null;
- if (!short.TryParse(data[27], out info.HolyAC)) return null;
- if (!short.TryParse(data[28], out info.DarkAC)) return null;
- if (!short.TryParse(data[29], out info.PhantomAC)) return null;
- if (!short.TryParse(data[30], out info.FireMAC)) return null;
- if (!short.TryParse(data[31], out info.WindMAC)) return null;
- if (!short.TryParse(data[32], out info.IceMAC)) return null;
- if (!short.TryParse(data[33], out info.LightMAC)) return null;
- if (!short.TryParse(data[34], out info.HolyMAC)) return null;
- if (!short.TryParse(data[35], out info.DarkMAC)) return null;
- if (!short.TryParse(data[36], out info.PhantomMAC)) return null;
- if (!ushort.TryParse(data[37], out info.HP)) return null;
- if (!ushort.TryParse(data[38], out info.MP)) return null;
- if (!sbyte.TryParse(data[39], out info.AttackSpeed)) return null;
- if (!sbyte.TryParse(data[40], out info.Luck)) return null;
- if (!short.TryParse(data[41], out info.BagWeight)) return null;
- if (!short.TryParse(data[42], out info.HandWeight)) return null;
- if (!short.TryParse(data[43], out info.WearWeight)) return null;
- if (!bool.TryParse(data[44], out info.StartItem)) return null;
- if (!ushort.TryParse(data[45], out info.Image)) return null;
- if (!ushort.TryParse(data[46], out info.Durability)) return null;
- if (!uint.TryParse(data[47], out info.Price)) return null;
- if (!uint.TryParse(data[48], out info.StackSize)) return null;
- if (!byte.TryParse(data[49], out info.Effect)) return null;
- if (!byte.TryParse(data[50], out info.Strong)) return null;
- if (!byte.TryParse(data[51], out info.MagicResist)) return null;
- if (!byte.TryParse(data[52], out info.PoisonResist)) return null;
- if (!byte.TryParse(data[53], out info.HealthRecovery)) return null;
- if (!byte.TryParse(data[54], out info.SpellRecovery)) return null;
- if (!byte.TryParse(data[55], out info.PoisonRecovery)) return null;
- if (!byte.TryParse(data[56], out info.HPrate)) return null;
- if (!byte.TryParse(data[57], out info.MPrate)) return null;
- if (!byte.TryParse(data[58], out info.CriticalRate)) return null;
- if (!byte.TryParse(data[59], out info.CriticalDamage)) return null;
- if (!bool.TryParse(data[60], out info.NeedIdentify)) return null;
- if (!bool.TryParse(data[61], out info.ShowGroupPickup)) return null;
- if (!byte.TryParse(data[62], out info.MaxAcRate)) return null;
- if (!byte.TryParse(data[63], out info.MaxMacRate)) return null;
- if (!byte.TryParse(data[64], out info.Holy)) return null;
- if (!byte.TryParse(data[65], out info.Freezing)) return null;
- if (!byte.TryParse(data[66], out info.PoisonAttack)) return null;
- if (!bool.TryParse(data[67], out info.ClassBased)) return null;
- if (!bool.TryParse(data[68], out info.LevelBased)) return null;
- if (!Enum.TryParse(data[69], out info.Bind)) return null;
- if (!byte.TryParse(data[70], out info.Reflect)) return null;
- if (!byte.TryParse(data[71], out info.HpDrainRate)) return null;
- if (!Enum.TryParse(data[72], out info.Unique)) return null;
- if (!byte.TryParse(data[73], out info.RandomStatsId)) return null;
- if (!bool.TryParse(data[74], out info.CanMine)) return null;
- if (!bool.TryParse(data[75], out info.CanFastRun)) return null;
- if (!bool.TryParse(data[76], out info.CanAwakening)) return null;
- if (!byte.TryParse(data[77], out info.Parry)) return null;
- if (!byte.TryParse(data[78], out info.HideParry)) return null;
- if (!byte.TryParse(data[79], out info.IgnoreAC)) return null;
- if (!byte.TryParse(data[80], out info.HideIgnoreAC)) return null;
- if (!byte.TryParse(data[81], out info.IgnoreMAC)) return null;
- if (!byte.TryParse(data[82], out info.HideIgnoreMAC)) return null;
- if (data[83] == "-")
- info.ToolTip = "";
- else
- {
- info.ToolTip = data[83];
- 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},{64},{65},{66},{67},{68},{69},{70},{71},{72},{73},{74},{75},{76},{77}",
- 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, FireAC, WindAC, IceAC, LightAC, HolyAC, DarkAC, PhantomAC, FireMAC, WindMAC, IceMAC, LightMAC, HolyMAC, DarkMAC, PhantomMAC, 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,Parry,HideParry,IgnoreAC,HideIgnoreAC,IgnoreMAC,HideIgnoreMAC, TransToolTip);
- }
- public Color GetNameColor()
- {
- if (Grade == ItemGrade.None)
- return Color.DarkGray;
- if (Grade == ItemGrade.高级)
- return Color.DeepSkyBlue;
- if (Grade == ItemGrade.稀有)
- return Color.DarkOrange;
- if (Grade == ItemGrade.神器)
- return Color.Fuchsia;
- if (Grade == ItemGrade.一般)
- return Color.Lime;
- return Color.White;
- }
- public override string ToString()
- {
- //return string.Format("{0}: {1}", Index, Name);
- return Name;
- }
- }
- public class UserItem
- {
- public ulong UniqueID;
- public int ItemIndex;
- public ItemInfo Info;
- public int CurrentDura, MaxDura;
- public string Store;
- public int InitialPosition;
- 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, Reflect, MaxAcRate, MaxMacRate,Parry,IgnoreAC,IgnoreMAC;
- public byte HideAC, HideMAC, HideDC, HideMC, HideSC, HideAccuracy, HideAgility;
- public byte BagWeight, WearWeight, HandWeight;
- public short FireAC, WindAC, IceAC, LightAC, HolyAC, DarkAC, PhantomAC;
- public short FireMAC, WindMAC, IceMAC, LightMAC, HolyMAC, DarkMAC, PhantomMAC;
- public int DropProtect;
- //装备颜色
- public byte IR;
- public byte IG;
- public byte IB;
- public uint WpLevelExp;
- 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 ulong Attached;
- public bool IsAttached = false;
- public int AwakeType;
- public bool IsAwake = false;
- public UserItem[] Slots = new UserItem[5];
- public DateTime ExpiryDate;
- public DateTime BuybackExpiryDate;
- public ExpireInfo ExpireInfo;
- public string MakeName;
- public short Make;
- public int SuperRefineLevel;
- public DateTime DropProtectTick;
- 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 || Reflect != 0 || MaxMacRate != 0 || MaxMacRate != 0 ||
- FireAC != 0 || WindAC != 0 || IceAC != 0 || LightAC != 0 || HolyAC != 0 || DarkAC != 0 || PhantomAC != 0 ||
- FireMAC != 0 || WindMAC != 0 || IceMAC != 0 || LightMAC != 0 || HolyMAC != 0 || DarkMAC != 0 || PhantomMAC != 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()
- {
- }
- 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.ReadInt32();
- MaxDura = reader.ReadInt32();
- Count = reader.ReadUInt32();
- AC = reader.ReadByte();
- MAC = reader.ReadByte();
- DC = reader.ReadByte();
- MC = reader.ReadByte();
- SC = reader.ReadByte();
- Accuracy = reader.ReadByte();
- Agility = reader.ReadByte();
- BagWeight = reader.ReadByte();
- WearWeight = reader.ReadByte();
- HandWeight = reader.ReadByte();
- FireAC = reader.ReadInt16();
- WindAC = reader.ReadInt16();
- IceAC = reader.ReadInt16();
- LightAC = reader.ReadInt16();
- HolyAC = reader.ReadInt16();
- DarkAC = reader.ReadInt16();
- PhantomAC = reader.ReadInt16();
- FireMAC = reader.ReadInt16();
- WindMAC = reader.ReadInt16();
- IceMAC = reader.ReadInt16();
- LightMAC = reader.ReadInt16();
- HolyMAC = reader.ReadInt16();
- DarkMAC = reader.ReadInt16();
- PhantomMAC = reader.ReadInt16();
- //装备颜色
- IR = reader.ReadByte();
- IG = reader.ReadByte();
- IB = reader.ReadByte();
- WpLevelExp = reader.ReadUInt32();
- 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();
- 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);
- }
- HideAC = reader.ReadByte();
- HideMAC = reader.ReadByte();
- HideDC = reader.ReadByte();
- HideMC = reader.ReadByte();
- HideSC = reader.ReadByte();
- HideAccuracy = reader.ReadByte();
- HideAgility = reader.ReadByte();
- Reflect = reader.ReadByte();
- MaxAcRate = reader.ReadByte();
- MaxMacRate = reader.ReadByte();
- MakeName = reader.ReadString();
- Make = reader.ReadInt16();
- Parry=reader.ReadByte();
- IgnoreAC=reader.ReadByte();
- IgnoreMAC=reader.ReadByte();
- DropProtect=reader.ReadInt32();
- SuperRefineLevel=reader.ReadInt32();
- }
- 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(BagWeight);
- writer.Write(WearWeight);
- writer.Write(HandWeight);
- writer.Write(FireAC);
- writer.Write(WindAC);
- writer.Write(IceAC);
- writer.Write(LightAC);
- writer.Write(HolyAC);
- writer.Write(DarkAC);
- writer.Write(PhantomAC);
- writer.Write(FireMAC);
- writer.Write(WindMAC);
- writer.Write(IceMAC);
- writer.Write(LightMAC);
- writer.Write(HolyMAC);
- writer.Write(DarkMAC);
- writer.Write(PhantomMAC);
- writer.Write(IR);
- writer.Write(IG);
- writer.Write(IB);
- writer.Write(WpLevelExp);
- 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);
- 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);
- if (ExpireInfo != null)
- {
- ExpireInfo.Save(writer);
- }
- writer.Write(HideAC);
- writer.Write(HideMAC);
- writer.Write(HideDC);
- writer.Write(HideMC);
- writer.Write(HideSC);
- writer.Write(HideAccuracy);
- writer.Write(HideAgility);
- writer.Write(Reflect);
- writer.Write(MaxAcRate);
- writer.Write(MaxMacRate);
- if (MakeName == null)
- {
- writer.Write("null");
- }
- else
- {
- writer.Write(MakeName);
- }
- writer.Write((short)Make);
- writer.Write(Parry);
- writer.Write(IgnoreAC);
- writer.Write(IgnoreMAC);
- writer.Write(DropProtect);
- writer.Write(SuperRefineLevel);
- }
- public uint Price()
- {
- if (Info == null) return 0;
- uint p = Info.Price;
- if (Info.Durability > 0&&Info.Type!=ItemType.Potion)
- {
- 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;
- uint 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));
- }
- return (p * Count) - Price();
- }
- 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)
- {
- 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;
- }
- return Info.Image;
- }
- }
- public UserItem Clone()
- {
- UserItem item = new UserItem(Info)
- {
- UniqueID = UniqueID,
- CurrentDura = CurrentDura,
- MaxDura = MaxDura,
- Count = Count,
- AC = AC,
- MAC = MAC,
- DC = DC,
- MC = MC,
- SC = SC,
- Accuracy = Accuracy,
- Agility = Agility,
- BagWeight = BagWeight,
- WearWeight = WearWeight,
- HandWeight = HandWeight,
- FireAC = FireAC,
- WindAC = WindAC,
- IceAC = IceAC,
- LightAC = LightAC,
- HolyAC = HolyAC,
- DarkAC = DarkAC,
- PhantomAC = PhantomAC,
- FireMAC = FireMAC,
- WindMAC = WindMAC,
- IceMAC = IceMAC,
- LightMAC = LightMAC,
- HolyMAC = HolyMAC,
- DarkMAC = DarkMAC,
- PhantomMAC = PhantomMAC,
- IR = IR,
- IG = IG,
- IB = IB,
- WpLevelExp = WpLevelExp,
- 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,
- AwakeType = AwakeType,
- RefinedValue = RefinedValue,
- RefineAdded = RefineAdded,
- Reflect = Reflect,
- MaxMacRate = MaxMacRate,
- MaxAcRate = MaxAcRate,
- ExpireInfo = ExpireInfo,
- MakeName = MakeName,
- Make = Make,
- Parry=Parry,
- IgnoreAC=IgnoreAC,
- IgnoreMAC=IgnoreMAC,
- DropProtect= DropProtect,
- SuperRefineLevel=SuperRefineLevel
- };
- return item;
- }
- public void Resetstat()
- {
- AC = MAC = DC = MC = SC = Accuracy = Agility = HP = MP = Strong = MagicResist = PoisonResist = 0;
- AttackSpeed = Luck = 0;
- HealthRecovery = ManaRecovery = PoisonRecovery = CriticalRate = CriticalDamage = Freezing = PoisonAttack = 0;
- FireAC = WindAC = IceAC = LightAC = HolyAC = DarkAC = PhantomAC = 0;
- FireMAC = WindMAC = IceMAC = LightMAC = HolyMAC = DarkMAC = PhantomMAC = 0;
- BagWeight = WearWeight = HandWeight = 0;
- HideAC = HideMAC = HideDC = HideMC = HideSC = HideAccuracy = HideAgility = 0;
- BagWeight = WearWeight = HandWeight = 0;
- AwakeType = 0;
- RefineAdded = 0;
- IR = IG = IB = 0;
- SuperRefineLevel = 0;
- WpLevelExp = 0;
- Luck = 0;
- }
- public void Resetstatwp()
- {
- AC = MAC = DC = MC = SC = 0;
- // AttackSpeed = Luck = 0;
- FireAC = WindAC = IceAC = LightAC = HolyAC = DarkAC = PhantomAC = 0;
- FireMAC = WindMAC = IceMAC = LightMAC = HolyMAC = DarkMAC = PhantomMAC = 0;
- BagWeight = WearWeight = HandWeight = 0;
- HideAC = HideMAC = HideDC = HideMC = HideSC = HideAccuracy = HideAgility = 0;
- BagWeight = WearWeight = HandWeight = 0;
- IR = IG = IB = 0;
- SuperRefineLevel = 0;
- WpLevelExp = 0;
- }
- public void ReinfinResetstat()
- {
- Accuracy = 0;
- CriticalRate = PoisonResist = PoisonRecovery = CriticalDamage = Freezing = PoisonAttack = Reflect = MaxAcRate = MaxMacRate = 0;
- HealthRecovery = ManaRecovery = 0;
- RefineAdded = HP = 0;
- Parry = Reflect = IgnoreAC = IgnoreMAC = 0;
- }
- public void ReinfinClone(UserItem temp)
- {
- Accuracy = temp.Accuracy;
- CriticalRate = temp.CriticalRate;
- PoisonResist = temp.PoisonResist;
- PoisonRecovery = temp.PoisonRecovery;
- CriticalDamage = temp.CriticalDamage;
- Freezing = temp.Freezing;
- PoisonAttack = temp.PoisonAttack;
- Reflect = temp.Reflect;
- HealthRecovery = temp.HealthRecovery;
- ManaRecovery = temp.ManaRecovery;
- MaxAcRate = temp.MaxAcRate;
- MaxMacRate = temp.MaxMacRate;
- RefineAdded = temp.RefineAdded;
- HP = temp.HP;
- }
- }
- 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 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(MySqlDataReader readerGameShopItem)
- //{
- // ItemIndex = Convert.ToInt32(readerGameShopItem["ItemIndex"]);
- // GIndex = Convert.ToInt32(readerGameShopItem["GIndex"]);
- // GoldPrice = Convert.ToUInt32(readerGameShopItem["GoldPrice"]);
- // CreditPrice = Convert.ToUInt32(readerGameShopItem["CreditPrice"]);
- // Count = Convert.ToUInt32(readerGameShopItem["Count"]);
- // Class = readerGameShopItem["Class"].ToString();
- // Category = readerGameShopItem["Category"].ToString();
- // Stock = Convert.ToInt32(readerGameShopItem["Stock"]);
- // iStock = Convert.ToBoolean(readerGameShopItem["iStock"]);
- // Deal = Convert.ToBoolean(readerGameShopItem["Deal"]);
- // TopItem = Convert.ToBoolean(readerGameShopItem["TopItem"]);
- // Date = readerGameShopItem.GetDateTime(readerGameShopItem.GetOrdinal("Date"));
- //}
- 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 = 6;
- 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;
- public 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.CanAwakening != true) return false;
- if (item.Info.Grade == ItemGrade.None) return false;
- if (item.RefineAdded > 5) return false;
- // if (IsMaxLevel()) return false;
- if (this.type == AwakeType.None)
- {
- if (item.Info.Type == ItemType.Weapon)
- {
- if (type == AwakeType.准确 ||
- type == AwakeType.暴击率 ||
- type == AwakeType.冰冻 ||
- type == AwakeType.毒攻击)
- {
- this.type = type;
- return true;
- }
- else
- return false;
- }
- else if (item.Info.Type == ItemType.Helmet)
- {
- if (type == AwakeType.物防 ||
- type == AwakeType.法防)
- {
- this.type = type;
- return true;
- }
- else
- return false;
- }
- else if (item.Info.Type == ItemType.Armour)
- {
- 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.破坏 ? getAwakeValue() : (byte)0); }
- //public byte getMC() { return (type == AwakeType.法攻 ? getAwakeValue() : (byte)0); }
- //public byte getSC() { return (type == AwakeType.道攻 ? getAwakeValue() : (byte)0); }
- public byte getAC() { return (type == AwakeType.物防 ? getAwakeValue() : (byte)0); }
- public byte getMAC() { return (type == AwakeType.法防 ? 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 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 bool IsUseGold;
- public string Message;
- public bool isSold, isGetBack;
- public ClientAuction()
- {
- }
- public ClientAuction(BinaryReader reader)
- {
- AuctionID = reader.ReadUInt64();
- Item = new UserItem(reader);
- Seller = reader.ReadString();
- Price = reader.ReadUInt32();
- ConsignmentDate = DateTime.FromBinary(reader.ReadInt64());
- IsUseGold=reader.ReadBoolean();
- Message = reader.ReadString();
- }
- public void Save(BinaryWriter writer)
- {
- writer.Write(AuctionID);
- Item.Save(writer);
- writer.Write(Seller);
- writer.Write(Price);
- writer.Write(ConsignmentDate.ToBinary());
- writer.Write(IsUseGold);
- writer.Write(Message==null?"":Message);
- }
- }
- public class GClientAuction
- {
- public ulong AuctionID;
- public string Seller = string.Empty;
- public int Price;
- public DateTime ConsignmentDate;
- public GClientAuction()
- {
- }
- public GClientAuction(BinaryReader reader)
- {
- AuctionID = reader.ReadUInt64();
- Seller = reader.ReadString();
- Price = reader.ReadInt32();
- ConsignmentDate = DateTime.FromBinary(reader.ReadInt64());
- }
- public void Save(BinaryWriter writer)
- {
- writer.Write(AuctionID);
- 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 int GenderNeeded;
- 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 List<QuestItemReward> RewardRandomItem =new List<QuestItemReward>();
- public uint FinishNPCIndex;
- public List<string> KillTaskNames = new List<string>();
- public List<int> KillTaskCounts=new List<int>();
- public List<string> ItemTaskNames=new List<string>();
- public List<int> ItemTaskCounts = new List<int>();
- public DateTime SeasonStartTime=DateTime.Now;
- public DateTime SeasonEndTime=DateTime.Now;
- 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();
- GenderNeeded = reader.ReadInt32();
- 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();
- count = reader.ReadInt32();
- for (int i = 0; i < count; i++)
- RewardRandomItem.Add(new QuestItemReward(reader));
- count = reader.ReadInt32();
- for (int i = 0; i < count; i++)
- KillTaskNames.Add(reader.ReadString());
- count= reader.ReadInt32();
- for (int i = 0; i < count; i++)
- KillTaskCounts.Add(reader.ReadInt32());
- count = reader.ReadInt32();
- for (int i = 0; i < count; i++)
- ItemTaskNames.Add(reader.ReadString());
- count = reader.ReadInt32();
- for (int i = 0; i < count; i++)
- ItemTaskCounts.Add(reader.ReadInt32());
- SeasonStartTime = DateTime.FromBinary(reader.ReadInt64());
- SeasonEndTime = DateTime.FromBinary(reader.ReadInt64());
- }
- 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(GenderNeeded);
- 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);
- writer.Write(RewardRandomItem.Count);
- for (int i = 0; i < RewardRandomItem.Count; i++)
- RewardRandomItem[i].Save(writer);
- writer.Write(KillTaskNames.Count);
- for (int i = 0; i < KillTaskNames.Count; i++)
- writer.Write(KillTaskNames[i]);
- writer.Write(KillTaskCounts.Count);
- for (int i = 0; i < KillTaskCounts.Count; i++)
- writer.Write(KillTaskCounts[i]);
- writer.Write(ItemTaskNames.Count);
- for (int i = 0; i < ItemTaskNames.Count; i++)
- writer.Write(ItemTaskNames[i]);
- writer.Write(ItemTaskCounts.Count);
- for (int i = 0; i < ItemTaskCounts.Count; i++)
- writer.Write(ItemTaskCounts[i]);
- writer.Write(SeasonStartTime.ToBinary());
- writer.Write(SeasonEndTime.ToBinary());
- }
- 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.Season:
- case QuestType.Daily:
- case QuestType.Random:
- 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 uint Power = 0;
- public QuestItemReward() { }
- public QuestItemReward(BinaryReader reader)
- {
- Item = new ItemInfo(reader);
- Count = reader.ReadUInt32();
- Power = reader.ReadUInt32();
- }
- public void Save(BinaryWriter writer)
- {
- Item.Save(writer);
- writer.Write(Count);
- writer.Write(Power);
- }
- public override string ToString()
- {
- return Item==null?"空":Item.Name;
- }
- }
- 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 int Level;
- public string LoacateMap;
- public ClientFriend() { }
- public ClientFriend(BinaryReader reader)
- {
- Index = reader.ReadInt32();
- Name = reader.ReadString();
- Memo = reader.ReadString();
- Blocked = reader.ReadBoolean();
- Online = reader.ReadBoolean();
- Level = reader.ReadInt32();
- LoacateMap = reader.ReadString();
- }
- public void Save(BinaryWriter writer)
- {
- writer.Write(Index);
- writer.Write(Name);
- writer.Write(Memo);
- writer.Write(Blocked);
- writer.Write(Online);
- writer.Write(Level);
- writer.Write(LoacateMap);
- }
- }
- 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 class ManagePacket
- {
- public string Type = "Lost";
- public Object Data;
- }
- public class GiveItemPacket
- {
- public string ItemName;
- public int Count;
- public string PlayerName;
- }
- public class DeleteItemPacket
- {
- public ulong UniqueID;
- public uint OwnerID;
- public string Store;
- }
- public class SendItemToInventoryPacket
- {
- public ulong UniqueID;
- public uint OwnerID;
- public string Store;
- }
- public class SendItemToMailPacket
- {
- public ulong UniqueID;
- public uint OwnerID;
- public string Store;
- }
- public class EditDDropPacket
- {
- public uint PlayerID;
- public int Value;
- public string MonsterName;
- }
- public class EditItemPacket
- {
- public ulong UniqueID;
- public uint OwnerID;
- public string Store;
- public string ItemName;
- public int Position;
- public int Count;
- public int MC;
- public int SC;
- public int AC;
- public int DC;
- public int MAC;
- public int Accuracy;
- public int Agility;
- public int BagWeight;
- public int WearWeight;
- public int HandWeight;
- public int FireAC;
- public int WindAC;
- public int IceAC;
- public int LightAC;
- public int HolyAC;
- public int DarkAC;
- public int PhantomAC;
- public int FireMAC;
- public int WindMAC;
- public int IceMAC;
- public int LightMAC;
- public int HolyMAC;
- public int DarkMAC;
- public int PhantomMAC;
- public int IR;
- public int IG;
- public int IB;
- public int WpLevelExp;
- public int HP;
- public int MP;
- public int AttackSpeed;
- public int Luck;
- public int MagicResist;
- public int PoisonResist;
- public int HealthRecovery;
- public int ManaRecovery;
- public int PoisonRecovery;
- public int CriticalRate;
- public int CriticalDamage;
- public int Freezing;
- public int PoisonAttack;
- public int RefineAdded;
- public int Reflect;
- public int MaxAcRate;
- public int MaxMacRate;
- public int Parry;
- public int IgnoreAC;
- public int IgnoreMAC;
- public int DropProtect;
- }
- public class ManageMsgResult
- {
- public int StatusCode;
- public string Message;
- }
- public class KickPlayerPacket
- {
- public uint PlayerID;
- }
- public class BanPlayerPacket
- {
- public string AccountID;
- }
- public class UnbanPlayerPacket
- {
- public string AccountID;
- }
- public class SendHookQuestionPacket
- {
- public string AccountID;
- }
- public class ChangeHookSuspicionLevelPacket
- {
- public string AccountID;
- public int Value;
- }
- public class AddBannedAddressPacket
- {
- public int Type;
- public string Address;
- }
- public abstract class Packet
- {
- // public static byte IsServer;
- public static byte[] alive;
- public static uint pid = 1;
- public abstract ushort Index { get; }
- internal uint PID = 0;
- public Packet()
- {
- }
- public static Packet GetPacket(ushort index)
- {
- if (index <= 30000)
- {
- return GetClientPacket(index);
- }
- else if (index <= 60000)
- {
- return GetServerPacket(index);
- }
- else
- {
- return GetCustomPacket(index);
- }
- }
- 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
- {
- stream.Seek(1, SeekOrigin.Begin);
- uint xh = reader.ReadUInt32();
- ushort id = reader.ReadUInt16();
- if (id == (ushort)ClientPacketIds.MoveShield)
- {
- Console.Write("AAA");
- }
- p = GetPacket(id);
- if (p == null) return null;
- p.PID = xh;
- p.ReadPacket(reader);
- }
- catch
- {
- extra = new byte[0];
- return null;
- }
- }
- extra = new byte[rawBytes.Length - length];
- System.Buffer.BlockCopy(rawBytes, length, extra, 0, rawBytes.Length - length);
- return p;
- }
- public IEnumerable<byte> GetPacketBytes(object peer = null)
- {
- 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((byte)0);
- if (PID == 0) PID = pid++;
- writer.Write(PID);
- 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);
- aliveData(data, (byte[])peer);
- }
- }
- return data;
- }
- protected void aliveData(byte[] ak, byte[] peer)
- {
- byte[] student;
- if (Index > 30000)
- {
- return;
- }
- else
- {
- student = peer == null ? alive : peer;
- }
- if (student == null)
- {
- return;
- }
- else
- {
- ak[2] = 1;
- // byte car = 0;
- for (int i = 3; i < ak.Length; i++)
- {
- // car = (byte)(ak[i] ^ car);
- ak[i] = (byte)(ak[i] ^ student[i % 8]);
- }
- // ak[ak.Length] = (byte)(car ^ student[4] ^ student[5]);
- }
- }
- protected void setAlive(byte[] value)
- {
- setAlive(value);
- }
- protected abstract void ReadPacket(BinaryReader reader);
- protected abstract void WritePacket(BinaryWriter writer);
- //服务端获得数据包并返回数据包函数
- private static Packet GetClientPacket(ushort index)
- {
- //if (index != (short)ClientPacketIds.KeepAlive && index != (short)ClientPacketIds.PickUp)
- //{
- // Console.WriteLine("111");
- //}
- switch (index)
- {
- case (ushort)ClientPacketIds.ClientVersion:
- return new C.ClientVersion();
- case (ushort)ClientPacketIds.Disconnect:
- return new C.Disconnect();
- case (ushort)ClientPacketIds.KeepAlive:
- return new C.KeepAlive();
- case (ushort)ClientPacketIds.EnterAlive:
- return new C.EnterAlive();
- case (ushort)ClientPacketIds.NewAccount:
- return new C.NewAccount();
- case (ushort)ClientPacketIds.ChangePassword:
- return new C.ChangePassword();
- case (ushort)ClientPacketIds.Login:
- return new C.Login();
- case (ushort)ClientPacketIds.LoginAccount:
- return new C.LoginAccount();
- case (ushort)ClientPacketIds.NewCharacter:
- return new C.NewCharacter();
- case (ushort)ClientPacketIds.DeleteCharacter:
- return new C.DeleteCharacter();
- case (ushort)ClientPacketIds.StartGame:
- return new C.StartGame();
- case (ushort)ClientPacketIds.LogOut:
- return new C.LogOut();
- case (ushort)ClientPacketIds.Turn:
- return new C.Turn();
- case (ushort)ClientPacketIds.Walk:
- return new C.Walk();
- case (ushort)ClientPacketIds.Run:
- return new C.Run();
- case (ushort)ClientPacketIds.Chat:
- return new C.Chat();
- case (ushort)ClientPacketIds.MoveItem:
- return new C.MoveItem();
- case (ushort)ClientPacketIds.StoreItem:
- return new C.StoreItem();
- case (ushort)ClientPacketIds.SendStorPassword:
- return new C.SendStorPassword();
- case (ushort)ClientPacketIds.SetStorPassword:
- return new C.SetStorPassword();
- case (ushort)ClientPacketIds.CancelPassword:
- return new C.CancelPassword();
- case (ushort)ClientPacketIds.BuyStorage:
- return new C.BuyStorage();
- case (ushort)ClientPacketIds.UseHorn:
- return new C.UseHorn();
- case (ushort)ClientPacketIds.TakeBackItem:
- return new C.TakeBackItem();
- case (ushort)ClientPacketIds.MergeItem:
- return new C.MergeItem();
- case (ushort)ClientPacketIds.EquipItem:
- return new C.EquipItem();
- case (ushort)ClientPacketIds.RemoveItem:
- return new C.RemoveItem();
- case (ushort)ClientPacketIds.RemoveSlotItem:
- return new C.RemoveSlotItem();
- case (ushort)ClientPacketIds.SplitItem:
- return new C.SplitItem();
- case (ushort)ClientPacketIds.UseItem:
- return new C.UseItem();
- case (ushort)ClientPacketIds.DropItem:
- return new C.DropItem();
- case (ushort)ClientPacketIds.DepositRefineItem:
- return new C.DepositRefineItem();
- case (ushort)ClientPacketIds.RetrieveRefineItem:
- return new C.RetrieveRefineItem();
- case (ushort)ClientPacketIds.RefineCancel:
- return new C.RefineCancel();
- case (ushort)ClientPacketIds.RefineItem:
- return new C.RefineItem();
- case (ushort)ClientPacketIds.CheckRefine:
- return new C.CheckRefine();
- case (ushort)ClientPacketIds.ReplaceWedRing:
- return new C.ReplaceWedRing();
- case (ushort)ClientPacketIds.DepositTradeItem:
- return new C.DepositTradeItem();
- case (ushort)ClientPacketIds.RetrieveTradeItem:
- return new C.RetrieveTradeItem();
- case (ushort)ClientPacketIds.DropGold:
- return new C.DropGold();
- case (ushort)ClientPacketIds.PickUp:
- return new C.PickUp();
- case (ushort)ClientPacketIds.Inspect:
- return new C.Inspect();
- case (ushort)ClientPacketIds.ChangeAMode:
- return new C.ChangeAMode();
- case (ushort)ClientPacketIds.ChangePMode:
- return new C.ChangePMode();
- case (ushort)ClientPacketIds.ChangeHelmetoff:
- return new C.ChangeHelmetoff();
- case (ushort)ClientPacketIds.ChangeTrade:
- return new C.ChangeTrade();
- case (ushort)ClientPacketIds.Attack:
- return new C.Attack();
- case (ushort)ClientPacketIds.RangeAttack:
- return new C.RangeAttack();
- case (ushort)ClientPacketIds.Harvest:
- return new C.Harvest();
- case (ushort)ClientPacketIds.CallNPC:
- return new C.CallNPC();
- case (ushort)ClientPacketIds.TalkMonsterNPC:
- return new C.TalkMonsterNPC();
- case (ushort)ClientPacketIds.BuyItem:
- return new C.BuyItem();
- case (ushort)ClientPacketIds.GetSelectItem:
- return new C.GetSelectItem();
- case (ushort)ClientPacketIds.SellItem:
- return new C.SellItem();
- case (ushort)ClientPacketIds.RepairItem:
- return new C.RepairItem();
- case (ushort)ClientPacketIds.BuyItemBack:
- return new C.BuyItemBack();
- case (ushort)ClientPacketIds.GetAllhp:
- return new C.GetAllhp();
- case (ushort)ClientPacketIds.FindItem:
- return new C.FindItem();
- case (ushort)ClientPacketIds.PoisonChangaChanged:
- return new C.PoisonChangaChanged();
- case (ushort)ClientPacketIds.SRepairItem:
- return new C.SRepairItem();
- case (ushort)ClientPacketIds.MagicKey:
- return new C.MagicKey();
- case (ushort)ClientPacketIds.Magic:
- return new C.Magic();
- case (ushort)ClientPacketIds.SwitchGroup:
- return new C.SwitchGroup();
- case (ushort)ClientPacketIds.AddMember:
- return new C.AddMember();
- case (ushort)ClientPacketIds.DellMember:
- return new C.DelMember();
- case (ushort)ClientPacketIds.GroupInvite:
- return new C.GroupInvite();
- case (ushort)ClientPacketIds.TownRevive:
- return new C.TownRevive();
- case (ushort)ClientPacketIds.SpellToggle:
- return new C.SpellToggle();
- case (ushort)ClientPacketIds.ConsignItem:
- return new C.ConsignItem();
- case (ushort)ClientPacketIds.MarketSearch:
- return new C.MarketSearch();
- case (ushort)ClientPacketIds.MarketSearch2:
- return new C.MarketSearch2();
- case (ushort)ClientPacketIds.ItemAuctionSearch:
- return new C.ItemAuctionSearch();
- case (ushort)ClientPacketIds.MyAuctionSearch:
- return new C.MyAuctionSearch();
- case (ushort)ClientPacketIds.MarketGroupSearch:
- return new C.MarketGroupSearch();
- case (ushort)ClientPacketIds.GameShopSearch:
- return new C.GameShopSearch();
- case (ushort)ClientPacketIds.ExchangeSend:
- return new C.ExchangeSend();
- case (ushort)ClientPacketIds.MACUpgradeSend:
- return new C.MACUpgradeSend();
- case (ushort)ClientPacketIds.ClearMACUpgradeSend:
- return new C.ClearMACUpgradeSend();
- case (ushort)ClientPacketIds.DropProtectUpgradeSend:
- return new C.DropProtectUpgradeSend();
- case (ushort)ClientPacketIds.BuyGameShopItem:
- return new C.BuyGameShopItem();
- case (ushort)ClientPacketIds.MarketRefresh:
- return new C.MarketRefresh();
- case (ushort)ClientPacketIds.MarketPage:
- return new C.MarketPage();
- case (ushort)ClientPacketIds.MarketBuy:
- return new C.MarketBuy();
- case (ushort)ClientPacketIds.MarketGetBack:
- return new C.MarketGetBack();
- case (ushort)ClientPacketIds.RequestUserName:
- return new C.RequestUserName();
- case (ushort)ClientPacketIds.RequestChatItem:
- return new C.RequestChatItem();
- case (ushort)ClientPacketIds.HookQuestionRespose:
- return new C.HookQuestionRespose();
- case (ushort)ClientPacketIds.EditGuildMember:
- return new C.EditGuildMember();
- case (ushort)ClientPacketIds.GetAllGuild:
- return new C.GetAllGuild();
- case (ushort)ClientPacketIds.GetAllJoinRequest:
- return new C.GetAllJoinRequest();
- case (ushort)ClientPacketIds.ResposeJoinGuild:
- return new C.ResposeJoinGuild();
- case (ushort)ClientPacketIds.RequestJoinGuild:
- return new C.RequestJoinGuild();
- case (ushort)ClientPacketIds.EditGuildNotice:
- return new C.EditGuildNotice();
- case (ushort)ClientPacketIds.GuildInvite:
- return new C.GuildInvite();
- case (ushort)ClientPacketIds.GuildNameReturn:
- return new C.GuildNameReturn();
- case (ushort)ClientPacketIds.RequestGuildInfo:
- return new C.RequestGuildInfo();
- case (ushort)ClientPacketIds.GuildStorageGoldChange:
- return new C.GuildStorageGoldChange();
- case (ushort)ClientPacketIds.GuildStorageItemChange:
- return new C.GuildStorageItemChange();
- case (ushort)ClientPacketIds.GuildWarReturn:
- return new C.GuildWarReturn();
- case (ushort)ClientPacketIds.MarriageRequest:
- return new C.MarriageRequest();
- case (ushort)ClientPacketIds.MarriageReply:
- return new C.MarriageReply();
- case (ushort)ClientPacketIds.ChangeMarriage:
- return new C.ChangeMarriage();
- case (ushort)ClientPacketIds.ChangeName:
- return new C.ChangeName();
- case (ushort)ClientPacketIds.DivorceRequest:
- return new C.DivorceRequest();
- case (ushort)ClientPacketIds.DivorceReply:
- return new C.DivorceReply();
- case (ushort)ClientPacketIds.AddMentor:
- return new C.AddMentor();
- case (ushort)ClientPacketIds.MentorReply:
- return new C.MentorReply();
- case (ushort)ClientPacketIds.AllowMentor:
- return new C.AllowMentor();
- case (ushort)ClientPacketIds.CancelMentor:
- return new C.CancelMentor();
- case (ushort)ClientPacketIds.TradeRequest:
- return new C.TradeRequest();
- case (ushort)ClientPacketIds.TradeReply:
- return new C.TradeReply();
- case (ushort)ClientPacketIds.TradeGold:
- return new C.TradeGold();
- case (ushort)ClientPacketIds.TradeConfirm:
- return new C.TradeConfirm();
- case (ushort)ClientPacketIds.TradeCancel:
- return new C.TradeCancel();
- case (ushort)ClientPacketIds.EquipSlotItem:
- return new C.EquipSlotItem();
- case (ushort)ClientPacketIds.FishingCast:
- return new C.FishingCast();
- case (ushort)ClientPacketIds.FishingChangeAutocast:
- return new C.FishingChangeAutocast();
- case (ushort)ClientPacketIds.AcceptQuest:
- return new C.AcceptQuest();
- case (ushort)ClientPacketIds.FinishQuest:
- return new C.FinishQuest();
- case (ushort)ClientPacketIds.AbandonQuest:
- return new C.AbandonQuest();
- case (ushort)ClientPacketIds.ShareQuest:
- return new C.ShareQuest();
- case (ushort)ClientPacketIds.AcceptReincarnation:
- return new C.AcceptReincarnation();
- case (ushort)ClientPacketIds.CancelReincarnation:
- return new C.CancelReincarnation();
- case (ushort)ClientPacketIds.CombineItem:
- return new C.CombineItem();
- case (ushort)ClientPacketIds.SetConcentration:
- return new C.SetConcentration();
- case (ushort)ClientPacketIds.AwakeningNeedMaterials:
- return new C.AwakeningNeedMaterials();
- case (ushort)ClientPacketIds.DropProtectNeedMaterials:
- return new C.DropProtectNeedMaterials();
- case (ushort)ClientPacketIds.AwakeningLockedItem:
- return new C.AwakeningLockedItem();
- case (ushort)ClientPacketIds.Awakening:
- return new C.Awakening();
- case (ushort)ClientPacketIds.UnAwakening:
- return new C.UnAwakening();
- case (ushort)ClientPacketIds.DisassembleItem:
- return new C.DisassembleItem();
- case (ushort)ClientPacketIds.DowngradeAwakening:
- return new C.DowngradeAwakening();
- case (ushort)ClientPacketIds.ResetAddedItem:
- return new C.ResetAddedItem();
- case (ushort)ClientPacketIds.SendMail:
- return new C.SendMail();
- case (ushort)ClientPacketIds.ReadMail:
- return new C.ReadMail();
- case (ushort)ClientPacketIds.CollectParcel:
- return new C.CollectParcel();
- case (ushort)ClientPacketIds.DeleteMail:
- return new C.DeleteMail();
- case (ushort)ClientPacketIds.LockMail:
- return new C.LockMail();
- case (ushort)ClientPacketIds.MailLockedItem:
- return new C.MailLockedItem();
- case (ushort)ClientPacketIds.MailCost:
- return new C.MailCost();
- case (ushort)ClientPacketIds.UpdateIntelligentCreature://IntelligentCreature
- return new C.UpdateIntelligentCreature();
- case (ushort)ClientPacketIds.IntelligentCreaturePickup://IntelligentCreature
- return new C.IntelligentCreaturePickup();
- case (ushort)ClientPacketIds.AddFriend:
- return new C.AddFriend();
- case (ushort)ClientPacketIds.AddFriendRespose:
- return new C.AddFriendRespose();
- case (ushort)ClientPacketIds.RemoveFriend:
- return new C.RemoveFriend();
- case (ushort)ClientPacketIds.RefreshFriends:
- return new C.RefreshFriends();
- case (ushort)ClientPacketIds.AddMemo:
- return new C.AddMemo();
- case (ushort)ClientPacketIds.GuildBuffUpdate:
- return new C.GuildBuffUpdate();
- case (ushort)ClientPacketIds.GameshopBuy:
- return new C.GameshopBuy();
- case (ushort)ClientPacketIds.NPCConfirmInput:
- return new C.NPCConfirmInput();
- case (ushort)ClientPacketIds.QueryMapNPCs:
- return new C.QueryMapNPCs();
- case (ushort)ClientPacketIds.QueryAllMaps:
- return new C.QueryAllMaps();
- case (ushort)ClientPacketIds.ReportIssue:
- return new C.ReportIssue();
- case (ushort)ClientPacketIds.GetRanking:
- return new C.GetRanking();
- case (ushort)ClientPacketIds.Opendoor:
- return new C.Opendoor();
- case (ushort)ClientPacketIds.PayMail:
- return new C.PayMail();
- case (ushort)ClientPacketIds.RefreshRecipe:
- return new C.RefreshRecipe();
- case (ushort)ClientPacketIds.VersionName:
- return new C.VersionName();
- case (ushort)ClientPacketIds.InitialItem:
- return new C.InitialItem();
- case (ushort)ClientPacketIds.MoveShield:
- return new C.MoveShield();
- case (ushort)ClientPacketIds.PrepareMoveShield:
- return new C.PrepareMoveShield();
- default:
- return null;
- }
- }
- private static Packet GetCustomPacket(ushort index)
- {
- switch (index)
- {
- case (ushort)CustomPacketIds.Manager:
- return new C.Manager();
- default:
- return null;
- }
- }
- private static Packet GetServerPacket(ushort index)
- {
- switch (index)
- {
- case (ushort)ServerPacketIds.Connected:
- return new S.Connected();
- case (ushort)ServerPacketIds.ClientVersion:
- return new S.ClientVersion();
- case (ushort)ServerPacketIds.Disconnect:
- return new S.Disconnect();
- case (ushort)ServerPacketIds.KeepAlive:
- return new S.KeepAlive();
- case (ushort)ServerPacketIds.HookSuspicionMsg:
- return new S.HookSuspicionMsg();
- case (ushort)ServerPacketIds.HookSuspicionMsgFailure:
- return new S.HookSuspicionMsgFailure();
- case (ushort)ServerPacketIds.NewAccount:
- return new S.NewAccount();
- case (ushort)ServerPacketIds.ChangePassword:
- return new S.ChangePassword();
- case (ushort)ServerPacketIds.ChangePasswordBanned:
- return new S.ChangePasswordBanned();
- case (ushort)ServerPacketIds.Login:
- return new S.Login();
- case (ushort)ServerPacketIds.LoginBanned:
- return new S.LoginBanned();
- case (ushort)ServerPacketIds.LoginSuccess:
- return new S.LoginSuccess();
- case (ushort)ServerPacketIds.NewCharacter:
- return new S.NewCharacter();
- case (ushort)ServerPacketIds.NewCharacterSuccess:
- return new S.NewCharacterSuccess();
- case (ushort)ServerPacketIds.DeleteCharacter:
- return new S.DeleteCharacter();
- case (ushort)ServerPacketIds.DeleteCharacterSuccess:
- return new S.DeleteCharacterSuccess();
- case (ushort)ServerPacketIds.StartGame:
- return new S.StartGame();
- case (ushort)ServerPacketIds.StartGameBanned:
- return new S.StartGameBanned();
- case (ushort)ServerPacketIds.StartGameDelay:
- return new S.StartGameDelay();
- case (ushort)ServerPacketIds.EnterAlive:
- return new S.EnterAlive();
- case (ushort)ServerPacketIds.MapInformation:
- return new S.MapInformation();
- case (ushort)ServerPacketIds.UserInformation:
- return new S.UserInformation();
- case (ushort)ServerPacketIds.UserLocation:
- return new S.UserLocation();
- case (ushort)ServerPacketIds.ObjectPlayer:
- return new S.ObjectPlayer();
- case (ushort)ServerPacketIds.ObjectRemove:
- return new S.ObjectRemove();
- case (ushort)ServerPacketIds.ObjectTurn:
- return new S.ObjectTurn();
- case (ushort)ServerPacketIds.ObjectWalk:
- return new S.ObjectWalk();
- case (ushort)ServerPacketIds.ObjectRun:
- return new S.ObjectRun();
- case (ushort)ServerPacketIds.Chat:
- return new S.Chat();
- case (ushort)ServerPacketIds.ObjectChat:
- return new S.ObjectChat();
- case (ushort)ServerPacketIds.NewItemInfo:
- return new S.NewItemInfo();
- case (ushort)ServerPacketIds.MoveItem:
- return new S.MoveItem();
- case (ushort)ServerPacketIds.EquipItem:
- return new S.EquipItem();
- case (ushort)ServerPacketIds.MergeItem:
- return new S.MergeItem();
- case (ushort)ServerPacketIds.RemoveItem:
- return new S.RemoveItem();
- case (ushort)ServerPacketIds.RemoveSlotItem:
- return new S.RemoveSlotItem();
- case (ushort)ServerPacketIds.TakeBackItem:
- return new S.TakeBackItem();
- case (ushort)ServerPacketIds.StoreItem:
- return new S.StoreItem();
- case (ushort)ServerPacketIds.SureBuyStorage:
- return new S.SureBuyStorage();
- case (ushort)ServerPacketIds.StorPasswordAuthResult:
- return new S.StorPasswordAuthResult();
- case (ushort)ServerPacketIds.ReceiveMessageBox:
- return new S.ReceiveMessageBox();
- case (ushort)ServerPacketIds.SetStoragePassword:
- return new S.SetStoragePassword();
- case (ushort)ServerPacketIds.StorPasswordAsk:
- return new S.StorPasswordAsk();
- case (ushort)ServerPacketIds.DepositRefineItem:
- return new S.DepositRefineItem();
- case (ushort)ServerPacketIds.RetrieveRefineItem:
- return new S.RetrieveRefineItem();
- case (ushort)ServerPacketIds.RefineItem:
- return new S.RefineItem();
- case (ushort)ServerPacketIds.Mir3RefineItem:
- return new S.Mir3RefineItem();
- case (ushort)ServerPacketIds.Mir3AtkRefine:
- return new S.Mir3AtkRefine();
- case (ushort)ServerPacketIds.ClientHP:
- return new S.ClientHP();
- case (ushort)ServerPacketIds.FindBlackItem:
- return new S.FindBlackItem();
- case (ushort)ServerPacketIds.DepositTradeItem:
- return new S.DepositTradeItem();
- case (ushort)ServerPacketIds.RetrieveTradeItem:
- return new S.RetrieveTradeItem();
- case (ushort)ServerPacketIds.SplitItem:
- return new S.SplitItem();
- case (ushort)ServerPacketIds.SplitItem1:
- return new S.SplitItem1();
- case (ushort)ServerPacketIds.UseItem:
- return new S.UseItem();
- case (ushort)ServerPacketIds.DropItem:
- return new S.DropItem();
- case (ushort)ServerPacketIds.PlayerUpdate:
- return new S.PlayerUpdate();
- case (ushort)ServerPacketIds.PlayerInspect:
- return new S.PlayerInspect();
- case (ushort)ServerPacketIds.LogOutSuccess:
- return new S.LogOutSuccess();
- case (ushort)ServerPacketIds.LogOutFailed:
- return new S.LogOutFailed();
- case (ushort)ServerPacketIds.TimeOfDay:
- return new S.TimeOfDay();
- case (ushort)ServerPacketIds.ChangeAMode:
- return new S.ChangeAMode();
- case (ushort)ServerPacketIds.ChangePMode:
- return new S.ChangePMode();
- case (ushort)ServerPacketIds.ObjectUseItem:
- return new S.ObjectUseItem();
- case (ushort)ServerPacketIds.DropProtectSuccess:
- return new S.DropProtectSuccess();
- case (ushort)ServerPacketIds.ObjectItem:
- return new S.ObjectItem();
- case (ushort)ServerPacketIds.ObjectGold:
- return new S.ObjectGold();
- case (ushort)ServerPacketIds.GainedItem:
- return new S.GainedItem();
- case (ushort)ServerPacketIds.GainedGold:
- return new S.GainedGold();
- case (ushort)ServerPacketIds.LoseGold:
- return new S.LoseGold();
- case (ushort)ServerPacketIds.GainedCredit:
- return new S.GainedCredit();
- case (ushort)ServerPacketIds.LoseCredit:
- return new S.LoseCredit();
- case (ushort)ServerPacketIds.ObjectMonster:
- return new S.ObjectMonster();
- case (ushort)ServerPacketIds.ObjectAttack:
- return new S.ObjectAttack();
- case (ushort)ServerPacketIds.Struck:
- return new S.Struck();
- case (ushort)ServerPacketIds.DamageIndicator:
- return new S.DamageIndicator();
- case (ushort)ServerPacketIds.ObjectStruck:
- return new S.ObjectStruck();
- case (ushort)ServerPacketIds.DuraChanged:
- return new S.DuraChanged();
- case (ushort)ServerPacketIds.PoisonChangaChanged:
- return new S.PoisonChangaChanged();
- case (ushort)ServerPacketIds.HealthChanged:
- return new S.HealthChanged();
- case (ushort)ServerPacketIds.DeleteItem:
- return new S.DeleteItem();
- case (ushort)ServerPacketIds.Death:
- return new S.Death();
- case (ushort)ServerPacketIds.ObjectDied:
- return new S.ObjectDied();
- case (ushort)ServerPacketIds.ColorChanged:
- return new S.ColorChanged();
- case (ushort)ServerPacketIds.ObjectColorChanged:
- return new S.ObjectColorChanged();
- case (ushort)ServerPacketIds.ObjectGuildNameChanged:
- return new S.ObjectGuildNameChanged();
- case (ushort)ServerPacketIds.GainExperience:
- return new S.GainExperience();
- case (ushort)ServerPacketIds.SubExperience:
- return new S.SubExperience();
- case (ushort)ServerPacketIds.LevelChanged:
- return new S.LevelChanged();
- case (ushort)ServerPacketIds.ExtraChanged:
- return new S.ExtraChanged();
- case (ushort)ServerPacketIds.ObjectLeveled:
- return new S.ObjectLeveled();
- case (ushort)ServerPacketIds.ObjectWpLeveled:
- return new S.ObjectWpLeveled();
- case (ushort)ServerPacketIds.ObjectShowHelmet:
- return new S.ObjectShowHelmet();
- case (ushort)ServerPacketIds.ObjectHarvest:
- return new S.ObjectHarvest();
- case (ushort)ServerPacketIds.ObjectHarvested:
- return new S.ObjectHarvested();
- case (ushort)ServerPacketIds.ObjectNpc:
- return new S.ObjectNPC();
- case (ushort)ServerPacketIds.QueryMapNPCs:
- return new S.QueryMapNPCs();
- case (ushort)ServerPacketIds.QueryAllMaps:
- return new S.QueryAllMaps();
- case (ushort)ServerPacketIds.NPCResponse:
- return new S.NPCResponse();
- case (ushort)ServerPacketIds.NPCDocument:
- return new S.NPCDocument();
- case (ushort)ServerPacketIds.ObjectHide:
- return new S.ObjectHide();
- case (ushort)ServerPacketIds.ObjectShow:
- return new S.ObjectShow();
- case (ushort)ServerPacketIds.Poisoned:
- return new S.Poisoned();
- case (ushort)ServerPacketIds.ObjectPoisoned:
- return new S.ObjectPoisoned();
- case (ushort)ServerPacketIds.MapChanged:
- return new S.MapChanged();
- case (ushort)ServerPacketIds.ObjectTeleportOut:
- return new S.ObjectTeleportOut();
- case (ushort)ServerPacketIds.ObjectTeleportIn:
- return new S.ObjectTeleportIn();
- case (ushort)ServerPacketIds.TeleportIn:
- return new S.TeleportIn();
- case (ushort)ServerPacketIds.NPCGoods:
- return new S.NPCGoods();
- case (ushort)ServerPacketIds.NPCSelectGoods:
- return new S.NPCSelectGoods();
- case (ushort)ServerPacketIds.NPCSell:
- return new S.NPCSell();
- case (ushort)ServerPacketIds.NPCRepair:
- return new S.NPCRepair();
- case (ushort)ServerPacketIds.NPCSRepair:
- return new S.NPCSRepair();
- case (ushort)ServerPacketIds.NPCRefine:
- return new S.NPCRefine();
- case (ushort)ServerPacketIds.NPCCheckRefine:
- return new S.NPCCheckRefine();
- case (ushort)ServerPacketIds.NPCCollectRefine:
- return new S.NPCCollectRefine();
- case (ushort)ServerPacketIds.NPCReplaceWedRing:
- return new S.NPCReplaceWedRing();
- case (ushort)ServerPacketIds.NPCStorage:
- return new S.NPCStorage();
- case (ushort)ServerPacketIds.StartMACUpgrade:
- return new S.StartMACUpgrade();
- case (ushort)ServerPacketIds.ClearMACUpgrade:
- return new S.ClearMACUpgrade();
- case (ushort)ServerPacketIds.MACUpgradeResult:
- return new S.MACUpgradeResult();
- case (ushort)ServerPacketIds.SellItem:
- return new S.SellItem();
- case (ushort)ServerPacketIds.RepairItem:
- return new S.RepairItem();
- case (ushort)ServerPacketIds.ItemRepaired:
- return new S.ItemRepaired();
- case (ushort)ServerPacketIds.NewMagic:
- return new S.NewMagic();
- case (ushort)ServerPacketIds.MagicLeveled:
- return new S.MagicLeveled();
- case (ushort)ServerPacketIds.Magic:
- return new S.Magic();
- case (ushort)ServerPacketIds.MagicDelay:
- return new S.MagicDelay();
- case (ushort)ServerPacketIds.MagicCast:
- return new S.MagicCast();
- case (ushort)ServerPacketIds.ObjectMagic:
- return new S.ObjectMagic();
- case (ushort)ServerPacketIds.ObjectEffect:
- return new S.ObjectEffect();
- case (ushort)ServerPacketIds.RangeAttack:
- return new S.RangeAttack();
- case (ushort)ServerPacketIds.Pushed:
- return new S.Pushed();
- case (ushort)ServerPacketIds.ObjectPushed:
- return new S.ObjectPushed();
- case (ushort)ServerPacketIds.ObjectName:
- return new S.ObjectName();
- case (ushort)ServerPacketIds.UserStorage:
- return new S.UserStorage();
- case (ushort)ServerPacketIds.SwitchGroup:
- return new S.SwitchGroup();
- case (ushort)ServerPacketIds.DeleteGroup:
- return new S.DeleteGroup();
- case (ushort)ServerPacketIds.DeleteMember:
- return new S.DeleteMember();
- case (ushort)ServerPacketIds.MemberLocation:
- return new S.MemberLocation();
- case (ushort)ServerPacketIds.GroupInvite:
- return new S.GroupInvite();
- case (ushort)ServerPacketIds.AddMember:
- return new S.AddMember();
- case (ushort)ServerPacketIds.Revived:
- return new S.Revived();
- case (ushort)ServerPacketIds.ObjectRevived:
- return new S.ObjectRevived();
- case (ushort)ServerPacketIds.SpellToggle:
- return new S.SpellToggle();
- case (ushort)ServerPacketIds.ObjectHealth:
- return new S.ObjectHealth();
- case (ushort)ServerPacketIds.MapEffect:
- return new S.MapEffect();
- case (ushort)ServerPacketIds.ObjectRangeAttack:
- return new S.ObjectRangeAttack();
- case (ushort)ServerPacketIds.AddBuff:
- return new S.AddBuff();
- case (ushort)ServerPacketIds.RemoveBuff:
- return new S.RemoveBuff();
- case (ushort)ServerPacketIds.ObjectHidden:
- return new S.ObjectHidden();
- case (ushort)ServerPacketIds.ObjectSpHidden:
- return new S.ObjectSpHidden();
- case (ushort)ServerPacketIds.RefreshItem:
- return new S.RefreshItem();
- case (ushort)ServerPacketIds.RefreshHair:
- return new S.RefreshHair();
- case (ushort)ServerPacketIds.ObjectRefreshHair:
- return new S.ObjectRefreshHair();
- case (ushort)ServerPacketIds.ObjectSpell:
- return new S.ObjectSpell();
- case (ushort)ServerPacketIds.UserDash:
- return new S.UserDash();
- case (ushort)ServerPacketIds.ObjectDash:
- return new S.ObjectDash();
- case (ushort)ServerPacketIds.UserDashFail:
- return new S.UserDashFail();
- case (ushort)ServerPacketIds.ObjectDashFail:
- return new S.ObjectDashFail();
- case (ushort)ServerPacketIds.NPCConsign:
- return new S.NPCConsign();
- case (ushort)ServerPacketIds.ZanZhuChangeName:
- return new S.ZanZhuChangeName();
- case (ushort)ServerPacketIds.NPCMarket:
- return new S.NPCMarket();
- case (ushort)ServerPacketIds.NPCMarketPage:
- return new S.NPCMarketPage();
- case (ushort)ServerPacketIds.AuctionGroups:
- return new S.AuctionGroups();
- case (ushort)ServerPacketIds.GameShopSearch:
- return new S.GameShopSearch();
- case (ushort)ServerPacketIds.ItemProtectStart:
- return new S.ItemProtectStart();
- case (ushort)ServerPacketIds.ExchangeConfigSearch:
- return new S.ExchangeConfigSearch();
- case (ushort)ServerPacketIds.ItemAuctionSearch:
- return new S.ItemAuctionSearch();
- case (ushort)ServerPacketIds.MyAuctionSearch:
- return new S.MyAuctionSearch();
- case (ushort)ServerPacketIds.ConsignItem:
- return new S.ConsignItem();
- case (ushort)ServerPacketIds.MarketFail:
- return new S.MarketFail();
- case (ushort)ServerPacketIds.MarketSuccess:
- return new S.MarketSuccess();
- case (ushort)ServerPacketIds.ObjectSitDown:
- return new S.ObjectSitDown();
- case (ushort)ServerPacketIds.RefreshSeasonExitTime:
- return new S.RefreshSeasonExitTime();
- case (ushort)ServerPacketIds.InTrapRock:
- return new S.InTrapRock();
- case (ushort)ServerPacketIds.RemoveMagic:
- return new S.RemoveMagic();
- case (ushort)ServerPacketIds.BaseStatsInfo:
- return new S.BaseStatsInfo();
- case (ushort)ServerPacketIds.UserName:
- return new S.UserName();
- case (ushort)ServerPacketIds.ChatItemStats:
- return new S.ChatItemStats();
- case (ushort)ServerPacketIds.GuildMemberChange:
- return new S.GuildMemberChange();
- case (ushort)ServerPacketIds.GuildNoticeChange:
- return new S.GuildNoticeChange();
- case (ushort)ServerPacketIds.GuildStatus:
- return new S.GuildStatus();
- case (ushort)ServerPacketIds.GetAllGuild:
- return new S.GetAllGuild();
- case (ushort)ServerPacketIds.GetAllJoinRequest:
- return new S.GetAllJoinRequest();
- case (ushort)ServerPacketIds.GuildInvite:
- return new S.GuildInvite();
- case (ushort)ServerPacketIds.GuildExpGain:
- return new S.GuildExpGain();
- case (ushort)ServerPacketIds.GuildNameRequest:
- return new S.GuildNameRequest();
- case (ushort)ServerPacketIds.GuildStorageGoldChange:
- return new S.GuildStorageGoldChange();
- case (ushort)ServerPacketIds.GuildStorageItemChange:
- return new S.GuildStorageItemChange();
- case (ushort)ServerPacketIds.GuildStorageList:
- return new S.GuildStorageList();
- case (ushort)ServerPacketIds.GuildRequestWar:
- return new S.GuildRequestWar();
- case (ushort)ServerPacketIds.DefaultNPC:
- return new S.DefaultNPC();
- case (ushort)ServerPacketIds.NPCUpdate:
- return new S.NPCUpdate();
- case (ushort)ServerPacketIds.MarriageRequest:
- return new S.MarriageRequest();
- case (ushort)ServerPacketIds.DivorceRequest:
- return new S.DivorceRequest();
- case (ushort)ServerPacketIds.MentorRequest:
- return new S.MentorRequest();
- case (ushort)ServerPacketIds.TradeRequest:
- return new S.TradeRequest();
- case (ushort)ServerPacketIds.TradeAccept:
- return new S.TradeAccept();
- case (ushort)ServerPacketIds.TradeGold:
- return new S.TradeGold();
- case (ushort)ServerPacketIds.TradeItem:
- return new S.TradeItem();
- case (ushort)ServerPacketIds.TradeCost:
- return new S.TradeCost();
- case (ushort)ServerPacketIds.TradeConfirm:
- return new S.TradeConfirm();
- case (ushort)ServerPacketIds.TradeCancel:
- return new S.TradeCancel();
- case (ushort)ServerPacketIds.MountUpdate:
- return new S.MountUpdate();
- case (ushort)ServerPacketIds.TransformUpdate:
- return new S.TransformUpdate();
- case (ushort)ServerPacketIds.EquipSlotItem:
- return new S.EquipSlotItem();
- case (ushort)ServerPacketIds.FishingUpdate:
- return new S.FishingUpdate();
- case (ushort)ServerPacketIds.ChangeQuest:
- return new S.ChangeQuest();
- case (ushort)ServerPacketIds.CompleteQuest:
- return new S.CompleteQuest();
- case (ushort)ServerPacketIds.ShareQuest:
- return new S.ShareQuest();
- case (ushort)ServerPacketIds.NewQuestInfo:
- return new S.NewQuestInfo();
- case (ushort)ServerPacketIds.GainedQuestItem:
- return new S.GainedQuestItem();
- case (ushort)ServerPacketIds.DeleteQuestItem:
- return new S.DeleteQuestItem();
- case (ushort)ServerPacketIds.CancelReincarnation:
- return new S.CancelReincarnation();
- case (ushort)ServerPacketIds.RequestReincarnation:
- return new S.RequestReincarnation();
- case (ushort)ServerPacketIds.UserBackStep:
- return new S.UserBackStep();
- case (ushort)ServerPacketIds.ObjectBackStep:
- return new S.ObjectBackStep();
- case (ushort)ServerPacketIds.UserDashAttack:
- return new S.UserDashAttack();
- case (ushort)ServerPacketIds.ObjectDashAttack:
- return new S.ObjectDashAttack();
- case (ushort)ServerPacketIds.UserAttackMove://Warrior Skill - SlashingBurst
- return new S.UserAttackMove();
- case (ushort)ServerPacketIds.CombineItem:
- return new S.CombineItem();
- case (ushort)ServerPacketIds.ItemUpgraded:
- return new S.ItemUpgraded();
- case (ushort)ServerPacketIds.SetConcentration:
- return new S.SetConcentration();
- case (ushort)ServerPacketIds.SetObjectConcentration:
- return new S.SetObjectConcentration();
- case (ushort)ServerPacketIds.SetElemental:
- return new S.SetElemental();
- case (ushort)ServerPacketIds.SetObjectElemental:
- return new S.SetObjectElemental();
- case (ushort)ServerPacketIds.RemoveDelayedExplosion:
- return new S.RemoveDelayedExplosion();
- case (ushort)ServerPacketIds.ObjectDeco:
- return new S.ObjectDeco();
- case (ushort)ServerPacketIds.ObjectSneaking:
- return new S.ObjectSneaking();
- case (ushort)ServerPacketIds.ObjectLevelEffects:
- return new S.ObjectLevelEffects();
- case (ushort)ServerPacketIds.SetBindingShot:
- return new S.SetBindingShot();
- case (ushort)ServerPacketIds.SendOutputMessage:
- return new S.SendOutputMessage();
- case (ushort)ServerPacketIds.NPCAwakening:
- return new S.NPCAwakening();
- case (ushort)ServerPacketIds.NPCUnAwaken:
- return new S.NPCUnAwaken();
- case (ushort)ServerPacketIds.NPCDisassemble:
- return new S.NPCDisassemble();
- case (ushort)ServerPacketIds.NPCDowngrade:
- return new S.NPCDowngrade();
- case (ushort)ServerPacketIds.NPCReset:
- return new S.NPCReset();
- case (ushort)ServerPacketIds.AwakeningNeedMaterials:
- return new S.AwakeningNeedMaterials();
- case (ushort)ServerPacketIds.DropProtectNeedMaterials:
- return new S.DropProtectNeedMaterials();
- case (ushort)ServerPacketIds.AwakeningLockedItem:
- return new S.AwakeningLockedItem();
- case (ushort)ServerPacketIds.Awakening:
- return new S.Awakening();
- case (ushort)ServerPacketIds.UnAwakening:
- return new S.UnAwakening();
- case (ushort)ServerPacketIds.ReceiveMail:
- return new S.ReceiveMail();
- case (ushort)ServerPacketIds.MailLockedItem:
- return new S.MailLockedItem();
- case (ushort)ServerPacketIds.MailSent:
- return new S.MailSent();
- case (ushort)ServerPacketIds.MailSendRequest:
- return new S.MailSendRequest();
- case (ushort)ServerPacketIds.ParcelCollected:
- return new S.ParcelCollected();
- case (ushort)ServerPacketIds.MailCost:
- return new S.MailCost();
- case (ushort)ServerPacketIds.ResizeInventory:
- return new S.ResizeInventory();
- case (ushort)ServerPacketIds.NewIntelligentCreature:
- return new S.NewIntelligentCreature();
- case (ushort)ServerPacketIds.UpdateIntelligentCreatureList:
- return new S.UpdateIntelligentCreatureList();
- case (ushort)ServerPacketIds.IntelligentCreatureEnableRename:
- return new S.IntelligentCreatureEnableRename();
- case (ushort)ServerPacketIds.IntelligentCreaturePickup:
- return new S.IntelligentCreaturePickup();
- case (ushort)ServerPacketIds.NPCPearlGoods:
- return new S.NPCPearlGoods();
- case (ushort)ServerPacketIds.FriendUpdate:
- return new S.FriendUpdate();
- case (ushort)ServerPacketIds.FriendRequest:
- return new S.FriendRequest();
- case (ushort)ServerPacketIds.LoverUpdate:
- return new S.LoverUpdate();
- case (ushort)ServerPacketIds.MentorUpdate:
- return new S.MentorUpdate();
- case (ushort)ServerPacketIds.GuildBuffList:
- return new S.GuildBuffList();
- case (ushort)ServerPacketIds.GameShopInfo:
- return new S.GameShopInfo();
- case (ushort)ServerPacketIds.GameShopStock:
- return new S.GameShopStock();
- case (ushort)ServerPacketIds.NPCRequestInput:
- return new S.NPCRequestInput();
- case (ushort)ServerPacketIds.Rankings:
- return new S.Rankings();
- case (ushort)ServerPacketIds.Opendoor:
- return new S.Opendoor();
- case (ushort)ServerPacketIds.OpenJyxt:
- return new S.OpenJyxt();
- case (ushort)ServerPacketIds.InitialItem:
- return new S.InitialItem();
- case (ushort)ServerPacketIds.MoveShield:
- return new S.MoveShield();
- case (ushort)ServerPacketIds.ReshRecipes:
- return new S.ReshRecipes();
- case (ushort)ServerPacketIds.AboutToQuest:
- return new S.AboutToQuest();
- 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 short FireAC, WindAC, IceAC, LightAC, HolyAC, DarkAC, PhantomAC;
- public short FireMAC, WindMAC, IceMAC, LightMAC, HolyMAC, DarkMAC, PhantomMAC;
- 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;
- FireAC = 0;
- WindAC = 0;
- IceAC = 0;
- LightAC = 0;
- HolyAC = 0;
- DarkAC = 0;
- PhantomAC = 0;
- FireMAC = 0;
- WindMAC = 0;
- IceMAC = 0;
- LightMAC = 0;
- HolyMAC = 0;
- DarkMAC = 0;
- PhantomMAC = 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;
- FireAC = 0;
- WindAC = 0;
- IceAC = 0;
- LightAC = 0;
- HolyAC = 0;
- DarkAC = 0;
- PhantomAC = 0;
- FireMAC = 0;
- WindMAC = 0;
- IceMAC = 0;
- LightMAC = 0;
- HolyMAC = 0;
- DarkMAC = 0;
- PhantomMAC = 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;
- FireAC = 0;
- WindAC = 0;
- IceAC = 0;
- LightAC = 0;
- HolyAC = 0;
- DarkAC = 0;
- PhantomAC = 0;
- FireMAC = 0;
- WindMAC = 0;
- IceMAC = 0;
- LightMAC = 0;
- HolyMAC = 0;
- DarkMAC = 0;
- PhantomMAC = 0;
- 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;
- FireAC = 0;
- WindAC = 0;
- IceAC = 0;
- LightAC = 0;
- HolyAC = 0;
- DarkAC = 0;
- PhantomAC = 0;
- FireMAC = 0;
- WindMAC = 0;
- IceMAC = 0;
- LightMAC = 0;
- HolyMAC = 0;
- DarkMAC = 0;
- PhantomMAC = 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;
- FireAC = 0;
- WindAC = 0;
- IceAC = 0;
- LightAC = 0;
- HolyAC = 0;
- DarkAC = 0;
- PhantomAC = 0;
- FireMAC = 0;
- WindMAC = 0;
- IceMAC = 0;
- LightMAC = 0;
- HolyMAC = 0;
- DarkMAC = 0;
- PhantomMAC = 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();
- FireAC = reader.ReadInt16();
- WindAC = reader.ReadInt16();
- IceAC = reader.ReadInt16();
- LightAC = reader.ReadInt16();
- HolyAC = reader.ReadInt16();
- DarkAC = reader.ReadInt16();
- PhantomAC = reader.ReadInt16();
- FireMAC = reader.ReadInt16();
- WindMAC = reader.ReadInt16();
- IceMAC = reader.ReadInt16();
- LightMAC = reader.ReadInt16();
- HolyMAC = reader.ReadInt16();
- DarkMAC = reader.ReadInt16();
- PhantomMAC = reader.ReadInt16();
- 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(FireAC);
- writer.Write(WindAC);
- writer.Write(IceAC);
- writer.Write(LightAC);
- writer.Write(HolyAC);
- writer.Write(DarkAC);
- writer.Write(PhantomAC);
- writer.Write(FireMAC);
- writer.Write(WindMAC);
- writer.Write(IceMAC);
- writer.Write(LightMAC);
- writer.Write(HolyMAC);
- writer.Write(DarkMAC);
- writer.Write(PhantomMAC);
- 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 AttackFireChance, AttackFireStatChance, AttackFireMaxStat;
- public byte AttackIceChance, AttackIceStatChance, AttackIceMaxStat;
- public byte AttackWindChance, AttackWindStatChance, AttackWindMaxStat;
- public byte AttackLightChance, AttackLightStatChance, AttackLightMaxStat;
- public byte AttackHolyChance, AttackHolyStatChance, AttackHolyMaxStat;
- public byte AttackDarkChance, AttackDarkStatChance, AttackDarkMaxStat;
- public byte AttackPhantomChance, AttackPhantomStatChance, AttackPhantomMaxStat;
- public byte EIAkNum, EiAcNum, EiAcStatChance, EiAcMaxStat;
- public byte BagWeightChance, BagWeightStatChance, BagWeightMaxStat;
- public byte WearWeightChance, WearWeightStatChance, WearWeightMaxStat;
- public byte HandWeightChance, HandWeightStatChance, HandWeightMaxStat;
- public byte CurseChance;
- public byte HideMaxAcChance, HideMaxAcStatChance, HideMaxAcMaxStat;
- public byte HideMaxMacChance, HideMaxMacStatChance, HideMaxMacMaxStat;
- public byte HideMaxDcChance, HideMaxDcStatChance, HideMaxDcMaxStat;
- public byte HideMaxMcChance, HideMaxMcStatChance, HideMaxMcMaxStat;
- public byte HideMaxScChance, HideMaxScStatChance, HideMaxScMaxStat;
- public byte HideAccuracyChance, HideAccuracyStatChance, HideAccuracyMaxStat;
- public byte HideAgilityChance, HideAgilityStatChance, HideAgilityMaxStat;
- 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:
- // case ItemSet.魔血:
- // 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:
- // //case ItemSet.金刚:
- // //case ItemSet.诺玛:
- // //case ItemSet.魔令:
- // case ItemSet.祈祷:
- // return 5;
- // default:
- // return 0;
- // }
- // }
- // }
- // public byte Count;
- // public bool SetComplete
- // {
- // get
- // {
- // return Count == Amount;
- // }
- // }
- //}
- public class ItemSetInfo
- {
- public int ID;
- public string Name;
- public List<int> ItemList = new List<int>();
- public int AvaliableCount;
- public bool RepeatWearCal = false;
- public int MinAC, MaxAC, MinMAC, MaxMAC, MinDC, MaxDC, MinMC, MaxMC, MinSC, MaxSC, Accuracy, Agility;
- public int FireAC, WindAC, IceAC, LightAC, HolyAC, DarkAC, PhantomAC;
- public int FireMAC, WindMAC, IceMAC, LightMAC, HolyMAC, DarkMAC, PhantomMAC;
- public int HP, MP;
- public int AttackSpeed, Luck;
- public int MagicResist, PoisonResist, HealthRecovery, SpellRecovery, PoisonRecovery, HPrate, MPrate;
- public int CriticalRate, CriticalDamage;
- public int MaxAcRate, MaxMacRate, Holy, Freezing, PoisonAttack, HpDrainRate;
- public int Reflect, Parry, IgnoreAC, IgnoreMAC;
- public int ACRate, MacRate;
- public override string ToString()
- {
- return Name;
- }
- }
- public class ItemSets
- {
- public ItemSetInfo Set;
- public List<int> ItemIndex;
- private byte Amount
- {
- get
- {
- return (byte)Set.AvaliableCount;
- }
- }
- 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 int MapMineIndex;
- public byte Mine;
- public Point Location;
- public ushort Size;
- public MineZone()
- {
- }
- public MineZone(MySqlDataReader readerMineZoneInfo)
- {
- MapMineIndex = Convert.ToInt32(readerMineZoneInfo["MapMineIndex"]);
- Location = new Point(Convert.ToInt32(readerMineZoneInfo["Location_X"]), Convert.ToInt32(readerMineZoneInfo["Location_Y"]));
- Size = Convert.ToUInt16(readerMineZoneInfo["Size"]);
- Mine = Convert.ToByte(readerMineZoneInfo["Mine"]);
- }
- 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;
- [JsonIgnore]
- public object Player;
- public DateTime LastLogin;
- public bool hasvoted;
- public bool Online;
- public string LatestLocateMap="";
- public int DonatePoint;
- 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;
- LatestLocateMap=reader.ReadString();
- if (string.IsNullOrEmpty(LatestLocateMap))
- {
- LatestLocateMap = "";
- }
- DonatePoint=reader.ReadInt32();
- }
- public void save(BinaryWriter writer)
- {
- writer.Write(name);
- writer.Write(Id);
- writer.Write(LastLogin.ToBinary());
- writer.Write(hasvoted);
- writer.Write(Online);
- writer.Write(LatestLocateMap);
- writer.Write(DonatePoint);
- }
- }
- [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("防御力+ 0-{0}.", BuffAc);
- if (text != "") text += "\n";
- }
- if (BuffMac > 0)
- {
- text += string.Format("魔法防御+ 0-{0}.", BuffMac);
- if (text != "") text += "\n";
- }
- if (BuffDc > 0)
- {
- text += string.Format("攻击+ 0-{0}.", BuffDc);
- if (text != "") text += "\n";
- }
- if (BuffMc > 0)
- {
- text += string.Format("自然系魔法+ 0-{0}.", BuffMc);
- if (text != "") text += "\n";
- }
- if (BuffSc > 0)
- {
- text += string.Format("灵魂系魔法+ 0-{0}.", BuffSc);
- if (text != "") text += "\n";
- }
- if (BuffMaxHp > 0)
- {
- text += string.Format("HP + {0}.", BuffMaxHp);
- if (text != "") text += "\n";
- }
- if (BuffMaxMp > 0)
- {
- text += string.Format("MP + {0}.", BuffMaxMp);
- if (text != "") text += "\n";
- }
- if (BuffHpRegen > 0)
- {
- text += string.Format("HP恢复+ {0}.", BuffHpRegen);
- if (text != "") text += "\n";
- }
- if (BuffMPRegen > 0)
- {
- text += string.Format("MP恢复+ {0}.", BuffMPRegen);
- if (text != "") text += "\n";
- }
- if (BuffMineRate > 0)
- {
- text += string.Format("采矿出矿率+ {0}%.", BuffMineRate * 5);
- if (text != "") text += "\n";
- }
- if (BuffGemRate > 0)
- {
- text += string.Format("宝玉成功率+ {0}%.", BuffGemRate * 5);
- if (text != "") text += "\n";
- }
- if (BuffFishRate > 0)
- {
- text += string.Format("钓鱼成功率+ {0}%.", BuffFishRate * 5);
- if (text != "") text += "\n";
- }
- if (BuffExpRate > 0)
- {
- text += string.Format("获取经验+ {0}%.", BuffExpRate);
- if (text != "") text += "\n";
- }
- if (BuffCraftRate > 0)
- {
- text += string.Format("制作成功率+ {0}%.", BuffCraftRate * 5);
- if (text != "") text += "\n";
- }
- if (BuffSkillRate > 0)
- {
- text += string.Format("技能熟练度+ {0}.", BuffSkillRate);
- if (text != "") text += "\n";
- }
- if (BuffAttack > 0)
- {
- text += string.Format("伤害+ {0}.", BuffAttack);
- if (text != "") text += "\n";
- }
- if (BuffDropRate > 0)
- {
- text += string.Format("掉宝率+ {0}%.", BuffDropRate);
- if (text != "") text += "\n";
- }
- if (BuffGoldRate > 0)
- {
- text += string.Format("庄园税金+ {0}%.", BuffGoldRate);
- if (text != "") text += "\n";
- }
- return text;
- }
- }
- public class GuildMemberRequest
- {
- public int Index;
- public DateTime RequestTime;
- public string Remark;
- }
- 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 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: 关闭, 1: 打开中, 2: 打开, 3: 关闭中
- public byte ImageIndex;
- public long LastTick;
- public Point Location;
- }
- public class Accountdata
- {
- public virtual int IndexID { get; set; }
- public virtual string AccountID { get; set; }
- public virtual string Password { get; set; }
- public virtual int AccountResize { get; set; }
- public virtual int Gold { get; set; }
- public virtual int Credit { get; set; }
- public virtual short AdminAccount { get; set; }
- public virtual int HookSuspicionLevel { get; set; }
- public Accountdata()
- {
- }
- public Accountdata(BinaryReader reader)
- {
- IndexID = reader.ReadInt32();
- AccountID = reader.ReadString();
- Password = reader.ReadString();
- AccountResize = reader.ReadInt32();
- Gold = reader.ReadInt32();
- Credit = reader.ReadInt32();
- AdminAccount = reader.ReadInt16();
- HookSuspicionLevel = reader.ReadInt32();
- }
- public void Save(BinaryWriter writer)
- {
- writer.Write(IndexID);
- writer.Write(AccountID);
- writer.Write(Password);
- writer.Write(AccountResize);
- writer.Write(Gold);
- writer.Write(Credit);
- writer.Write(AdminAccount);
- writer.Write(HookSuspicionLevel);
- }
- }
|