PlayerObject.cs 283 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285
  1. using Client.MirGraphics;
  2. using Client.MirNetwork;
  3. using Client.MirScenes;
  4. using Client.MirSounds;
  5. using Client.MirControls;
  6. using S = ServerPackets;
  7. using C = ClientPackets;
  8. using Client.MirScenes.Dialogs;
  9. using System.Reflection;
  10. namespace Client.MirObjects
  11. {
  12. public class PlayerObject : MapObject
  13. {
  14. public override ObjectType Race
  15. {
  16. get { return ObjectType.Player; }
  17. }
  18. public override bool Blocking
  19. {
  20. get { return !Dead; }
  21. }
  22. public MirGender Gender;
  23. public MirClass Class;
  24. public byte Hair;
  25. public ushort Level;
  26. public MLibrary WeaponLibrary1, WeaponEffectLibrary1, WeaponLibrary2, HairLibrary, WingLibrary, MountLibrary;
  27. public int Armour, Weapon, WeaponEffect, ArmourOffSet, HairOffSet, WeaponOffSet, WingOffset, MountOffset;
  28. public int DieSound, FlinchSound, AttackSound;
  29. public FrameSet Frames;
  30. public Frame Frame, WingFrame;
  31. public int FrameIndex, FrameInterval, EffectFrameIndex, EffectFrameInterval, SlowFrameIndex;
  32. public byte SkipFrameUpdate = 0;
  33. public bool HasClassWeapon
  34. {
  35. get
  36. {
  37. switch (Weapon / Globals.ClassWeaponCount)
  38. {
  39. default:
  40. return Class == MirClass.Wizard || Class == MirClass.Warrior || Class == MirClass.Taoist;
  41. case 1:
  42. return Class == MirClass.Assassin;
  43. case 2:
  44. return Class == MirClass.Archer;
  45. }
  46. }
  47. }
  48. public bool HasFishingRod
  49. {
  50. get
  51. {
  52. return Globals.FishingRodShapes.Contains(Weapon);
  53. }
  54. }
  55. public Spell Spell;
  56. public byte SpellLevel;
  57. public bool Cast;
  58. public uint TargetID;
  59. public List<uint> SecondaryTargetIDs;
  60. public Point TargetPoint;
  61. public bool MagicShield;
  62. public Effect ShieldEffect;
  63. public bool ElementalBarrier;
  64. public Effect ElementalBarrierEffect;
  65. public byte WingEffect;
  66. private short StanceDelay = 2500;
  67. //ArcherSpells - Elemental system
  68. public bool ElementalBuff;
  69. public bool Concentrating;
  70. public InterruptionEffect ConcentratingEffect;
  71. public bool ConcentrateInterrupted;
  72. public bool HasElements;
  73. public bool ElementCasted;
  74. public int ElementEffect;//hold orb count for player(object) load
  75. public int ElementsLevel;
  76. public int ElementOrbMax;
  77. //Elemental system END
  78. public SpellEffect CurrentEffect;
  79. public bool RidingMount, Sprint, FastRun, Fishing, FoundFish;
  80. public long StanceTime, MountTime, FishingTime;
  81. public long BlizzardStopTime, ReincarnationStopTime, SlashingBurstTime;
  82. public short MountType = -1, TransformType = -1;
  83. public string GuildName;
  84. public string GuildRankName;
  85. public Point FishingPoint;
  86. public LevelEffects LevelEffects;
  87. public PlayerObject() { }
  88. public PlayerObject(uint objectID) : base(objectID)
  89. {
  90. Frames = FrameSet.Player;
  91. }
  92. public void Load(S.ObjectPlayer info)
  93. {
  94. Name = info.Name;
  95. NameColour = info.NameColour;
  96. GuildName = info.GuildName;
  97. GuildRankName = info.GuildRankName;
  98. Class = info.Class;
  99. Gender = info.Gender;
  100. Level = info.Level;
  101. CurrentLocation = info.Location;
  102. MapLocation = info.Location;
  103. GameScene.Scene.MapControl.AddObject(this);
  104. Direction = info.Direction;
  105. Hair = info.Hair;
  106. Weapon = info.Weapon;
  107. WeaponEffect = info.WeaponEffect;
  108. Armour = info.Armour;
  109. Light = info.Light;
  110. Poison = info.Poison;
  111. Dead = info.Dead;
  112. Hidden = info.Hidden;
  113. WingEffect = info.WingEffect;
  114. CurrentEffect = info.Effect;
  115. MountType = info.MountType;
  116. RidingMount = info.RidingMount;
  117. Fishing = info.Fishing;
  118. TransformType = info.TransformType;
  119. SetLibraries();
  120. if (Dead) ActionFeed.Add(new QueuedAction { Action = MirAction.Dead, Direction = Direction, Location = CurrentLocation });
  121. if (info.Extra) Effects.Add(new Effect(Libraries.Magic2, 670, 10, 800, this));
  122. ElementEffect = (int)info.ElementOrbEffect;
  123. ElementsLevel = (int)info.ElementOrbLvl;
  124. ElementOrbMax = (int)info.ElementOrbMax;
  125. Buffs = info.Buffs;
  126. LevelEffects = info.LevelEffects;
  127. ProcessBuffs();
  128. SetAction();
  129. SetEffects();
  130. }
  131. public void Update(S.PlayerUpdate info)
  132. {
  133. Weapon = info.Weapon;
  134. WeaponEffect = info.WeaponEffect;
  135. Armour = info.Armour;
  136. Light = info.Light;
  137. WingEffect = info.WingEffect;
  138. SetLibraries();
  139. SetEffects();
  140. }
  141. public override bool ShouldDrawHealth()
  142. {
  143. if (GroupDialog.GroupList.Contains(Name) || this == User)
  144. {
  145. return true;
  146. }
  147. else
  148. {
  149. return false;
  150. }
  151. }
  152. public void ProcessBuffs()
  153. {
  154. for (int i = 0; i < Buffs.Count; i++)
  155. {
  156. AddBuffEffect(Buffs[i]);
  157. }
  158. }
  159. public void MountUpdate(S.MountUpdate info)
  160. {
  161. MountType = info.MountType;
  162. RidingMount = info.RidingMount;
  163. QueuedAction action = new QueuedAction { Action = MirAction.Standing, Direction = Direction, Location = CurrentLocation };
  164. ActionFeed.Insert(0, action);
  165. MountTime = CMain.Time;
  166. if (MountType < 0)
  167. GameScene.Scene.MountDialog.Hide();
  168. SetLibraries();
  169. SetEffects();
  170. PlayMountSound();
  171. }
  172. public void FishingUpdate(S.FishingUpdate p)
  173. {
  174. if (Fishing != p.Fishing)
  175. {
  176. MirDirection dir = Functions.DirectionFromPoint(CurrentLocation, p.FishingPoint);
  177. if (p.Fishing)
  178. {
  179. QueuedAction action = new QueuedAction { Action = MirAction.FishingCast, Direction = dir, Location = CurrentLocation };
  180. ActionFeed.Add(action);
  181. }
  182. else
  183. {
  184. QueuedAction action = new QueuedAction { Action = MirAction.FishingReel, Direction = dir, Location = CurrentLocation };
  185. ActionFeed.Add(action);
  186. }
  187. Fishing = p.Fishing;
  188. SetLibraries();
  189. }
  190. if (!HasFishingRod)
  191. {
  192. GameScene.Scene.FishingDialog.Hide();
  193. }
  194. FishingPoint = p.FishingPoint;
  195. FoundFish = p.FoundFish;
  196. }
  197. public virtual void SetLibraries()
  198. {
  199. //fishing broken
  200. //10
  201. //11
  202. //12
  203. //13
  204. //almost all broken
  205. //20 - black footballer - 791
  206. //21 - red footballer - 791
  207. //22 - blue footballer - 791
  208. //23 - green footballer - 791
  209. //24 - red2 footballer - 791
  210. bool altAnim = false;
  211. bool showMount = true;
  212. bool showFishing = true;
  213. if (TransformType > -1)
  214. {
  215. #region Transform
  216. switch (TransformType)
  217. {
  218. case 4:
  219. case 5:
  220. case 7:
  221. case 8:
  222. case 26:
  223. case 28:
  224. case 29:
  225. case 30:
  226. case 31:
  227. case 32:
  228. case 33:
  229. case 34:
  230. case 35:
  231. case 36:
  232. case 37:
  233. case 38:
  234. showFishing = false;
  235. break;
  236. case 6:
  237. case 9:
  238. showMount = false;
  239. showFishing = false;
  240. break;
  241. default:
  242. break;
  243. }
  244. switch (CurrentAction)
  245. {
  246. case MirAction.Standing:
  247. case MirAction.Jump:
  248. Frames.TryGetValue(MirAction.Standing, out Frame);
  249. break;
  250. case MirAction.Walking:
  251. case MirAction.WalkingBow:
  252. Frames.TryGetValue(MirAction.Walking, out Frame);
  253. break;
  254. case MirAction.Running:
  255. case MirAction.RunningBow:
  256. Frames.TryGetValue(MirAction.Running, out Frame);
  257. break;
  258. case MirAction.Attack1:
  259. case MirAction.Attack2:
  260. case MirAction.Attack3:
  261. case MirAction.Attack4:
  262. case MirAction.AttackRange1:
  263. case MirAction.AttackRange2:
  264. case MirAction.AttackRange3:
  265. Frames.TryGetValue(MirAction.Attack1, out Frame);
  266. break;
  267. }
  268. if (MountType > 6 && RidingMount)
  269. {
  270. ArmourOffSet = -416;
  271. BodyLibrary = TransformType < Libraries.TransformMounts.Length ? Libraries.TransformMounts[TransformType] : Libraries.TransformMounts[0];
  272. }
  273. else
  274. {
  275. ArmourOffSet = 0;
  276. BodyLibrary = TransformType < Libraries.Transform.Length ? Libraries.Transform[TransformType] : Libraries.Transform[0];
  277. }
  278. HairLibrary = null;
  279. WeaponLibrary1 = null;
  280. WeaponLibrary2 = null;
  281. if (TransformType == 19)
  282. {
  283. WingEffect = 2;
  284. WingLibrary = WingEffect - 1 < Libraries.TransformEffect.Length ? Libraries.TransformEffect[WingEffect - 1] : null;
  285. }
  286. else
  287. {
  288. WingLibrary = null;
  289. }
  290. HairOffSet = 0;
  291. WeaponOffSet = 0;
  292. WingOffset = 0;
  293. MountOffset = 0;
  294. #endregion
  295. }
  296. else
  297. {
  298. switch (Class)
  299. {
  300. #region Archer
  301. case MirClass.Archer:
  302. #region WeaponType
  303. if (HasClassWeapon)
  304. {
  305. switch (CurrentAction)
  306. {
  307. case MirAction.Walking:
  308. case MirAction.Running:
  309. case MirAction.AttackRange1:
  310. case MirAction.AttackRange2:
  311. altAnim = true;
  312. break;
  313. }
  314. }
  315. if (CurrentAction == MirAction.Jump) altAnim = true;
  316. #endregion
  317. #region Armours
  318. if (altAnim)
  319. {
  320. BodyLibrary = Armour < Libraries.ARArmours.Length ? Libraries.ARArmours[Armour] : Libraries.ARArmours[0];
  321. HairLibrary = Hair < Libraries.ARHair.Length ? Libraries.ARHair[Hair] : null;
  322. }
  323. else
  324. {
  325. BodyLibrary = Armour < Libraries.CArmours.Length ? Libraries.CArmours[Armour] : Libraries.CArmours[0];
  326. HairLibrary = Hair < Libraries.CHair.Length ? Libraries.CHair[Hair] : null;
  327. }
  328. #endregion
  329. #region Weapons
  330. if (HasClassWeapon)
  331. {
  332. int Index = Weapon - 200;
  333. if (altAnim)
  334. WeaponLibrary2 = Index < Libraries.ARWeaponsS.Length ? Libraries.ARWeaponsS[Index] : null;
  335. else
  336. WeaponLibrary2 = Index < Libraries.ARWeapons.Length ? Libraries.ARWeapons[Index] : null;
  337. WeaponLibrary1 = null;
  338. }
  339. else
  340. {
  341. if (Weapon >= 0)
  342. {
  343. WeaponLibrary1 = Weapon < Libraries.CWeapons.Length ? Libraries.CWeapons[Weapon] : null;
  344. if (WeaponEffect > 0)
  345. WeaponEffectLibrary1 = WeaponEffect < Libraries.CWeaponEffect.Length ? Libraries.CWeaponEffect[WeaponEffect] : null;
  346. else
  347. WeaponEffectLibrary1 = null;
  348. WeaponLibrary2 = null;
  349. }
  350. else
  351. {
  352. WeaponLibrary1 = null;
  353. WeaponEffectLibrary1 = null;
  354. WeaponLibrary2 = null;
  355. }
  356. }
  357. #endregion
  358. #region WingEffects
  359. if (WingEffect > 0 && WingEffect < 100)
  360. {
  361. if (altAnim)
  362. WingLibrary = (WingEffect - 1) < Libraries.ARHumEffect.Length ? Libraries.ARHumEffect[WingEffect - 1] : null;
  363. else
  364. WingLibrary = (WingEffect - 1) < Libraries.CHumEffect.Length ? Libraries.CHumEffect[WingEffect - 1] : null;
  365. }
  366. #endregion
  367. #region Offsets
  368. ArmourOffSet = Gender == MirGender.Male ? 0 : altAnim ? 352 : 808;
  369. HairOffSet = Gender == MirGender.Male ? 0 : altAnim ? 352 : 808;
  370. WeaponOffSet = Gender == MirGender.Male ? 0 : altAnim ? 352 : 416;
  371. WingOffset = Gender == MirGender.Male ? 0 : altAnim ? 352 : 840;
  372. MountOffset = 0;
  373. #endregion
  374. break;
  375. #endregion
  376. #region Assassin
  377. case MirClass.Assassin:
  378. #region WeaponType
  379. if (HasClassWeapon || Weapon < 0)
  380. {
  381. switch (CurrentAction)
  382. {
  383. case MirAction.Standing:
  384. case MirAction.Stance:
  385. case MirAction.Walking:
  386. case MirAction.Running:
  387. case MirAction.Die:
  388. case MirAction.Struck:
  389. case MirAction.Attack1:
  390. case MirAction.Attack2:
  391. case MirAction.Attack3:
  392. case MirAction.Attack4:
  393. case MirAction.Sneek:
  394. case MirAction.Spell:
  395. case MirAction.DashAttack:
  396. altAnim = true;
  397. break;
  398. }
  399. }
  400. #endregion
  401. #region Armours
  402. if (altAnim)
  403. {
  404. BodyLibrary = Armour < Libraries.AArmours.Length ? Libraries.AArmours[Armour] : Libraries.AArmours[0];
  405. HairLibrary = Hair < Libraries.AHair.Length ? Libraries.AHair[Hair] : null;
  406. }
  407. else
  408. {
  409. BodyLibrary = Armour < Libraries.CArmours.Length ? Libraries.CArmours[Armour] : Libraries.CArmours[0];
  410. HairLibrary = Hair < Libraries.CHair.Length ? Libraries.CHair[Hair] : null;
  411. }
  412. #endregion
  413. #region Weapons
  414. if (HasClassWeapon)
  415. {
  416. int Index = Weapon - 100;
  417. WeaponLibrary1 = Index < Libraries.AWeaponsL.Length ? Libraries.AWeaponsR[Index] : null;
  418. WeaponLibrary2 = Index < Libraries.AWeaponsR.Length ? Libraries.AWeaponsL[Index] : null;
  419. }
  420. else
  421. {
  422. if (Weapon >= 0)
  423. {
  424. WeaponLibrary1 = Weapon < Libraries.CWeapons.Length ? Libraries.CWeapons[Weapon] : null;
  425. if (WeaponEffect > 0)
  426. WeaponEffectLibrary1 = WeaponEffect < Libraries.CWeaponEffect.Length ? Libraries.CWeaponEffect[WeaponEffect] : null;
  427. else
  428. WeaponEffectLibrary1 = null;
  429. WeaponLibrary2 = null;
  430. }
  431. else
  432. {
  433. WeaponLibrary1 = null;
  434. WeaponEffectLibrary1 = null;
  435. WeaponLibrary2 = null;
  436. }
  437. }
  438. #endregion
  439. #region WingEffects
  440. if (WingEffect > 0 && WingEffect < 100)
  441. {
  442. if (altAnim)
  443. WingLibrary = (WingEffect - 1) < Libraries.AHumEffect.Length ? Libraries.AHumEffect[WingEffect - 1] : null;
  444. else
  445. WingLibrary = (WingEffect - 1) < Libraries.CHumEffect.Length ? Libraries.CHumEffect[WingEffect - 1] : null;
  446. }
  447. #endregion
  448. #region Offsets
  449. ArmourOffSet = Gender == MirGender.Male ? 0 : altAnim ? 512 : 808;
  450. HairOffSet = Gender == MirGender.Male ? 0 : altAnim ? 512 : 808;
  451. WeaponOffSet = Gender == MirGender.Male ? 0 : altAnim ? 512 : 416;
  452. WingOffset = Gender == MirGender.Male ? 0 : altAnim ? 544 : 840;
  453. MountOffset = 0;
  454. #endregion
  455. break;
  456. #endregion
  457. #region Others
  458. case MirClass.Warrior:
  459. case MirClass.Taoist:
  460. case MirClass.Wizard:
  461. #region Armours
  462. BodyLibrary = Armour < Libraries.CArmours.Length ? Libraries.CArmours[Armour] : Libraries.CArmours[0];
  463. HairLibrary = Hair < Libraries.CHair.Length ? Libraries.CHair[Hair] : null;
  464. #endregion
  465. #region Weapons
  466. if (Weapon >= 0)
  467. {
  468. WeaponLibrary1 = Weapon < Libraries.CWeapons.Length ? Libraries.CWeapons[Weapon] : null;
  469. if (WeaponEffect > 0)
  470. WeaponEffectLibrary1 = WeaponEffect < Libraries.CWeaponEffect.Length ? Libraries.CWeaponEffect[WeaponEffect] : null;
  471. else
  472. WeaponEffectLibrary1 = null;
  473. }
  474. else
  475. {
  476. WeaponLibrary1 = null;
  477. WeaponEffectLibrary1 = null;
  478. WeaponLibrary2 = null;
  479. }
  480. #endregion
  481. #region WingEffects
  482. if (WingEffect > 0 && WingEffect < 100)
  483. {
  484. WingLibrary = (WingEffect - 1) < Libraries.CHumEffect.Length ? Libraries.CHumEffect[WingEffect - 1] : null;
  485. }
  486. #endregion
  487. #region Offsets
  488. ArmourOffSet = Gender == MirGender.Male ? 0 : 808;
  489. HairOffSet = Gender == MirGender.Male ? 0 : 808;
  490. WeaponOffSet = Gender == MirGender.Male ? 0 : 416;
  491. WingOffset = Gender == MirGender.Male ? 0 : 840;
  492. MountOffset = 0;
  493. #endregion
  494. break;
  495. #endregion
  496. }
  497. }
  498. #region Common
  499. //Harvest
  500. if (CurrentAction == MirAction.Harvest && TransformType < 0)
  501. {
  502. WeaponLibrary1 = 1 < Libraries.CWeapons.Length ? Libraries.CWeapons[1] : null;
  503. }
  504. //Mounts
  505. if (MountType > -1 && RidingMount && showMount)
  506. {
  507. MountLibrary = MountType < Libraries.Mounts.Length ? Libraries.Mounts[MountType] : null;
  508. }
  509. else
  510. {
  511. MountLibrary = null;
  512. }
  513. //Fishing
  514. if (HasFishingRod && showFishing)
  515. {
  516. if (CurrentAction == MirAction.FishingCast || CurrentAction == MirAction.FishingWait || CurrentAction == MirAction.FishingReel)
  517. {
  518. WeaponLibrary1 = 0 < Libraries.Fishing.Length ? Libraries.Fishing[Weapon - 49] : null;
  519. WeaponLibrary2 = null;
  520. WeaponOffSet = -632;
  521. }
  522. }
  523. DieSound = Gender == MirGender.Male ? SoundList.MaleDie : SoundList.FemaleDie;
  524. FlinchSound = Gender == MirGender.Male ? SoundList.MaleFlinch : SoundList.FemaleFlinch;
  525. #endregion
  526. }
  527. public virtual void SetEffects()
  528. {
  529. for (int i = Effects.Count - 1; i >= 0; i--)
  530. {
  531. if (Effects[i] is SpecialEffect) Effects[i].Remove();
  532. }
  533. if (RidingMount) return;
  534. if (CurrentEffect == SpellEffect.MagicShieldUp)
  535. {
  536. if (ShieldEffect != null)
  537. {
  538. ShieldEffect.Clear();
  539. ShieldEffect.Remove();
  540. }
  541. MagicShield = true;
  542. Effects.Add(ShieldEffect = new Effect(Libraries.Magic, 3890, 3, 600, this) { Repeat = true });
  543. }
  544. if (WingEffect >= 100)
  545. {
  546. switch(WingEffect)
  547. {
  548. case 100: //Oma King Robe effect
  549. Effects.Add(new SpecialEffect(Libraries.Effect, 352, 33, 3600, this, true, false, 0) { Repeat = true });
  550. break;
  551. case 101://Black Dragon Armour Fire effect
  552. Effects.Add(new SpecialEffect(Libraries.CHumEffect[4], 0, 10, 1500, this, true, false, 0u)
  553. {
  554. Repeat = true
  555. });
  556. break;
  557. }
  558. }
  559. long delay = 5000;
  560. if (LevelEffects == LevelEffects.None) return;
  561. //Effects dependant on flags
  562. if (LevelEffects.HasFlag(LevelEffects.BlueDragon))
  563. {
  564. Effects.Add(new SpecialEffect(Libraries.Effect, 1210, 20, 3200, this, true, true, 1) { Repeat = true });
  565. SpecialEffect effect = new SpecialEffect(Libraries.Effect, 1240, 32, 4200, this, true, false, 1) { Repeat = true };
  566. effect.SetStart(CMain.Time);
  567. Effects.Add(effect);
  568. }
  569. if (LevelEffects.HasFlag(LevelEffects.RedDragon))
  570. {
  571. Effects.Add(new SpecialEffect(Libraries.Effect, 990, 20, 3200, this, true, true, 1) { Repeat = true });
  572. SpecialEffect effect = new SpecialEffect(Libraries.Effect, 1020, 32, 4200, this, true, false, 1) { Repeat = true, Delay = delay };
  573. effect.SetStart(CMain.Time + delay);
  574. Effects.Add(effect);
  575. }
  576. if (LevelEffects.HasFlag(LevelEffects.Mist))
  577. {
  578. Effects.Add(new SpecialEffect(Libraries.Effect, 296, 32, 3600, this, true, false, 1) { Repeat = true });
  579. }
  580. if (LevelEffects.HasFlag(LevelEffects.Rebirth1))
  581. {
  582. Effects.Add(new SpecialEffect(Libraries.Magic3, 6800, 20, 3600, this, true, false, 1) { Repeat = true });
  583. }
  584. if (LevelEffects.HasFlag(LevelEffects.Rebirth2))
  585. {
  586. Effects.Add(new SpecialEffect(Libraries.Magic3, 6870, 19, 3600, this, true, true, 1) { Repeat = true });
  587. SpecialEffect effect = new SpecialEffect(Libraries.Magic3, 6840, 22, 3600, this, true, false, 1) { Repeat = true, Delay = delay };
  588. effect.SetStart(CMain.Time + delay);
  589. Effects.Add(effect);
  590. }
  591. if (LevelEffects.HasFlag(LevelEffects.Rebirth3))
  592. {
  593. Effects.Add(new SpecialEffect(Libraries.Magic3, 6906, 19, 3600, this, true, false, 1) { Repeat = true, Delay = delay });
  594. SpecialEffect effect = new SpecialEffect(Libraries.Magic3, 6930, 29, 3600, this, true, true, 1) { Repeat = true };
  595. Effects.Add(effect);
  596. }
  597. if (LevelEffects.HasFlag(LevelEffects.NewBlue))
  598. {
  599. Effects.Add(new SpecialEffect(Libraries.Magic3, 7040, 31, 3600, this, true, false, 1) { Repeat = true, Delay = delay });
  600. SpecialEffect effect = new SpecialEffect(Libraries.Magic3,7080, 24, 3600, this, true, true, 1) { Repeat = true };
  601. Effects.Add(effect);
  602. }
  603. if (LevelEffects.HasFlag(LevelEffects.YellowDragon))
  604. {
  605. Effects.Add(new SpecialEffect(Libraries.Magic3, 7120, 31, 3600, this, true, false, 1) { Repeat = true, Delay = delay });
  606. SpecialEffect effect = new SpecialEffect(Libraries.Magic3, 7160, 24, 3600, this, true, true, 1) { Repeat = true };
  607. Effects.Add(effect);
  608. }
  609. if (LevelEffects.HasFlag(LevelEffects.Phoenix))
  610. {
  611. Effects.Add(new SpecialEffect(Libraries.Magic3, 6970, 26, 3600, this, true, false, 1) { Repeat = true, Delay = delay });
  612. SpecialEffect effect = new SpecialEffect(Libraries.Magic3, 7000, 21, 3600, this, true, true, 1) { Repeat = true };
  613. Effects.Add(effect);
  614. }
  615. }
  616. public override void Process()
  617. {
  618. bool update = CMain.Time >= NextMotion || GameScene.CanMove;
  619. if (this == User)
  620. {
  621. if (CMain.Time - GameScene.LastRunTime > 899)
  622. GameScene.CanRun = false;
  623. }
  624. SkipFrames = this != User && ActionFeed.Count > 0;
  625. ProcessFrames();
  626. if (Frame == null)
  627. {
  628. DrawFrame = 0;
  629. DrawWingFrame = 0;
  630. }
  631. else
  632. {
  633. DrawFrame = Frame.Start + (Frame.OffSet * (byte)Direction) + FrameIndex;
  634. DrawWingFrame = Frame.EffectStart + (Frame.EffectOffSet * (byte)Direction) + EffectFrameIndex;
  635. }
  636. #region Moving OffSet
  637. switch (CurrentAction)
  638. {
  639. case MirAction.Walking:
  640. case MirAction.Running:
  641. case MirAction.MountWalking:
  642. case MirAction.MountRunning:
  643. case MirAction.Pushed:
  644. case MirAction.DashL:
  645. case MirAction.DashR:
  646. case MirAction.Sneek:
  647. case MirAction.Jump:
  648. case MirAction.DashAttack:
  649. if (Frame == null)
  650. {
  651. OffSetMove = Point.Empty;
  652. Movement = CurrentLocation;
  653. break;
  654. }
  655. var i = 0;
  656. if (CurrentAction == MirAction.MountRunning) i = 3;
  657. else if (CurrentAction == MirAction.Running)
  658. i = (Sprint && !Sneaking ? 3 : 2);
  659. else i = 1;
  660. if (CurrentAction == MirAction.Jump) i = -JumpDistance;
  661. if (CurrentAction == MirAction.DashAttack) i = JumpDistance;
  662. Movement = Functions.PointMove(CurrentLocation, Direction, CurrentAction == MirAction.Pushed ? 0 : -i);
  663. int count = Frame.Count;
  664. int index = FrameIndex;
  665. if (CurrentAction == MirAction.DashR || CurrentAction == MirAction.DashL)
  666. {
  667. count = 3;
  668. index %= 3;
  669. }
  670. switch (Direction)
  671. {
  672. case MirDirection.Up:
  673. OffSetMove = new Point(0, (int)((MapControl.CellHeight * i / (float)(count)) * (index + 1)));
  674. break;
  675. case MirDirection.UpRight:
  676. OffSetMove = new Point((int)((-MapControl.CellWidth * i / (float)(count)) * (index + 1)), (int)((MapControl.CellHeight * i / (float)(count)) * (index + 1)));
  677. break;
  678. case MirDirection.Right:
  679. OffSetMove = new Point((int)((-MapControl.CellWidth * i / (float)(count)) * (index + 1)), 0);
  680. break;
  681. case MirDirection.DownRight:
  682. OffSetMove = new Point((int)((-MapControl.CellWidth * i / (float)(count)) * (index + 1)), (int)((-MapControl.CellHeight * i / (float)(count)) * (index + 1)));
  683. break;
  684. case MirDirection.Down:
  685. OffSetMove = new Point(0, (int)((-MapControl.CellHeight * i / (float)(count)) * (index + 1)));
  686. break;
  687. case MirDirection.DownLeft:
  688. OffSetMove = new Point((int)((MapControl.CellWidth * i / (float)(count)) * (index + 1)), (int)((-MapControl.CellHeight * i / (float)(count)) * (index + 1)));
  689. break;
  690. case MirDirection.Left:
  691. OffSetMove = new Point((int)((MapControl.CellWidth * i / (float)(count)) * (index + 1)), 0);
  692. break;
  693. case MirDirection.UpLeft:
  694. OffSetMove = new Point((int)((MapControl.CellWidth * i / (float)(count)) * (index + 1)), (int)((MapControl.CellHeight * i / (float)(count)) * (index + 1)));
  695. break;
  696. }
  697. OffSetMove = new Point(OffSetMove.X % 2 + OffSetMove.X, OffSetMove.Y % 2 + OffSetMove.Y);
  698. break;
  699. default:
  700. OffSetMove = Point.Empty;
  701. Movement = CurrentLocation;
  702. break;
  703. }
  704. #endregion
  705. DrawY = Movement.Y > CurrentLocation.Y ? Movement.Y : CurrentLocation.Y;
  706. DrawLocation = new Point((Movement.X - User.Movement.X + MapControl.OffSetX) * MapControl.CellWidth, (Movement.Y - User.Movement.Y + MapControl.OffSetY) * MapControl.CellHeight);
  707. DrawLocation.Offset(GlobalDisplayLocationOffset);
  708. if (this != User)
  709. {
  710. DrawLocation.Offset(User.OffSetMove);
  711. DrawLocation.Offset(-OffSetMove.X, -OffSetMove.Y);
  712. }
  713. if (BodyLibrary != null && update)
  714. {
  715. FinalDrawLocation = DrawLocation.Add(BodyLibrary.GetOffSet(DrawFrame));
  716. DisplayRectangle = new Rectangle(DrawLocation, BodyLibrary.GetTrueSize(DrawFrame));
  717. }
  718. for (int i = 0; i < Effects.Count; i++)
  719. Effects[i].Process();
  720. Color newColour = Poison switch
  721. {
  722. _ when (Poison & PoisonType.DelayedExplosion) == PoisonType.DelayedExplosion => Color.Orange,
  723. _ when (Poison & (PoisonType.Paralysis | PoisonType.LRParalysis)) != 0 => Color.Gray,
  724. _ when (Poison & PoisonType.Frozen) == PoisonType.Frozen => Color.Blue,
  725. _ when (Poison & PoisonType.Blindness) == PoisonType.Blindness => Color.MediumVioletRed,
  726. _ when (Poison & (PoisonType.Stun | PoisonType.Dazed)) != 0 => Color.Yellow,
  727. _ when (Poison & PoisonType.Slow) == PoisonType.Slow => Color.Purple,
  728. _ when (Poison & PoisonType.Bleeding) == PoisonType.Bleeding => Color.DarkRed,
  729. _ when (Poison & PoisonType.Red) == PoisonType.Red => Color.Red,
  730. _ when (Poison & PoisonType.Green) == PoisonType.Green => Color.Green,
  731. _ => Color.White
  732. };
  733. if (newColour != DrawColour)
  734. {
  735. DrawColour = newColour;
  736. GameScene.Scene.MapControl.TextureValid = false;
  737. }
  738. }
  739. public virtual void SetAction()
  740. {
  741. if (NextAction != null && !GameScene.CanMove)
  742. {
  743. switch (NextAction.Action)
  744. {
  745. case MirAction.Walking:
  746. case MirAction.Running:
  747. case MirAction.MountWalking:
  748. case MirAction.MountRunning:
  749. case MirAction.Pushed:
  750. case MirAction.DashL:
  751. case MirAction.DashR:
  752. case MirAction.Sneek:
  753. case MirAction.Jump:
  754. case MirAction.DashAttack:
  755. return;
  756. }
  757. }
  758. if (User == this && !GameScene.Observing && CMain.Time < MapControl.NextAction)
  759. return;
  760. if (ActionFeed.Count == 0)
  761. {
  762. CurrentAction = MirAction.Standing;
  763. CurrentAction = CMain.Time > BlizzardStopTime ? CurrentAction : MirAction.Stance2;
  764. if (RidingMount)
  765. {
  766. switch (CurrentAction)
  767. {
  768. case MirAction.Standing:
  769. CurrentAction = MirAction.MountStanding;
  770. break;
  771. case MirAction.Walking:
  772. CurrentAction = MirAction.MountWalking;
  773. break;
  774. case MirAction.Running:
  775. CurrentAction = MirAction.MountRunning;
  776. break;
  777. case MirAction.Struck:
  778. CurrentAction = MirAction.MountStruck;
  779. break;
  780. case MirAction.Attack1:
  781. CurrentAction = MirAction.MountAttack;
  782. break;
  783. }
  784. }
  785. if (CurrentAction == MirAction.Standing)
  786. {
  787. if (Class == MirClass.Archer && HasClassWeapon)
  788. CurrentAction = MirAction.Standing;
  789. else
  790. CurrentAction = CMain.Time > StanceTime ? MirAction.Standing : MirAction.Stance;
  791. }
  792. if (Fishing) CurrentAction = MirAction.FishingWait;
  793. Frames.TryGetValue(CurrentAction, out Frame);
  794. FrameIndex = 0;
  795. EffectFrameIndex = 0;
  796. if (MapLocation != CurrentLocation)
  797. {
  798. GameScene.Scene.MapControl.RemoveObject(this);
  799. MapLocation = CurrentLocation;
  800. GameScene.Scene.MapControl.AddObject(this);
  801. }
  802. if (Frame == null) return;
  803. FrameInterval = Frame.Interval;
  804. EffectFrameInterval = Frame.EffectInterval;
  805. SetLibraries();
  806. }
  807. else
  808. {
  809. QueuedAction action = ActionFeed[0];
  810. ActionFeed.RemoveAt(0);
  811. CurrentAction = action.Action;
  812. if (RidingMount)
  813. {
  814. switch (CurrentAction)
  815. {
  816. case MirAction.Standing:
  817. CurrentAction = MirAction.MountStanding;
  818. break;
  819. case MirAction.Walking:
  820. CurrentAction = MirAction.MountWalking;
  821. break;
  822. case MirAction.Running:
  823. CurrentAction = MirAction.MountRunning;
  824. break;
  825. case MirAction.Struck:
  826. CurrentAction = MirAction.MountStruck;
  827. break;
  828. case MirAction.Attack1:
  829. CurrentAction = MirAction.MountAttack;
  830. break;
  831. }
  832. }
  833. CurrentLocation = action.Location;
  834. MirDirection olddirection = Direction;
  835. Direction = action.Direction;
  836. Point temp;
  837. switch (CurrentAction)
  838. {
  839. case MirAction.Walking:
  840. case MirAction.Running:
  841. case MirAction.MountWalking:
  842. case MirAction.MountRunning:
  843. case MirAction.Pushed:
  844. case MirAction.DashL:
  845. case MirAction.DashR:
  846. case MirAction.Sneek:
  847. var steps = 0;
  848. if (CurrentAction == MirAction.MountRunning) steps = 3;
  849. else if (CurrentAction == MirAction.Running) steps = (Sprint && !Sneaking ? 3 : 2);
  850. else steps = 1;
  851. temp = Functions.PointMove(CurrentLocation, Direction, CurrentAction == MirAction.Pushed ? 0 : -steps);
  852. break;
  853. case MirAction.Jump:
  854. case MirAction.DashAttack:
  855. temp = Functions.PointMove(CurrentLocation, Direction, JumpDistance);
  856. break;
  857. default:
  858. temp = CurrentLocation;
  859. break;
  860. }
  861. if (MapLocation != temp)
  862. {
  863. GameScene.Scene.MapControl.RemoveObject(this);
  864. MapLocation = temp;
  865. GameScene.Scene.MapControl.AddObject(this);
  866. }
  867. bool ArcherLayTrap = false;
  868. switch (CurrentAction)
  869. {
  870. case MirAction.Pushed:
  871. if (this == User)
  872. MapControl.InputDelay = CMain.Time + 500;
  873. Frames.TryGetValue(MirAction.Walking, out Frame);
  874. break;
  875. case MirAction.DashL:
  876. case MirAction.DashR:
  877. Frames.TryGetValue(MirAction.Running, out Frame);
  878. break;
  879. case MirAction.DashAttack:
  880. Frames.TryGetValue(MirAction.DashAttack, out Frame);
  881. break;
  882. case MirAction.DashFail:
  883. Frames.TryGetValue(RidingMount ? MirAction.MountStanding : MirAction.Standing, out Frame);
  884. break;
  885. case MirAction.Jump:
  886. Frames.TryGetValue(MirAction.Jump, out Frame);
  887. break;
  888. case MirAction.Attack1:
  889. switch (Class)
  890. {
  891. case MirClass.Archer:
  892. Frames.TryGetValue(CurrentAction, out Frame);
  893. break;
  894. case MirClass.Assassin:
  895. if(GameScene.User.DoubleSlash)
  896. Frames.TryGetValue(MirAction.Attack1, out Frame);
  897. else if (CMain.Shift)
  898. Frames.TryGetValue(CMain.Random.Next(100) >= 20 ? (CMain.Random.Next(100) > 40 ? MirAction.Attack1 : MirAction.Attack4) : (CMain.Random.Next(100) > 10 ? MirAction.Attack2 : MirAction.Attack3), out Frame);
  899. else
  900. Frames.TryGetValue(CMain.Random.Next(100) >= 40 ? MirAction.Attack1 : MirAction.Attack4, out Frame);
  901. break;
  902. default:
  903. if (CMain.Shift && TargetObject == null)
  904. Frames.TryGetValue(CMain.Random.Next(100) >= 20 ? MirAction.Attack1 : MirAction.Attack3, out Frame);
  905. else
  906. Frames.TryGetValue(CurrentAction, out Frame);
  907. break;
  908. }
  909. break;
  910. case MirAction.Attack4:
  911. Spell = (Spell)action.Params[0];
  912. Frames.TryGetValue(Spell == Spell.TwinDrakeBlade || Spell == Spell.FlamingSword ? MirAction.Attack1 : CurrentAction, out Frame);
  913. break;
  914. case MirAction.Spell:
  915. Spell = (Spell)action.Params[0];
  916. switch (Spell)
  917. {
  918. case Spell.ShoulderDash:
  919. Frames.TryGetValue(MirAction.Running, out Frame);
  920. CurrentAction = MirAction.DashL;
  921. Direction = olddirection;
  922. CurrentLocation = Functions.PointMove(CurrentLocation, Direction, 1);
  923. if (this == User)
  924. {
  925. MapControl.NextAction = CMain.Time + 2500;
  926. GameScene.SpellTime = CMain.Time + 2500; //Spell Delay
  927. Network.Enqueue(new C.Magic { ObjectID = GameScene.User.ObjectID, Spell = Spell, Direction = Direction, });
  928. }
  929. break;
  930. case Spell.BladeAvalanche:
  931. Frames.TryGetValue(MirAction.Attack3, out Frame);
  932. if (this == User)
  933. {
  934. MapControl.NextAction = CMain.Time + 2500;
  935. GameScene.SpellTime = CMain.Time + 1500; //Spell Delay
  936. MapControl.InputDelay = CMain.Time + 1000;
  937. }
  938. break;
  939. case Spell.SlashingBurst:
  940. Frames.TryGetValue(MirAction.Attack1, out Frame);
  941. if (this == User)
  942. {
  943. MapControl.NextAction = CMain.Time + 2000; // 80%
  944. GameScene.SpellTime = CMain.Time + 1500; //Spell Delay
  945. }
  946. break;
  947. case Spell.CounterAttack:
  948. Frames.TryGetValue(MirAction.Attack1, out Frame);
  949. if (this == User)
  950. {
  951. GameScene.AttackTime = CMain.Time + User.AttackSpeed;
  952. MapControl.NextAction = CMain.Time + 100; // 80%
  953. GameScene.SpellTime = CMain.Time + 100; //Spell Delay
  954. }
  955. break;
  956. case Spell.PoisonSword:
  957. Frames.TryGetValue(MirAction.Attack1, out Frame);
  958. if (this == User)
  959. {
  960. MapControl.NextAction = CMain.Time + 2000; // 80%
  961. GameScene.SpellTime = CMain.Time + 1500; //Spell Delay
  962. }
  963. break;
  964. case Spell.HeavenlySword:
  965. Frames.TryGetValue(MirAction.Attack2, out Frame);
  966. if (this == User)
  967. {
  968. MapControl.NextAction = CMain.Time + 1200;
  969. GameScene.SpellTime = CMain.Time + 1200; //Spell Delay
  970. }
  971. break;
  972. case Spell.CrescentSlash:
  973. Frames.TryGetValue(MirAction.Attack3, out Frame);
  974. if (this == User)
  975. {
  976. MapControl.NextAction = CMain.Time + 2500;
  977. GameScene.SpellTime = CMain.Time + 1500; //Spell Delay
  978. }
  979. break;
  980. case Spell.FlashDash:
  981. {
  982. int sLevel = (byte)action.Params[3];
  983. GetFlashDashDistance(sLevel);
  984. if (JumpDistance != 0)
  985. {
  986. Frames.TryGetValue(MirAction.DashAttack, out Frame);
  987. CurrentAction = MirAction.DashAttack;
  988. CurrentLocation = Functions.PointMove(CurrentLocation, Direction, JumpDistance);
  989. }
  990. else
  991. {
  992. Frames.TryGetValue(CMain.Random.Next(100) >= 40 ? MirAction.Attack1 : MirAction.Attack4, out Frame);
  993. }
  994. if (this == User)
  995. {
  996. MapControl.NextAction = CMain.Time;
  997. GameScene.SpellTime = CMain.Time + 250; //Spell Delay
  998. if (JumpDistance != 0) Network.Enqueue(new C.Magic { Spell = Spell, Direction = Direction });
  999. }
  1000. }
  1001. break;
  1002. case Spell.StraightShot:
  1003. Frames.TryGetValue(MirAction.AttackRange2, out Frame);
  1004. CurrentAction = MirAction.AttackRange2;
  1005. if (this == User)
  1006. {
  1007. MapControl.NextAction = CMain.Time + 1000;
  1008. GameScene.SpellTime = CMain.Time + 1500; //Spell Delay
  1009. }
  1010. break;
  1011. case Spell.DoubleShot:
  1012. Frames.TryGetValue(MirAction.AttackRange2, out Frame);
  1013. CurrentAction = MirAction.AttackRange2;
  1014. if (this == User)
  1015. {
  1016. MapControl.NextAction = CMain.Time + 1000;
  1017. GameScene.SpellTime = CMain.Time + 500; //Spell Delay
  1018. }
  1019. break;
  1020. case Spell.ExplosiveTrap:
  1021. Frames.TryGetValue(MirAction.Harvest, out Frame);
  1022. CurrentAction = MirAction.Harvest;
  1023. ArcherLayTrap = true;
  1024. if (this == User)
  1025. {
  1026. uint targetID = (uint)action.Params[1];
  1027. Point location = (Point)action.Params[2];
  1028. Network.Enqueue(new C.Magic { ObjectID = GameScene.User.ObjectID, Spell = Spell, Direction = Direction, TargetID = targetID, Location = location });
  1029. MapControl.NextAction = CMain.Time + 1000;
  1030. GameScene.SpellTime = CMain.Time + 1500; //Spell Delay
  1031. }
  1032. break;
  1033. case Spell.DelayedExplosion:
  1034. Frames.TryGetValue(MirAction.AttackRange2, out Frame);
  1035. CurrentAction = MirAction.AttackRange2;
  1036. if (this == User)
  1037. {
  1038. MapControl.NextAction = CMain.Time + 1000;
  1039. GameScene.SpellTime = CMain.Time + 1500; //Spell Delay
  1040. }
  1041. break;
  1042. case Spell.BackStep:
  1043. {
  1044. int sLevel = (byte)action.Params[3];
  1045. GetBackStepDistance(sLevel);
  1046. Frames.TryGetValue(MirAction.Jump, out Frame);
  1047. CurrentAction = MirAction.Jump;
  1048. CurrentLocation = Functions.PointMove(CurrentLocation, Functions.ReverseDirection(Direction), JumpDistance);
  1049. if (this == User)
  1050. {
  1051. MapControl.NextAction = CMain.Time + 800;
  1052. GameScene.SpellTime = CMain.Time + 2500; //Spell Delay
  1053. Network.Enqueue(new C.Magic { ObjectID = GameScene.User.ObjectID, Spell = Spell, Direction = Direction });
  1054. }
  1055. break;
  1056. }
  1057. case Spell.ElementalShot:
  1058. if (HasElements && !ElementCasted)
  1059. {
  1060. Frames.TryGetValue(MirAction.AttackRange2, out Frame);
  1061. CurrentAction = MirAction.AttackRange2;
  1062. if (this == User)
  1063. {
  1064. MapControl.NextAction = CMain.Time + 1000;
  1065. GameScene.SpellTime = CMain.Time + 1500; //Spell Delay
  1066. }
  1067. }
  1068. else Frames.TryGetValue(CurrentAction, out Frame);
  1069. if (ElementCasted) ElementCasted = false;
  1070. break;
  1071. case Spell.BindingShot:
  1072. case Spell.VampireShot:
  1073. case Spell.PoisonShot:
  1074. case Spell.CrippleShot:
  1075. case Spell.NapalmShot:
  1076. case Spell.SummonVampire:
  1077. case Spell.SummonToad:
  1078. case Spell.SummonSnakes:
  1079. case Spell.Stonetrap:
  1080. Frames.TryGetValue(MirAction.AttackRange2, out Frame);
  1081. CurrentAction = MirAction.AttackRange2;
  1082. if (this == User)
  1083. {
  1084. MapControl.NextAction = CMain.Time + 1000;
  1085. GameScene.SpellTime = CMain.Time + 1000; //Spell Delay
  1086. }
  1087. break;
  1088. default:
  1089. Frames.TryGetValue(CurrentAction, out Frame);
  1090. break;
  1091. }
  1092. break;
  1093. default:
  1094. Frames.TryGetValue(CurrentAction, out Frame);
  1095. break;
  1096. }
  1097. //ArcherTest - Need to check for bow weapon only
  1098. if (Class == MirClass.Archer && HasClassWeapon)
  1099. {
  1100. switch (CurrentAction)
  1101. {
  1102. case MirAction.Walking:
  1103. Frames.TryGetValue(MirAction.WalkingBow, out Frame);
  1104. break;
  1105. case MirAction.Running:
  1106. Frames.TryGetValue(MirAction.RunningBow, out Frame);
  1107. break;
  1108. }
  1109. }
  1110. //Assassin sneekyness
  1111. if (Class == MirClass.Assassin && Sneaking && (CurrentAction == MirAction.Walking || CurrentAction == MirAction.Running))
  1112. {
  1113. Frames.TryGetValue(MirAction.Sneek, out Frame);
  1114. }
  1115. SetLibraries();
  1116. FrameIndex = 0;
  1117. EffectFrameIndex = 0;
  1118. Spell = Spell.None;
  1119. SpellLevel = 0;
  1120. //NextMagic = null;
  1121. ClientMagic magic;
  1122. if (Frame == null) return;
  1123. FrameInterval = Frame.Interval;
  1124. EffectFrameInterval = Frame.EffectInterval;
  1125. if (this == User)
  1126. {
  1127. switch (CurrentAction)
  1128. {
  1129. case MirAction.DashFail:
  1130. //CanSetAction = false;
  1131. break;
  1132. case MirAction.Standing:
  1133. case MirAction.MountStanding:
  1134. Network.Enqueue(new C.Turn { Direction = Direction });
  1135. MapControl.NextAction = CMain.Time + 2500;
  1136. GameScene.CanRun = false;
  1137. break;
  1138. case MirAction.Walking:
  1139. case MirAction.MountWalking:
  1140. case MirAction.Sneek:
  1141. GameScene.LastRunTime = CMain.Time;
  1142. Network.Enqueue(new C.Walk { Direction = Direction });
  1143. GameScene.Scene.MapControl.FloorValid = false;
  1144. GameScene.CanRun = true;
  1145. MapControl.NextAction = CMain.Time + 2500;
  1146. break;
  1147. case MirAction.Running:
  1148. case MirAction.MountRunning:
  1149. GameScene.LastRunTime = CMain.Time;
  1150. Network.Enqueue(new C.Run { Direction = Direction });
  1151. GameScene.Scene.MapControl.FloorValid = false;
  1152. MapControl.NextAction = CMain.Time + (Sprint ? 1000 : 2500);
  1153. break;
  1154. case MirAction.Pushed:
  1155. GameScene.LastRunTime = CMain.Time;
  1156. GameScene.Scene.MapControl.FloorValid = false;
  1157. MapControl.InputDelay = CMain.Time + 500;
  1158. GameScene.CanRun = false;
  1159. GameScene.CanMove = false;
  1160. break;
  1161. case MirAction.DashL:
  1162. case MirAction.DashR:
  1163. case MirAction.Jump:
  1164. case MirAction.DashAttack:
  1165. GameScene.LastRunTime = CMain.Time;
  1166. GameScene.Scene.MapControl.FloorValid = false;
  1167. GameScene.CanRun = false;
  1168. //CanSetAction = false;
  1169. break;
  1170. case MirAction.Mine:
  1171. Network.Enqueue(new C.Attack { Direction = Direction, Spell = Spell.None });
  1172. GameScene.AttackTime = CMain.Time + (1400 - Math.Min(370, (User.Level * 14)));
  1173. MapControl.NextAction = CMain.Time + 2500;
  1174. break;
  1175. case MirAction.Attack1:
  1176. case MirAction.MountAttack:
  1177. if (!RidingMount)
  1178. {
  1179. if (GameScene.User.Slaying && (TargetObject != null || GameScene.Observing))
  1180. Spell = Spell.Slaying;
  1181. if (GameScene.User.Thrusting && GameScene.Scene.MapControl.HasTarget(Functions.PointMove(CurrentLocation, Direction, 2)))
  1182. Spell = Spell.Thrusting;
  1183. if (GameScene.User.HalfMoon)
  1184. {
  1185. if (TargetObject != null || GameScene.Scene.MapControl.CanHalfMoon(CurrentLocation, Direction))
  1186. {
  1187. magic = User.GetMagic(Spell.HalfMoon);
  1188. if (magic != null && magic.BaseCost + magic.LevelCost * magic.Level <= User.MP)
  1189. Spell = Spell.HalfMoon;
  1190. }
  1191. }
  1192. if (GameScene.User.CrossHalfMoon)
  1193. {
  1194. if (TargetObject != null || GameScene.Scene.MapControl.CanCrossHalfMoon(CurrentLocation))
  1195. {
  1196. magic = User.GetMagic(Spell.CrossHalfMoon);
  1197. if (magic != null && magic.BaseCost + magic.LevelCost * magic.Level <= User.MP)
  1198. Spell = Spell.CrossHalfMoon;
  1199. }
  1200. }
  1201. if (GameScene.User.DoubleSlash)
  1202. {
  1203. magic = User.GetMagic(Spell.DoubleSlash);
  1204. if (magic != null && magic.BaseCost + magic.LevelCost * magic.Level <= User.MP)
  1205. Spell = Spell.DoubleSlash;
  1206. }
  1207. if (GameScene.User.TwinDrakeBlade && (TargetObject != null || GameScene.Observing))
  1208. {
  1209. magic = User.GetMagic(Spell.TwinDrakeBlade);
  1210. if (magic != null && magic.BaseCost + magic.LevelCost * magic.Level <= User.MP)
  1211. Spell = Spell.TwinDrakeBlade;
  1212. }
  1213. if (GameScene.User.FlamingSword)
  1214. {
  1215. if (TargetObject != null)
  1216. {
  1217. magic = User.GetMagic(Spell.FlamingSword);
  1218. if (magic != null)
  1219. {
  1220. Spell = Spell.FlamingSword;
  1221. magic.CastTime = CMain.Time;
  1222. }
  1223. }
  1224. }
  1225. }
  1226. Network.Enqueue(new C.Attack { Direction = Direction, Spell = Spell });
  1227. if (Spell == Spell.Slaying)
  1228. GameScene.User.Slaying = false;
  1229. if (Spell == Spell.TwinDrakeBlade)
  1230. GameScene.User.TwinDrakeBlade = false;
  1231. if (Spell == Spell.FlamingSword)
  1232. GameScene.User.FlamingSword = false;
  1233. magic = User.GetMagic(Spell);
  1234. if (magic != null) SpellLevel = magic.Level;
  1235. GameScene.AttackTime = CMain.Time + User.AttackSpeed;
  1236. MapControl.NextAction = CMain.Time + 2500;
  1237. break;
  1238. case MirAction.Attack2:
  1239. //Network.Enqueue(new C.Attack2 { Direction = Direction });
  1240. break;
  1241. case MirAction.Attack3:
  1242. //Network.Enqueue(new C.Attack3 { Direction = Direction });
  1243. break;
  1244. //case MirAction.Attack4:
  1245. // GameScene.AttackTime = CMain.Time;// + User.AttackSpeed;
  1246. // MapControl.NextAction = CMain.Time;
  1247. // break;
  1248. case MirAction.AttackRange1:
  1249. {
  1250. GameScene.AttackTime = CMain.Time + User.AttackSpeed + 200;
  1251. uint targetID = (uint)action.Params[0];
  1252. Point location = (Point)action.Params[1];
  1253. Network.Enqueue(new C.RangeAttack { Direction = Direction, Location = CurrentLocation, TargetID = targetID, TargetLocation = location });
  1254. }
  1255. break;
  1256. case MirAction.AttackRange2:
  1257. case MirAction.Spell:
  1258. {
  1259. Spell = (Spell)action.Params[0];
  1260. uint targetID = (uint)action.Params[1];
  1261. Point location = (Point)action.Params[2];
  1262. Network.Enqueue(new C.Magic { ObjectID = GameScene.User.ObjectID, Spell = Spell, Direction = Direction, TargetID = targetID, Location = location });
  1263. if (Spell == Spell.FlashDash)
  1264. {
  1265. GameScene.SpellTime = CMain.Time + 250;
  1266. MapControl.NextAction = CMain.Time;
  1267. }
  1268. else
  1269. {
  1270. GameScene.SpellTime = Spell == Spell.FlameField ? CMain.Time + 2500 : CMain.Time + 1800;
  1271. MapControl.NextAction = CMain.Time + 2500;
  1272. }
  1273. }
  1274. break;
  1275. case MirAction.Harvest:
  1276. if (ArcherLayTrap)
  1277. {
  1278. ArcherLayTrap = false;
  1279. SoundManager.PlaySound(20000 + 124 * 10);
  1280. }
  1281. else
  1282. {
  1283. Network.Enqueue(new C.Harvest { Direction = Direction });
  1284. MapControl.NextAction = CMain.Time + 2500;
  1285. }
  1286. break;
  1287. }
  1288. }
  1289. switch (CurrentAction)
  1290. {
  1291. case MirAction.Pushed:
  1292. FrameIndex = Frame.Count - 1;
  1293. EffectFrameIndex = Frame.EffectCount - 1;
  1294. GameScene.Scene.Redraw();
  1295. break;
  1296. case MirAction.DashL:
  1297. case MirAction.Jump:
  1298. FrameIndex = 0;
  1299. EffectFrameIndex = 0;
  1300. GameScene.Scene.Redraw();
  1301. break;
  1302. case MirAction.DashR:
  1303. FrameIndex = 3;
  1304. EffectFrameIndex = 3;
  1305. GameScene.Scene.Redraw();
  1306. break;
  1307. case MirAction.Walking:
  1308. case MirAction.Running:
  1309. case MirAction.MountWalking:
  1310. case MirAction.MountRunning:
  1311. case MirAction.Sneek:
  1312. GameScene.Scene.Redraw();
  1313. break;
  1314. case MirAction.DashAttack:
  1315. //FrameIndex = 0;
  1316. //EffectFrameIndex = 0;
  1317. GameScene.Scene.Redraw();
  1318. if (IsDashAttack())
  1319. {
  1320. action = new QueuedAction { Action = MirAction.Attack4, Direction = Direction, Location = CurrentLocation, Params = new List<object>() };
  1321. action.Params.Add(Spell.FlashDash);
  1322. ActionFeed.Insert(0, action);
  1323. }
  1324. break;
  1325. case MirAction.Attack1:
  1326. if (this != User)
  1327. {
  1328. Spell = (Spell)action.Params[0];
  1329. SpellLevel = (byte)action.Params[1];
  1330. }
  1331. switch (Spell)
  1332. {
  1333. case Spell.Slaying:
  1334. SoundManager.PlaySound(20000 + (ushort)Spell * 10 + (Gender == MirGender.Male ? 0 : 1));
  1335. break;
  1336. case Spell.DoubleSlash:
  1337. FrameInterval = (int)(FrameInterval * 0.46f); //46% Animation Speed
  1338. EffectFrameInterval = (int)(EffectFrameInterval * 0.46f);
  1339. action = new QueuedAction { Action = MirAction.Attack4, Direction = Direction, Location = CurrentLocation, Params = new List<object>() };
  1340. action.Params.Add(Spell);
  1341. ActionFeed.Insert(0, action);
  1342. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1343. break;
  1344. case Spell.Thrusting:
  1345. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1346. break;
  1347. case Spell.HalfMoon:
  1348. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1349. break;
  1350. case Spell.TwinDrakeBlade:
  1351. //FrameInterval = FrameInterval * 9 / 10; //70% Faster Animation
  1352. //EffectFrameInterval = EffectFrameInterval * 9 / 10;
  1353. //action = new QueuedAction { Action = MirAction.Attack4, Direction = Direction, Location = CurrentLocation, Params = new List<object>() };
  1354. //action.Params.Add(Spell);
  1355. //ActionFeed.Insert(0, action);
  1356. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1357. break;
  1358. case Spell.CrossHalfMoon:
  1359. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1360. break;
  1361. case Spell.FlamingSword:
  1362. SoundManager.PlaySound(20000 + (ushort)Spell * 10 + 1);
  1363. break;
  1364. }
  1365. break;
  1366. case MirAction.Attack4:
  1367. Spell = (Spell)action.Params[0];
  1368. switch (Spell)
  1369. {
  1370. case Spell.DoubleSlash:
  1371. FrameInterval = (int)(FrameInterval * 0.46f); //46% Animation Speed
  1372. EffectFrameInterval = (int)(EffectFrameInterval * 0.46f);
  1373. SoundManager.PlaySound(20000 + (ushort)Spell * 10 + 1);
  1374. break;
  1375. case Spell.TwinDrakeBlade:
  1376. FrameInterval = FrameInterval * 9 / 10; //80% Animation Speed
  1377. EffectFrameInterval = EffectFrameInterval * 9 / 10;
  1378. break;
  1379. case Spell.FlashDash:
  1380. int attackDelay = (User.AttackSpeed - 120) <= 300 ? 300 : (User.AttackSpeed - 120);
  1381. float attackRate = (float)(attackDelay / 300F * 10F);
  1382. FrameInterval = FrameInterval * (int)attackRate / 20;
  1383. EffectFrameInterval = EffectFrameInterval * (int)attackRate / 20;
  1384. break;
  1385. }
  1386. break;
  1387. case MirAction.Struck:
  1388. case MirAction.MountStruck:
  1389. uint attackerID = (uint)action.Params[0];
  1390. StruckWeapon = -2;
  1391. if (action.Params.Count > 1)
  1392. {
  1393. StruckWeapon = (int)action.Params[1];
  1394. }
  1395. else if (MapControl.Objects.TryGetValue(attackerID, out MapObject ob))
  1396. if (ob.Race == ObjectType.Player)
  1397. {
  1398. PlayerObject player = (PlayerObject)ob;
  1399. StruckWeapon = player.Weapon;
  1400. if (player.Class == MirClass.Assassin && StruckWeapon != -1)
  1401. StruckWeapon = 1;
  1402. }
  1403. PlayStruckSound();
  1404. PlayFlinchSound();
  1405. break;
  1406. case MirAction.AttackRange1: //ArcherTest - Assign Target for other users
  1407. if (this != User)
  1408. {
  1409. TargetID = (uint)action.Params[0];
  1410. TargetPoint = (Point)action.Params[1];
  1411. Spell = (Spell)action.Params[2];
  1412. }
  1413. break;
  1414. case MirAction.AttackRange2:
  1415. case MirAction.Spell:
  1416. if (this != User)
  1417. {
  1418. Spell = (Spell)action.Params[0];
  1419. TargetID = (uint)action.Params[1];
  1420. TargetPoint = (Point)action.Params[2];
  1421. Cast = (bool)action.Params[3];
  1422. SpellLevel = (byte)action.Params[4];
  1423. SecondaryTargetIDs = (List<uint>)action.Params[5];
  1424. }
  1425. switch (Spell)
  1426. {
  1427. #region FireBall
  1428. case Spell.FireBall:
  1429. Effects.Add(new Effect(Libraries.Magic, 0, 10, Frame.Count * FrameInterval, this));
  1430. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1431. break;
  1432. #endregion
  1433. #region Healing
  1434. case Spell.Healing:
  1435. Effects.Add(new Effect(Libraries.Magic, 200, 10, Frame.Count * FrameInterval, this));
  1436. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1437. break;
  1438. #endregion
  1439. #region Repulsion
  1440. case Spell.Repulsion:
  1441. Effects.Add(new Effect(Libraries.Magic, 900, 6, Frame.Count * FrameInterval, this));
  1442. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1443. break;
  1444. #endregion
  1445. #region ElectricShock
  1446. case Spell.ElectricShock:
  1447. Effects.Add(new Effect(Libraries.Magic, 1560, 10, Frame.Count * FrameInterval, this));
  1448. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1449. break;
  1450. #endregion
  1451. #region Poisoning
  1452. case Spell.Poisoning:
  1453. Effects.Add(new Effect(Libraries.Magic, 600, 10, Frame.Count * FrameInterval, this));
  1454. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1455. break;
  1456. #endregion
  1457. #region GreatFireBall
  1458. case Spell.GreatFireBall:
  1459. Effects.Add(new Effect(Libraries.Magic, 400, 10, Frame.Count * FrameInterval, this));
  1460. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1461. break;
  1462. #endregion
  1463. #region HellFire
  1464. case Spell.HellFire:
  1465. Effects.Add(new Effect(Libraries.Magic, 920, 10, Frame.Count * FrameInterval, this));
  1466. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1467. break;
  1468. #endregion
  1469. #region ThunderBolt
  1470. case Spell.ThunderBolt:
  1471. Effects.Add(new Effect(Libraries.Magic2, 20, 3, 300, this));
  1472. break;
  1473. #endregion
  1474. #region SoulFireBall
  1475. case Spell.SoulFireBall:
  1476. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1477. break;
  1478. #endregion
  1479. #region SummonSkeleton
  1480. case Spell.SummonSkeleton:
  1481. Effects.Add(new Effect(Libraries.Magic, 1500, 10, Frame.Count * FrameInterval, this));
  1482. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1483. break;
  1484. #endregion
  1485. #region StormEscape
  1486. case Spell.StormEscape:
  1487. Effects.Add(new Effect(Libraries.Magic3, 590, 10, Frame.Count * FrameInterval, this));
  1488. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1489. break;
  1490. #endregion
  1491. #region Teleport
  1492. case Spell.Teleport:
  1493. Effects.Add(new Effect(Libraries.Magic, 1590, 10, Frame.Count * FrameInterval, this));
  1494. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1495. break;
  1496. #endregion
  1497. #region Blink
  1498. case Spell.Blink:
  1499. Effects.Add(new Effect(Libraries.Magic, 1590, 10, Frame.Count * FrameInterval, this));
  1500. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1501. break;
  1502. #endregion
  1503. #region Hiding
  1504. case Spell.Hiding:
  1505. Effects.Add(new Effect(Libraries.Magic, 1520, 10, Frame.Count * FrameInterval, this));
  1506. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1507. break;
  1508. #endregion
  1509. #region Haste
  1510. case Spell.Haste:
  1511. Effects.Add(new Effect(Libraries.Magic2, 2140 + (int)Direction * 10, 6, Frame.Count * FrameInterval, this));
  1512. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1513. break;
  1514. #endregion
  1515. #region Fury
  1516. case Spell.Fury:
  1517. Effects.Add(new Effect(Libraries.Magic3, 200, 8, 8 * FrameInterval, this));
  1518. Effects.Add(new Effect(Libraries.Magic3, 187, 10, 10 * FrameInterval, this));
  1519. //i don't know sound
  1520. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1521. break;
  1522. #endregion
  1523. #region ImmortalSkin
  1524. case Spell.ImmortalSkin:
  1525. Effects.Add(new Effect(Libraries.Magic3, 550, 17, Frame.Count * FrameInterval * 4, this));
  1526. Effects.Add(new Effect(Libraries.Magic3, 570, 5, Frame.Count * FrameInterval, this));
  1527. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1528. break;
  1529. #endregion
  1530. #region FireBang
  1531. case Spell.FireBang:
  1532. Effects.Add(new Effect(Libraries.Magic, 1650, 10, Frame.Count * FrameInterval, this));
  1533. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1534. break;
  1535. #endregion
  1536. #region FireWall
  1537. case Spell.FireWall:
  1538. Effects.Add(new Effect(Libraries.Magic, 1620, 10, Frame.Count * FrameInterval, this));
  1539. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1540. break;
  1541. #endregion
  1542. #region HealingCircle
  1543. case Spell.HealingCircle:
  1544. Effects.Add(new Effect(Libraries.Magic3, 620, 10, Frame.Count * FrameInterval, this));
  1545. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1546. break;
  1547. #endregion
  1548. #region MoonMist
  1549. case Spell.MoonMist:
  1550. MapControl.Effects.Add(new Effect(Libraries.Magic3, 680, 25, 1800, CurrentLocation));
  1551. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1552. break;
  1553. #endregion
  1554. #region TrapHexagon
  1555. case Spell.TrapHexagon:
  1556. Effects.Add(new Effect(Libraries.Magic, 1380, 10, Frame.Count * FrameInterval, this));
  1557. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1558. break;
  1559. #endregion
  1560. #region EnergyRepulsor
  1561. case Spell.EnergyRepulsor:
  1562. Effects.Add(new Effect(Libraries.Magic2, 190, 6, Frame.Count * FrameInterval, this));
  1563. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1564. break;
  1565. #endregion
  1566. #region FireBurst
  1567. case Spell.FireBurst:
  1568. Effects.Add(new Effect(Libraries.Magic2, 2320, 10, Frame.Count * FrameInterval, this));
  1569. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1570. break;
  1571. #endregion
  1572. #region FlameDisruptor
  1573. case Spell.FlameDisruptor:
  1574. Effects.Add(new Effect(Libraries.Magic2, 130, 6, Frame.Count * FrameInterval, this));
  1575. break;
  1576. #endregion
  1577. #region SummonShinsu
  1578. case Spell.SummonShinsu:
  1579. Effects.Add(new Effect(Libraries.Magic2, 0, 10, Frame.Count * FrameInterval, this));
  1580. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1581. break;
  1582. #endregion
  1583. #region UltimateEnchancer
  1584. case Spell.UltimateEnhancer:
  1585. Effects.Add(new Effect(Libraries.Magic2, 160, 15, 1000, this));
  1586. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1587. break;
  1588. #endregion
  1589. #region FrostCrunch
  1590. case Spell.FrostCrunch:
  1591. Effects.Add(new Effect(Libraries.Magic2, 400, 10, Frame.Count * FrameInterval, this));
  1592. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1593. break;
  1594. #endregion
  1595. #region Purification
  1596. case Spell.Purification:
  1597. Effects.Add(new Effect(Libraries.Magic2, 600, 10, Frame.Count * FrameInterval, this));
  1598. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1599. break;
  1600. #endregion
  1601. #region FlameField
  1602. case Spell.FlameField:
  1603. MapControl.Effects.Add(new Effect(Libraries.Magic2, 910, 23, 1800, CurrentLocation));
  1604. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1605. break;
  1606. #endregion
  1607. #region Trap
  1608. case Spell.Trap:
  1609. Effects.Add(new Effect(Libraries.Magic2, 2340, 11, 11 * FrameInterval, this));
  1610. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1611. break;
  1612. #endregion
  1613. #region MoonLight
  1614. case Spell.MoonLight:
  1615. Effects.Add(new Effect(Libraries.Magic2, 2380, 10, Frame.Count * FrameInterval, this));
  1616. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1617. break;
  1618. #endregion
  1619. #region SwiftFeet
  1620. case Spell.SwiftFeet:
  1621. Effects.Add(new Effect(Libraries.Magic2, 2440, 16, 16 * EffectFrameInterval, this));
  1622. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1623. break;
  1624. #endregion
  1625. #region LightBody
  1626. case Spell.LightBody:
  1627. Effects.Add(new Effect(Libraries.Magic2, 2470, 10, Frame.Count * FrameInterval, this));
  1628. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1629. break;
  1630. #endregion
  1631. #region PoisonSword
  1632. case Spell.PoisonSword:
  1633. Effects.Add(new Effect(Libraries.Magic2, 2490 + ((int)Direction * 10), 10, Frame.Count * FrameInterval + 500, this));
  1634. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1635. break;
  1636. #endregion
  1637. #region DarkBody
  1638. case Spell.DarkBody:
  1639. Effects.Add(new Effect(Libraries.Magic2, 2580, 10, 10 * FrameInterval, this));
  1640. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1641. break;
  1642. #endregion
  1643. #region ThunderStorm
  1644. case Spell.ThunderStorm:
  1645. MapControl.Effects.Add(new Effect(Libraries.Magic, 1680, 10, Frame.Count * FrameInterval, CurrentLocation));
  1646. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1647. break;
  1648. #endregion
  1649. #region MassHealing
  1650. case Spell.MassHealing:
  1651. Effects.Add(new Effect(Libraries.Magic, 1790, 10, Frame.Count * FrameInterval, this));
  1652. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1653. break;
  1654. #endregion
  1655. #region IceStorm
  1656. case Spell.IceStorm:
  1657. Effects.Add(new Effect(Libraries.Magic, 3840, 10, Frame.Count * FrameInterval, this));
  1658. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1659. break;
  1660. #endregion
  1661. #region MagicShield
  1662. case Spell.MagicShield:
  1663. Effects.Add(new Effect(Libraries.Magic, 3880, 10, Frame.Count * FrameInterval, this));
  1664. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1665. break;
  1666. #endregion
  1667. #region TurnUndead
  1668. case Spell.TurnUndead:
  1669. Effects.Add(new Effect(Libraries.Magic, 3920, 10, Frame.Count * FrameInterval, this));
  1670. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1671. break;
  1672. #endregion
  1673. #region MagicBooster
  1674. case Spell.MagicBooster:
  1675. Effects.Add(new Effect(Libraries.Magic3, 80, 9, 9 * FrameInterval, this));
  1676. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1677. break;
  1678. #endregion
  1679. #region PetEnhancer
  1680. case Spell.PetEnhancer:
  1681. Effects.Add(new Effect(Libraries.Magic3, 200, 8, 8 * FrameInterval, this));
  1682. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1683. break;
  1684. #endregion
  1685. #region Revelation
  1686. case Spell.Revelation:
  1687. Effects.Add(new Effect(Libraries.Magic, 3960, 20, 1200, this));
  1688. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1689. break;
  1690. #endregion
  1691. #region ProtectionField
  1692. case Spell.ProtectionField:
  1693. Effects.Add(new Effect(Libraries.Magic2, 1520, 10, Frame.Count * FrameInterval, this));
  1694. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1695. break;
  1696. #endregion
  1697. #region Rage
  1698. case Spell.Rage:
  1699. Effects.Add(new Effect(Libraries.Magic2, 1510, 10, Frame.Count * FrameInterval, this));
  1700. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1701. break;
  1702. #endregion
  1703. #region Vampirism
  1704. case Spell.Vampirism:
  1705. Effects.Add(new Effect(Libraries.Magic2, 1040, 7, Frame.Count * FrameInterval, this));
  1706. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1707. break;
  1708. #endregion
  1709. #region LionRoar, BattleCry
  1710. case Spell.LionRoar:
  1711. case Spell.BattleCry:
  1712. Effects.Add(new Effect(Libraries.Magic2, 710, 20, 1200, this));
  1713. SoundManager.PlaySound(20000 + (ushort)Spell * 10 + (Gender == MirGender.Male ? 0 : 1));
  1714. break;
  1715. #endregion
  1716. #region TwinDrakeBlade
  1717. case Spell.TwinDrakeBlade:
  1718. Effects.Add(new Effect(Libraries.Magic2, 210, 6, 500, this));
  1719. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1720. break;
  1721. #endregion
  1722. #region Entrapment
  1723. case Spell.Entrapment:
  1724. Effects.Add(new Effect(Libraries.Magic2, 990, 10, Frame.Count * FrameInterval, this));
  1725. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1726. break;
  1727. #endregion
  1728. #region BladeAvalanche
  1729. case Spell.BladeAvalanche:
  1730. Effects.Add(new Effect(Libraries.Magic2, 740 + (int)Direction * 20, 15, 15 * FrameInterval, this));
  1731. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1732. break;
  1733. #endregion
  1734. #region SlashingBurst
  1735. case Spell.SlashingBurst:
  1736. MapControl.Effects.Add(new Effect(Libraries.Magic2, 1700 + (int)Direction * 10, 9, 9 * FrameInterval, CurrentLocation, CMain.Time + 300));
  1737. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1738. SlashingBurstTime = CMain.Time + 2000;
  1739. break;
  1740. #endregion
  1741. #region CounterAttack
  1742. case Spell.CounterAttack:
  1743. SoundManager.PlaySound(20000 + (ushort)Spell * 10 + 5);
  1744. Effects.Add(new Effect(Libraries.Magic, 3480 + (int)Direction * 10, 10, 10 * FrameInterval, this));
  1745. Effects.Add(new Effect(Libraries.Magic3, 140, 2, 2 * FrameInterval, this));
  1746. break;
  1747. #endregion
  1748. #region CrescentSlash
  1749. case Spell.CrescentSlash:
  1750. Effects.Add(new Effect(Libraries.Magic2, 2620 + (int)Direction * 20, 20, 20 * FrameInterval, this));
  1751. SoundManager.PlaySound(20000 + (ushort)Spell * 10 + (Gender == MirGender.Male ? 0 : 1));
  1752. break;
  1753. #endregion
  1754. #region FlashDash
  1755. case Spell.FlashDash:
  1756. SoundManager.PlaySound(20000 + (ushort)Spell * 10 + (Gender == MirGender.Male ? 0 : 1));
  1757. int attackDelay = (User.AttackSpeed - 120) <= 300 ? 300 : (User.AttackSpeed - 120);
  1758. float attackRate = (float)(attackDelay / 300F * 10F);
  1759. FrameInterval = FrameInterval * (int)attackRate / 20;
  1760. EffectFrameInterval = EffectFrameInterval * (int)attackRate / 20;
  1761. break;
  1762. #endregion
  1763. #region Mirroring
  1764. case Spell.Mirroring:
  1765. Effects.Add(new Effect(Libraries.Magic2, 650, 10, Frame.Count * FrameInterval, this));
  1766. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1767. break;
  1768. #endregion
  1769. #region Blizzard
  1770. case Spell.Blizzard:
  1771. Effects.Add(new Effect(Libraries.Magic2, 1540, 8, Frame.Count * FrameInterval, this));
  1772. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1773. BlizzardStopTime = CMain.Time + 3000;
  1774. break;
  1775. #endregion
  1776. #region MeteorStrike
  1777. case Spell.MeteorStrike:
  1778. Effects.Add(new Effect(Libraries.Magic2, 1590, 10, Frame.Count * FrameInterval, this));
  1779. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1780. BlizzardStopTime = CMain.Time + 3000;
  1781. break;
  1782. #endregion
  1783. #region Reincarnation
  1784. case Spell.Reincarnation:
  1785. ReincarnationStopTime = CMain.Time + 6000;
  1786. break;
  1787. #endregion
  1788. #region HeavenlySword
  1789. case Spell.HeavenlySword:
  1790. Effects.Add(new Effect(Libraries.Magic2, 2230 + ((int)Direction * 10), 8, 800, this));
  1791. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1792. break;
  1793. #endregion
  1794. #region ElementalBarrier
  1795. case Spell.ElementalBarrier:
  1796. if (HasElements && !ElementalBarrier)
  1797. {
  1798. Effects.Add(new Effect(Libraries.Magic3, 1880, 8, Frame.Count * FrameInterval, this));
  1799. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  1800. }
  1801. break;
  1802. #endregion
  1803. #region PoisonShot
  1804. case Spell.PoisonShot:
  1805. Effects.Add(new Effect(Libraries.Magic3, 2300, 8, 1000, this));
  1806. break;
  1807. #endregion
  1808. #region OneWithNature
  1809. case Spell.OneWithNature:
  1810. MapControl.Effects.Add(new Effect(Libraries.Magic3, 2710, 8, 1200, CurrentLocation));
  1811. SoundManager.PlaySound(20000 + 139 * 10);
  1812. break;
  1813. #endregion
  1814. #region FireBounce
  1815. case Spell.FireBounce:
  1816. Effects.Add(new Effect(Libraries.Magic, 400, 10, Frame.Count * FrameInterval, this));
  1817. SoundManager.PlaySound(20000 + (ushort)Spell.GreatFireBall * 10);
  1818. break;
  1819. #endregion
  1820. #region MeteorShower
  1821. case Spell.MeteorShower:
  1822. Effects.Add(new Effect(Libraries.Magic, 400, 10, Frame.Count * FrameInterval, this));
  1823. SoundManager.PlaySound(20000 + (ushort)Spell.GreatFireBall * 10);
  1824. break;
  1825. #endregion
  1826. }
  1827. break;
  1828. case MirAction.Dead:
  1829. GameScene.Scene.Redraw();
  1830. GameScene.Scene.MapControl.SortObject(this);
  1831. if (MouseObject == this) MouseObjectID = 0;
  1832. if (TargetObject == this) TargetObjectID = 0;
  1833. if (MagicObject == this) MagicObjectID = 0;
  1834. DeadTime = CMain.Time;
  1835. break;
  1836. }
  1837. }
  1838. GameScene.Scene.MapControl.TextureValid = false;
  1839. NextMotion = CMain.Time + FrameInterval;
  1840. NextMotion2 = CMain.Time + EffectFrameInterval;
  1841. if (ElementalBarrier)
  1842. {
  1843. switch (CurrentAction)
  1844. {
  1845. case MirAction.Struck:
  1846. case MirAction.MountStruck:
  1847. if (ElementalBarrierEffect != null)
  1848. {
  1849. ElementalBarrierEffect.Clear();
  1850. ElementalBarrierEffect.Remove();
  1851. }
  1852. Effects.Add(ElementalBarrierEffect = new Effect(Libraries.Magic3, 1910, 5, 600, this));
  1853. ElementalBarrierEffect.Complete += (o, e) => Effects.Add(ElementalBarrierEffect = new Effect(Libraries.Magic3, 1890, 16, 3200, this) { Repeat = true });
  1854. break;
  1855. default:
  1856. if (ElementalBarrierEffect == null)
  1857. Effects.Add(ElementalBarrierEffect = new Effect(Libraries.Magic3, 1890, 16, 3200, this) { Repeat = true });
  1858. break;
  1859. }
  1860. }
  1861. if (MagicShield)
  1862. {
  1863. switch (CurrentAction)
  1864. {
  1865. case MirAction.Struck:
  1866. case MirAction.MountStruck:
  1867. if (ShieldEffect != null)
  1868. {
  1869. ShieldEffect.Clear();
  1870. ShieldEffect.Remove();
  1871. }
  1872. Effects.Add(ShieldEffect = new Effect(Libraries.Magic, 3900, 3, 600, this));
  1873. ShieldEffect.Complete += (o, e) => Effects.Add(ShieldEffect = new Effect(Libraries.Magic, 3890, 3, 600, this) { Repeat = true });
  1874. break;
  1875. default:
  1876. if (ShieldEffect == null)
  1877. Effects.Add(ShieldEffect = new Effect(Libraries.Magic, 3890, 3, 600, this) { Repeat = true });
  1878. break;
  1879. }
  1880. }
  1881. }
  1882. public virtual void ProcessFrames()
  1883. {
  1884. if (Frame == null) return;
  1885. switch (CurrentAction)
  1886. {
  1887. case MirAction.Walking:
  1888. case MirAction.Running:
  1889. case MirAction.MountWalking:
  1890. case MirAction.MountRunning:
  1891. case MirAction.Sneek:
  1892. case MirAction.DashAttack:
  1893. if (!GameScene.CanMove) return;
  1894. GameScene.Scene.MapControl.TextureValid = false;
  1895. if (this == User) GameScene.Scene.MapControl.FloorValid = false;
  1896. if (SkipFrames) FrameIndex = Frame.Count;
  1897. if (UpdateFrame(false) >= Frame.Count)
  1898. {
  1899. FrameIndex = Frame.Count - 1;
  1900. SetAction();
  1901. }
  1902. else
  1903. {
  1904. if (this == User)
  1905. {
  1906. if (FrameIndex == 1 || FrameIndex == 4)
  1907. PlayStepSound();
  1908. }
  1909. }
  1910. UpdateWingEffect();
  1911. break;
  1912. case MirAction.Jump:
  1913. if (!GameScene.CanMove) return;
  1914. GameScene.Scene.MapControl.TextureValid = false;
  1915. if (this == User) GameScene.Scene.MapControl.FloorValid = false;
  1916. if (SkipFrames) UpdateFrame();
  1917. if (UpdateFrame() >= Frame.Count)
  1918. {
  1919. FrameIndex = Frame.Count - 1;
  1920. SetAction();
  1921. }
  1922. else
  1923. {
  1924. if (FrameIndex == 1)
  1925. SoundManager.PlaySound(20000 + 127 * 10 + (Gender == MirGender.Male ? 5 : 6));
  1926. if (FrameIndex == 7)
  1927. SoundManager.PlaySound(20000 + 127 * 10 + 7);
  1928. }
  1929. //Backstep wingeffect
  1930. UpdateWingEffect();
  1931. break;
  1932. case MirAction.DashL:
  1933. if (!GameScene.CanMove) return;
  1934. GameScene.Scene.MapControl.TextureValid = false;
  1935. if (this == User) GameScene.Scene.MapControl.FloorValid = false;
  1936. if (UpdateFrame() >= 3)
  1937. {
  1938. FrameIndex = 2;
  1939. SetAction();
  1940. }
  1941. if (UpdateFrame2() >= 3) EffectFrameIndex = 2;
  1942. break;
  1943. case MirAction.DashR:
  1944. if (!GameScene.CanMove) return;
  1945. GameScene.Scene.MapControl.TextureValid = false;
  1946. if (this == User) GameScene.Scene.MapControl.FloorValid = false;
  1947. if (UpdateFrame() >= 6)
  1948. {
  1949. FrameIndex = 5;
  1950. SetAction();
  1951. }
  1952. if (UpdateFrame2() >= 6) EffectFrameIndex = 5;
  1953. break;
  1954. case MirAction.Pushed:
  1955. if (!GameScene.CanMove) return;
  1956. GameScene.Scene.MapControl.TextureValid = false;
  1957. if (this == User) GameScene.Scene.MapControl.FloorValid = false;
  1958. FrameIndex -= 2;
  1959. EffectFrameIndex -= 2;
  1960. if (FrameIndex < 0)
  1961. {
  1962. FrameIndex = 0;
  1963. SetAction();
  1964. }
  1965. if (EffectFrameIndex < 0) EffectFrameIndex = 0;
  1966. break;
  1967. case MirAction.Standing:
  1968. case MirAction.MountStanding:
  1969. case MirAction.DashFail:
  1970. case MirAction.Harvest:
  1971. case MirAction.Stance:
  1972. case MirAction.Stance2:
  1973. if (CMain.Time >= NextMotion)
  1974. {
  1975. GameScene.Scene.MapControl.TextureValid = false;
  1976. if (SkipFrames) UpdateFrame();
  1977. if (UpdateFrame() >= Frame.Count)
  1978. {
  1979. FrameIndex = Frame.Count - 1;
  1980. SetAction();
  1981. }
  1982. else
  1983. {
  1984. NextMotion += FrameInterval;
  1985. }
  1986. }
  1987. UpdateWingEffect();
  1988. break;
  1989. case MirAction.FishingCast:
  1990. case MirAction.FishingReel:
  1991. case MirAction.FishingWait:
  1992. if (CMain.Time >= NextMotion)
  1993. {
  1994. GameScene.Scene.MapControl.TextureValid = false;
  1995. if (SkipFrames) UpdateFrame();
  1996. if (UpdateFrame() >= Frame.Count)
  1997. {
  1998. FrameIndex = Frame.Count - 1;
  1999. SetAction();
  2000. }
  2001. else
  2002. {
  2003. switch (FrameIndex)
  2004. {
  2005. case 1:
  2006. switch (CurrentAction)
  2007. {
  2008. case MirAction.FishingCast:
  2009. SoundManager.PlaySound(SoundList.FishingThrow);
  2010. ((MirAnimatedButton)GameScene.Scene.FishingStatusDialog.FishButton).Visible = false;
  2011. break;
  2012. case MirAction.FishingReel:
  2013. SoundManager.PlaySound(SoundList.FishingPull);
  2014. break;
  2015. case MirAction.FishingWait:
  2016. if (FoundFish)
  2017. {
  2018. MapControl.Effects.Add(new Effect(Libraries.Effect, 671, 6, 720, FishingPoint) { Light = 0 });
  2019. MapControl.Effects.Add(new Effect(Libraries.Effect, 665, 6, 720, FishingPoint) { Light = 0 });
  2020. SoundManager.PlaySound(SoundList.Fishing);
  2021. Effects.Add(new Effect(Libraries.Prguse, 1350, 2, 720, this) { Light = 0, Blend = false });
  2022. ((MirAnimatedButton)GameScene.Scene.FishingStatusDialog.FishButton).Visible = true;
  2023. }
  2024. else
  2025. {
  2026. MapControl.Effects.Add(new Effect(Libraries.Effect, 650, 6, 720, FishingPoint) { Light = 0 });
  2027. MapControl.Effects.Add(new Effect(Libraries.Effect, 640, 6, 720, FishingPoint) { Light = 0 });
  2028. ((MirAnimatedButton)GameScene.Scene.FishingStatusDialog.FishButton).Visible = false;
  2029. }
  2030. ((MirAnimatedButton)GameScene.Scene.FishingStatusDialog.FishButton).AnimationCount = FoundFish ? 10 : 1;
  2031. break;
  2032. }
  2033. break;
  2034. }
  2035. NextMotion += FrameInterval;
  2036. }
  2037. }
  2038. UpdateWingEffect();
  2039. break;
  2040. case MirAction.Attack1:
  2041. case MirAction.Attack2:
  2042. case MirAction.Attack3:
  2043. case MirAction.Attack4:
  2044. case MirAction.MountAttack:
  2045. case MirAction.Mine:
  2046. if (CMain.Time >= NextMotion)
  2047. {
  2048. GameScene.Scene.MapControl.TextureValid = false;
  2049. if (SkipFrames) UpdateFrame();
  2050. if (UpdateFrame() >= Frame.Count)
  2051. {
  2052. //if (ActionFeed.Count == 0)
  2053. // ActionFeed.Add(new QueuedAction { Action = MirAction.Stance, Direction = Direction, Location = CurrentLocation });
  2054. StanceTime = CMain.Time + StanceDelay;
  2055. FrameIndex = Frame.Count - 1;
  2056. SetAction();
  2057. }
  2058. else
  2059. {
  2060. if (FrameIndex == 1) PlayAttackSound();
  2061. NextMotion += FrameInterval;
  2062. }
  2063. }
  2064. UpdateWingEffect();
  2065. break;
  2066. case MirAction.AttackRange1:
  2067. if (CMain.Time >= NextMotion)
  2068. {
  2069. GameScene.Scene.MapControl.TextureValid = false;
  2070. if (SkipFrames) UpdateFrame();
  2071. if (UpdateFrame() >= Frame.Count)
  2072. {
  2073. FrameIndex = Frame.Count - 1;
  2074. SetAction();
  2075. }
  2076. else
  2077. {
  2078. if (FrameIndex == 1) PlayAttackSound();
  2079. Missile missile;
  2080. switch (FrameIndex)
  2081. {
  2082. case 6:
  2083. switch (Spell)
  2084. {
  2085. case Spell.Focus:
  2086. Effects.Add(new Effect(Libraries.Magic3, 2730, 10, Frame.Count * FrameInterval, this));
  2087. SoundManager.PlaySound(20000 + 121 * 10 + 5);
  2088. break;
  2089. }
  2090. break;
  2091. case 5:
  2092. missile = CreateProjectile(1030, Libraries.Magic3, true, 5, 30, 5);
  2093. StanceTime = CMain.Time + StanceDelay;
  2094. SoundManager.PlaySound(20000 + 121 * 10);
  2095. if (missile.Target != null)
  2096. {
  2097. missile.Complete += (o, e) =>
  2098. {
  2099. SoundManager.PlaySound(20000 + 121 * 10 + 2);
  2100. };
  2101. }
  2102. break;
  2103. }
  2104. NextMotion += FrameInterval;
  2105. }
  2106. }
  2107. UpdateWingEffect();
  2108. break;
  2109. case MirAction.AttackRange2:
  2110. if (CMain.Time >= NextMotion)
  2111. {
  2112. GameScene.Scene.MapControl.TextureValid = false;
  2113. if (SkipFrames) UpdateFrame();
  2114. if (UpdateFrame() >= Frame.Count)
  2115. {
  2116. if (Cast)
  2117. {
  2118. MapObject ob = MapControl.GetObject(TargetID);
  2119. Missile missile;
  2120. switch (Spell)
  2121. {
  2122. case Spell.StraightShot:
  2123. SoundManager.PlaySound(20000 + (ushort)Spell * 10 + 0);
  2124. missile = CreateProjectile(1210, Libraries.Magic3, true, 5, 30, 5);
  2125. if (missile.Target != null)
  2126. {
  2127. missile.Complete += (o, e) =>
  2128. {
  2129. if (missile.Target.CurrentAction == MirAction.Dead) return;
  2130. missile.Target.Effects.Add(new Effect(Libraries.Magic3, 1370, 7, 600, missile.Target));
  2131. SoundManager.PlaySound(20000 + (ushort)Spell.StraightShot * 10 + 2);
  2132. };
  2133. }
  2134. break;
  2135. }
  2136. Cast = false;
  2137. }
  2138. StanceTime = CMain.Time + StanceDelay;
  2139. FrameIndex = Frame.Count - 1;
  2140. SetAction();
  2141. }
  2142. else
  2143. {
  2144. NextMotion += FrameInterval;
  2145. Missile missile;
  2146. switch(Spell)
  2147. {
  2148. case Spell.DoubleShot:
  2149. switch (FrameIndex)
  2150. {
  2151. case 7:
  2152. case 5:
  2153. missile = CreateProjectile(1030, Libraries.Magic3, true, 5, 30, 5);//normal arrow
  2154. StanceTime = CMain.Time + StanceDelay;
  2155. SoundManager.PlaySound(20000 + 121 * 10);
  2156. if (missile.Target != null)
  2157. {
  2158. missile.Complete += (o, e) =>
  2159. {
  2160. SoundManager.PlaySound(20000 + 121 * 10 + 2);
  2161. };
  2162. }
  2163. break;
  2164. }
  2165. break;
  2166. case Spell.ElementalShot:
  2167. if (HasElements && !ElementCasted)
  2168. switch (FrameIndex)
  2169. {
  2170. case 7:
  2171. missile = CreateProjectile(1690, Libraries.Magic3, true, 6, 30, 4);//elemental arrow
  2172. StanceTime = CMain.Time + StanceDelay;
  2173. if (missile.Target != null)
  2174. {
  2175. missile.Complete += (o, e) =>
  2176. {
  2177. SoundManager.PlaySound(20000 + (ushort)Spell * 10 + 2);//sound M128-2
  2178. };
  2179. }
  2180. break;
  2181. case 1:
  2182. Effects.Add(new Effect(Libraries.Magic3, 1681, 5, Frame.Count * FrameInterval, this));
  2183. SoundManager.PlaySound(20000 + (ushort)Spell * 10 + 0);//sound M128-0
  2184. break;
  2185. }
  2186. break;
  2187. case Spell.BindingShot:
  2188. case Spell.SummonVampire:
  2189. case Spell.SummonToad:
  2190. case Spell.SummonSnakes:
  2191. switch (FrameIndex)
  2192. {
  2193. case 7:
  2194. SoundManager.PlaySound(20000 + 121 * 10);
  2195. missile = CreateProjectile(2750, Libraries.Magic3, true, 5, 10, 5);
  2196. StanceTime = CMain.Time + StanceDelay;
  2197. if (missile.Target != null)
  2198. {
  2199. missile.Complete += (o, e) =>
  2200. {
  2201. SoundManager.PlaySound(20000 + (ushort)Spell * 10 + 7);//sound M130-7
  2202. };
  2203. }
  2204. break;
  2205. }
  2206. break;
  2207. case Spell.Stonetrap:
  2208. switch (FrameIndex)
  2209. {
  2210. case 7:
  2211. SoundManager.PlaySound(20000 + 121 * 10);
  2212. missile = CreateProjectile(2750, Libraries.Magic3, true, 5, 20, 5);
  2213. StanceTime = CMain.Time + StanceDelay;
  2214. missile.Explode = true;
  2215. missile.Complete += (o, e) =>
  2216. {
  2217. SoundManager.PlaySound(20000 + (ushort)Spell * 10 + 7);//sound M130-7
  2218. };
  2219. break;
  2220. }
  2221. break;
  2222. case Spell.DelayedExplosion:
  2223. switch (FrameIndex)
  2224. {
  2225. case 5:
  2226. missile = CreateProjectile(1030, Libraries.Magic3, true, 5, 30, 5);//normal arrow
  2227. StanceTime = CMain.Time + StanceDelay;
  2228. SoundManager.PlaySound(20000 + 121 * 10);
  2229. if (missile.Target != null)
  2230. {
  2231. missile.Complete += (o, e) =>
  2232. {
  2233. SoundManager.PlaySound(20000 + 121 * 10 + 2);
  2234. };
  2235. }
  2236. break;
  2237. }
  2238. break;
  2239. case Spell.VampireShot:
  2240. case Spell.PoisonShot:
  2241. case Spell.CrippleShot:
  2242. MapObject ob = MapControl.GetObject(TargetID);
  2243. Effect eff;
  2244. int exFrameStart = 0;
  2245. if (Spell == Spell.PoisonShot) exFrameStart = 200;
  2246. if (Spell == Spell.CrippleShot) exFrameStart = 400;
  2247. switch (FrameIndex)
  2248. {
  2249. case 7:
  2250. SoundManager.PlaySound(20000 + ((Spell == Spell.CrippleShot) ? 136 : 121) * 10);//M136-0
  2251. missile = CreateProjectile(1930 + exFrameStart, Libraries.Magic3, true, 5, 10, 5);
  2252. StanceTime = CMain.Time + StanceDelay;
  2253. if (missile.Target != null)
  2254. {
  2255. missile.Complete += (o, e) =>
  2256. {
  2257. if (ob != null)
  2258. {
  2259. if (Spell == Spell.CrippleShot)
  2260. {
  2261. int exIdx = 0;
  2262. if (this == User)
  2263. {
  2264. if (GameScene.Scene.BuffsDialog.Buffs.Any(x => x.Type == BuffType.VampireShot)) exIdx = 20;
  2265. if (GameScene.Scene.BuffsDialog.Buffs.Any(x => x.Type == BuffType.PoisonShot)) exIdx = 10;
  2266. }
  2267. else
  2268. {
  2269. if (Buffs.Any(x => x == BuffType.VampireShot)) exIdx = 20;
  2270. if (Buffs.Any(x => x == BuffType.PoisonShot)) exIdx = 10;
  2271. }
  2272. ob.Effects.Add(eff = new Effect(Libraries.Magic3, 2490 + exIdx, 7, 1000, ob));
  2273. SoundManager.PlaySound(20000 + 136 * 10 + 5 + (exIdx / 10));//sound M136-5/7
  2274. if (exIdx == 20)
  2275. eff.Complete += (o1, e1) =>
  2276. {
  2277. SoundManager.PlaySound(20000 + 45 * 10 + 2);//sound M45-2
  2278. Effects.Add(new Effect(Libraries.Magic3, 2100, 8, 1000, this));
  2279. };
  2280. }
  2281. if (Spell == Spell.VampireShot || Spell == Spell.PoisonShot)
  2282. {
  2283. ob.Effects.Add(eff = new Effect(Libraries.Magic3, 2090 + exFrameStart, 6, 1000, ob));
  2284. SoundManager.PlaySound(20000 + (133 + (exFrameStart / 100)) * 10 + 2);//sound M133-2 or M135-2
  2285. if (Spell == Spell.VampireShot)
  2286. eff.Complete += (o1, e1) =>
  2287. {
  2288. SoundManager.PlaySound(20000 + 45 * 10 + 2);//sound M45-2
  2289. Effects.Add(new Effect(Libraries.Magic3, 2100 + exFrameStart, 8, 1000, this));
  2290. };
  2291. }
  2292. }
  2293. //SoundManager.PlaySound(20000 + 121 * 10 + 2);//sound M121-2
  2294. };
  2295. }
  2296. break;
  2297. }
  2298. break;
  2299. case Spell.NapalmShot:
  2300. switch (FrameIndex)
  2301. {
  2302. case 7:
  2303. SoundManager.PlaySound(20000 + 138 * 10);//M138-0
  2304. missile = CreateProjectile(2530, Libraries.Magic3, true, 6, 50, 4);
  2305. StanceTime = CMain.Time + StanceDelay;
  2306. if (missile.Target != null)
  2307. {
  2308. missile.Complete += (o, e) =>
  2309. {
  2310. SoundManager.PlaySound(20000 + 138 * 10 + 2);//M138-2
  2311. MapControl.Effects.Add(new Effect(Libraries.Magic3, 2690, 10, 1000, TargetPoint));
  2312. };
  2313. }
  2314. break;
  2315. }
  2316. break;
  2317. }
  2318. }
  2319. }
  2320. UpdateWingEffect();
  2321. break;
  2322. case MirAction.Struck:
  2323. case MirAction.MountStruck:
  2324. if (CMain.Time >= NextMotion)
  2325. {
  2326. GameScene.Scene.MapControl.TextureValid = false;
  2327. if (SkipFrames) UpdateFrame();
  2328. if (UpdateFrame() >= Frame.Count)
  2329. {
  2330. FrameIndex = Frame.Count - 1;
  2331. SetAction();
  2332. }
  2333. else
  2334. {
  2335. NextMotion += FrameInterval;
  2336. }
  2337. }
  2338. UpdateWingEffect();
  2339. break;
  2340. case MirAction.Spell:
  2341. if (CMain.Time >= NextMotion)
  2342. {
  2343. GameScene.Scene.MapControl.TextureValid = false;
  2344. if (SkipFrames) UpdateFrame();
  2345. if (UpdateFrame() >= Frame.Count)
  2346. {
  2347. if (Cast)
  2348. {
  2349. MapObject ob = MapControl.GetObject(TargetID);
  2350. Missile missile;
  2351. Effect effect;
  2352. switch (Spell)
  2353. {
  2354. #region FireBall
  2355. case Spell.FireBall:
  2356. SoundManager.PlaySound(20000 + (ushort)Spell * 10 + 1);
  2357. missile = CreateProjectile(10, Libraries.Magic, true, 6, 30, 4);
  2358. if (missile.Target != null)
  2359. {
  2360. missile.Complete += (o, e) =>
  2361. {
  2362. if (missile.Target.CurrentAction == MirAction.Dead) return;
  2363. missile.Target.Effects.Add(new Effect(Libraries.Magic, 170, 10, 600, missile.Target));
  2364. SoundManager.PlaySound(20000 + (ushort)Spell * 10 + 2);
  2365. };
  2366. }
  2367. break;
  2368. #endregion
  2369. #region GreatFireBall
  2370. case Spell.GreatFireBall:
  2371. SoundManager.PlaySound(20000 + (ushort)Spell * 10 + 1);
  2372. missile = CreateProjectile(410, Libraries.Magic, true, 6, 30, 4);
  2373. if (missile.Target != null)
  2374. {
  2375. missile.Complete += (o, e) =>
  2376. {
  2377. if (missile.Target.CurrentAction == MirAction.Dead) return;
  2378. missile.Target.Effects.Add(new Effect(Libraries.Magic, 570, 10, 600, missile.Target));
  2379. SoundManager.PlaySound(20000 + (ushort)Spell.GreatFireBall * 10 + 2);
  2380. };
  2381. }
  2382. break;
  2383. #endregion
  2384. #region Healing
  2385. case Spell.Healing:
  2386. SoundManager.PlaySound(20000 + (ushort)Spell * 10 + 1);
  2387. if (ob == null)
  2388. MapControl.Effects.Add(new Effect(Libraries.Magic, 370, 10, 800, TargetPoint));
  2389. else
  2390. ob.Effects.Add(new Effect(Libraries.Magic, 370, 10, 800, ob));
  2391. break;
  2392. #endregion
  2393. #region ElectricShock
  2394. case Spell.ElectricShock:
  2395. SoundManager.PlaySound(20000 + (ushort)Spell * 10 + 1);
  2396. if (ob == null)
  2397. MapControl.Effects.Add(new Effect(Libraries.Magic, 1570, 10, 1000, TargetPoint));
  2398. else
  2399. ob.Effects.Add(new Effect(Libraries.Magic, 1570, 10, 1000, ob));
  2400. break;
  2401. #endregion
  2402. #region Poisoning
  2403. case Spell.Poisoning:
  2404. SoundManager.PlaySound(20000 + (ushort)Spell * 10 + 1);
  2405. if (ob != null)
  2406. ob.Effects.Add(new Effect(Libraries.Magic, 770, 10, 1000, ob));
  2407. break;
  2408. #endregion
  2409. #region HellFire
  2410. case Spell.HellFire:
  2411. SoundManager.PlaySound(20000 + (ushort)Spell * 10 + 1);
  2412. Point dest = CurrentLocation;
  2413. for (int i = 0; i < 4; i++)
  2414. {
  2415. dest = Functions.PointMove(dest, Direction, 1);
  2416. if (!GameScene.Scene.MapControl.ValidPoint(dest)) break;
  2417. effect = new Effect(Libraries.Magic, 930, 6, 500, dest) { Rate = 0.7F };
  2418. effect.SetStart(CMain.Time + i * 50);
  2419. MapControl.Effects.Add(effect);
  2420. }
  2421. if (SpellLevel == 3)
  2422. {
  2423. MirDirection dir = (MirDirection)(((int)Direction + 1) % 8);
  2424. dest = CurrentLocation;
  2425. for (int r = 0; r < 4; r++)
  2426. {
  2427. dest = Functions.PointMove(dest, dir, 1);
  2428. if (!GameScene.Scene.MapControl.ValidPoint(dest)) break;
  2429. effect = new Effect(Libraries.Magic, 930, 6, 500, dest) { Rate = 0.7F };
  2430. effect.SetStart(CMain.Time + r * 50);
  2431. MapControl.Effects.Add(effect);
  2432. }
  2433. dir = (MirDirection)(((int)Direction - 1 + 8) % 8);
  2434. dest = CurrentLocation;
  2435. for (int r = 0; r < 4; r++)
  2436. {
  2437. dest = Functions.PointMove(dest, dir, 1);
  2438. if (!GameScene.Scene.MapControl.ValidPoint(dest)) break;
  2439. effect = new Effect(Libraries.Magic, 930, 6, 500, dest) { Rate = 0.7F };
  2440. effect.SetStart(CMain.Time + r * 50);
  2441. MapControl.Effects.Add(effect);
  2442. }
  2443. }
  2444. break;
  2445. #endregion
  2446. #region ThunderBolt
  2447. case Spell.ThunderBolt:
  2448. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  2449. if (ob == null)
  2450. MapControl.Effects.Add(new Effect(Libraries.Magic2, 10, 5, 400, TargetPoint));
  2451. else
  2452. ob.Effects.Add(new Effect(Libraries.Magic2, 10, 5, 400, ob));
  2453. break;
  2454. #endregion
  2455. #region SoulFireBall
  2456. case Spell.SoulFireBall:
  2457. SoundManager.PlaySound(20000 + (ushort)Spell * 10 + 1);
  2458. missile = CreateProjectile(1160, Libraries.Magic, true, 3, 30, 7);
  2459. if (missile.Target != null)
  2460. {
  2461. missile.Complete += (o, e) =>
  2462. {
  2463. if (missile.Target.CurrentAction == MirAction.Dead) return;
  2464. missile.Target.Effects.Add(new Effect(Libraries.Magic, 1360, 10, 600, missile.Target));
  2465. SoundManager.PlaySound(20000 + (ushort)Spell.SoulFireBall * 10 + 2);
  2466. };
  2467. }
  2468. break;
  2469. #endregion
  2470. #region EnergyShield
  2471. case Spell.EnergyShield:
  2472. //Effects.Add(new Effect(Libraries.Magic2, 1880, 9, Frame.Count * FrameInterval, this));
  2473. //SoundManager.PlaySound(20000 + (ushort)Spell * 9);
  2474. break;
  2475. #endregion
  2476. #region FireBang
  2477. case Spell.FireBang:
  2478. SoundManager.PlaySound(20000 + (ushort)Spell * 10 + 1);
  2479. MapControl.Effects.Add(new Effect(Libraries.Magic, 1660, 10, 1000, TargetPoint));
  2480. break;
  2481. #endregion
  2482. #region MassHiding
  2483. case Spell.MassHiding:
  2484. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  2485. missile = CreateProjectile(1160, Libraries.Magic, true, 3, 30, 7);
  2486. missile.Explode = true;
  2487. missile.Complete += (o, e) =>
  2488. {
  2489. MapControl.Effects.Add(new Effect(Libraries.Magic, 1540, 10, 800, TargetPoint));
  2490. SoundManager.PlaySound(20000 + (ushort)Spell.MassHiding * 10 + 1);
  2491. };
  2492. break;
  2493. #endregion
  2494. #region SoulShield
  2495. case Spell.SoulShield:
  2496. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  2497. missile = CreateProjectile(1160, Libraries.Magic, true, 3, 30, 7);
  2498. missile.Explode = true;
  2499. missile.Complete += (o, e) =>
  2500. {
  2501. MapControl.Effects.Add(new Effect(Libraries.Magic, 1320, 15, 1200, TargetPoint));
  2502. SoundManager.PlaySound(20000 + (ushort)Spell.SoulShield * 10 + 1);
  2503. };
  2504. break;
  2505. #endregion
  2506. #region BlessedArmour
  2507. case Spell.BlessedArmour:
  2508. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  2509. missile = CreateProjectile(1160, Libraries.Magic, true, 3, 30, 7);
  2510. missile.Explode = true;
  2511. missile.Complete += (o, e) =>
  2512. {
  2513. MapControl.Effects.Add(new Effect(Libraries.Magic, 1340, 15, 1200, TargetPoint));
  2514. SoundManager.PlaySound(20000 + (ushort)Spell.BlessedArmour * 10 + 1);
  2515. };
  2516. break;
  2517. #endregion
  2518. #region FireWall
  2519. case Spell.FireWall:
  2520. SoundManager.PlaySound(20000 + (ushort)Spell * 10 + 1);
  2521. break;
  2522. #endregion
  2523. #region HealingCircle
  2524. case Spell.HealingCircle:
  2525. SoundManager.PlaySound(20000 + (ushort)Spell * 10 + 1);
  2526. MapControl.Effects.Add(new Effect(Libraries.Magic3, 620, 10, 1200, TargetPoint));
  2527. break;
  2528. #endregion
  2529. #region MassHealing
  2530. case Spell.MassHealing:
  2531. SoundManager.PlaySound(20000 + (ushort)Spell * 10 + 1);
  2532. MapControl.Effects.Add(new Effect(Libraries.Magic, 1800, 10, 1000, TargetPoint));
  2533. break;
  2534. #endregion
  2535. #region IceStorm
  2536. case Spell.IceStorm:
  2537. SoundManager.PlaySound(20000 + (ushort)Spell * 10 + 1);
  2538. MapControl.Effects.Add(new Effect(Libraries.Magic, 3850, 20, 1300, TargetPoint));
  2539. break;
  2540. #endregion
  2541. #region TurnUndead
  2542. case Spell.TurnUndead:
  2543. SoundManager.PlaySound(20000 + (ushort)Spell * 10 + 1);
  2544. if (ob == null)
  2545. MapControl.Effects.Add(new Effect(Libraries.Magic, 3930, 15, 1000, TargetPoint));
  2546. else
  2547. ob.Effects.Add(new Effect(Libraries.Magic, 3930, 15, 1000, ob));
  2548. break;
  2549. #endregion
  2550. #region IceThrust
  2551. case Spell.IceThrust:
  2552. Point location = Functions.PointMove(CurrentLocation, Direction, 1);
  2553. MapControl.Effects.Add(new Effect(Libraries.Magic2, 1790 + (int)Direction * 10, 10, 10 * FrameInterval, location));
  2554. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  2555. break;
  2556. #endregion
  2557. #region Revelation
  2558. case Spell.Revelation:
  2559. SoundManager.PlaySound(20000 + (ushort)Spell * 10 + 1);
  2560. if (ob == null)
  2561. MapControl.Effects.Add(new Effect(Libraries.Magic, 3990, 10, 1000, TargetPoint));
  2562. else
  2563. ob.Effects.Add(new Effect(Libraries.Magic, 3990, 10, 1000, ob));
  2564. break;
  2565. #endregion
  2566. #region FlameDisruptor
  2567. case Spell.FlameDisruptor:
  2568. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  2569. if (ob == null)
  2570. MapControl.Effects.Add(new Effect(Libraries.Magic2, 140, 10, 600, TargetPoint));
  2571. else
  2572. ob.Effects.Add(new Effect(Libraries.Magic2, 140, 10, 600, ob));
  2573. break;
  2574. #endregion
  2575. #region CatTongue
  2576. case Spell.CatTongue:
  2577. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  2578. missile = CreateProjectile(260, Libraries.Magic3, true, 6, 30, 4);
  2579. if (missile.Target != null)
  2580. {
  2581. missile.Complete += (o, e) =>
  2582. {
  2583. if (missile.Target.CurrentAction == MirAction.Dead) return;
  2584. missile.Target.Effects.Add(new Effect(Libraries.Magic3, 420, 8, 800, missile.Target));
  2585. SoundManager.PlaySound(20000 + (ushort)Spell.CatTongue * 10 + 1);
  2586. };
  2587. }
  2588. break;
  2589. #endregion
  2590. #region FrostCrunch
  2591. case Spell.FrostCrunch:
  2592. SoundManager.PlaySound(20000 + (ushort)Spell * 10 + 1);
  2593. missile = CreateProjectile(410, Libraries.Magic2, true, 4, 30, 6);
  2594. if (missile.Target != null)
  2595. {
  2596. missile.Complete += (o, e) =>
  2597. {
  2598. if (missile.Target.CurrentAction == MirAction.Dead) return;
  2599. missile.Target.Effects.Add(new Effect(Libraries.Magic2, 570, 8, 600, missile.Target));
  2600. SoundManager.PlaySound(20000 + (ushort)Spell.FrostCrunch * 10 + 2);
  2601. };
  2602. }
  2603. break;
  2604. #endregion
  2605. #region Purification
  2606. case Spell.Purification:
  2607. if (ob == null)
  2608. MapControl.Effects.Add(new Effect(Libraries.Magic2, 620, 10, 800, TargetPoint));
  2609. else
  2610. ob.Effects.Add(new Effect(Libraries.Magic2, 620, 10, 800, ob));
  2611. break;
  2612. #endregion
  2613. #region Curse
  2614. case Spell.Curse:
  2615. missile = CreateProjectile(1160, Libraries.Magic, true, 3, 30, 7);
  2616. missile.Explode = true;
  2617. missile.Complete += (o, e) =>
  2618. {
  2619. MapControl.Effects.Add(new Effect(Libraries.Magic2, 950, 24, 2000, TargetPoint));
  2620. SoundManager.PlaySound(20000 + (ushort)Spell.Curse * 10);
  2621. };
  2622. break;
  2623. #endregion
  2624. #region Hallucination
  2625. case Spell.Hallucination:
  2626. missile = CreateProjectile(1160, Libraries.Magic, true, 3, 48, 7);
  2627. if (missile.Target != null)
  2628. {
  2629. missile.Complete += (o, e) =>
  2630. {
  2631. if (missile.Target.CurrentAction == MirAction.Dead) return;
  2632. missile.Target.Effects.Add(new Effect(Libraries.Magic2, 1110, 10, 1000, missile.Target));
  2633. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  2634. };
  2635. }
  2636. break;
  2637. #endregion
  2638. #region Lightning
  2639. case Spell.Lightning:
  2640. Effects.Add(new Effect(Libraries.Magic, 970 + (int)Direction * 20, 6, Frame.Count * FrameInterval, this));
  2641. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  2642. break;
  2643. #endregion
  2644. #region Vampirism
  2645. case Spell.Vampirism:
  2646. SoundManager.PlaySound(20000 + (ushort)Spell * 10 + 1);
  2647. if (ob == null)
  2648. MapControl.Effects.Add(new Effect(Libraries.Magic2, 1060, 20, 1000, TargetPoint));
  2649. else
  2650. {
  2651. ob.Effects.Add(effect = new Effect(Libraries.Magic2, 1060, 20, 1000, ob));
  2652. effect.Complete += (o, e) =>
  2653. {
  2654. SoundManager.PlaySound(20000 + (ushort)Spell.Vampirism * 10 + 2);
  2655. Effects.Add(new Effect(Libraries.Magic2, 1090, 10, 500, this));
  2656. };
  2657. }
  2658. break;
  2659. #endregion
  2660. #region PoisonCloud
  2661. case Spell.PoisonCloud:
  2662. missile = CreateProjectile(1160, Libraries.Magic, true, 3, 30, 7);
  2663. missile.Explode = true;
  2664. missile.Complete += (o, e) =>
  2665. {
  2666. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  2667. };
  2668. break;
  2669. #endregion
  2670. #region Blizzard
  2671. case Spell.Blizzard:
  2672. SoundManager.PlaySound(20000 + (ushort)Spell * 10 + 1);
  2673. //BlizzardFreezeTime = CMain.Time + 3000;
  2674. break;
  2675. #endregion
  2676. #region MeteorStrike
  2677. case Spell.MeteorStrike:
  2678. SoundManager.PlaySound(20000 + (ushort)Spell * 10 + 1);
  2679. SoundManager.PlaySound(20000 + (ushort)Spell * 10 + 2);
  2680. //BlizzardFreezeTime = CMain.Time + 3000;
  2681. break;
  2682. #endregion
  2683. #region Reincarnation
  2684. case Spell.Reincarnation:
  2685. ReincarnationStopTime = 0;
  2686. break;
  2687. #endregion
  2688. #region SummonHolyDeva
  2689. case Spell.SummonHolyDeva:
  2690. Effects.Add(new Effect(Libraries.Magic, 1500, 10, Frame.Count * FrameInterval, this));
  2691. SoundManager.PlaySound(20000 + (ushort)Spell * 10);
  2692. break;
  2693. #endregion
  2694. #region UltimateEnhancer
  2695. case Spell.UltimateEnhancer:
  2696. if (ob != null && ob != User)
  2697. ob.Effects.Add(new Effect(Libraries.Magic2, 160, 15, 1000, ob));
  2698. break;
  2699. #endregion
  2700. #region Plague
  2701. case Spell.Plague:
  2702. //SoundManager.PlaySound(20000 + (ushort)Spell.SoulShield * 10);
  2703. missile = CreateProjectile(1160, Libraries.Magic, true, 3, 30, 7);
  2704. missile.Explode = true;
  2705. missile.Complete += (o, e) =>
  2706. {
  2707. MapControl.Effects.Add(new Effect(Libraries.Magic3, 110, 10, 1200, TargetPoint));
  2708. SoundManager.PlaySound(20000 + (ushort)Spell.Plague * 10 + 3);
  2709. };
  2710. break;
  2711. #endregion
  2712. #region TrapHexagon
  2713. case Spell.TrapHexagon:
  2714. if (ob != null)
  2715. SoundManager.PlaySound(20000 + (ushort)Spell.TrapHexagon * 10 + 1);
  2716. break;
  2717. #endregion
  2718. #region Trap
  2719. case Spell.Trap:
  2720. if (ob != null)
  2721. SoundManager.PlaySound(20000 + (ushort)Spell.Trap * 10 + 1);
  2722. break;
  2723. #endregion
  2724. #region CrescentSlash
  2725. case Spell.CrescentSlash:
  2726. SoundManager.PlaySound(20000 + (ushort)Spell * 10 + 2);
  2727. break;
  2728. #endregion
  2729. #region NapalmShot
  2730. case Spell.NapalmShot:
  2731. SoundManager.PlaySound(20000 + (ushort)Spell * 10 + 1);
  2732. MapControl.Effects.Add(new Effect(Libraries.Magic3, 1660, 10, 1000, TargetPoint));
  2733. break;
  2734. #endregion
  2735. #region FireBounce
  2736. case Spell.FireBounce:
  2737. SoundManager.PlaySound(20000 + (ushort)Spell.GreatFireBall * 10 + 1);
  2738. missile = CreateProjectile(410, Libraries.Magic, true, 6, 30, 4);
  2739. if (missile.Target != null)
  2740. {
  2741. missile.Complete += (o, e) =>
  2742. {
  2743. if (missile.Target.CurrentAction == MirAction.Dead) return;
  2744. missile.Target.Effects.Add(new Effect(Libraries.Magic, 570, 10, 600, missile.Target));
  2745. SoundManager.PlaySound(20000 + (ushort)Spell.GreatFireBall * 10 + 2);
  2746. };
  2747. }
  2748. break;
  2749. #endregion
  2750. #region MeteorShower
  2751. case Spell.MeteorShower:
  2752. SoundManager.PlaySound(20000 + (ushort)Spell.GreatFireBall * 10 + 1);
  2753. var targetIDs = new List<uint> { TargetID };
  2754. if (SecondaryTargetIDs != null)
  2755. {
  2756. targetIDs.AddRange(SecondaryTargetIDs);
  2757. }
  2758. foreach (var targetID in targetIDs)
  2759. {
  2760. missile = CreateProjectile(410, Libraries.Magic, true, 6, 30, 4, targetID: targetID);
  2761. if (missile.Target != null)
  2762. {
  2763. missile.Complete += (o, e) =>
  2764. {
  2765. var sender = (Missile)o;
  2766. if (sender.Target.CurrentAction == MirAction.Dead) return;
  2767. sender.Target.Effects.Add(new Effect(Libraries.Magic, 570, 10, 600, sender.Target));
  2768. SoundManager.PlaySound(20000 + (ushort)Spell.GreatFireBall * 10 + 2);
  2769. };
  2770. }
  2771. }
  2772. break;
  2773. #endregion
  2774. }
  2775. Cast = false;
  2776. }
  2777. //if (ActionFeed.Count == 0)
  2778. // ActionFeed.Add(new QueuedAction { Action = MirAction.Stance, Direction = Direction, Location = CurrentLocation });
  2779. StanceTime = CMain.Time + StanceDelay;
  2780. FrameIndex = Frame.Count - 1;
  2781. SetAction();
  2782. }
  2783. else
  2784. {
  2785. NextMotion += FrameInterval;
  2786. }
  2787. }
  2788. UpdateWingEffect();
  2789. break;
  2790. case MirAction.Die:
  2791. if (CMain.Time >= NextMotion)
  2792. {
  2793. GameScene.Scene.MapControl.TextureValid = false;
  2794. if (SkipFrames) UpdateFrame();
  2795. if (UpdateFrame() >= Frame.Count)
  2796. {
  2797. FrameIndex = Frame.Count - 1;
  2798. ActionFeed.Clear();
  2799. ActionFeed.Add(new QueuedAction { Action = MirAction.Dead, Direction = Direction, Location = CurrentLocation });
  2800. SetAction();
  2801. }
  2802. else
  2803. {
  2804. if (FrameIndex == 1)
  2805. PlayDieSound();
  2806. NextMotion += FrameInterval;
  2807. }
  2808. }
  2809. UpdateWingEffect();
  2810. break;
  2811. case MirAction.Dead:
  2812. break;
  2813. case MirAction.Revive:
  2814. if (CMain.Time >= NextMotion)
  2815. {
  2816. GameScene.Scene.MapControl.TextureValid = false;
  2817. if (SkipFrames) UpdateFrame();
  2818. if (UpdateFrame() >= Frame.Count)
  2819. {
  2820. FrameIndex = Frame.Count - 1;
  2821. ActionFeed.Clear();
  2822. ActionFeed.Add(new QueuedAction { Action = MirAction.Standing, Direction = Direction, Location = CurrentLocation });
  2823. SetAction();
  2824. }
  2825. else
  2826. {
  2827. NextMotion += FrameInterval;
  2828. }
  2829. }
  2830. break;
  2831. }
  2832. if (this == User) return;
  2833. if ((CurrentAction == MirAction.Standing || CurrentAction == MirAction.MountStanding || CurrentAction == MirAction.Stance || CurrentAction == MirAction.Stance2 || CurrentAction == MirAction.DashFail) && NextAction != null)
  2834. SetAction();
  2835. //if Revive and dead set action
  2836. }
  2837. public int UpdateFrame(bool skip = true)
  2838. {
  2839. if (Frame == null) return 0;
  2840. if (Poison.HasFlag(PoisonType.Slow) && !skip)
  2841. {
  2842. SkipFrameUpdate++;
  2843. if (SkipFrameUpdate == 2)
  2844. SkipFrameUpdate = 0;
  2845. else
  2846. return FrameIndex;
  2847. }
  2848. if (Frame.Reverse) return Math.Abs(--FrameIndex);
  2849. return ++FrameIndex;
  2850. }
  2851. public int UpdateFrame2()
  2852. {
  2853. if (Frame == null) return 0;
  2854. if (Frame.Reverse) return Math.Abs(--EffectFrameIndex);
  2855. return ++EffectFrameIndex;
  2856. }
  2857. private void UpdateWingEffect()
  2858. {
  2859. if (WingEffect > 0 && CMain.Time >= NextMotion2)
  2860. {
  2861. GameScene.Scene.MapControl.TextureValid = false;
  2862. if (SkipFrames) UpdateFrame2();
  2863. if (UpdateFrame2() >= Frame.EffectCount)
  2864. EffectFrameIndex = Frame.EffectCount - 1;
  2865. else
  2866. NextMotion2 += EffectFrameInterval;
  2867. }
  2868. }
  2869. public override Missile CreateProjectile(int baseIndex, MLibrary library, bool blend, int count, int interval, int skip, int lightDistance = 6, bool direction16 = true, Color? lightColour = null, uint targetID = 0)
  2870. {
  2871. if (targetID == 0)
  2872. {
  2873. targetID = TargetID;
  2874. }
  2875. MapObject ob = MapControl.GetObject(targetID);
  2876. var targetPoint = TargetPoint;
  2877. if (ob != null) targetPoint = ob.CurrentLocation;
  2878. int duration = Functions.MaxDistance(CurrentLocation, targetPoint) * 50;
  2879. Missile missile = new Missile(library, baseIndex, duration / interval, duration, this, targetPoint)
  2880. {
  2881. Target = ob,
  2882. Interval = interval,
  2883. FrameCount = count,
  2884. Blend = blend,
  2885. Skip = skip,
  2886. Light = lightDistance,
  2887. LightColour = lightColour == null ? Color.White : (Color)lightColour
  2888. };
  2889. Effects.Add(missile);
  2890. return missile;
  2891. }
  2892. //Rebuild
  2893. public void PlayStepSound()
  2894. {
  2895. int x = CurrentLocation.X - CurrentLocation.X % 2;
  2896. int y = CurrentLocation.Y - CurrentLocation.Y % 2;
  2897. if (GameScene.Scene.MapControl.M2CellInfo[x, y].FrontIndex > 199) return; //prevents any move sounds on non mir2 maps atm
  2898. if (GameScene.Scene.MapControl.M2CellInfo[x, y].MiddleIndex > 199) return; //prevents any move sounds on non mir2 maps atm
  2899. if (GameScene.Scene.MapControl.M2CellInfo[x, y].BackIndex > 199) return; //prevents any move sounds on non mir2 maps atm
  2900. int moveSound;
  2901. if (GameScene.Scene.MapControl.M2CellInfo[x, y].BackIndex > 99 && GameScene.Scene.MapControl.M2CellInfo[x, y].BackIndex < 199) //shanda tiles
  2902. {
  2903. PlayShandaStepSound(x, y, out moveSound);
  2904. }
  2905. else if (GameScene.Scene.MapControl.M2CellInfo[x, y].BackIndex > 199 && GameScene.Scene.MapControl.M2CellInfo[x, y].BackIndex < 299) //mir3 tiles
  2906. {
  2907. PlayWemadeMir3StepSound(x, y, out moveSound);
  2908. }
  2909. else //wemade tiles
  2910. {
  2911. PlayWemadeStepSound(x, y, out moveSound);
  2912. }
  2913. if (RidingMount) moveSound = SoundList.MountWalkL;
  2914. if (CurrentAction == MirAction.Running) moveSound += 2;
  2915. if (FrameIndex == 4) moveSound++;
  2916. SoundManager.PlaySound(moveSound);
  2917. }
  2918. private void PlayWemadeStepSound(int x, int y, out int moveSound)
  2919. {
  2920. int index = (GameScene.Scene.MapControl.M2CellInfo[x, y].BackImage & 0x1FFFF) - 1;
  2921. //index = (GameScene.Scene.MapControl.M2CellInfo[x, y].FrontIndex - 2) * 10000 + index;
  2922. if (index >= 0 && index <= 10000)
  2923. {
  2924. if ((index >= 330 && index <= 349) || (index >= 450 && index <= 454) || (index >= 550 && index <= 554) ||
  2925. (index >= 750 && index <= 754) || (index >= 950 && index <= 954) || (index >= 1250 && index <= 1254) ||
  2926. (index >= 1400 && index <= 1424) || (index >= 1455 && index <= 1474) || (index >= 1500 && index <= 1524) ||
  2927. (index >= 1550 && index <= 1574))
  2928. moveSound = SoundList.WalkLawnL;
  2929. else if ((index >= 250 && index <= 254) || (index >= 1005 && index <= 1009) || (index >= 1050 && index <= 1054) ||
  2930. (index >= 1060 && index <= 1064) || (index >= 1450 && index <= 1454) || (index >= 1650 && index <= 1654))
  2931. moveSound = SoundList.WalkRoughL;
  2932. else if ((index >= 605 && index <= 609) || (index >= 650 && index <= 654) || (index >= 660 && index <= 664) ||
  2933. (index >= 2000 && index <= 2049) || (index >= 3025 && index <= 3049) || (index >= 2400 && index <= 2424) ||
  2934. (index >= 4625 && index <= 4649) || (index >= 4675 && index <= 4678))
  2935. moveSound = SoundList.WalkStoneL;
  2936. else if ((index >= 1825 && index <= 1924) || (index >= 2150 && index <= 2174) || (index >= 3075 && index <= 3099) ||
  2937. (index >= 3325 && index <= 3349) || (index >= 3375 && index <= 3399))
  2938. moveSound = SoundList.WalkCaveL;
  2939. else if (index == 3230 || index == 3231 || index == 3246 || index == 3277 || (index >= 3780 && index <= 3799))
  2940. moveSound = SoundList.WalkWoodL;
  2941. else if (index >= 3825 && index <= 4434)
  2942. switch (index % 25)
  2943. {
  2944. case 0:
  2945. moveSound = SoundList.WalkWoodL;
  2946. break;
  2947. default:
  2948. moveSound = SoundList.WalkGroundL;
  2949. break;
  2950. }
  2951. else if ((index >= 2075 && index <= 2099) || (index >= 2125 && index <= 2149))
  2952. moveSound = SoundList.WalkRoomL;
  2953. else if (index >= 1800 && index <= 1824)
  2954. moveSound = SoundList.WalkWaterL;
  2955. else moveSound = SoundList.WalkGroundL;
  2956. if ((index >= 825 && index <= 1349) && (index - 825) / 25 % 2 == 0) moveSound = SoundList.WalkStoneL;
  2957. if ((index >= 1375 && index <= 1799) && (index - 1375) / 25 % 2 == 0) moveSound = SoundList.WalkCaveL;
  2958. if (index == 1385 || index == 1386 || index == 1391 || index == 1392) moveSound = SoundList.WalkWoodL;
  2959. index = (GameScene.Scene.MapControl.M2CellInfo[x, y].MiddleImage & 0x7FFF) - 1;
  2960. if (index >= 0 && index <= 115)
  2961. moveSound = SoundList.WalkGroundL;
  2962. else if (index >= 120 && index <= 124)
  2963. moveSound = SoundList.WalkLawnL;
  2964. index = (GameScene.Scene.MapControl.M2CellInfo[x, y].FrontImage & 0x7FFF) - 1;
  2965. if ((index >= 221 && index <= 289) || (index >= 583 && index <= 658) || (index >= 1183 && index <= 1206) ||
  2966. (index >= 7163 && index <= 7295) || (index >= 7404 && index <= 7414))
  2967. moveSound = SoundList.WalkStoneL;
  2968. else if ((index >= 3125 && index <= 3267) || (index >= 3757 && index <= 3948) || (index >= 6030 && index <= 6999))
  2969. moveSound = SoundList.WalkWoodL;
  2970. if (index >= 3316 && index <= 3589)
  2971. moveSound = SoundList.WalkRoomL;
  2972. }
  2973. else
  2974. moveSound = SoundList.WalkGroundL;
  2975. }
  2976. private void PlayShandaStepSound(int x, int y, out int moveSound)
  2977. {
  2978. int index = (GameScene.Scene.MapControl.M2CellInfo[x, y].BackImage & 0x1FFFF) - 1;
  2979. //index = (GameScene.Scene.MapControl.M2CellInfo[x, y].BackIndex - 100) * 100000 + index;
  2980. var tt = GameScene.Scene.MapControl.M2CellInfo[x, y];
  2981. //CMain.SendDebugMessage(string.Format("BackImage : {0}. BackIndex : {1}. MiddleImage : {2}. MiddleIndex {3}", tt.BackImage, tt.BackIndex, tt.MiddleImage, tt.MiddleIndex));
  2982. #region Back Tiles (Tiles)
  2983. switch (GameScene.Scene.MapControl.M2CellInfo[x, y].BackIndex)
  2984. {
  2985. case 100:
  2986. {
  2987. //Tiles1
  2988. if ((index >= 0 && index <= 39) || (index >= 50 && index <= 74) || (index >= 80 && index <= 84) || (index >= 100 && index <= 204) ||
  2989. (index >= 210 && index <= 249) || (index >= 255 && index <= 259) || (index >= 265 && index <= 329) || (index >= 350 && index <= 404) ||
  2990. (index >= 410 && index <= 449) || (index >= 455 && index <= 459) || (index >= 465 && index <= 504) || (index >= 510 && index <= 549) ||
  2991. (index >= 555 && index <= 559) || (index >= 565 && index <= 574) || (index >= 581 && index <= 581) || (index >= 586 && index <= 587) ||
  2992. (index >= 600 && index <= 604) || (index >= 610 && index <= 614) || (index >= 615 && index <= 649) || (index >= 655 && index <= 659) ||
  2993. (index >= 665 && index <= 704) || (index >= 710 && index <= 749) || (index >= 755 && index <= 759) || (index >= 765 && index <= 824) ||
  2994. (index >= 850 && index <= 874) || (index >= 900 && index <= 924) || (index >= 950 && index <= 974) || (index >= 1100 && index <= 1124) ||
  2995. (index >= 1150 && index <= 1174) || (index >= 1200 && index <= 1204) || (index >= 1210 && index <= 1214) || (index >= 1255 && index <= 1259) ||
  2996. (index >= 1300 && index <= 1324) || (index >= 1340 && index <= 1374) || (index >= 1560 && index <= 1604) || (index >= 1610 && index <= 1614) ||
  2997. (index >= 1655 && index <= 1659) || (index >= 1665 && index <= 1674) || (index >= 1700 && index <= 1724) || (index >= 1750 && index <= 1774) ||
  2998. (index >= 1850 && index <= 1874) || (index >= 2050 && index <= 2074) || (index >= 2100 && index <= 2124) || (index >= 2150 && index <= 2174) ||
  2999. (index >= 2200 && index <= 2224) ||(index >= 2250 && index <= 2274) ||(index >= 2300 && index <= 2324) ||(index >= 2350 && index <= 2374) ||
  3000. (index >= 2500 && index <= 2524) ||(index >= 2750 && index <= 2774) ||(index >= 3250 && index <= 3274) ||(index >= 3300 && index <= 3349) ||
  3001. (index >= 3375 && index <= 3404) ||(index >= 3425 && index <= 3449) ||(index >= 3475 && index <= 3499) ||(index >= 3525 && index <= 3549) ||
  3002. (index >= 3575 && index <= 3599) ||(index >= 3625 && index <= 3649) ||(index >= 3675 && index <= 3749) ||(index >= 3775 && index <= 3780) ||
  3003. (index >= 4475 && index <= 4624) ||(index >= 4680 && index <= 4824) ||(index >= 6225 && index <= 7924) ||(index >= 11079 && index <= 11079) ||
  3004. (index >= 11083 && index <= 11084) ||(index >= 11120 && index <= 11127) ||(index >= 11129 && index <= 11130) ||(index >= 11132 && index <= 11133) ||
  3005. (index >= 11135 && index <= 11136) ||(index >= 13770 && index <= 14019) ||(index >= 14170 && index <= 14219) ||(index >= 14820 && index <= 14869) ||
  3006. (index >= 20470 && index <= 21619) ||(index >= 25000 && index <= 31724))
  3007. moveSound = SoundList.WalkGroundL;
  3008. else if ((index >= 205 && index <= 209) ||(index >= 260 && index <= 264) ||(index >= 330 && index <= 349) ||(index >= 405 && index <= 409) ||
  3009. (index >= 460 && index <= 464) ||(index >= 505 && index <= 509) ||(index >= 560 && index <= 564) ||(index >= 575 && index <= 580) ||
  3010. (index >= 582 && index <= 585) ||(index >= 588 && index <= 599) ||(index >= 705 && index <= 709) ||(index >= 750 && index <= 754) ||
  3011. (index >= 760 && index <= 764) ||(index >= 1205 && index <= 1209) ||(index >= 1215 && index <= 1224) ||(index >= 1250 && index <= 1254) ||
  3012. (index >= 1260 && index <= 1274) ||(index >= 1400 && index <= 1424) ||(index >= 1455 && index <= 1459) ||(index >= 1500 && index <= 1524) ||
  3013. (index >= 1550 && index <= 1574) ||(index >= 2555 && index <= 2559) ||(index >= 2605 && index <= 2609) ||(index >= 2655 && index <= 2659) ||
  3014. (index >= 2705 && index <= 2709) ||(index >= 10320 && index <= 10324) ||(index >= 10329 && index <= 10329) ||(index >= 10334 && index <= 10334) ||
  3015. (index >= 10372 && index <= 10372) ||(index >= 10381 && index <= 10381) ||(index >= 10420 && index <= 10422) ||(index >= 10425 && index <= 10424) ||
  3016. (index >= 10429 && index <= 10429) ||(index >= 10470 && index <= 10470) ||(index >= 10472 && index <= 10472) ||(index >= 10475 && index <= 10475) ||
  3017. (index >= 10479 && index <= 10519) ||(index >= 10530 && index <= 10530) ||(index >= 10535 && index <= 10535) ||(index >= 10539 && index <= 10539) ||
  3018. (index >= 10623 && index <= 10624) ||(index >= 10628 && index <= 10629) ||(index >= 10634 && index <= 10634) ||(index >= 10639 && index <= 10639) ||
  3019. (index >= 10644 && index <= 10669) ||(index >= 10673 && index <= 10677) ||(index >= 10680 && index <= 10681) ||(index >= 10684 && index <= 10685) ||
  3020. (index >= 10688 && index <= 10690) ||(index >= 10721 && index <= 10723) ||(index >= 10725 && index <= 10727) ||(index >= 10729 && index <= 10731) ||
  3021. (index >= 10733 && index <= 10770) ||(index >= 10772 && index <= 10772) ||(index >= 10775 && index <= 10775) ||(index >= 10779 && index <= 10779) ||
  3022. (index >= 10784 && index <= 10784) ||(index >= 10835 && index <= 10836) ||(index >= 10840 && index <= 10869) ||(index >= 10874 && index <= 10874) ||
  3023. (index >= 10890 && index <= 10890) ||(index >= 10920 && index <= 10929) ||(index >= 10931 && index <= 10934) ||(index >= 10936 && index <= 10939) ||
  3024. (index >= 10941 && index <= 10970) ||(index >= 10974 && index <= 10974) ||(index >= 10977 && index <= 11019) ||(index >= 11021 && index <= 11021) ||
  3025. (index >= 11023 && index <= 11027) ||(index >= 11029 && index <= 11033) ||(index >= 11037 && index <= 11038) ||(index >= 11070 && index <= 11071) ||
  3026. (index >= 11075 && index <= 11078) ||(index >= 11080 && index <= 11082) ||(index >= 11086 && index <= 11089) ||(index >= 11091 && index <= 11119) ||
  3027. (index >= 11128 && index <= 11128) ||(index >= 11131 && index <= 11131) ||(index >= 11134 && index <= 11134) ||(index >= 11137 && index <= 11171) ||
  3028. (index >= 11175 && index <= 11177) ||(index >= 11180 && index <= 11182) ||(index >= 11185 && index <= 11219) ||(index >= 11223 && index <= 11224) ||
  3029. (index >= 11227 && index <= 11229) ||(index >= 11232 && index <= 11291) ||(index >= 11296 && index <= 11299) ||(index >= 11305 && index <= 11308) ||
  3030. (index >= 11314 && index <= 11317) ||(index >= 11322 && index <= 11327) ||(index >= 11332 && index <= 11369))
  3031. moveSound = SoundList.WalkLawnL;
  3032. else if ((index >= 250 && index <= 254) ||(index >= 450 && index <= 454) ||(index >= 550 && index <= 554) ||(index >= 1000 && index <= 1024) ||
  3033. (index >= 1050 && index <= 1074) ||(index >= 1450 && index <= 1454) ||(index >= 1460 && index <= 1464) ||(index >= 1465 && index <= 1474) ||
  3034. (index >= 1605 && index <= 1609) ||(index >= 1615 && index <= 1624) ||(index >= 1650 && index <= 1654) ||(index >= 1660 && index <= 1664))
  3035. moveSound = SoundList.WalkRoughL;
  3036. else if ((index >= 2800 && index <= 2824) ||(index >= 3130 && index <= 3130) ||(index >= 3137 && index <= 3138) ||(index >= 3177 && index <= 3178) ||
  3037. (index >= 3189 && index <= 3190) ||(index >= 3230 && index <= 3231) ||(index >= 3240 && index <= 3242) ||(index >= 3246 && index <= 3246) ||
  3038. (index >= 3276 && index <= 3278) ||(index >= 3280 && index <= 3299) ||(index >= 5178 && index <= 5179) ||(index >= 5182 && index <= 5185) ||
  3039. (index >= 5188 && index <= 5191) ||(index >= 5194 && index <= 5195) ||(index >= 5780 && index <= 6060) ||(index >= 6080 && index <= 6084) ||
  3040. (index >= 6145 && index <= 6224) ||(index >= 14020 && index <= 14169) ||(index >= 14220 && index <= 14819))
  3041. moveSound = SoundList.WalkWoodL;
  3042. else if ((index >= 825 && index <= 849) ||(index >= 875 && index <= 899) ||(index >= 925 && index <= 949) ||(index >= 975 && index <= 999) ||
  3043. (index >= 1025 && index <= 1049) ||(index >= 1075 && index <= 1099) ||(index >= 1125 && index <= 1149) ||(index >= 1175 && index <= 1199) ||
  3044. (index >= 1225 && index <= 1249) ||(index >= 1275 && index <= 1299) ||(index >= 1325 && index <= 1339) ||(index >= 2025 && index <= 2049) ||
  3045. (index >= 2075 && index <= 2099) ||(index >= 2125 && index <= 2149) ||(index >= 2900 && index <= 2924) ||(index >= 3781 && index <= 4474) ||
  3046. (index >= 6085 && index <= 6144))
  3047. moveSound = SoundList.WalkWoodL;
  3048. else if ((index >= 40 && index <= 49) ||(index >= 75 && index <= 79) ||(index >= 85 && index <= 99) ||(index >= 1375 && index <= 1399) ||
  3049. (index >= 1425 && index <= 1449) ||(index >= 1475 && index <= 1499) ||(index >= 1525 && index <= 1549) ||(index >= 1575 && index <= 1559) ||
  3050. (index >= 1625 && index <= 1649) ||(index >= 1675 && index <= 1699) ||(index >= 1725 && index <= 1749) ||(index >= 1775 && index <= 1799) ||
  3051. (index >= 1825 && index <= 1849) ||(index >= 1875 && index <= 2024) ||(index >= 2175 && index <= 2199) ||(index >= 2225 && index <= 2249) ||
  3052. (index >= 2275 && index <= 2299) ||(index >= 2325 && index <= 2349) ||(index >= 2375 && index <= 2499) ||(index >= 2525 && index <= 2549) ||
  3053. (index >= 2575 && index <= 2599) ||(index >= 2625 && index <= 2649) ||(index >= 2675 && index <= 2699) ||(index >= 2725 && index <= 2749) ||
  3054. (index >= 2775 && index <= 2799) ||(index >= 2825 && index <= 2849) ||(index >= 2875 && index <= 2899) ||(index >= 2925 && index <= 2994) ||
  3055. (index >= 2995 && index <= 2999) ||(index >= 3025 && index <= 3129) ||(index >= 3131 && index <= 3136) ||(index >= 3139 && index <= 3176) ||
  3056. (index >= 3179 && index <= 3188) ||(index >= 3191 && index <= 3229) ||(index >= 3232 && index <= 3239) ||(index >= 3243 && index <= 3245) ||
  3057. (index >= 3247 && index <= 3249) ||(index >= 3275 && index <= 3275) ||(index >= 3279 && index <= 3279) ||(index >= 3350 && index <= 3374) ||
  3058. (index >= 3450 && index <= 3474) ||(index >= 3500 && index <= 3524) ||(index >= 3550 && index <= 3574) ||(index >= 3600 && index <= 3624) ||
  3059. (index >= 3650 && index <= 3674) ||(index >= 3750 && index <= 3774) ||(index >= 4825 && index <= 5177) ||(index >= 5180 && index <= 5181) ||
  3060. (index >= 5186 && index <= 5187) ||(index >= 5192 && index <= 5193) ||(index >= 5196 && index <= 5779) ||(index >= 7925 && index <= 10305) ||
  3061. (index >= 11370 && index <= 13769) ||(index >= 14870 && index <= 20469) ||(index >= 21620 && index <= 24999))
  3062. moveSound = SoundList.WalkCaveL;
  3063. else if ((index >= 605 && index <= 609) ||(index >= 650 && index <= 654) ||(index >= 660 && index <= 664) ||(index >= 2550 && index <= 2554) ||
  3064. (index >= 2560 && index <= 2564) ||(index >= 2565 && index <= 2574) ||(index >= 2600 && index <= 2604) ||(index >= 2610 && index <= 2624) ||
  3065. (index >= 2650 && index <= 2654) ||(index >= 2660 && index <= 2674) ||(index >= 2700 && index <= 2704) ||(index >= 2710 && index <= 2724) ||
  3066. (index >= 2850 && index <= 2874) ||(index >= 3405 && index <= 3424) ||(index >= 4625 && index <= 4679) ||(index >= 6075 && index <= 6079) ||
  3067. (index >= 10325 && index <= 10328) ||(index >= 10330 && index <= 10333) ||(index >= 10335 && index <= 10371) ||(index >= 10373 && index <= 10380) ||
  3068. (index >= 10382 && index <= 10419) ||(index >= 10423 && index <= 10424) ||(index >= 10426 && index <= 10428) ||(index >= 10430 && index <= 10469) ||
  3069. (index >= 10471 && index <= 10471) ||(index >= 10473 && index <= 10474) ||(index >= 10476 && index <= 10478) ||(index >= 10520 && index <= 10529) ||
  3070. (index >= 10531 && index <= 10534) ||(index >= 10536 && index <= 10538) ||(index >= 10540 && index <= 10622) ||(index >= 10625 && index <= 10627) ||
  3071. (index >= 10630 && index <= 10633) ||(index >= 10635 && index <= 10638) ||(index >= 10640 && index <= 10643) ||(index >= 10670 && index <= 10672) ||
  3072. (index >= 10771 && index <= 10771) ||(index >= 10773 && index <= 10774) ||(index >= 10776 && index <= 10778) ||(index >= 10780 && index <= 10783) ||
  3073. (index >= 10785 && index <= 10834) ||(index >= 10837 && index <= 10839) ||(index >= 10870 && index <= 10873) ||(index >= 10875 && index <= 10889) ||
  3074. (index >= 10891 && index <= 10919) ||(index >= 10930 && index <= 10930) ||(index >= 10935 && index <= 10935) ||(index >= 10940 && index <= 10940) ||
  3075. (index >= 10971 && index <= 10973) ||(index >= 10975 && index <= 10976) ||(index >= 11020 && index <= 11020) ||(index >= 11022 && index <= 11022) ||
  3076. (index >= 11028 && index <= 11028) ||(index >= 11072 && index <= 11074))
  3077. moveSound = SoundList.WalkStoneL;
  3078. else if ((index >= 1800 && index <= 1824) || (index >= 3000 && index <= 3024) ||(index >= 10678 && index <= 10679) ||
  3079. (index >= 10682 && index <= 10683) ||(index >= 10686 && index <= 10687) ||(index >= 10691 && index <= 10720) ||
  3080. (index >= 10724 && index <= 10724) ||(index >= 10728 && index <= 10728) ||(index >= 10732 && index <= 10732) ||
  3081. (index >= 11034 && index <= 11036) ||(index >= 11039 && index <= 11069) ||(index >= 11085 && index <= 11085) ||
  3082. (index >= 11090 && index <= 11090) ||(index >= 11172 && index <= 11174) ||(index >= 11178 && index <= 11179) ||
  3083. (index >= 11183 && index <= 11184) ||(index >= 11220 && index <= 11222) ||(index >= 11225 && index <= 11226) ||
  3084. (index >= 11230 && index <= 11231) ||(index >= 11292 && index <= 11295) ||(index >= 11300 && index <= 11304) ||
  3085. (index >= 11309 && index <= 11313) ||(index >= 11318 && index <= 11321) ||(index >= 11328 && index <= 11331))
  3086. moveSound = SoundList.WalkWaterL;
  3087. else
  3088. moveSound = SoundList.WalkWaterL;
  3089. }
  3090. break;
  3091. case 101:
  3092. {
  3093. //Tiles2
  3094. if ((index >= 0 && index <= 74) || (index >= 79 && index <= 83) || (index >= 94 && index <= 204) || (index >= 209 && index <= 213) ||
  3095. (index >= 209 && index <= 213) || (index >= 224 && index <= 249) || (index >= 255 && index <= 258) || (index >= 274 && index <= 329) ||
  3096. (index >= 350 && index <= 404) || (index >= 424 && index <= 449) || (index >= 455 && index <= 459) || (index >= 474 && index <= 504) ||
  3097. (index >= 509 && index <= 513) || (index >= 524 && index <= 549) || (index >= 555 && index <= 559) || (index >= 565 && index <= 573) ||
  3098. (index >= 594 && index <= 704) || (index >= 709 && index <= 713) || (index >= 724 && index <= 748) || (index >= 755 && index <= 759) ||
  3099. (index >= 774 && index <= 904) || (index >= 909 && index <= 923) || (index >= 974 && index <= 1004) || (index >= 1055 && index <= 1058) ||
  3100. (index >= 1064 && index <= 1204) || (index >= 1209 && index <= 1213) || (index >= 1300 && index <= 1373) || (index >= 1574 && index <= 1604) ||
  3101. (index >= 1609 && index <= 1649) || (index >= 1655 && index <= 1659) || (index >= 1674 && index <= 1704) || (index >= 1709 && index <= 1723) ||
  3102. (index >= 1755 && index <= 1758) || (index >= 1765 && index <= 1799) || (index >= 2050 && index <= 2523) || (index >= 2724 && index <= 2849) ||
  3103. (index >= 2950 && index <= 2999) || (index >= 3150 && index <= 3804) || (index >= 3809 && index <= 3849) || (index >= 3855 && index <= 3858) ||
  3104. (index >= 4475 && index <= 4794) || (index >= 5024 && index <= 5054) || (index >= 5059 && index <= 5299))
  3105. moveSound = SoundList.WalkGroundL;
  3106. else if ((index >= 205 && index <= 208) || (index >= 214 && index <= 223) || (index >= 264 && index <= 273) || (index >= 330 && index <= 349) ||
  3107. (index >= 405 && index <= 423) || (index >= 460 && index <= 474) || (index >= 505 && index <= 508) || (index >= 514 && index <= 523) ||
  3108. (index >= 560 && index <= 564) || (index >= 714 && index <= 723) || (index >= 764 && index <= 773) || (index >= 905 && index <= 908) ||
  3109. (index >= 955 && index <= 973) || (index >= 1009 && index <= 1023) || (index >= 1205 && index <= 1208) || (index >= 5055 && index <= 5058))
  3110. moveSound = SoundList.WalkLawnL;
  3111. else if ((index >= 250 && index <= 254) || (index >= 259 && index <= 263) || (index >= 450 && index <= 454) || (index >= 550 && index <= 554) ||
  3112. (index >= 574 && index <= 593) || (index >= 705 && index <= 708) || (index >= 749 && index <= 754) || (index >= 924 && index <= 954) ||
  3113. (index >= 1005 && index <= 1008) || (index >= 1024 && index <= 1054) || (index >= 1059 && index <= 1063) || (index >= 760 && index <= 763) ||
  3114. (index >= 1214 && index <= 1299) || (index >= 1374 && index <= 1573) || (index >= 1605 && index <= 1608) || (index >= 1650 && index <= 1654) ||
  3115. (index >= 1660 && index <= 1673) || (index >= 1705 && index <= 1708) || (index >= 1724 && index <= 1754) || (index >= 1759 && index <= 1764) ||
  3116. (index >= 2555 && index <= 2558) || (index >= 2605 && index <= 2608) || (index >= 2655 && index <= 2658) || (index >= 2705 && index <= 2708))
  3117. moveSound = SoundList.WalkRoughL;
  3118. else if ((index >= 75 && index <= 78) || (index >= 84 && index <= 93) || (index >= 2524 && index <= 2554) || (index >= 2560 && index <= 2604) ||
  3119. (index >= 2609 && index <= 2654) || (index >= 2659 && index <= 2704) || (index >= 2709 && index <= 2723) || (index >= 2850 && index <= 2949) ||
  3120. (index >= 3805 && index <= 3808) || (index >= 3850 && index <= 3854) || (index >= 3859 && index <= 3873) || (index >= 5300 && index <= 5323) ||
  3121. (index >= 6052 && index <= 6118))
  3122. moveSound = SoundList.WalkStoneL;
  3123. else if ((index >= 4795 && index <= 5023))
  3124. moveSound = SoundList.WalkCaveL;
  3125. else if ((index >= 1800 && index <= 2049) || (index >= 3000 && index <= 3149))
  3126. moveSound = SoundList.WalkWaterL;
  3127. else if ((index >= 5324 && index <= 6051) || (index >= 6119 && index <= 6296))
  3128. moveSound = SoundList.WalkRoomL;
  3129. else moveSound = SoundList.WalkWaterL;
  3130. }
  3131. break;
  3132. case 102:
  3133. {
  3134. //Tiles3
  3135. if ((index >= 0 && index <= 299) || (index >= 400 && index <= 449) || (index >= 455 && index <= 522) || (index >= 528 && index <= 531) ||
  3136. (index >= 1553 && index <= 1554) || (index >= 1560 && index <= 1561) || (index >= 1565 && index <= 1566) || (index >= 1569 && index <= 1699) ||
  3137. (index >= 1805 && index <= 1809) || (index >= 1850 && index <= 1854) || (index >= 1860 && index <= 1864) || (index >= 1950 && index <= 1954) ||
  3138. (index >= 2000 && index <= 2204) || (index >= 2300 && index <= 2653))
  3139. moveSound = SoundList.WalkGroundL;
  3140. else if ((index >= 300 && index <= 399) || (index >= 450 && index <= 454) || (index >= 524 && index <= 527) || (index >= 1705 && index <= 1709) ||
  3141. (index >= 1715 && index <= 1799) || (index >= 2205 && index <= 2299))
  3142. moveSound = SoundList.WalkLawnL;
  3143. else if ((index >= 1700 && index <= 1704) || (index >= 1710 && index <= 1714))
  3144. moveSound = SoundList.WalkRoughL;
  3145. else if ((index >= 1800 && index <= 1804) || (index >= 1810 && index <= 1849) || (index >= 1855 && index <= 1859) || (index >= 1865 && index <= 1949) ||
  3146. (index >= 1955 && index <= 1999))
  3147. moveSound = SoundList.WalkStoneL;
  3148. else if ((index >= 1411 && index <= 1550) || (index >= 1555 && index <= 1557))
  3149. moveSound = SoundList.WalkWoodL;
  3150. else if ((index >= 532 && index <= 1410) || (index >= 1551 && index <= 1552) || (index >= 1558 && index <= 1559) || (index >= 1562 && index <= 1564) ||
  3151. (index >= 1567 && index <= 1568))
  3152. moveSound = SoundList.WalkWaterL;
  3153. else moveSound = SoundList.WalkWaterL;
  3154. }
  3155. break;
  3156. case 103:
  3157. {
  3158. //Tiles4
  3159. if ((index >= 0000 && index <= 199) || (index >= 0205 && index <= 209) || (index >= 0250 && index <= 254) || (index >= 260 && index <= 1481) ||
  3160. (index >= 1495 && index <= 1549) || (index >= 1555 && index <= 1559) || (index >= 2500 && index <= 3349) || (index >= 3355 && index <= 3359) ||
  3161. (index >= 3365 && index <= 3399) || (index >= 3500 && index <= 3899) || (index >= 4193 && index <= 4254) || (index >= 4650 && index <= 4849) ||
  3162. (index >= 5000 && index <= 5149) || (index >= 5155 && index <= 5399) || (index >= 5405 && index <= 5409) || (index >= 5415 && index <= 5449) ||
  3163. (index >= 5550 && index <= 5554) || (index >= 5560 && index <= 5564) || (index >= 5605 && index <= 5609) || (index >= 5615 && index <= 5625) ||
  3164. (index >= 5680 && index <= 5749) || (index >= 7400 && index <= 7649) || (index >= 7655 && index <= 7749) || (index >= 7900 && index <= 8099) ||
  3165. (index >= 8166 && index <= 8299) || (index >= 8305 && index <= 8309) || (index >= 8350 && index <= 8354) || (index >= 8360 && index <= 8364) ||
  3166. (index >= 8400 && index <= 8499) || (index >= 8605 && index <= 8609) || (index >= 8615 && index <= 8619) || (index >= 8623 && index <= 8654) ||
  3167. (index >= 8660 && index <= 8754) || (index >= 8805 && index <= 8809) || (index >= 9050 && index <= 9299) || (index >= 9450 && index <= 9549))
  3168. moveSound = SoundList.WalkGroundL;
  3169. else if ((index >= 200 && index <= 204) || (index >= 210 && index <= 249) || (index >= 255 && index <= 259) || (index >= 1482 && index <= 1494) ||
  3170. (index >= 1560 && index <= 2499) || (index >= 4255 && index <= 4299) || (index >= 4305 && index <= 4349) || (index >= 5555 && index <= 5559) ||
  3171. (index >= 5565 && index <= 5604) || (index >= 5610 && index <= 5614) || (index >= 7650 && index <= 7654) || (index >= 7750 && index <= 7899) ||
  3172. (index >= 8100 && index <= 8165) || (index >= 8300 && index <= 8304) || (index >= 8310 && index <= 8349) || (index >= 8355 && index <= 8359) ||
  3173. (index >= 8365 && index <= 8399) || (index >= 8505 && index <= 8599) || (index >= 8610 && index <= 8614) || (index >= 8620 && index <= 8622) ||
  3174. (index >= 8655 && index <= 8659) || (index >= 8755 && index <= 8799) || (index >= 8810 && index <= 8849) || (index >= 8950 && index <= 8999) ||
  3175. (index >= 9005 && index <= 9049) || (index >= 9550 && index <= 9554))
  3176. moveSound = SoundList.WalkLawnL;
  3177. else if ((index >= 4300 && index <= 4304) || (index >= 8600 && index <= 8604) || (index >= 1550 && index <= 1554) || (index >= 4131 && index <= 4193) ||
  3178. (index >= 4350 && index <= 4549) || (index >= 5150 && index <= 5154) || (index >= 8500 && index <= 8504) || (index >= 8800 && index <= 8804) ||
  3179. (index >= 8850 && index <= 8949) || (index >= 9000 && index <= 9004))
  3180. moveSound = SoundList.WalkRoughL;
  3181. else if ((index >= 3350 && index <= 3354) || (index >= 3360 && index <= 3364) || (index >= 3400 && index <= 3499) || (index >= 5400 && index <= 5404) ||
  3182. (index >= 5410 && index <= 5414) || (index >= 5450 && index <= 5549) || (index >= 5626 && index <= 5679) || (index >= 9300 && index <= 9449) ||
  3183. (index >= 9555 && index <= 9749))
  3184. moveSound = SoundList.WalkStoneL;
  3185. else if ((index >= 3900 && index <= 4130) || (index >= 4550 && index <= 4649) || (index >= 4850 && index <= 4999) || (index >= 5750 && index <= 7399) ||
  3186. (index >= 9750 && index <= 11349))
  3187. moveSound = SoundList.WalkCaveL;
  3188. else if ((index >= 11350 && index <= 13534))
  3189. moveSound = SoundList.WalkWoodL;
  3190. else moveSound = SoundList.WalkWaterL;
  3191. }
  3192. break;
  3193. case 104:
  3194. {
  3195. //Tiles5
  3196. if ((index >= 10 && index <= 0014) || (index >= 100 && index <= 0104) || (index >= 110 && index <= 0114) || (index >= 156 && index <= 0159) ||
  3197. (index >= 165 && index <= 0204) || (index >= 210 && index <= 0214) || (index >= 255 && index <= 0259) || (index >= 300 && index <= 0304) ||
  3198. (index >= 310 && index <= 0314) || (index >= 400 && index <= 0404) || (index >= 410 && index <= 0414) || (index >= 500 && index <= 0504) ||
  3199. (index >= 510 && index <= 0514) || (index >= 555 && index <= 0559) || (index >= 800 && index <= 0849) || (index >= 855 && index <= 0859) ||
  3200. (index >= 900 && index <= 0904) || (index >= 910 && index <= 0914) || (index >= 955 && index <= 0959) || (index >= 1000 && index <= 1004) ||
  3201. (index >= 1010 && index <= 1014) || (index >= 1055 && index <= 1059) || (index >= 1400 && index <= 1404) || (index >= 1410 && index <= 1449) ||
  3202. (index >= 1455 && index <= 1459) || (index >= 1465 && index <= 1499) || (index >= 1700 && index <= 1749) || (index >= 1755 && index <= 1759) ||
  3203. (index >= 1765 && index <= 1804) || (index >= 1810 && index <= 1849) || (index >= 1855 && index <= 1859) || (index >= 1900 && index <= 1904) ||
  3204. (index >= 1910 && index <= 1949) || (index >= 1955 && index <= 1959) || (index >= 2000 && index <= 2099) || (index >= 2150 && index <= 2154) ||
  3205. (index >= 2160 && index <= 2164) || (index >= 2250 && index <= 2254) || (index >= 2260 && index <= 2263) || (index >= 2300 && index <= 2399) ||
  3206. (index >= 2500 && index <= 2549) || (index >= 2555 && index <= 2559) || (index >= 2565 && index <= 2699) || (index >= 2750 && index <= 2754) ||
  3207. (index >= 2760 && index <= 2764) || (index >= 2800 && index <= 2804) || (index >= 2810 && index <= 2814) || (index >= 2855 && index <= 2859) ||
  3208. (index >= 2865 && index <= 2904) || (index >= 2910 && index <= 2914) || (index >= 2955 && index <= 2959) || (index >= 2965 && index <= 3004) ||
  3209. (index >= 3010 && index <= 3014) || (index >= 3100 && index <= 3104) || (index >= 3111 && index <= 3114) || (index >= 3200 && index <= 3204) ||
  3210. (index >= 3300 && index <= 3304) || (index >= 3800 && index <= 3804) || (index >= 3900 && index <= 3904) || (index >= 3910 && index <= 3914) ||
  3211. (index >= 4000 && index <= 4004) || (index >= 4010 && index <= 4014) || (index >= 4100 && index <= 4104) || (index >= 4110 && index <= 4114) ||
  3212. (index >= 4200 && index <= 4204) || (index >= 4210 && index <= 4214) || (index >= 4300 && index <= 4304) || (index >= 4310 && index <= 4311) ||
  3213. (index >= 4500 && index <= 4504) || (index >= 4510 && index <= 4514) || (index >= 4600 && index <= 4604) || (index >= 4610 && index <= 4614) ||
  3214. (index >= 4620 && index <= 4621) || (index >= 4655 && index <= 4659) || (index >= 4700 && index <= 4904) || (index >= 4910 && index <= 4949) ||
  3215. (index >= 4955 && index <= 4959) || (index >= 5000 && index <= 5004) || (index >= 5010 && index <= 5014) || (index >= 5100 && index <= 5104) ||
  3216. (index >= 5110 && index <= 5114) || (index >= 5155 && index <= 5159) || (index >= 5165 && index <= 5204) || (index >= 5210 && index <= 5254) ||
  3217. (index >= 5260 && index <= 5264) || (index >= 5305 && index <= 5309) || (index >= 5355 && index <= 5359) || (index >= 5400 && index <= 5599) ||
  3218. (index >= 5650 && index <= 5654) || (index >= 5700 && index <= 5799) || (index >= 5900 && index <= 6049) || (index >= 6100 && index <= 6399) ||
  3219. (index >= 6850 && index <= 6949) || (index >= 7050 && index <= 7349) || (index >= 7750 && index <= 7754) || (index >= 7760 && index <= 7764) ||
  3220. (index >= 7805 && index <= 7809) || (index >= 7815 && index <= 7849) || (index >= 7950 && index <= 7999) || (index >= 8150 && index <= 8399))
  3221. moveSound = SoundList.WalkGroundL;
  3222. else if ((index >= 710 && index <= 0714) || (index >= 860 && index <= 0899) || (index >= 905 && index <= 0909) || (index >= 915 && index <= 0949) ||
  3223. (index >= 960 && index <= 0999) || (index >= 1005 && index <= 1009) || (index >= 1015 && index <= 1049) || (index >= 1060 && index <= 1099) ||
  3224. (index >= 1105 && index <= 1109) || (index >= 1160 && index <= 1199) || (index >= 1260 && index <= 1264) || (index >= 1305 && index <= 1309) ||
  3225. (index >= 1360 && index <= 1364) || (index >= 1405 && index <= 1409) || (index >= 1460 && index <= 1464) || (index >= 1500 && index <= 1549) ||
  3226. (index >= 1555 && index <= 1599) || (index >= 1608 && index <= 1609) || (index >= 1660 && index <= 1664) || (index >= 1760 && index <= 1764) ||
  3227. (index >= 1805 && index <= 1809) || (index >= 1860 && index <= 1899) || (index >= 1905 && index <= 1909) || (index >= 1960 && index <= 1999) ||
  3228. (index >= 2400 && index <= 2499) || (index >= 2550 && index <= 2554) || (index >= 2560 && index <= 2564) || (index >= 3400 && index <= 3404) ||
  3229. (index >= 3410 && index <= 3414) || (index >= 3455 && index <= 3459) || (index >= 3465 && index <= 3504) || (index >= 3510 && index <= 3514) ||
  3230. (index >= 3555 && index <= 3559) || (index >= 3565 && index <= 3604) || (index >= 3610 && index <= 3614) || (index >= 3700 && index <= 3704) ||
  3231. (index >= 3710 && index <= 3714) || (index >= 4400 && index <= 4404) || (index >= 4410 && index <= 4414) || (index >= 4904 && index <= 4909) ||
  3232. (index >= 4950 && index <= 4954) || (index >= 4960 && index <= 4999) || (index >= 5005 && index <= 5009) || (index >= 5015 && index <= 5099) ||
  3233. (index >= 5105 && index <= 5109) || (index >= 5115 && index <= 5154) || (index >= 5160 && index <= 5164) || (index >= 5205 && index <= 5209) ||
  3234. (index >= 5225 && index <= 5259) || (index >= 5265 && index <= 5304) || (index >= 5310 && index <= 5354) || (index >= 5360 && index <= 5399) ||
  3235. (index >= 5600 && index <= 5649) || (index >= 5655 && index <= 5699) || (index >= 6050 && index <= 6099) || (index >= 6950 && index <= 7049) ||
  3236. (index >= 7350 && index <= 7449) || (index >= 7855 && index <= 7859) || (index >= 7865 && index <= 7899))
  3237. moveSound = SoundList.WalkLawnL;
  3238. else if ((index >= 600 && index <= 0604) || (index >= 610 && index <= 0614) || (index >= 655 && index <= 0659) || (index >= 700 && index <= 0704) ||
  3239. (index >= 850 && index <= 0854) || (index >= 950 && index <= 0954) || (index >= 1050 && index <= 1054) || (index >= 1150 && index <= 1154) ||
  3240. (index >= 1250 && index <= 1254) || (index >= 1350 && index <= 1354) || (index >= 1450 && index <= 1454) || (index >= 1550 && index <= 1554) ||
  3241. (index >= 1650 && index <= 1654) || (index >= 1750 && index <= 1754) || (index >= 1850 && index <= 1854) || (index >= 1950 && index <= 1954) ||
  3242. (index >= 5800 && index <= 5899) || (index >= 7450 && index <= 7454) || (index >= 7460 && index <= 7464) || (index >= 7505 && index <= 7509) ||
  3243. (index >= 7515 && index <= 7554) || (index >= 7560 && index <= 7564) || (index >= 7605 && index <= 7609) || (index >= 7615 && index <= 7649) ||
  3244. (index >= 7655 && index <= 7659) || (index >= 7665 && index <= 7704) || (index >= 7755 && index <= 7759) || (index >= 7765 && index <= 7804) ||
  3245. (index >= 7810 && index <= 7814) || (index >= 7850 && index <= 7854) || (index >= 7860 && index <= 7864))
  3246. moveSound = SoundList.WalkRoughL;
  3247. else if ((index >= 5 && index <= 0009) || (index >= 15 && index <= 0099) || (index >= 105 && index <= 0109) || (index >= 115 && index <= 0155) ||
  3248. (index >= 160 && index <= 0164) || (index >= 205 && index <= 0209) || (index >= 215 && index <= 0254) || (index >= 260 && index <= 0299) ||
  3249. (index >= 305 && index <= 0309) || (index >= 315 && index <= 0399) || (index >= 405 && index <= 0409) || (index >= 415 && index <= 0499) ||
  3250. (index >= 505 && index <= 0509) || (index >= 515 && index <= 0554) || (index >= 560 && index <= 0599) || (index >= 605 && index <= 0609) ||
  3251. (index >= 615 && index <= 0654) || (index >= 660 && index <= 0699) || (index >= 705 && index <= 0709) || (index >= 715 && index <= 0799) ||
  3252. (index >= 1100 && index <= 1104) || (index >= 1110 && index <= 1149) || (index >= 1155 && index <= 1159) || (index >= 1200 && index <= 1249) ||
  3253. (index >= 1255 && index <= 1259) || (index >= 1265 && index <= 1304) || (index >= 1310 && index <= 1349) || (index >= 1355 && index <= 1359) ||
  3254. (index >= 1365 && index <= 1399) || (index >= 1600 && index <= 1604) || (index >= 1606 && index <= 1607) || (index >= 1610 && index <= 1649) ||
  3255. (index >= 1655 && index <= 1659) || (index >= 1665 && index <= 1699) || (index >= 2100 && index <= 2149) || (index >= 2155 && index <= 2159) ||
  3256. (index >= 2165 && index <= 2249) || (index >= 2255 && index <= 2259) || (index >= 2264 && index <= 2299) || (index >= 2700 && index <= 2749) ||
  3257. (index >= 2755 && index <= 2759) || (index >= 2765 && index <= 2799) || (index >= 2805 && index <= 2809) || (index >= 2815 && index <= 2854) ||
  3258. (index >= 2860 && index <= 2864) || (index >= 2905 && index <= 2909) || (index >= 2915 && index <= 2954) || (index >= 2960 && index <= 2964) ||
  3259. (index >= 3005 && index <= 3009) || (index >= 3015 && index <= 3099) || (index >= 3105 && index <= 3110) || (index >= 3115 && index <= 3199) ||
  3260. (index >= 3205 && index <= 3299) || (index >= 3305 && index <= 3399) || (index >= 3405 && index <= 3409) || (index >= 3415 && index <= 3454) ||
  3261. (index >= 3460 && index <= 3464) || (index >= 3505 && index <= 3509) || (index >= 3515 && index <= 3554) || (index >= 3560 && index <= 3564) ||
  3262. (index >= 3605 && index <= 3609) || (index >= 3615 && index <= 3699) || (index >= 3705 && index <= 3709) || (index >= 3715 && index <= 3799) ||
  3263. (index >= 3805 && index <= 3899) || (index >= 3905 && index <= 3909) || (index >= 3915 && index <= 3999) || (index >= 4005 && index <= 4009) ||
  3264. (index >= 4015 && index <= 4099) || (index >= 4105 && index <= 4109) || (index >= 4115 && index <= 4199) || (index >= 4205 && index <= 4209) ||
  3265. (index >= 4305 && index <= 4309) || (index >= 4312 && index <= 4399) || (index >= 4405 && index <= 4409) || (index >= 4415 && index <= 4499) ||
  3266. (index >= 4505 && index <= 4509) || (index >= 4515 && index <= 4599) || (index >= 4605 && index <= 4609) || (index >= 4615 && index <= 4619) ||
  3267. (index >= 4622 && index <= 4654) || (index >= 4660 && index <= 4699) || (index >= 6400 && index <= 6849) || (index >= 7455 && index <= 7459) ||
  3268. (index >= 7465 && index <= 7504) || (index >= 7510 && index <= 7514) || (index >= 7555 && index <= 7559) || (index >= 7565 && index <= 7604) ||
  3269. (index >= 7610 && index <= 7614) || (index >= 7650 && index <= 7654) || (index >= 7660 && index <= 7664) ||
  3270. (index >= 7705 && index <= 7709) || (index >= 7715 && index <= 7749))
  3271. moveSound = SoundList.WalkStoneL;
  3272. else if ((index >= 8000 && index <= 8149) || (index >= 8400 && index <= 8481))
  3273. moveSound = SoundList.WalkCaveL;
  3274. else if ((index >= 7900 && index <= 7949))
  3275. moveSound = SoundList.WalkWaterL;
  3276. else moveSound = SoundList.WalkWaterL;
  3277. }
  3278. break;
  3279. case 105:
  3280. {
  3281. //Tiles6
  3282. if (index >= 0 && index <= 1539)
  3283. moveSound = SoundList.WalkLawnL;
  3284. else if (index >= 1540 && index <= 2368)
  3285. moveSound = SoundList.WalkRoomL;
  3286. else
  3287. moveSound = SoundList.WalkWaterL;
  3288. }
  3289. break;
  3290. case 106:
  3291. {
  3292. //Tiles7
  3293. if ((index >= 0 && index <= 19) || (index >= 24 && index <= 053) || (index >= 56 && index <= 69) || (index >= 72 && index <= 74) ||
  3294. (index >= 77 && index <= 93) || (index >= 99 && index <= 115) || (index >= 121 && index <= 124) || (index >= 127 && index <= 132) ||
  3295. (index >= 135 && index <= 141) || (index >= 185 && index <= 190) || (index >= 191 && index <= 200) || (index >= 927 && index <= 940) ||
  3296. (index >= 961 && index <= 1160))
  3297. moveSound = SoundList.WalkGroundL;
  3298. else if ((index >= 201 && index <= 926) || (index >= 941 && index <= 960) || (index >= 1161 && index <= 3310))
  3299. moveSound = SoundList.WalkLawnL;
  3300. else if ((index >= 96 && index <= 98))
  3301. moveSound = SoundList.WalkWoodL;
  3302. else if ((index >= 94 && index <= 95) || (index >= 151 && index <= 184))
  3303. moveSound = SoundList.WalkStoneL;
  3304. else if ((index >= 20 && index <= 23) || (index >= 54 && index <= 55) || (index >= 70 && index <= 71) || (index >= 75 && index <= 76) ||
  3305. (index >= 116 && index <= 120))
  3306. moveSound = SoundList.WalkCaveL;
  3307. else if ((index >= 125 && index <= 126) || (index >= 133 && index <= 134) || (index >= 142 && index <= 151))
  3308. moveSound = SoundList.WalkWaterL;
  3309. else moveSound = SoundList.WalkWaterL;
  3310. }
  3311. break;
  3312. case 107:
  3313. {
  3314. //Tiles8
  3315. if (index >= 0 && index <= 1215)
  3316. moveSound = SoundList.WalkCaveL;
  3317. else moveSound = SoundList.WalkWaterL;
  3318. }
  3319. break;
  3320. default:
  3321. moveSound = SoundList.WalkWaterL;
  3322. break;
  3323. }
  3324. #endregion
  3325. index = (GameScene.Scene.MapControl.M2CellInfo[x, y].MiddleImage & 0x1FFFF) - 1;
  3326. #region Middle Tiles
  3327. switch (GameScene.Scene.MapControl.M2CellInfo[x, y].MiddleIndex)
  3328. {
  3329. case 114:
  3330. {
  3331. //SMTiles5 iJam Ver
  3332. if ((index >= 3165 && index <= 21311) || (index >= 23775 && index <= 24650))
  3333. moveSound = SoundList.WalkGroundL;
  3334. else if ((index >= 2773 && index <= 3164) || (index >= 21416 && index <= 21462) || (index >= 21510 && index <= 21511) || (index >= 21528 && index <= 21531) ||
  3335. (index >= 21548 && index <= 21533) || (index >= 21569 && index <= 21575) || (index >= 21591 && index <= 21594) || (index >= 21609 && index <= 21613) ||
  3336. (index >= 21627 && index <= 21632) || (index >= 21646 && index <= 21650) || (index >= 21634 && index <= 21667) || (index >= 22977 && index <= 23316) ||
  3337. (index >= 30473 && index <= 31255))
  3338. moveSound = SoundList.WalkLawnL;
  3339. else if ((index >= 24651 && index <= 30472))
  3340. moveSound = SoundList.WalkRoomL;
  3341. else if ((index >= 0 && index <= 2772) || (index >= 21312 && index <= 21415) || (index >= 21463 && index <= 21509) || (index >= 21512 && index <= 21527) ||
  3342. (index >= 21532 && index <= 21547) || (index >= 21534 && index <= 21568) || (index >= 21576 && index <= 21590) || (index >= 21595 && index <= 21608) ||
  3343. (index >= 21614 && index <= 21626) || (index >= 21633 && index <= 21645) || (index >= 21651 && index <= 21633) || (index >= 21668 && index <= 22976) ||
  3344. (index >= 23317 && index <= 23774) || (index >= 31256 && index <= 31302))
  3345. moveSound = SoundList.WalkStoneL;
  3346. }
  3347. break;
  3348. case 116:
  3349. {
  3350. //SMTiles7 iJam Ver
  3351. if ((index >= 10 && index <= 13) || (index >= 23 && index <= 25) || (index >= 35 && index <= 37) || (index >= 47 && index <= 49) ||
  3352. (index >= 59 && index <= 61) || (index >= 71 && index <= 73) || (index >= 83 && index <= 85) || (index >= 95 && index <= 97) ||
  3353. (index >= 107 && index <= 109) || (index >= 119 && index <= 121) || (index >= 131 && index <= 133) || (index >= 143 && index <= 145) ||
  3354. (index >= 155 && index <= 157) || (index >= 167 && index <= 169) || (index >= 179 && index <= 181) || (index >= 191 && index <= 193) ||
  3355. (index >= 203 && index <= 205) || (index >= 215 && index <= 217) || (index >= 227 && index <= 229) || (index >= 239 && index <= 241) ||
  3356. (index >= 251 && index <= 253) || (index >= 263 && index <= 264) || (index >= 269 && index <= 271) || (index >= 281 && index <= 283) ||
  3357. (index >= 297 && index <= 299) || (index >= 311 && index <= 313) || (index >= 323 && index <= 325) || (index >= 333 && index <= 335) ||
  3358. (index >= 341 && index <= 343) || (index >= 347 && index <= 349) || (index >= 351 && index <= 353) || (index >= 488 && index <= 489) ||
  3359. (index >= 494 && index <= 495) || (index >= 502 && index <= 503) || (index >= 512 && index <= 514) || (index >= 524 && index <= 526) ||
  3360. (index >= 538 && index <= 540) || (index >= 554 && index <= 556) || (index >= 572 && index <= 573) || (index >= 648 && index <= 649) ||
  3361. (index >= 665 && index <= 667) || (index >= 677 && index <= 679) || (index >= 689 && index <= 690) || (index >= 701 && index <= 702) ||
  3362. (index >= 713 && index <= 714) || (index >= 1260 && index <= 1567) || (index >= 2772 && index <= 5869) || (index >= 8887 && index <= 10230))
  3363. moveSound = SoundList.WalkGroundL;
  3364. else if ((index >= 2013 && index <= 2438) || (index >= 2639 && index <= 2771))
  3365. moveSound = SoundList.WalkRoughL;
  3366. else if ((index >= 7810 && index <= 7814) || (index >= 7827 && index <= 7832) || (index >= 7847 && index <= 7853) || (index >= 7866 && index <= 7867) ||
  3367. (index >= 7872 && index <= 7874) || (index >= 7884 && index <= 7887) || (index >= 7892 && index <= 7910) || (index >= 7916 && index <= 7923) ||
  3368. (index >= 7929 && index <= 7990))
  3369. moveSound = SoundList.WalkWoodL;
  3370. else if ((index >= 5870 && index <= 7753) || (index >= 7868 && index <= 7871) || (index >= 7888 && index <= 7891) || (index >= 7991 && index <= 8886) ||
  3371. (index >= 10231 && index <= 10430))
  3372. moveSound = SoundList.WalkRoomL;
  3373. else if ((index >= 0 && index <= 9) || (index >= 14 && index <= 22) || (index >= 26 && index <= 34) || (index >= 38 && index <= 46) ||
  3374. (index >= 50 && index <= 58) || (index >= 62 && index <= 70) || (index >= 74 && index <= 82) || (index >= 86 && index <= 94) ||
  3375. (index >= 98 && index <= 106) || (index >= 110 && index <= 118) || (index >= 122 && index <= 130) || (index >= 134 && index <= 142) ||
  3376. (index >= 146 && index <= 154) || (index >= 158 && index <= 166) || (index >= 170 && index <= 178) || (index >= 182 && index <= 190) ||
  3377. (index >= 194 && index <= 202) || (index >= 206 && index <= 214) || (index >= 218 && index <= 226) || (index >= 230 && index <= 238) ||
  3378. (index >= 242 && index <= 250) || (index >= 254 && index <= 262) || (index >= 265 && index <= 268) || (index >= 272 && index <= 280) ||
  3379. (index >= 284 && index <= 296) || (index >= 300 && index <= 310) || (index >= 314 && index <= 322) || (index >= 326 && index <= 332) ||
  3380. (index >= 336 && index <= 340) || (index >= 344 && index <= 346) || (index >= 350 && index <= 350) || (index >= 354 && index <= 487) ||
  3381. (index >= 490 && index <= 493) || (index >= 496 && index <= 501) || (index >= 504 && index <= 511) || (index >= 515 && index <= 523) ||
  3382. (index >= 527 && index <= 537) || (index >= 541 && index <= 553) || (index >= 557 && index <= 571) || (index >= 574 && index <= 647) ||
  3383. (index >= 650 && index <= 664) || (index >= 668 && index <= 676) || (index >= 680 && index <= 688) || (index >= 691 && index <= 700) ||
  3384. (index >= 703 && index <= 712) || (index >= 715 && index <= 1259) || (index >= 1568 && index <= 2012) || (index >= 7754 && index <= 7809) ||
  3385. (index >= 7815 && index <= 7826) || (index >= 7833 && index <= 7846) || (index >= 7854 && index <= 7865) || (index >= 7875 && index <= 7883) ||
  3386. (index >= 7911 && index <= 7915) || (index >= 7924 && index <= 7928))
  3387. moveSound = SoundList.WalkStoneL;
  3388. else if ((index >= 2439 && index <= 2638))
  3389. moveSound = SoundList.WalkCaveL;
  3390. }
  3391. break;
  3392. }
  3393. #endregion
  3394. index = (GameScene.Scene.MapControl.M2CellInfo[x, y].MiddleIndex - 110) * 100000 + index;
  3395. #region Middle Tiles old code method
  3396. if (index >= 0 && index <= 99999)
  3397. {
  3398. //SMTiles
  3399. if (index >= 0 && index <= 7)
  3400. moveSound = SoundList.WalkGroundL;
  3401. else if (index >= 8 && index <= 1175)
  3402. moveSound = SoundList.WalkLawnL;
  3403. }
  3404. else if (index >= 100000 && index <= 199999)
  3405. {
  3406. //SMTiles2
  3407. if (index >= 100000 && index <= 106205)
  3408. moveSound = SoundList.WalkGroundL;
  3409. else if (index >= 106206 && index <= 109914)
  3410. moveSound = SoundList.WalkStoneL;
  3411. }
  3412. else if (index >= 200000 && index <= 299999)
  3413. {
  3414. //SMTiles3
  3415. if ((index >= 9119 && index <= 9235) || (index >= 9296 && index <= 209355) || (index >= 9416 && index <= 209475) || (index >= 9536 && index <= 209835) ||
  3416. (index >= 210556 && index <= 210688) || (index >= 210916 && index <= 211035) || (index >= 219200 && index <= 220540) || (index >= 220788 && index <= 221194) ||
  3417. (index >= 229475 && index <= 230959) || (index >= 231378 && index <= 231436))
  3418. moveSound = SoundList.WalkGroundL;
  3419. else if ((index >= 209236 && index <= 209295) || (index >= 209356 && index <= 209415) || (index >= 209476 && index <= 209535) || (index >= 209836 && index <= 210435) ||
  3420. (index >= 210689 && index <= 210915) || (index >= 223242 && index <= 225299) || (index >= 226252 && index <= 227305) || (index >= 228128 && index <= 228132) ||
  3421. (index >= 228187 && index <= 228192) || (index >= 228245 && index <= 228249) || (index >= 228275 && index <= 228280) || (index >= 228358 && index <= 228454) ||
  3422. (index >= 228974 && index <= 229474) || (index >= 230960 && index <= 231377))
  3423. moveSound = SoundList.WalkLawnL;
  3424. else if ((index >= 300000 && index <= 209118) || (index >= 220541 && index <= 220787) || (index >= 221195 && index <= 223241) || (index >= 225300 && index <= 226251) ||
  3425. (index >= 227306 && index <= 228127) || (index >= 228133 && index <= 228186) || (index >= 228193 && index <= 228244) || (index >= 228250 && index <= 228274) ||
  3426. (index >= 228281 && index <= 228357) || (index >= 228455 && index <= 228973) || (index >= 231437 && index <= 231703))
  3427. moveSound = SoundList.WalkStoneL;
  3428. else if ((index >= 211036 && index <= 219199))
  3429. moveSound = SoundList.WalkRoomL;
  3430. else if ((index >= 210436 && index <= 210555))
  3431. moveSound = SoundList.WalkRoughL;
  3432. }
  3433. else if (index >= 300000 && index <= 399999)
  3434. {
  3435. //SMTiles4
  3436. if ((index >= 300000 && index <= 300682) || (index >= 300695 && index <= 300699) || (index >= 300714 && index <= 300718) || (index >= 300733 && index <= 300745) ||
  3437. (index >= 300752 && index <= 300829) || (index >= 300833 && index <= 300849) || (index >= 300852 && index <= 300904) || (index >= 300907 && index <= 300920) ||
  3438. (index >= 300923 && index <= 300935) || (index >= 300939 && index <= 301088) || (index >= 301105 && index <= 301106) || (index >= 301112 && index <= 301113) ||
  3439. (index >= 301137 && index <= 301138) || (index >= 301422 && index <= 301423) || (index >= 301441 && index <= 301446) || (index >= 301460 && index <= 301467) ||
  3440. (index >= 301764 && index <= 301767) || (index >= 301772 && index <= 301786) || (index >= 301790 && index <= 302129) || (index >= 302132 && index <= 302291) ||
  3441. (index >= 302492 && index <= 302827) || (index >= 304419 && index <= 304646) || (index >= 306951 && index <= 306955) || (index >= 307027 && index <= 307104) ||
  3442. (index >= 307010 && index <= 307118) || (index >= 307124 && index <= 307133) || (index >= 307138 && index <= 307149) || (index >= 307162 && index <= 307167) ||
  3443. (index >= 307243 && index <= 308983) || (index >= 310892 && index <= 328054) || (index >= 304935 && index <= 305614) || (index >= 305619 && index <= 305627) ||
  3444. (index >= 305633 && index <= 305640) || (index >= 305647 && index <= 305651) || (index >= 305661 && index <= 305563) || (index >= 305675 && index <= 305676) ||
  3445. (index >= 305989 && index <= 306437) || (index >= 306457 && index <= 306474) || (index >= 306484 && index <= 306505) || (index >= 306512 && index <= 306533) ||
  3446. (index >= 306540 && index <= 306625) || (index >= 306636 && index <= 306761) || (index >= 306788 && index <= 306929) || (index >= 306936 && index <= 306942))
  3447. moveSound = SoundList.WalkGroundL;
  3448. else if ((index >= 301468 && index <= 301515) || (index >= 302130 && index <= 302131) || (index >= 302292 && index <= 302491) || (index >= 302828 && index <= 303063))
  3449. moveSound = SoundList.WalkRoughL;
  3450. else if ((index >= 301516 && index <= 301555) || (index >= 304647 && index <= 304934) || (index >= 305615 && index <= 305618) || (index >= 305628 && index <= 303632) ||
  3451. (index >= 305641 && index <= 305646) || (index >= 305652 && index <= 305660) || (index >= 305664 && index <= 305674) || (index >= 305677 && index <= 305988) ||
  3452. (index >= 306438 && index <= 306456) || (index >= 306475 && index <= 306483) || (index >= 306506 && index <= 306511) || (index >= 306534 && index <= 306539) ||
  3453. (index >= 306626 && index <= 306635) || (index >= 306762 && index <= 306787) || (index >= 306930 && index <= 306935) || (index >= 306943 && index <= 306950) ||
  3454. (index >= 306956 && index <= 307026) || (index >= 307105 && index <= 307109) || (index >= 307119 && index <= 307123) || (index >= 307134 && index <= 307137) ||
  3455. (index >= 307150 && index <= 307161) || (index >= 307168 && index <= 307242) || (index >= 308983 && index <= 310891))
  3456. moveSound = SoundList.WalkLawnL;
  3457. else if ((index >= 300691 && index <= 300694) || (index >= 301155 && index <= 301164) || (index >= 301167 && index <= 301173) || (index >= 301181 && index <= 301185) ||
  3458. (index >= 301194 && index <= 301197) || (index >= 301208 && index <= 301211) || (index >= 301223 && index <= 301225) || (index >= 301233 && index <= 301235) ||
  3459. (index >= 301238 && index <= 301239) || (index >= 301247 && index <= 301250) || (index >= 301254 && index <= 301256) || (index >= 301262 && index <= 301265) ||
  3460. (index >= 301271 && index <= 301273) || (index >= 301277 && index <= 301280) || (index >= 301288 && index <= 301295) || (index >= 301305 && index <= 301310) ||
  3461. (index >= 301322 && index <= 301325) || (index >= 301339 && index <= 301341) || (index >= 301350 && index <= 301352) || (index >= 301356 && index <= 301358) ||
  3462. (index >= 301368 && index <= 301375) || (index >= 301386 && index <= 301392) || (index >= 301404 && index <= 301409) || (index >= 301424 && index <= 301427) ||
  3463. (index >= 301587 && index <= 301590) || (index >= 301605 && index <= 301608) || (index >= 301622 && index <= 301625) || (index >= 301638 && index <= 301642) ||
  3464. (index >= 301655 && index <= 301660) || (index >= 301666 && index <= 301678) || (index >= 301683 && index <= 301685) || (index >= 301688 && index <= 301692) ||
  3465. (index >= 301700 && index <= 301709) || (index >= 301718 && index <= 301728) || (index >= 301736 && index <= 301744) || (index >= 301754 && index <= 301763))
  3466. moveSound = SoundList.WalkWoodL;
  3467. else if ((index >= 303064 && index <= 304418))
  3468. moveSound = SoundList.WalkRoomL;
  3469. else if ((index >= 328055 && index <= 332912))
  3470. moveSound = SoundList.WalkCaveL;
  3471. else if ((index >= 300683 && index <= 300690) || (index >= 300700 && index <= 300713) || (index >= 300719 && index <= 300732) || (index >= 300746 && index <= 300751) ||
  3472. (index >= 300830 && index <= 300832) || (index >= 300850 && index <= 300851) || (index >= 300905 && index <= 300906) || (index >= 300921 && index <= 300922) ||
  3473. (index >= 300936 && index <= 300938) || (index >= 301089 && index <= 301104) || (index >= 301107 && index <= 301111) || (index >= 301114 && index <= 301136) ||
  3474. (index >= 301139 && index <= 301154) || (index >= 301165 && index <= 301166) || (index >= 301174 && index <= 301180) || (index >= 301186 && index <= 301193) ||
  3475. (index >= 301198 && index <= 301207) || (index >= 301212 && index <= 301222) || (index >= 301226 && index <= 301232) || (index >= 301236 && index <= 301237) ||
  3476. (index >= 301240 && index <= 301246) || (index >= 301251 && index <= 301253) || (index >= 301258 && index <= 301261) || (index >= 301266 && index <= 301270) ||
  3477. (index >= 301274 && index <= 301276) || (index >= 301281 && index <= 301287) || (index >= 301296 && index <= 301304) || (index >= 301311 && index <= 301321) ||
  3478. (index >= 301326 && index <= 301338) || (index >= 301342 && index <= 301349) || (index >= 301354 && index <= 301355) || (index >= 301359 && index <= 301367) ||
  3479. (index >= 301376 && index <= 301385) || (index >= 301393 && index <= 301403) || (index >= 301410 && index <= 301421) || (index >= 301428 && index <= 301440) ||
  3480. (index >= 301447 && index <= 301459) || (index >= 301556 && index <= 301586) || (index >= 301591 && index <= 301604) || (index >= 301609 && index <= 301621) ||
  3481. (index >= 301626 && index <= 301637) || (index >= 301643 && index <= 301654) || (index >= 301661 && index <= 301665) || (index >= 301679 && index <= 301682) ||
  3482. (index >= 301686 && index <= 301687) || (index >= 301693 && index <= 301699) || (index >= 301710 && index <= 301717) || (index >= 301729 && index <= 301735) ||
  3483. (index >= 301768 && index <= 301771) || (index >= 301787 && index <= 301789) || (index >= 301745 && index <= 301753))
  3484. moveSound = SoundList.WalkWaterL;
  3485. }
  3486. else if (index >= 500000 && index <= 599999)
  3487. {
  3488. //SMTiles6 (115 image)
  3489. if ((index >= 500000 && index <= 501844) || (index >= 503294 && index <= 509086) || (index >= 509520 && index <= 512812) || (index >= 514854 && index <= 515035) ||
  3490. (index >= 521326 && index <= 522110) || (index >= 526820 && index <= 528871))
  3491. moveSound = SoundList.WalkGroundL;
  3492. else if ((index >= 501845 && index <= 503293) || (index >= 513557 && index <= 513745))
  3493. moveSound = SoundList.WalkLawnL;
  3494. else if ((index >= 509087 && index <= 509519) || (index >= 512813 && index <= 512909) || (index >= 516308 && index <= 521325) || (index >= 522111 && index <= 526819) ||
  3495. (index >= 528872 && index <= 530723))
  3496. moveSound = SoundList.WalkRoomL;
  3497. else if ((index >= 512910 && index <= 513556) || (index >= 513746 && index <= 514853) || (index >= 515037 && index <= 516307))
  3498. moveSound = SoundList.WalkStoneL;
  3499. }
  3500. else if (index >= 700000 && index <= 799999)
  3501. {
  3502. //SMTiles8
  3503. if (index >= 700000 && index <= 701702)
  3504. moveSound = SoundList.WalkCaveL;
  3505. }
  3506. #endregion
  3507. }
  3508. private void PlayWemadeMir3StepSound(int x, int y, out int moveSound)
  3509. {
  3510. moveSound = 0;
  3511. int backIndex = (GameScene.Scene.MapControl.M2CellInfo[x, y].BackIndex);
  3512. int midIndex = (GameScene.Scene.MapControl.M2CellInfo[x, y].MiddleIndex);
  3513. int midImage = (GameScene.Scene.MapControl.M2CellInfo[x, y].MiddleImage & 0x7FFF - 1);
  3514. #region Shanda & Wemade Mir 3
  3515. int index = (GameScene.Scene.MapControl.M2CellInfo[x, y].BackImage & 0x1FFFF) - 1; // Back
  3516. #region Back 300 Tilesc*!
  3517. if (backIndex == 300 || backIndex == 200)
  3518. { // Lawn
  3519. if ((index >= 1605 && index <= 1750) || (index >= 1753 && index <= 1759) || (index >= 1763 && index <= 1769)
  3520. || (index >= 1772 && index <= 1794) || (index >= 7246 && index <= 7477))
  3521. moveSound = SoundList.WalkLawnL;
  3522. // Rough
  3523. else if (index >= 6672 && index <= 6918)
  3524. moveSound = SoundList.WalkRoughL;
  3525. // Stone
  3526. else if ((index >= 500 && index <= 518) || (index >= 523 && index <= 524) || (index >= 527 && index <= 528)
  3527. || (index >= 907 && index <= 733) || (index >= 1543 && index <= 1564) || (index >= 1561 && index <= 1564)
  3528. || (index == 1589) || (index >= 1591 && index <= 1592) || (index == 1595) || (index >= 1598 && index <= 1600)
  3529. || (index >= 1751 && index <= 1752) || (index >= 1760 && index <= 1762) || (index >= 1770 && index <= 1771)
  3530. || (index >= 1882 && index <= 1883) || (index >= 1891 && index <= 1893) || (index >= 1900 && index <= 1903)
  3531. || (index >= 1910 && index <= 1911) || (index >= 1920 && index <= 1922) || (index >= 1926 && index <= 1929)
  3532. || (index >= 1940 && index <= 1941) || (index == 7138) || (index == 7492) || (index == 7552) || (index == 7557)
  3533. || (index == 7560) || (index == 7932) || (index == 7935) || (index == 7940) || (index == 7943) || (index == 8085)
  3534. || (index == 8110) || (index == 8111) || (index == 8130) || (index == 8352) || (index == 8356) || (index == 8543)
  3535. || (index == 8571) || (index == 8579) || (index == 8680) || (index == 9217) || (index == 9248) || (index == 9249)
  3536. || (index >= 9283 && index <= 9285) || (index >= 9287 && index <= 9288) || (index >= 9300 && index <= 9301)
  3537. || (index >= 9317 && index <= 9318) || (index >= 9321 && index <= 9322) || (index >= 9333 && index <= 9334)
  3538. || (index == 9350) || (index == 9353) || (index >= 9377 && index <= 9378) || (index == 9381)
  3539. || (index >= 9405 && index <= 9406) || (index == 9409) || (index >= 9442 && index <= 9443)
  3540. || (index >= 9471 && index <= 9472) || (index == 9484) || (index == 9517) || (index >= 9553 && index <= 9554)
  3541. || (index >= 9630 && index <= 9631) || (index == 9662))
  3542. moveSound = SoundList.WalkStoneL;
  3543. // Cave
  3544. else if (index >= 980 && index <= 1498)
  3545. moveSound = SoundList.WalkCaveL;
  3546. // Wood
  3547. else if ((index >= 1502 && index <= 1533) || (index == 1535) || (index == 1539) || (index == 1541) || (index == 1566)
  3548. || (index == 1569) || (index == 1573) || (index >= 1577 && index <= 1578) || (index >= 1580 && index <= 1587))
  3549. moveSound = SoundList.WalkWoodL;
  3550. // Room
  3551. else if ((index == 1534) || (index >= 1536 && index <= 1538) || (index == 1540) || (index == 1567)
  3552. || (index >= 1570 && index <= 1572) || (index >= 1574 && index <= 1576) || (index == 1579) || (index == 1590)
  3553. || (index >= 1593 && index <= 1594) || (index >= 1596 && index <= 1597))
  3554. moveSound = SoundList.WalkRoomL;
  3555. // Water
  3556. else if ((index >= 0 && index <= 3) || (index >= 7 && index <= 11) || (index >= 14 && index <= 17)
  3557. || (index >= 23 && index <= 25) || (index >= 30 && index <= 35) || (index >= 38 && index <= 43)
  3558. || (index >= 48 && index <= 51) || (index >= 55 && index <= 59) || (index >= 62 && index <= 65)
  3559. || (index >= 88 && index <= 91) || (index >= 100 && index <= 104) || (index >= 109 && index <= 117)
  3560. || (index >= 124 && index <= 130) || (index >= 139 && index <= 142) || (index >= 145 && index <= 150)
  3561. || (index >= 153 && index <= 159) || (index >= 164 && index <= 167) || (index >= 172 && index <= 175)
  3562. || (index >= 179 && index <= 182) || (index >= 186 && index <= 192) || (index >= 195 && index <= 200)
  3563. || (index >= 205 && index <= 207) || (index >= 212 && index <= 216) || (index >= 221 && index <= 224)
  3564. || (index >= 228 && index <= 231) || (index >= 236 && index <= 243) || (index >= 250 && index <= 258)
  3565. || (index >= 264 && index <= 268) || (index >= 277 && index <= 279) || (index >= 291 && index <= 296)
  3566. || (index >= 300 && index <= 305) || (index >= 308 && index <= 311) || (index >= 320 && index <= 326)
  3567. || (index >= 333 && index <= 341) || (index >= 350 && index <= 354) || (index >= 363 && index <= 366)
  3568. || (index >= 385 && index <= 388) || (index >= 392 && index <= 396) || (index >= 400 && index <= 403)
  3569. || (index >= 415 && index <= 417) || (index >= 423 && index <= 427) || (index >= 435 && index <= 443)
  3570. || (index >= 449 && index <= 457) || (index >= 5825 && index <= 5829) || (index >= 5835 && index <= 5844)
  3571. || (index >= 5849 && index <= 5859) || (index >= 5865 && index <= 5877) || (index >= 5882 && index <= 5894)
  3572. || (index >= 5900 && index <= 5912) || (index >= 5918 && index <= 5932) || (index >= 5937 && index <= 5951)
  3573. || (index >= 5958 && index <= 5973) || (index >= 5979 && index <= 5993) || (index >= 5999 && index <= 6011)
  3574. || (index >= 6017 && index <= 6029) || (index >= 6034 && index <= 6046) || (index >= 6051 && index <= 6061)
  3575. || (index >= 6067 && index <= 6076) || (index >= 6083 && index <= 6087) || (index >= 6105 && index <= 6110)
  3576. || (index >= 6116 && index <= 6128) || (index >= 6138 && index <= 6152) || (index >= 6159 && index <= 6283)
  3577. || (index >= 6290 && index <= 6303) || (index >= 6313 && index <= 6325) || (index >= 6331 && index <= 6336)
  3578. || (index >= 6340 && index <= 6345) || (index >= 6348 && index <= 6354) || (index >= 6357 && index <= 6363)
  3579. || (index >= 6366 && index <= 6371) || (index >= 6378 && index <= 6383) || (index >= 6386 && index <= 6392)
  3580. || (index >= 6395 && index <= 6400) || (index >= 6404 && index <= 6409) || (index >= 6416 && index <= 6421)
  3581. || (index >= 6424 && index <= 6430) || (index >= 6433 && index <= 6439) || (index >= 6442 && index <= 6448)
  3582. || (index >= 6454 && index <= 6458) || (index >= 6462 && index <= 6467) || (index >= 6471 && index <= 6477)
  3583. || (index >= 6480 && index <= 6486) || (index >= 6493 && index <= 6499) || (index >= 6502 && index <= 6508)
  3584. || (index >= 6511 && index <= 6517) || (index >= 6520 && index <= 6525) || (index >= 6532 && index <= 6537)
  3585. || (index >= 6541 && index <= 6546) || (index >= 6549 && index <= 6555) || (index >= 6558 && index <= 6563)
  3586. || (index >= 6569 && index <= 6575) || (index >= 6578 && index <= 6584) || (index >= 6587 && index <= 6593)
  3587. || (index >= 6597 && index <= 6601) || (index >= 6607 && index <= 6613) || (index >= 6616 && index <= 6622)
  3588. || (index >= 6627 && index <= 6631) || (index >= 6635 && index <= 6639))
  3589. moveSound = SoundList.WalkWaterL;
  3590. // Ground
  3591. else moveSound = SoundList.WalkGroundL;
  3592. }
  3593. #endregion
  3594. #region Back 315 Wood/Tilesc*
  3595. if (backIndex == 315 || backIndex == 215)
  3596. { // Stone
  3597. if ((index == 51) || (index >= 57 && index <= 58) || (index >= 64 && index <= 66) || (index == 74)
  3598. || (index == 79) || (index == 87) || (index == 99) || (index == 103) || (index == 116) || (index == 123)
  3599. || (index >= 136 && index <= 140) || (index >= 160 && index <= 166) || (index >= 186 && index <= 196)
  3600. || (index >= 215 && index <= 221) || (index == 225) || (index >= 245 && index <= 250) || (index >= 268 && index <= 271)
  3601. || (index == 282) || (index == 286) || (index == 290) || (index >= 302 && index <= 303) || (index == 322)
  3602. || (index == 345) || (index >= 406 && index <= 409) || (index >= 444 && index <= 448) || (index >= 477 && index <= 481)
  3603. || (index >= 503 && index <= 504) || (index >= 506 && index <= 507) || (index >= 524 && index <= 526)
  3604. || (index >= 528 && index <= 529) || (index >= 544 && index <= 548) || (index >= 563 && index <= 564) || (index >= 566 && index <= 567)
  3605. || (index == 580) || (index >= 586 && index <= 587) || (index >= 589 && index <= 590) || (index == 595) || (index == 602)
  3606. || (index >= 609 && index <= 613) || (index >= 617 && index <= 618) || (index == 626) || (index >= 633 && index <= 634)
  3607. || (index >= 636 && index <= 637) || (index == 642) || (index >= 657 && index == 658) || (index >= 660 && index <= 661)
  3608. || (index >= 666 && index <= 667) || (index >= 681 && index <= 682) || (index == 685) || (index >= 705 && index <= 709)
  3609. || (index >= 730 && index <= 733) || (index >= 753 && index <= 754) || (index == 905) || (index >= 1166 && index <= 1167)
  3610. || (index >= 1191 && index <= 1192) || (index >= 1221 && index <= 1222) || (index == 1326) || (index >= 1383 && index <= 1384)
  3611. || (index == 1427) || (index == 1451) || (index == 1465) || (index == 1488) || (index == 1505) || (index >= 1509 && index <= 1512)
  3612. || (index == 1525) || (index == 1545) || (index >= 1554 && index <= 1558) || (index == 1570) || (index == 1590)
  3613. || (index >= 1598 && index <= 1603) || (index >= 1626 && index <= 1627) || (index == 1634) || (index >= 1641 && index <= 1647)
  3614. || (index == 1673) || (index >= 1687 && index <= 1692) || (index == 1714) || (index >= 1730 && index <= 1733) || (index == 1749)
  3615. || (index >= 1766 && index <= 1767) || (index >= 1786 && index <= 1787) || (index >= 1834 && index <= 1835) || (index == 1942)
  3616. || (index >= 2080 && index <= 2081) || (index >= 2091 && index <= 2092) || (index >= 2623 && index <= 2624) || (index == 2850)
  3617. || (index >= 2862 && index <= 2863) || (index == 2877) || (index >= 2924 && index <= 2925) || (index >= 2939 && index <= 2940)
  3618. || (index == 3057) || (index >= 3913 && index <= 3914))
  3619. moveSound = SoundList.WalkStoneL;
  3620. // Wood
  3621. else if ((index >= 3157 && index <= 3159) || (index >= 3168 && index <= 3171) || (index >= 3179 && index <= 3182)
  3622. || (index >= 3199 && index <= 3202) || (index >= 3220 && index <= 3222) || (index >= 3243 && index <= 3245)
  3623. || (index >= 3266 && index <= 3268) || (index >= 3286 && index <= 3289) || (index >= 3307 && index <= 3309)
  3624. || (index >= 3329 && index <= 3331) || (index >= 3352 && index <= 3354) || (index >= 3374 && index <= 3376)
  3625. || (index >= 3387 && index <= 3389) || (index >= 3502 && index <= 3503) || (index >= 3522 && index <= 3523)
  3626. || (index >= 3532 && index <= 3538) || (index >= 3545 && index <= 3551) || (index >= 3559 && index <= 3566)
  3627. || (index >= 3581 && index <= 3582) || (index >= 3591 && index <= 3592) || (index >= 3598 && index <= 3600)
  3628. || (index >= 3615 && index <= 3617) || (index >= 3634 && index <= 3636) || (index == 3659) || (index == 3715)
  3629. || (index >= 3727 && index <= 3728) || (index >= 3738 && index <= 3739) || (index == 3745) || (index == 3749)
  3630. || (index == 3750) || (index >= 3754 && index <= 3757) || (index >= 3774 && index <= 3776)
  3631. || (index >= 3797 && index <= 3798) || (index >= 3816 && index <= 3818) || (index >= 3831 && index <= 3832)
  3632. || (index >= 3836 && index <= 3837) || (index >= 3850 && index <= 3853) || (index >= 3866 && index <= 3868))
  3633. moveSound = SoundList.WalkWoodL;
  3634. // Water
  3635. else if ((index == 3744) || (index >= 3761 && index <= 3769) || (index >= 3782 && index <= 3790)
  3636. || (index >= 3804 && index <= 3809) || (index >= 3824 && index <= 3830) || (index >= 3842 && index <= 3848)
  3637. || (index >= 3860 && index <= 3865) || (index == 3870) || (index >= 3875 && index <= 3881) || (index == 3884)
  3638. || (index >= 3890 && index <= 3894))
  3639. moveSound = SoundList.WalkWaterL;
  3640. // Ground
  3641. else moveSound = SoundList.WalkGroundL;
  3642. }
  3643. #endregion
  3644. #region Back 330 Sand/Tilesc*
  3645. if (backIndex == 330 || backIndex == 230)
  3646. { // Stone
  3647. if ((index >= 1029 && index <= 1031) || (index >= 1048 && index <= 1053) || (index >= 1070 && index <= 1075)
  3648. || (index >= 1094 && index <= 1100) || (index >= 1119 && index <= 1120) || (index >= 1124 && index <= 1127)
  3649. || (index >= 1145 && index <= 1146) || (index >= 1150 && index <= 1154) || (index >= 1177 && index <= 1183)
  3650. || (index >= 1185 && index <= 1187) || (index >= 1212 && index <= 1218) || (index >= 1242 && index <= 1246)
  3651. || (index >= 1269 && index <= 1271) || (index >= 1273 && index <= 1274) || (index >= 1301 && index <= 1305)
  3652. || (index >= 1308 && index <= 1310) || (index == 1338) || (index >= 1340 && index <= 1342)
  3653. || (index >= 1345 && index <= 1351) || (index >= 1378 && index <= 1386) || (index >= 1388 && index <= 1393)
  3654. || (index >= 1414 && index <= 1422) || (index >= 1426 && index <= 1429) || (index >= 1444 && index <= 1451)
  3655. || (index >= 1458 && index <= 1459) || (index >= 1475 && index <= 1479) || (index >= 1500 && index <= 1503)
  3656. || (index >= 1520 && index <= 1521) || (index >= 1538 && index <= 1539) || (index >= 1554 && index <= 1557)
  3657. || (index >= 1576 && index <= 1581) || (index >= 1600 && index <= 1603) || (index >= 1616 && index <= 1618)
  3658. || (index >= 1629 && index <= 1631) || (index == 2135) || (index >= 2150 && index <= 2151)
  3659. || (index >= 2163 && index <= 2164) || (index == 2177) || (index >= 2179 && index <= 2180) || (index == 2199)
  3660. || (index == 2201) || (index >= 2205 && index <= 2208) || (index >= 2219 && index <= 2220)
  3661. || (index >= 2227 && index <= 2228) || (index == 2230) || (index == 2249) || (index == 2377) || (index == 2493)
  3662. || (index >= 2600 && index <= 2601) || (index >= 2603 && index <= 2604) || (index >= 2656 && index <= 2659)
  3663. || (index >= 2677 && index <= 2681) || (index >= 2700 && index <= 2703) || (index >= 2717 && index <= 2718)
  3664. || (index >= 2723 && index <= 2726) || (index == 2751) || (index == 2793) || (index >= 3020 && index <= 3022)
  3665. || (index >= 3052 && index <= 3053) || (index >= 3088 && index <= 3089) || (index >= 3115 && index <= 3116)
  3666. || (index >= 3124 && index <= 3125) || (index >= 3131 && index <= 3133) || (index >= 3159 && index <= 3161)
  3667. || (index >= 3168 && index <= 3171) || (index >= 3192 && index <= 3193) || (index >= 3197 && index <= 3199)
  3668. || (index == 3232) || (index >= 4008 && index <= 4009) || (index >= 4030 && index <= 4033)
  3669. || (index >= 4055 && index <= 4056) || (index >= 4078 && index <= 4079) || (index >= 4101 && index <= 4104)
  3670. || (index >= 4121 && index <= 4123) || (index >= 4129 && index <= 4130) || (index >= 4140 && index <= 4141)
  3671. || (index >= 4149 && index <= 4150) || (index >= 4159 && index <= 4160) || (index == 4175) || (index == 4192)
  3672. || (index >= 4212 && index <= 4215) || (index >= 4299 && index <= 4361) || (index >= 4610 && index <= 4734)
  3673. || (index >= 4775 && index <= 4810))
  3674. moveSound = SoundList.WalkStoneL;
  3675. // Cave
  3676. else if ((index >= 4364 && index <= 4607) || (index >= 4737 && index <= 4772) || (index >= 4813 && index <= 4906))
  3677. moveSound = SoundList.WalkCaveL;
  3678. // Ground
  3679. else moveSound = SoundList.WalkGroundL;
  3680. }
  3681. #endregion
  3682. #region Back 345 Snow/Tilesc*!
  3683. if (backIndex == 345 || backIndex == 245)
  3684. { // Stone
  3685. if ((index >= 988 && index <= 1116) || (index == 1721) || (index == 1781) || (index == 1801) || (index >= 3051 && index <= 3282)
  3686. || (index >= 3296 && index <= 3297) || (index >= 3300 && index <= 3301) || (index >= 3994 && index <= 4301)
  3687. || (index >= 6224 && index <= 6291) || (index >= 6293 && index <= 6308) || (index >= 6313 && index <= 6329)
  3688. || (index >= 6336 && index <= 6354) || (index >= 6362 && index <= 6382) || (index >= 6392 && index <= 6414)
  3689. || (index >= 6424 && index <= 6448) || (index >= 6458 && index <= 6484) || (index >= 6494 && index <= 6522)
  3690. || (index >= 6532 && index <= 6561) || (index >= 6571 && index <= 6600) || (index >= 6610 && index <= 6639)
  3691. || (index >= 6649 && index <= 6677) || (index >= 6687 && index <= 6712) || (index >= 6720 && index <= 6747)
  3692. || (index >= 6754 && index <= 6782) || (index >= 6787 && index <= 7941))
  3693. moveSound = SoundList.WalkStoneL;
  3694. // Snow
  3695. else if ((index >= 2 && index <= 984) || (index >= 2123 && index <= 2453) || (index >= 2456 && index <= 2458)
  3696. || (index >= 2462 && index <= 2465) || (index >= 2468 && index <= 2736) || (index >= 3287 && index <= 3295)
  3697. || (index >= 3298 && index <= 3299) || (index >= 3302 && index <= 3306))
  3698. moveSound = SoundList.WalkSnowL;
  3699. // Wood
  3700. else if ((index >= 2454 && index <= 2455) || (index >= 2459 && index <= 2461) || (index >= 2466 && index <= 2467)
  3701. || (index >= 4590 && index <= 4593) || (index >= 4611 && index <= 4613) || (index == 4646) || (index == 4655)
  3702. || (index == 4665) || (index == 4668) || (index == 4675) || (index >= 4687 && index <= 4688) || (index >= 4693 && index <= 4694)
  3703. || (index >= 4762 && index <= 4713) || (index >= 4729 && index <= 4732) || (index >= 4750 && index <= 4751))
  3704. moveSound = SoundList.WalkWoodL;
  3705. // Cave
  3706. else if ((index >= 3311 && index <= 3854) || (index >= 4304 && index <= 4519))
  3707. moveSound = SoundList.WalkCaveL;
  3708. // Room
  3709. if ((index == 6292) || (index >= 6309 && index <= 6312) || (index >= 6330 && index <= 6335)
  3710. || (index >= 6355 && index <= 6361) || (index >= 6383 && index <= 6391) || (index >= 6415 && index <= 6423)
  3711. || (index >= 6449 && index <= 6457) || (index >= 6485 && index <= 6493) || (index >= 6523 && index <= 6531)
  3712. || (index >= 6562 && index <= 6570) || (index >= 6601 && index <= 6609) || (index >= 6640 && index <= 6648)
  3713. || (index >= 6678 && index <= 6686) || (index >= 6713 && index <= 6719) || (index >= 6748 && index <= 6753)
  3714. || (index >= 6783 && index <= 6785))
  3715. moveSound = SoundList.WalkRoomL;
  3716. // Ground
  3717. else moveSound = SoundList.WalkGroundL;
  3718. }
  3719. #endregion
  3720. #region Back 360 Forest/Tilesc*!
  3721. if (backIndex == 360 || backIndex == 260)
  3722. { // Stone
  3723. if ((index >= 120 && index <= 140) || (index >= 141 && index <= 156) || (index >= 158 && index <= 179)
  3724. || (index >= 184 && index <= 195) || (index >= 197 && index <= 198) || (index >= 200 && index <= 205)
  3725. || (index >= 210 && index <= 219) || (index >= 222 && index <= 231) || (index >= 233 && index <= 240)
  3726. || (index >= 248 && index <= 255) || (index >= 257 && index <= 263) || (index >= 271 && index <= 278)
  3727. || (index >= 282 && index <= 286) || (index >= 289 && index <= 290) || (index >= 294 && index <= 299)
  3728. || (index == 306) || (index >= 642 && index <= 646) || (index >= 666 && index <= 670)
  3729. || (index == 677) || (index >= 687 && index <= 692) || (index >= 698 && index <= 700)
  3730. || (index >= 709 && index <= 718) || (index >= 720 && index <= 724) || (index >= 732 && index <= 742)
  3731. || (index >= 744 && index <= 748) || (index >= 755 && index <= 762) || (index >= 768 && index <= 771)
  3732. || (index >= 775 && index <= 790) || (index >= 792 && index <= 812) || (index >= 817 && index <= 833)
  3733. || (index >= 836 && index <= 845) || (index >= 847 && index <= 853) || (index >= 855 && index <= 856)
  3734. || (index >= 1645 && index <= 1786) || (index >= 2041 && index <= 9868))
  3735. moveSound = SoundList.WalkStoneL;
  3736. // Lawn
  3737. else moveSound = SoundList.WalkLawnL;
  3738. }
  3739. #endregion
  3740. #region Back 301 Tiles30c*
  3741. if (backIndex == 301 || backIndex == 201)
  3742. { // Lawn
  3743. if ((index == 14) || (index == 19) || (index == 24) || (index == 29) || (index >= 395 && index <= 403)
  3744. || (index >= 410 && index <= 418) || (index >= 425 && index <= 433) || (index >= 440 && index <= 448)
  3745. || (index >= 455 && index <= 463) || (index >= 470 && index <= 478) || (index >= 485 && index <= 493)
  3746. || (index >= 500 && index <= 508) || (index >= 515 && index <= 523) || (index >= 530 && index <= 538)
  3747. || (index >= 605 && index <= 613) || (index >= 620 && index <= 628) || (index >= 635 && index <= 643)
  3748. || (index >= 650 && index <= 658) || (index >= 720 && index <= 724) || (index >= 735 && index <= 748)
  3749. || (index >= 900 && index <= 904) || (index >= 915 && index <= 928) || (index >= 995 && index <= 1003))
  3750. moveSound = SoundList.WalkLawnL;
  3751. // Stone
  3752. else if ((index >= 30 && index <= 34) || (index >= 45 && index <= 48) || (index >= 120 && index <= 124)
  3753. || (index >= 135 && index <= 138) || (index >= 185 && index <= 193) || (index >= 200 && index <= 208)
  3754. || (index >= 330 && index <= 334) || (index >= 345 && index <= 348) || (index >= 450 && index <= 454)
  3755. || (index >= 465 && index <= 468) || (index >= 1025 && index <= 1033))
  3756. moveSound = SoundList.WalkStoneL;
  3757. // Rough
  3758. else if ((index >= 600 && index <= 604) || (index >= 615 && index <= 618) || (index >= 780 && index <= 784)
  3759. || (index >= 795 && index <= 814) || (index >= 825 && index <= 844) || (index >= 855 && index <= 868)
  3760. || (index >= 930 && index <= 934) || (index >= 945 && index <= 958))
  3761. moveSound = SoundList.WalkRoughL;
  3762. // Ground
  3763. else moveSound = SoundList.WalkGroundL;
  3764. }
  3765. #endregion
  3766. //316 = wood/Tiles30c
  3767. //331 = sand/Tiles30c
  3768. #region Back 346 Snow/Tiles30c*
  3769. if (backIndex == 346 || backIndex == 246)
  3770. { // Snow
  3771. if ((index >= 0 && index <= 58) || (index >= 75 && index <= 94) || (index >= 105 && index <= 118)
  3772. || (index >= 125 && index <= 133) || (index >= 140 && index <= 148) || (index >= 165 && index <= 178))
  3773. moveSound = SoundList.WalkSnowL;
  3774. // Lawn
  3775. else if ((index >= 210 && index <= 214) || (index >= 225 && index <= 238))
  3776. moveSound = SoundList.WalkLawnL;
  3777. else moveSound = SoundList.WalkGroundL;
  3778. }
  3779. #endregion
  3780. #region Back 361 Forest/Tiles30c*
  3781. if (backIndex == 361 || backIndex == 261)
  3782. { // Lawn
  3783. if ((index >= 0 && index <= 4) || (index >= 14 && index <= 34) || (index >= 45 && index <= 64)
  3784. || (index >= 75 && index <= 124) || (index >= 135 && index <= 138) || (index >= 150 && index <= 154)
  3785. || (index >= 165 && index <= 179))
  3786. moveSound = SoundList.WalkLawnL;
  3787. // Ground
  3788. else moveSound = SoundList.WalkGroundL;
  3789. }
  3790. #endregion
  3791. #region Back 302 Tiles5c*
  3792. if (backIndex == 302 || backIndex == 202)
  3793. { // Lawn
  3794. if ((index >= 10330 && index <= 10348) || (index >= 10405 && index <= 10408) || (index >= 10450 && index <= 10454)
  3795. || (index >= 10460 && index <= 10463) || (index >= 10505 && index <= 10508) || (index >= 10550 && index <= 10554)
  3796. || (index >= 10560 && index <= 10563) || (index >= 10575 && index <= 10580) || (index >= 10582 && index <= 10585)
  3797. || (index >= 10588 && index <= 10593) || (index >= 10705 && index <= 10708) || (index >= 10750 && index <= 10754)
  3798. || (index >= 10760 && index <= 10763) || (index >= 10905 && index <= 10908) || (index >= 10915 && index <= 10954)
  3799. || (index >= 10960 && index <= 10973) || (index >= 11205 && index <= 11208) || (index >= 11215 && index <= 11254)
  3800. || (index >= 11260 && index <= 11273) || (index >= 11400 && index <= 11404) || (index >= 11410 && index <= 11423)
  3801. || (index >= 11455 && index <= 11473) || (index >= 11500 && index <= 11523) || (index >= 11550 && index <= 11573)
  3802. || (index >= 12555 && index <= 12558) || (index >= 12565 && index <= 12573) || (index >= 12605 && index <= 12608)
  3803. || (index >= 12615 && index <= 12623) || (index >= 12655 && index <= 12658) || (index >= 12665 && index <= 12673)
  3804. || (index >= 12705 && index <= 12708) || (index >= 12715 && index <= 12723))
  3805. moveSound = SoundList.WalkLawnL;
  3806. // Rough
  3807. else if ((index >= 10205 && index <= 10208) || (index >= 10215 && index <= 10223) || (index >= 10250 && index <= 10254)
  3808. || (index >= 10260 && index <= 10273) || (index >= 11005 && index <= 11008) || (index >= 11015 && index <= 11054)
  3809. || (index >= 11060 && index <= 11073) || (index >= 11405 && index <= 11408) || (index >= 11450 && index <= 11454))
  3810. moveSound = SoundList.WalkRoughL;
  3811. // Stone
  3812. else if ((index >= 10 && index <= 14) || (index >= 10085 && index <= 10093) || (index >= 10105 && index <= 10108)
  3813. || (index >= 10150 && index <= 10154) || (index >= 10160 && index <= 10173) || (index >= 10605 && index <= 10608)
  3814. || (index >= 10615 && index <= 10623) || (index >= 10650 && index <= 10654) || (index >= 10660 && index <= 10673)
  3815. || (index >= 11305 && index <= 11308) || (index >= 11315 && index <= 11354) || (index >= 11360 && index <= 11373)
  3816. || (index >= 11479 && index <= 11481) || (index >= 11486 && index <= 11488) || (index >= 11491 && index <= 11493)
  3817. || (index >= 12000 && index <= 12023) || (index >= 12400 && index <= 12423) || (index >= 12550 && index <= 12554)
  3818. || (index >= 12560 && index <= 12563) || (index >= 12600 && index <= 12604) || (index >= 12610 && index <= 12613)
  3819. || (index >= 12650 && index <= 12654) || (index >= 12660 && index <= 12663) || (index >= 12700 && index <= 12704)
  3820. || (index >= 12710 && index <= 12713) || (index >= 12850 && index <= 12874) || (index >= 12995 && index <= 13049)
  3821. || (index >= 14625 && index <= 14678) || (index >= 15045 && index <= 15143) || (index >= 15780 && index <= 15849)
  3822. || (index >= 16075 && index <= 16077))
  3823. moveSound = SoundList.WalkStoneL;
  3824. // Cave
  3825. else if ((index >= 10040 && index <= 10078) || (index >= 11375 && index <= 11378) || (index >= 11380 && index <= 11383)
  3826. || (index >= 11387 && index <= 11390) || (index >= 11394 && index <= 11396) || (index >= 11425 && index <= 11449)
  3827. || (index >= 11475 && index <= 11478) || (index >= 11482 && index <= 11485) || (index >= 11489 && index <= 11490)
  3828. || (index >= 11494 && index <= 11499) || (index >= 11525 && index <= 11549) || (index >= 11575 && index <= 11973)
  3829. || (index >= 12150 && index <= 12173) || (index >= 12450 && index <= 12473) || (index >= 12495 && index <= 12499)
  3830. || (index >= 12525 && index <= 12549) || (index >= 12575 && index <= 12599) || (index >= 12625 && index <= 12649)
  3831. || (index >= 12675 && index <= 12699) || (index >= 12725 && index <= 12749) || (index >= 12775 && index <= 12799)
  3832. || (index >= 12825 && index <= 12849) || (index >= 12875 && index <= 12899) || (index >= 12925 && index <= 12993)
  3833. || (index >= 13075 && index <= 13098) || (index >= 13125 && index <= 13129) || (index >= 13131 && index <= 13136)
  3834. || (index >= 13139 && index <= 13176) || (index >= 13180 && index <= 13188) || (index >= 13191 && index <= 13229)
  3835. || (index >= 13232 && index <= 13239) || (index >= 13242 && index <= 13245) || (index >= 13247 && index <= 13275)
  3836. || (index >= 13279 && index <= 13281) || (index >= 14825 && index <= 15035) || (index >= 15225 && index <= 15779))
  3837. moveSound = SoundList.WalkCaveL;
  3838. // Wood
  3839. else if ((index >= 25 && index <= 29) || (index == 11379) || (index >= 11384 && index <= 11386)
  3840. || (index >= 11391 && index <= 11393) || (index >= 11397 && index <= 11399) || (index == 13130)
  3841. || (index >= 13137 && index <= 13138) || (index >= 13177 && index <= 13179) || (index >= 13189 && index <= 13190)
  3842. || (index >= 13230 && index <= 13231) || (index >= 13240 && index <= 13241) || (index == 13246)
  3843. || (index >= 13276 && index <= 13278) || (index == 13282) || (index >= 13780 && index <= 14434)
  3844. || (index >= 15178 && index <= 15179) || (index >= 15182 && index <= 15185) || (index >= 15188 && index <= 15191)
  3845. || (index >= 15194 && index <= 15195) || (index >= 15875 && index <= 16041) || (index >= 16080 && index <= 16083)
  3846. || (index >= 16145 && index <= 16188))
  3847. moveSound = SoundList.WalkWoodL;
  3848. // Room
  3849. else if ((index >= 12175 && index <= 12199) || (index >= 12232 && index <= 10249) || (index >= 12275 && index <= 12299)
  3850. || (index >= 12325 && index <= 12349) || (index >= 12375 && index <= 12399) || (index >= 12425 && index <= 12449)
  3851. || (index >= 12475 && index <= 12488) || (index >= 12800 && index <= 12824) || (index >= 12900 && index <= 12924)
  3852. || (index >= 15037 && index <= 15040) || (index >= 16085 && index <= 16088))
  3853. moveSound = SoundList.WalkRoomL;
  3854. // Water
  3855. else if ((index >= 0 && index <= 4) || (index >= 30 && index <= 34))
  3856. moveSound = SoundList.WalkWaterL;
  3857. // Ground
  3858. else moveSound = SoundList.WalkGroundL;
  3859. }
  3860. #endregion
  3861. #region Back 317 Wood/Tiles5c*
  3862. if (backIndex == 317 || backIndex == 217)
  3863. { // Cave
  3864. if (index >= 0 && index <= 4)
  3865. moveSound = SoundList.WalkCaveL;
  3866. // Stone
  3867. else moveSound = SoundList.WalkStoneL;
  3868. }
  3869. #endregion
  3870. #region Back 332 Sand/Tiles5c*
  3871. if (backIndex == 332 || backIndex == 232)
  3872. { // Stone
  3873. if (index >= 5 && index <= 9)
  3874. moveSound = SoundList.WalkStoneL;
  3875. // Cave
  3876. else if (index >= 0 && index <= 4)
  3877. moveSound = SoundList.WalkCaveL;
  3878. else moveSound = SoundList.WalkGroundL;
  3879. }
  3880. #endregion
  3881. #region Back 347 Snow/Tiles5c*
  3882. if (backIndex == 347 || backIndex == 247)
  3883. { // Cave
  3884. if ((index >= 21 && index <= 24) || (index >= 35 && index <= 44))
  3885. moveSound = SoundList.WalkCaveL;
  3886. // Stone
  3887. else if ((index >= 0 && index <= 4) || (index >= 15 && index <= 19))
  3888. moveSound = SoundList.WalkStoneL;
  3889. // Water
  3890. else if ((index >= 30 && index <= 34))
  3891. moveSound = SoundList.WalkWaterL;
  3892. // Snow
  3893. else if ((index >= 30 && index <= 34))
  3894. moveSound = SoundList.WalkSnowL;
  3895. else moveSound = SoundList.WalkGroundL;
  3896. }
  3897. #endregion
  3898. #region Back 362 Forest/Tiles5c*
  3899. if (backIndex == 362 || backIndex == 262)
  3900. { // Stone
  3901. if (index >= 0 && index <= 36)
  3902. moveSound = SoundList.WalkStoneL;
  3903. else moveSound = SoundList.WalkGroundL;
  3904. }
  3905. #endregion
  3906. #region Back 304 Housesc || 219 Wood | 234 Sand | 249 Snow | 264 Forest
  3907. if (backIndex == 304 || backIndex == 204)
  3908. {
  3909. moveSound = SoundList.WalkGroundL;
  3910. }
  3911. #endregion
  3912. index = (GameScene.Scene.MapControl.M2CellInfo[x, y].MiddleImage & 0x7FFF) - 1; // Middle
  3913. #region Middle 310 smObjectsc
  3914. if (midIndex == 310 || backIndex == 210 && midImage != 0)
  3915. // Wood
  3916. if (index >= 7755 && index <= 8300)
  3917. moveSound = SoundList.WalkWoodL;
  3918. else moveSound = SoundList.WalkGroundL;
  3919. #endregion
  3920. #region Middle 325 Wood/smObjectsc
  3921. if (midIndex == 325 || backIndex == 225 && midImage != 0)
  3922. // Stone
  3923. if ((index >= 480 && index <= 624) || (index >= 2459 && index <= 2519))
  3924. moveSound = SoundList.WalkStoneL;
  3925. // Room
  3926. else if (index >= 2539 && index <= 2623)
  3927. moveSound = SoundList.WalkRoomL;
  3928. else moveSound = SoundList.WalkGroundL;
  3929. #endregion
  3930. #region Middle 340 Sand/smObjectsc
  3931. if (midIndex == 340 || backIndex == 240 && midImage != 0)
  3932. // Stone
  3933. if ((index >= 0 && index <= 0) || (index >= 0 && index <= 0))
  3934. moveSound = SoundList.WalkGroundL;
  3935. #endregion
  3936. #region Middle 355 Snow/smObjectsc
  3937. if (midIndex == 355 || backIndex == 255 && midImage != 0)
  3938. // Wood
  3939. if ((index >= 939 && index <= 942) || (index >= 960 && index <= 966) || (index >= 986 && index <= 994)
  3940. || (index >= 1013 && index <= 1021) || (index >= 1044 && index <= 1052) || (index >= 1073 && index <= 1081)
  3941. || (index >= 1104 && index <= 1112) || (index >= 1130 && index <= 1136) || (index >= 1156 && index <= 1161)
  3942. || (index >= 1178 && index <= 1182) || (index >= 1200 && index <= 1203) || (index >= 1219 && index <= 1220)
  3943. || (index >= 1302 && index <= 1303) || (index >= 1319 && index <= 1322) || (index >= 1337 && index <= 1341)
  3944. || (index >= 1358 && index <= 1364) || (index >= 1380 && index <= 1386) || (index >= 1404 && index <= 1412)
  3945. || (index >= 1429 && index <= 1437) || (index >= 1456 && index <= 1464) || (index >= 1480 && index <= 1489)
  3946. || (index >= 1509 && index <= 1516) || (index >= 1532 && index <= 1538) || (index >= 1555 && index <= 1558)
  3947. || (index >= 9681 && index <= 9952))
  3948. moveSound = SoundList.WalkWoodL;
  3949. // Stone
  3950. else if ((index >= 4596 && index <= 4602) || (index >= 4638 && index <= 4644) || (index >= 4670 && index <= 4676)
  3951. || (index >= 6383 && index <= 6387))
  3952. moveSound = SoundList.WalkStoneL;
  3953. else moveSound = SoundList.WalkSnowL;
  3954. #endregion
  3955. #region Middle 370 Forest/smObjectsc
  3956. if (midIndex == 370 || backIndex == 270 && midImage != 0)
  3957. // Stone
  3958. moveSound = SoundList.WalkStoneL;
  3959. #endregion
  3960. #endregion Wemade Mir 3
  3961. }
  3962. public void PlayStruckSound()
  3963. {
  3964. if (RidingMount)
  3965. {
  3966. if (MountType < 7)
  3967. SoundManager.PlaySound(CMain.Random.Next(10179, 10181));
  3968. else if (MountType < 12)
  3969. SoundManager.PlaySound(CMain.Random.Next(10193, 10194));
  3970. return;
  3971. }
  3972. int add = 0;
  3973. if (Class != MirClass.Assassin) //Archer to add?
  3974. switch (Armour)
  3975. {
  3976. case 3:
  3977. case 6:
  3978. case 9:
  3979. add = 10;
  3980. break;
  3981. }
  3982. switch (StruckWeapon)
  3983. {
  3984. case 0:
  3985. case 23:
  3986. case 1:
  3987. case 12:
  3988. case 28:
  3989. case 40:
  3990. SoundManager.PlaySound(SoundList.StruckBodySword + add);
  3991. break;
  3992. case 2:
  3993. case 8:
  3994. case 11:
  3995. case 15:
  3996. case 18:
  3997. case 20:
  3998. case 25:
  3999. case 31:
  4000. case 33:
  4001. case 34:
  4002. case 37:
  4003. case 41:
  4004. SoundManager.PlaySound(SoundList.StruckBodySword + add);
  4005. break;
  4006. case 3:
  4007. case 5:
  4008. case 7:
  4009. case 9:
  4010. case 13:
  4011. case 19:
  4012. case 24:
  4013. case 26:
  4014. case 29:
  4015. case 32:
  4016. case 35:
  4017. SoundManager.PlaySound(SoundList.StruckBodySword + add);
  4018. break;
  4019. case 4:
  4020. case 14:
  4021. case 16:
  4022. case 38:
  4023. SoundManager.PlaySound(SoundList.StruckBodyAxe + add);
  4024. break;
  4025. case 6:
  4026. case 10:
  4027. case 17:
  4028. case 22:
  4029. case 27:
  4030. case 30:
  4031. case 36:
  4032. case 39:
  4033. SoundManager.PlaySound(SoundList.StruckBodyLongStick + add);
  4034. break;
  4035. case 21:
  4036. SoundManager.PlaySound(SoundList.StruckBodyLongStick + add);
  4037. break;
  4038. case -1:
  4039. SoundManager.PlaySound(SoundList.StruckBodyFist + add);
  4040. break;
  4041. }
  4042. }
  4043. public void PlayFlinchSound()
  4044. {
  4045. SoundManager.PlaySound(FlinchSound);
  4046. }
  4047. public void PlayAttackSound()
  4048. {
  4049. if (RidingMount)
  4050. {
  4051. if (MountType < 7)
  4052. SoundManager.PlaySound(CMain.Random.Next(10181, 10184));
  4053. else if (MountType < 12)
  4054. SoundManager.PlaySound(CMain.Random.Next(10190, 10193));
  4055. return;
  4056. }
  4057. if (Weapon >= 0 && Class == MirClass.Assassin)
  4058. {
  4059. SoundManager.PlaySound(SoundList.SwingShort);
  4060. return;
  4061. }
  4062. if (Class == MirClass.Archer && HasClassWeapon)
  4063. {
  4064. return;
  4065. }
  4066. switch (Weapon)
  4067. {
  4068. case 0:
  4069. case 23:
  4070. case 28:
  4071. case 40:
  4072. SoundManager.PlaySound(SoundList.SwingWood);
  4073. break;
  4074. case 1:
  4075. case 12:
  4076. SoundManager.PlaySound(SoundList.SwingShort);
  4077. break;
  4078. case 2:
  4079. case 8:
  4080. case 11:
  4081. case 15:
  4082. case 18:
  4083. case 20:
  4084. case 25:
  4085. case 31:
  4086. case 33:
  4087. case 34:
  4088. case 37:
  4089. case 41:
  4090. SoundManager.PlaySound(SoundList.SwingSword);
  4091. break;
  4092. case 3:
  4093. case 5:
  4094. case 7:
  4095. case 9:
  4096. case 13:
  4097. case 19:
  4098. case 24:
  4099. case 26:
  4100. case 29:
  4101. case 32:
  4102. case 35:
  4103. SoundManager.PlaySound(SoundList.SwingSword2);
  4104. break;
  4105. case 4:
  4106. case 14:
  4107. case 16:
  4108. case 38:
  4109. SoundManager.PlaySound(SoundList.SwingAxe);
  4110. break;
  4111. case 6:
  4112. case 10:
  4113. case 17:
  4114. case 22:
  4115. case 27:
  4116. case 30:
  4117. case 36:
  4118. case 39:
  4119. SoundManager.PlaySound(SoundList.SwingLong);
  4120. break;
  4121. case 21:
  4122. SoundManager.PlaySound(SoundList.SwingClub);
  4123. break;
  4124. default:
  4125. SoundManager.PlaySound(SoundList.SwingFist);
  4126. break;
  4127. }
  4128. }
  4129. public void PlayDieSound()
  4130. {
  4131. if (Gender == 0) { SoundManager.PlaySound(SoundList.MaleDie); }
  4132. else { SoundManager.PlaySound(SoundList.FemaleDie); }
  4133. }
  4134. public void PlayMountSound()
  4135. {
  4136. if (RidingMount)
  4137. {
  4138. if(MountType < 7)
  4139. SoundManager.PlaySound(10218);
  4140. else if (MountType < 12)
  4141. SoundManager.PlaySound(10188);
  4142. }
  4143. else
  4144. {
  4145. if (MountType < 7)
  4146. SoundManager.PlaySound(10219);
  4147. else if (MountType < 12)
  4148. SoundManager.PlaySound(10189);
  4149. }
  4150. }
  4151. public override void Draw()
  4152. {
  4153. DrawBehindEffects(Settings.Effect);
  4154. float oldOpacity = DXManager.Opacity;
  4155. if (Hidden && !DXManager.Blending) DXManager.SetOpacity(0.5F);
  4156. DrawMount();
  4157. if (!RidingMount)
  4158. {
  4159. if (Direction == MirDirection.Left || Direction == MirDirection.Up || Direction == MirDirection.UpLeft || Direction == MirDirection.DownLeft)
  4160. DrawWeapon();
  4161. else
  4162. DrawWeapon2();
  4163. }
  4164. DrawBody();
  4165. if (Direction == MirDirection.Up || Direction == MirDirection.UpLeft || Direction == MirDirection.UpRight || Direction == MirDirection.Right || Direction == MirDirection.Left)
  4166. {
  4167. DrawHead();
  4168. if (this != User)
  4169. {
  4170. DrawWings();
  4171. }
  4172. }
  4173. else
  4174. {
  4175. if (this != User)
  4176. {
  4177. DrawWings();
  4178. }
  4179. DrawHead();
  4180. }
  4181. if (!RidingMount)
  4182. {
  4183. if (Direction == MirDirection.UpRight || Direction == MirDirection.Right || Direction == MirDirection.DownRight || Direction == MirDirection.Down)
  4184. DrawWeapon();
  4185. else
  4186. DrawWeapon2();
  4187. if (Class == MirClass.Archer && HasClassWeapon)
  4188. DrawWeapon2();
  4189. }
  4190. DXManager.SetOpacity(oldOpacity);
  4191. }
  4192. public override void DrawBehindEffects(bool effectsEnabled)
  4193. {
  4194. for (int i = 0; i < Effects.Count; i++)
  4195. {
  4196. if (!Effects[i].DrawBehind) continue;
  4197. if (!Settings.LevelEffect && (Effects[i] is SpecialEffect) && ((SpecialEffect)Effects[i]).EffectType == 1) continue;
  4198. if ((!effectsEnabled) && (!IsVitalEffect(Effects[i]))) continue;
  4199. Effects[i].Draw();
  4200. }
  4201. }
  4202. public override void DrawEffects(bool effectsEnabled)
  4203. {
  4204. for (int i = 0; i < Effects.Count; i++)
  4205. {
  4206. if (Effects[i].DrawBehind) continue;
  4207. if (!Settings.LevelEffect && (Effects[i] is SpecialEffect) && ((SpecialEffect)Effects[i]).EffectType == 1) continue;
  4208. if ((!effectsEnabled) && (!IsVitalEffect(Effects[i]))) continue;
  4209. Effects[i].Draw();
  4210. }
  4211. if (!effectsEnabled) return;
  4212. switch (CurrentAction)
  4213. {
  4214. case MirAction.Attack1:
  4215. switch (Spell)
  4216. {
  4217. case Spell.Slaying:
  4218. Libraries.Magic.DrawBlend(1820 + ((int)Direction * 10) + SpellLevel * 90 + FrameIndex, DrawLocation, Color.White, true, 0.7F);
  4219. break;
  4220. case Spell.DoubleSlash:
  4221. Libraries.Magic2.DrawBlend(1960 + ((int)Direction * 10) + FrameIndex, DrawLocation, Color.White, true, 0.7F);
  4222. break;
  4223. case Spell.Thrusting:
  4224. Libraries.Magic.DrawBlend(2190 + ((int)Direction * 10) + SpellLevel * 90 + FrameIndex, DrawLocation, Color.White, true, 0.7F);
  4225. break;
  4226. case Spell.HalfMoon:
  4227. Libraries.Magic.DrawBlend(2560 + ((int)Direction * 10) + SpellLevel * 90 + FrameIndex, DrawLocation, Color.White, true, 0.7F);
  4228. break;
  4229. case Spell.TwinDrakeBlade:
  4230. Libraries.Magic2.DrawBlend(220 + ((int)Direction * 20) + FrameIndex, DrawLocation, Color.White, true, 0.7F);
  4231. break;
  4232. case Spell.CrossHalfMoon:
  4233. Libraries.Magic2.DrawBlend(40 + ((int)Direction * 10) + FrameIndex, DrawLocation, Color.White, true, 0.7F);
  4234. break;
  4235. case Spell.FlamingSword:
  4236. Libraries.Magic.DrawBlend(3480 + ((int)Direction * 10) + FrameIndex, DrawLocation, Color.White, true, 0.7F);
  4237. break;
  4238. }
  4239. break;
  4240. case MirAction.Attack4:
  4241. switch (Spell)
  4242. {
  4243. case Spell.DoubleSlash:
  4244. Libraries.Magic2.DrawBlend(2050 + ((int)Direction * 10) + FrameIndex, DrawLocation, Color.White, true, 0.7F);
  4245. break;
  4246. case Spell.TwinDrakeBlade:
  4247. Libraries.Magic2.DrawBlend(226 + ((int)Direction * 20) + FrameIndex, DrawLocation, Color.White, true, 0.7F);
  4248. break;
  4249. case Spell.FlamingSword:
  4250. Libraries.Magic.DrawBlend(3480 + ((int)Direction * 10) + FrameIndex, DrawLocation, Color.White, true, 0.7F);
  4251. break;
  4252. }
  4253. break;
  4254. }
  4255. }
  4256. public void DrawCurrentEffects()
  4257. {
  4258. if (CurrentEffect == SpellEffect.MagicShieldUp && !MagicShield)
  4259. {
  4260. MagicShield = true;
  4261. Effects.Add(ShieldEffect = new Effect(Libraries.Magic, 3890, 3, 600, this) { Repeat = true });
  4262. CurrentEffect = SpellEffect.None;
  4263. }
  4264. if (CurrentEffect == SpellEffect.ElementalBarrierUp && !ElementalBarrier)
  4265. {
  4266. ElementalBarrier = true;
  4267. Effects.Add(ElementalBarrierEffect = new Effect(Libraries.Magic3, 1890, 16, 3200, this) { Repeat = true });
  4268. CurrentEffect = SpellEffect.None;
  4269. }
  4270. if (ElementEffect > 0 && !HasElements)
  4271. {
  4272. HasElements = true;
  4273. if (ElementEffect == 4)
  4274. Effects.Add(new ElementsEffect(Libraries.Magic3, 1660, 10, 10 * 100, this, true, 4, ElementOrbMax));
  4275. else
  4276. {
  4277. if (ElementEffect >= 1)
  4278. Effects.Add(new ElementsEffect(Libraries.Magic3, 1630, 10, 10 * 100, this, true, 1, ElementOrbMax));
  4279. if (ElementEffect >= 2)
  4280. Effects.Add(new ElementsEffect(Libraries.Magic3, 1640, 10, 10 * 100, this, true, 2, ElementOrbMax));
  4281. if (ElementEffect == 3)
  4282. Effects.Add(new ElementsEffect(Libraries.Magic3, 1650, 10, 10 * 100, this, true, 3, ElementOrbMax));
  4283. }
  4284. ElementEffect = 0;
  4285. }
  4286. }
  4287. public override void DrawBlend()
  4288. {
  4289. DXManager.SetBlend(true, 0.3F);
  4290. Draw();
  4291. DXManager.SetBlend(false);
  4292. }
  4293. public void DrawBody()
  4294. {
  4295. bool oldGrayScale = DXManager.GrayScale;
  4296. Color drawColour = ApplyDrawColour();
  4297. if (BodyLibrary != null)
  4298. BodyLibrary.Draw(DrawFrame + ArmourOffSet, DrawLocation, drawColour, true);
  4299. DXManager.SetGrayscale(oldGrayScale);
  4300. //BodyLibrary.DrawTinted(DrawFrame + ArmourOffSet, DrawLocation, DrawColour, Color.DarkSeaGreen);
  4301. }
  4302. public void DrawHead()
  4303. {
  4304. if (HairLibrary != null)
  4305. HairLibrary.Draw(DrawFrame + HairOffSet, DrawLocation, DrawColour, true);
  4306. }
  4307. public void DrawWeapon()
  4308. {
  4309. if (Weapon < 0) return;
  4310. if (WeaponLibrary1 != null)
  4311. {
  4312. WeaponLibrary1.Draw(DrawFrame + WeaponOffSet, DrawLocation, DrawColour, true); //original
  4313. if (WeaponEffectLibrary1 != null)
  4314. WeaponEffectLibrary1.DrawBlend(DrawFrame + WeaponOffSet, DrawLocation, DrawColour, true, 0.4F);
  4315. }
  4316. }
  4317. public void DrawWeapon2()
  4318. {
  4319. if (Weapon == -1) return;
  4320. if (WeaponLibrary2 != null)
  4321. WeaponLibrary2.Draw(DrawFrame + WeaponOffSet, DrawLocation, DrawColour, true);
  4322. }
  4323. public void DrawWings()
  4324. {
  4325. if (WingEffect <= 0 || WingEffect >= 100) return;
  4326. if (WingLibrary != null)
  4327. WingLibrary.DrawBlend(DrawWingFrame + WingOffset, DrawLocation, DrawColour, true);
  4328. }
  4329. public void DrawMount()
  4330. {
  4331. if (MountType < 0 || !RidingMount) return;
  4332. if (MountLibrary != null)
  4333. MountLibrary.Draw(DrawFrame - 416 + MountOffset, DrawLocation, DrawColour, true);
  4334. }
  4335. private bool IsVitalEffect(Effect effect)
  4336. {
  4337. if ((effect.Library == Libraries.Magic) && (effect.BaseIndex == 3890))
  4338. return true;
  4339. if ((effect.Library == Libraries.Magic3) && (effect.BaseIndex == 1890))
  4340. return true;
  4341. return false;
  4342. }
  4343. public void GetBackStepDistance(int magicLevel)
  4344. {
  4345. JumpDistance = 0;
  4346. if (InTrapRock) return;
  4347. int travel = 0;
  4348. bool blocked = false;
  4349. int dist = (magicLevel == 0) ? 1 : magicLevel;//3 max
  4350. MirDirection jumpDir = Functions.ReverseDirection(Direction);
  4351. Point location = CurrentLocation;
  4352. for (int i = 0; i < dist; i++)//step 1t/m3
  4353. {
  4354. location = Functions.PointMove(location, jumpDir, 1);
  4355. if (!GameScene.Scene.MapControl.ValidPoint(location)) break;
  4356. CellInfo cInfo = GameScene.Scene.MapControl.M2CellInfo[location.X, location.Y];
  4357. if (cInfo.CellObjects != null)
  4358. for (int c = 0; c < cInfo.CellObjects.Count; c++)
  4359. {
  4360. MapObject ob = cInfo.CellObjects[c];
  4361. if (!ob.Blocking) continue;
  4362. blocked = true;
  4363. if ((cInfo.CellObjects == null) || blocked) break;
  4364. }
  4365. if (blocked) break;
  4366. travel++;
  4367. }
  4368. JumpDistance = travel;
  4369. }
  4370. public void GetFlashDashDistance(int magicLevel)
  4371. {
  4372. JumpDistance = 0;
  4373. if (InTrapRock) return;
  4374. int travel = 0;
  4375. bool blocked = false;
  4376. int dist = (magicLevel <= 1) ? 0 : 1;
  4377. MirDirection jumpDir = Direction;
  4378. Point location = CurrentLocation;
  4379. for (int i = 0; i < dist; i++)
  4380. {
  4381. location = Functions.PointMove(location, jumpDir, 1);
  4382. if (!GameScene.Scene.MapControl.ValidPoint(location)) break;
  4383. CellInfo cInfo = GameScene.Scene.MapControl.M2CellInfo[location.X, location.Y];
  4384. if (cInfo.CellObjects != null)
  4385. for (int c = 0; c < cInfo.CellObjects.Count; c++)
  4386. {
  4387. MapObject ob = cInfo.CellObjects[c];
  4388. if (!ob.Blocking) continue;
  4389. blocked = true;
  4390. if ((cInfo.CellObjects == null) || blocked) break;
  4391. }
  4392. if (blocked) break;
  4393. travel++;
  4394. }
  4395. JumpDistance = travel;
  4396. }
  4397. public bool IsDashAttack()
  4398. {
  4399. Point location = CurrentLocation;
  4400. location = Functions.PointMove(location, Direction, 1);
  4401. if (!GameScene.Scene.MapControl.ValidPoint(location)) return false;
  4402. CellInfo cInfo = GameScene.Scene.MapControl.M2CellInfo[location.X, location.Y];
  4403. if (cInfo.CellObjects != null)
  4404. {
  4405. for (int c = 0; c < cInfo.CellObjects.Count; c++)
  4406. {
  4407. MapObject ob = cInfo.CellObjects[c];
  4408. if (ob == this) return false;
  4409. switch (ob.Race)
  4410. {
  4411. case ObjectType.Monster:
  4412. case ObjectType.Player:
  4413. return true;
  4414. }
  4415. }
  4416. }
  4417. return false;
  4418. }
  4419. public override bool MouseOver(Point p)
  4420. {
  4421. return MapControl.MapLocation == CurrentLocation || BodyLibrary != null && BodyLibrary.VisiblePixel(DrawFrame + ArmourOffSet, p.Subtract(FinalDrawLocation), false);
  4422. }
  4423. private void CreateNameLabel()
  4424. {
  4425. for (int i = 0; i < LabelList.Count; i++)
  4426. {
  4427. if (LabelList[i].Text != Name || LabelList[i].ForeColour != NameColour) continue;
  4428. NameLabel = LabelList[i];
  4429. break;
  4430. }
  4431. if (NameLabel != null && !NameLabel.IsDisposed) return;
  4432. NameLabel = new MirLabel
  4433. {
  4434. AutoSize = true,
  4435. BackColour = Color.Transparent,
  4436. ForeColour = NameColour,
  4437. OutLine = true,
  4438. OutLineColour = Color.Black,
  4439. Text = Name,
  4440. };
  4441. NameLabel.Disposing += (o, e) => LabelList.Remove(NameLabel);
  4442. LabelList.Add(NameLabel);
  4443. }
  4444. private void CreateGuildLabel()
  4445. {
  4446. if (string.IsNullOrEmpty(GuildName))
  4447. return;
  4448. for (int i = 0; i < LabelList.Count; i++)
  4449. {
  4450. if (LabelList[i].Text != GuildName || LabelList[i].ForeColour != NameColour) continue;
  4451. GuildLabel = LabelList[i];
  4452. break;
  4453. }
  4454. if (GuildLabel != null && !GuildLabel.IsDisposed) return;
  4455. GuildLabel = new MirLabel
  4456. {
  4457. AutoSize = true,
  4458. BackColour = Color.Transparent,
  4459. ForeColour = NameColour,
  4460. OutLine = true,
  4461. OutLineColour = Color.Black,
  4462. Text = GuildName,
  4463. };
  4464. GuildLabel.Disposing += (o, e) => LabelList.Remove(GuildLabel);
  4465. LabelList.Add(GuildLabel);
  4466. }
  4467. public override void CreateLabel()
  4468. {
  4469. NameLabel = null;
  4470. GuildLabel = null;
  4471. CreateNameLabel();
  4472. CreateGuildLabel();
  4473. }
  4474. public override void DrawName()
  4475. {
  4476. CreateLabel();
  4477. if (GuildLabel != null && !string.IsNullOrEmpty(GuildName))
  4478. {
  4479. GuildLabel.Text = GuildName;
  4480. GuildLabel.Location = new Point(DisplayRectangle.X + (50 - GuildLabel.Size.Width) / 2, DisplayRectangle.Y - (19 - GuildLabel.Size.Height / 2) + (Dead ? 35 : 8)); //was 48 -
  4481. GuildLabel.Draw();
  4482. }
  4483. if (NameLabel != null)
  4484. {
  4485. NameLabel.Text = Name;
  4486. NameLabel.Location = new Point(DisplayRectangle.X + (50 - NameLabel.Size.Width) / 2, DisplayRectangle.Y - (31 - NameLabel.Size.Height / 2) + (Dead ? 35 : 8)); //was 48 -
  4487. NameLabel.Draw();
  4488. }
  4489. }
  4490. }
  4491. public class QueuedAction
  4492. {
  4493. public MirAction Action;
  4494. public Point Location;
  4495. public MirDirection Direction;
  4496. public List<object> Params;
  4497. }
  4498. }