Advertisement
Guest User

Untitled

a guest
Mar 8th, 2018
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 248.88 KB | None | 0 0
  1. Option Explicit
  2.  
  3. Dim Color_Normal(0 To 3) As Long
  4. Dim color_Conectar(0 To 3) As Long
  5.  
  6. 'particulas
  7. Private Type Particle
  8.  
  9. friction As Single
  10. X As Single
  11. Y As Single
  12. vector_x As Single
  13. vector_y As Single
  14. angle As Single
  15. grh As grh
  16. alive_counter As Long
  17. X1 As Integer
  18. X2 As Integer
  19. Y1 As Integer
  20. Y2 As Integer
  21. vecx1 As Integer
  22. vecx2 As Integer
  23. vecy1 As Integer
  24. vecy2 As Integer
  25. life1 As Long
  26. life2 As Long
  27. fric As Integer
  28. spin_speedL As Single
  29. spin_speedH As Single
  30. gravity As Boolean
  31. grav_strength As Long
  32. bounce_strength As Long
  33. spin As Boolean
  34. XMove As Boolean
  35. YMove As Boolean
  36. move_x1 As Integer
  37. move_x2 As Integer
  38. move_y1 As Integer
  39. move_y2 As Integer
  40. rgb_list(0 To 3) As Long
  41. grh_resize As Boolean
  42. grh_resizex As Integer
  43. grh_resizey As Integer
  44.  
  45. End Type
  46.  
  47. Private Type Stream
  48.  
  49. Name As String
  50. NumOfParticles As Long
  51. NumGrhs As Long
  52. id As Long
  53. X1 As Long
  54. Y1 As Long
  55. X2 As Long
  56. Y2 As Long
  57. angle As Long
  58. vecx1 As Long
  59. vecx2 As Long
  60. vecy1 As Long
  61. vecy2 As Long
  62. life1 As Long
  63. life2 As Long
  64. friction As Long
  65. spin As Byte
  66. spin_speedL As Single
  67. spin_speedH As Single
  68. AlphaBlend As Byte
  69. gravity As Byte
  70. grav_strength As Long
  71. bounce_strength As Long
  72. XMove As Byte
  73. YMove As Byte
  74. move_x1 As Long
  75. move_x2 As Long
  76. move_y1 As Long
  77. move_y2 As Long
  78. grh_list() As Long
  79.  
  80. 'Todo
  81. colortint(0 To 3) As RGB
  82.  
  83. Speed As Single
  84. life_counter As Long
  85.  
  86. End Type
  87.  
  88. 'Modified by: Ryan Cain (Onezero)
  89. 'Last modify date: 5/14/2003
  90. Private Type particle_group
  91.  
  92. active As Boolean
  93. id As Long
  94. map_x As Integer
  95. map_y As Integer
  96. char_index As Long
  97.  
  98. frame_counter As Single
  99. frame_speed As Single
  100.  
  101. stream_type As Byte
  102.  
  103. particle_stream() As Particle
  104. particle_count As Long
  105.  
  106. grh_index_list() As Long
  107. grh_index_count As Long
  108.  
  109. alpha_blend As Boolean
  110.  
  111. alive_counter As Long
  112. never_die As Boolean
  113.  
  114. X1 As Integer
  115. X2 As Integer
  116. Y1 As Integer
  117. Y2 As Integer
  118. angle As Integer
  119. vecx1 As Integer
  120. vecx2 As Integer
  121. vecy1 As Integer
  122. vecy2 As Integer
  123. life1 As Long
  124. life2 As Long
  125. fric As Long
  126. spin_speedL As Single
  127. spin_speedH As Single
  128. gravity As Boolean
  129. grav_strength As Long
  130. bounce_strength As Long
  131. spin As Boolean
  132. XMove As Boolean
  133. YMove As Boolean
  134. move_x1 As Integer
  135. move_x2 As Integer
  136. move_y1 As Integer
  137. move_y2 As Integer
  138. rgb_list(0 To 3) As Long
  139.  
  140. 'Added by Juan Martín Sotuyo Dodero
  141. Speed As Single
  142. life_counter As Long
  143.  
  144. 'Added by David Justus
  145. grh_resize As Boolean
  146. grh_resizex As Integer
  147. grh_resizey As Integer
  148.  
  149. End Type
  150.  
  151. Dim TotalStreams As Long
  152. Dim particle_group_list() As particle_group
  153. Dim particle_group_count As Long
  154. Dim particle_group_last As Long
  155. '/particulas
  156.  
  157. Public bRunning As Boolean
  158.  
  159. Private Const FVF = D3DFVF_XYZRHW Or D3DFVF_TEX1 Or D3DFVF_DIFFUSE Or D3DFVF_SPECULAR
  160. Private Const COLOR_KEY As Long = &HFF000000
  161.  
  162. Dim font_count As Long
  163. Dim font_last As Long
  164.  
  165. Private font_list() As D3DXFont
  166.  
  167. Public Enum FontAlignment
  168.  
  169. fa_center = DT_CENTER
  170. fa_top = DT_TOP
  171. fa_left = DT_LEFT
  172. fa_topleft = DT_TOP Or DT_LEFT
  173. fa_bottomleft = DT_BOTTOM Or DT_LEFT
  174. fa_bottom = DT_BOTTOM
  175. fa_right = DT_RIGHT
  176. fa_bottomright = DT_BOTTOM Or DT_RIGHT
  177. fa_topright = DT_TOP Or DT_RIGHT
  178.  
  179. End Enum
  180.  
  181. Dim Texture As Direct3DTexture8
  182. Dim TransTexture As Direct3DTexture8
  183.  
  184. Private Declare Function QueryPerformanceFrequency _
  185. Lib "kernel32" (lpFrequency As Currency) As Long
  186. Private Declare Function QueryPerformanceCounter _
  187. Lib "kernel32" (lpPerformanceCount As Currency) As Long
  188.  
  189. Public FPS As Integer
  190. Private FramesPerSecCounter As Integer
  191. Private timerElapsedTime As Single
  192. Private timerTicksPerFrame As Double
  193. Private particletimer As Single
  194. Public engineBaseSpeed As Single
  195. Private lFrameTimer As Long
  196. Private lFrameLimiter As Long
  197. Private ScrollPixelsPerFrameX As Byte
  198. Private ScrollPixelsPerFrameY As Byte
  199.  
  200. Private TileBufferPixelOffsetX As Integer
  201. Private TileBufferPixelOffsetY As Integer
  202.  
  203. Private MainViewTop As Integer
  204. Private MainViewLeft As Integer
  205. Private MainDestRect As RECT
  206. Private MainViewRect As RECT
  207. Private BackBufferRect As RECT
  208.  
  209. Private MainViewWidth As Integer
  210. Private MainViewHeight As Integer
  211.  
  212. Private MouseTileX As Byte
  213. Private MouseTileY As Byte
  214. Private RLluvia(7) As RECT 'RECT de la lluvia
  215. Private iFrameIndex As Byte 'Frame actual de la LL
  216. Private llTick As Long 'Contador
  217. Private LTLluvia(4) As Integer
  218. Private WindowTileWidth As Integer
  219. Private WindowTileHeight As Integer
  220.  
  221. Private HalfWindowTileWidth As Integer
  222. Private HalfWindowTileHeight As Integer
  223. Private Const GrhFogata As Integer = 1521
  224.  
  225. Public lastTime As Long 'Para controlar la velocidad
  226. Public fpsLastCheck As Long
  227.  
  228. Dim bump_map_supported As Boolean
  229. 'Sets a Grh animation to loop indefinitely.
  230.  
  231. #Const HARDCODED = False 'True ' == MÁS FPS ^^
  232.  
  233. Private Function GetElapsedTime() As Single
  234. '**************************************************************
  235. 'Author: Aaron Perkins
  236. 'Last Modify Date: 10/07/2002
  237. 'Gets the time that past since the last call
  238. '**************************************************************
  239. Dim start_time As Currency
  240. Static end_time As Currency
  241. Static timer_freq As Currency
  242.  
  243. 'Get the timer frequency
  244. If timer_freq = 0 Then
  245. QueryPerformanceFrequency timer_freq
  246.  
  247. End If
  248.  
  249. 'Get current time
  250. Call QueryPerformanceCounter(start_time)
  251.  
  252. 'Calculate elapsed time
  253. GetElapsedTime = (start_time - end_time) / timer_freq * 1000
  254.  
  255. 'Get next end time
  256. Call QueryPerformanceCounter(end_time)
  257.  
  258. End Function
  259.  
  260. Public Sub Text_Render(ByVal font As D3DXFont, _
  261. ByVal Text As String, _
  262. ByVal top As Long, _
  263. ByVal left As Long, _
  264. ByVal Width As Long, _
  265. ByVal Height As Long, _
  266. ByVal Color As Long, _
  267. ByVal format As Long, _
  268. Optional ByVal Shadow As Boolean = False, _
  269. Optional ByVal Nombre As Byte, _
  270. Optional ByVal Rojo As Byte, _
  271. Optional ByVal Verde As Byte, _
  272. Optional ByVal Azul As Byte)
  273. '*****************************************************
  274. '****** Coded by Menduz (lord.yo.wo@gmail.com) *******
  275. '*****************************************************
  276. Dim TextRect As RECT
  277. Dim ShadowRect As RECT
  278.  
  279. TextRect.top = top
  280. TextRect.left = left
  281. TextRect.bottom = top + Height
  282. TextRect.Right = left + Width
  283.  
  284. If Shadow Then
  285. ShadowRect.top = top - 1
  286. ShadowRect.left = left - 2
  287. ShadowRect.bottom = (top + Height) - 1
  288. ShadowRect.Right = (left + Width) - 2
  289.  
  290. End If
  291.  
  292. D3DX.DrawText font, Color, Text, TextRect, format
  293.  
  294. End Sub
  295.  
  296. Public Sub Text_Render_Inventario(ByVal font As D3DXFont, _
  297. ByVal Text As String, _
  298. ByVal top As Long, _
  299. ByVal left As Long, _
  300. ByVal Width As Long, _
  301. ByVal Height As Long, _
  302. ByVal Color As Long, _
  303. ByVal format As Long, _
  304. Optional ByVal Shadow As Boolean = False)
  305. '*****************************************************
  306. '****** Coded by Menduz (lord.yo.wo@gmail.com) *******
  307. ' editado por: juanjo
  308. '*****************************************************
  309. Dim TextRect As RECT
  310. Dim ShadowRect As RECT
  311.  
  312. TextRect.top = top
  313. TextRect.left = left
  314. TextRect.bottom = top + Height
  315. TextRect.Right = left + Width
  316.  
  317. If Shadow Then
  318. ShadowRect.top = top - 1
  319. ShadowRect.left = left - 2
  320. ShadowRect.bottom = (top + Height) - 1
  321. ShadowRect.Right = (left + Width) - 2
  322.  
  323. 'D3DX.DrawText font, &HFF000000, Text, ShadowRect, format
  324. 'D3DX.DrawText font, D3DColorXRGB(0, 255, 0), Text, ShadowRect, format
  325. End If
  326.  
  327. D3DX.DrawText font, Color, Text, TextRect, format
  328.  
  329. End Sub
  330.  
  331. Public Sub Text_Render_ext(ByVal Text As String, _
  332. ByVal top As Long, _
  333. ByVal left As Long, _
  334. ByVal Width As Long, _
  335. ByVal Height As Long, _
  336. ByVal Color As Long, _
  337. Optional ByVal Shadow As Boolean = False, _
  338. Optional ByVal Center As Boolean = False)
  339.  
  340. If Center = True Then
  341. Call Text_Render_Inventario(font_list(1), Text, top, left, Width, Height, Color, fa_center, Shadow)
  342. Else
  343. Call Text_Render_Inventario(font_list(1), Text, top, left, Width, Height, Color, DT_TOP Or DT_LEFT, Shadow)
  344.  
  345. End If
  346.  
  347. End Sub
  348.  
  349. Private Sub Font_Make(ByVal font_index As Long, _
  350. ByVal style As String, _
  351. ByVal bold As Boolean, _
  352. ByVal italic As Boolean, _
  353. ByVal size As Long)
  354.  
  355. If font_index > font_last Then
  356. font_last = font_index
  357. ReDim Preserve font_list(1 To font_last)
  358.  
  359. End If
  360.  
  361. font_count = font_count + 1
  362.  
  363. Dim font_desc As IFont
  364. Dim fnt As New StdFont
  365. fnt.Name = style
  366. fnt.size = size
  367. fnt.bold = bold
  368. fnt.italic = italic
  369.  
  370. Set font_desc = fnt
  371. Set font_list(font_index) = D3DX.CreateFont(D3DDevice, font_desc.hFont)
  372.  
  373. End Sub
  374.  
  375. Public Function Font_Create(ByVal style As String, _
  376. ByVal size As Long, _
  377. ByVal bold As Boolean, _
  378. ByVal italic As Boolean) As Long
  379.  
  380. On Error GoTo ErrorHandler:
  381.  
  382. Font_Create = Font_Next_Open
  383. Font_Make Font_Create, style, bold, italic, size
  384. ErrorHandler:
  385. Font_Create = 0
  386.  
  387. End Function
  388.  
  389. Private Function Font_Next_Open() As Long
  390. Font_Next_Open = font_last + 1
  391.  
  392. End Function
  393.  
  394. Private Function Font_Check(ByVal font_index As Long) As Boolean
  395.  
  396. '*****************************************************
  397. '****** Coded by Menduz (lord.yo.wo@gmail.com) *******
  398. '*****************************************************
  399. If font_index > 0 And font_index <= font_last Then
  400. Font_Check = True
  401.  
  402. End If
  403.  
  404. End Function
  405.  
  406. Function MakeVector(ByVal X As Single, ByVal Y As Single, ByVal Z As Single) As D3DVECTOR
  407. '*****************************************************
  408. '****** Coded by Menduz (lord.yo.wo@gmail.com) *******
  409. '*****************************************************
  410. MakeVector.X = X
  411. MakeVector.Y = Y
  412. MakeVector.Z = Z
  413.  
  414. End Function
  415.  
  416. Public Sub Engine_Init()
  417. '*****************************************************
  418. '****** Coded by Menduz (lord.yo.wo@gmail.com) *******
  419. '*****************************************************
  420. 'On Error GoTo ErrHandler:
  421.  
  422. Dim DispMode As D3DDISPLAYMODE
  423. Dim DispModeBK As D3DDISPLAYMODE
  424. Dim D3DWindow As D3DPRESENT_PARAMETERS
  425. Dim ColorKeyVal As Long
  426.  
  427. Set SurfaceDB = New clsSurfaceManDynDX8
  428.  
  429. Set dX = New DirectX8
  430. Set D3D = dX.Direct3DCreate()
  431. Set D3DX = New D3DX8
  432.  
  433. D3D.GetAdapterDisplayMode D3DADAPTER_DEFAULT, DispMode
  434. D3D.GetAdapterDisplayMode D3DADAPTER_DEFAULT, DispModeBK
  435.  
  436. With D3DWindow
  437. .Windowed = True
  438. .SwapEffect = D3DSWAPEFFECT_COPY
  439. .BackBufferFormat = DispMode.format
  440. .BackBufferWidth = 800
  441. .BackBufferHeight = 600
  442. .EnableAutoDepthStencil = 1
  443. .AutoDepthStencilFormat = D3DFMT_D16
  444. .hDeviceWindow = frmMain.renderer.hWnd
  445.  
  446. End With
  447.  
  448. DispMode.format = D3DFMT_X8R8G8B8
  449.  
  450. If D3D.CheckDeviceFormat(0, D3DDEVTYPE_HAL, DispMode.format, 0, D3DRTYPE_TEXTURE, D3DFMT_A8R8G8B8) = D3D_OK Then
  451. Dim Caps8 As D3DCAPS8
  452. D3D.GetDeviceCaps 0, D3DDEVTYPE_HAL, Caps8
  453.  
  454. If (Caps8.TextureOpCaps And D3DTEXOPCAPS_DOTPRODUCT3) = D3DTEXOPCAPS_DOTPRODUCT3 Then
  455. bump_map_supported = True
  456. Else
  457. bump_map_supported = False
  458. DispMode.format = DispModeBK.format
  459.  
  460. End If
  461.  
  462. Else
  463. bump_map_supported = False
  464. DispMode.format = DispModeBK.format
  465.  
  466. End If
  467.  
  468. Set D3DDevice = D3D.CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, frmMain.renderer.hWnd, _
  469. D3DCREATE_SOFTWARE_VERTEXPROCESSING, D3DWindow)
  470.  
  471. HalfWindowTileHeight = (frmMain.renderer.ScaleHeight / 32) \ 2
  472. HalfWindowTileWidth = (frmMain.renderer.ScaleWidth / 32) \ 2
  473.  
  474. TileBufferSize = 9
  475. TileBufferPixelOffsetX = (TileBufferSize - 1) * 32
  476. TileBufferPixelOffsetY = (TileBufferSize - 1) * 32
  477.  
  478. D3DDevice.SetVertexShader FVF
  479.  
  480. '//Transformed and lit vertices dont need lighting
  481. ' so we disable it...
  482. D3DDevice.SetRenderState D3DRS_LIGHTING, False
  483.  
  484. D3DDevice.SetRenderState D3DRS_SRCBLEND, D3DBLEND_SRCALPHA
  485. D3DDevice.SetRenderState D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA
  486. D3DDevice.SetRenderState D3DRS_ALPHABLENDENABLE, True
  487.  
  488. Call SurfaceDB.Init(D3DX, D3DDevice, 90)
  489.  
  490. engineBaseSpeed = 0.016
  491.  
  492. ReDim MapData(XMinMapSize To XMaxMapSize, YMinMapSize To YMaxMapSize) As MapBlock
  493.  
  494. ScrollPixelsPerFrameX = 9
  495. ScrollPixelsPerFrameY = 9
  496.  
  497. UserPos.X = 50
  498. UserPos.Y = 50
  499.  
  500. MinXBorder = XMinMapSize + (frmMain.renderer.ScaleWidth / 64)
  501. MaxXBorder = XMaxMapSize - (frmMain.renderer.ScaleWidth / 64)
  502. MinYBorder = YMinMapSize + (frmMain.renderer.ScaleHeight / 64)
  503. MaxYBorder = YMaxMapSize - (frmMain.renderer.ScaleHeight / 64)
  504.  
  505. Texto.Engine_Init_FontSettings
  506. Texto.Engine_Init_FontTextures
  507.  
  508. Color_Normal(0) = d3dcolorxrgb(255, 255, 255)
  509. Color_Normal(1) = Color_Normal(0)
  510. Color_Normal(2) = Color_Normal(0)
  511. Color_Normal(3) = Color_Normal(0)
  512.  
  513. color_Conectar(0) = d3dcolorxrgb(120, 120, 120)
  514. color_Conectar(1) = color_Conectar(0)
  515. color_Conectar(2) = color_Conectar(0)
  516. color_Conectar(3) = color_Conectar(0)
  517.  
  518. 'partículas
  519.  
  520. 'D3DDevice.SetRenderState D3DRS_POINTSPRITE_ENABLE, 1
  521. 'D3DDevice.SetRenderState D3DRS_POINTSCALE_ENABLE, 0
  522.  
  523. Font_Create "Tahoma", 8, True, 0
  524. 'Font_Create "Verdana", 8, False, 0
  525.  
  526. bRunning = True
  527. Exit Sub
  528. ErrHandler:
  529. Debug.Print "Error Number Returned: " & Err.Number
  530. bRunning = False
  531.  
  532. End Sub
  533.  
  534. Public Sub Engine_Deinit()
  535. Erase MapData
  536. Erase charlist
  537. Set D3DDevice = Nothing
  538. Set D3D = Nothing
  539. Set dX = Nothing
  540. End
  541.  
  542. End Sub
  543.  
  544. Private Function CreateTLVertex(X As Single, _
  545. Y As Single, _
  546. Z As Single, _
  547. rhw As Single, _
  548. Color As Long, _
  549. Specular As Long, _
  550. tu As Single, _
  551. tv As Single) As TLVERTEX
  552. '*****************************************************
  553. '****** Coded by Menduz (lord.yo.wo@gmail.com) *******
  554. '*****************************************************
  555. CreateTLVertex.X = X
  556. CreateTLVertex.Y = Y
  557. CreateTLVertex.Z = Z
  558. CreateTLVertex.rhw = rhw
  559. CreateTLVertex.Color = Color
  560. CreateTLVertex.Specular = Specular
  561. CreateTLVertex.tu = tu
  562. CreateTLVertex.tv = tv
  563.  
  564. End Function
  565.  
  566. Public Sub Engine_ActFPS()
  567.  
  568. If frmMain.Visible = True Then
  569. If mode = True Then
  570. TechoDesv.AlphaX = TechoDesv.AlphaX + 1
  571.  
  572. If TechoDesv.AlphaX > 130 And TechoDesv.AlphaX < 140 Then
  573. TechoDesv.AlphaX = 130
  574. mode = False
  575.  
  576. End If
  577.  
  578. Else
  579. TechoDesv.AlphaX = TechoDesv.AlphaX - 1
  580.  
  581. If TechoDesv.AlphaX < 10 And TechoDesv.AlphaX > 5 Then
  582. TechoDesv.AlphaX = 5
  583. mode = True
  584.  
  585. End If
  586.  
  587. End If
  588.  
  589. If bTecho Then
  590. If Not Val(AlphaY) = 10 Then AlphaY = Val(AlphaY) - 1
  591. Else
  592.  
  593. If Not AlphaY = 130 Then AlphaY = AlphaY + 1
  594.  
  595. End If
  596.  
  597. End If
  598.  
  599. temp_rgb(0) = D3DColorARGB(AlphaY, AlphaY, AlphaY, AlphaY)
  600. temp_rgb(1) = D3DColorARGB(AlphaY, AlphaY, AlphaY, AlphaY)
  601. temp_rgb(2) = D3DColorARGB(AlphaY, AlphaY, AlphaY, AlphaY)
  602. temp_rgb(3) = D3DColorARGB(AlphaY, AlphaY, AlphaY, AlphaY)
  603.  
  604. LuzGrh(0) = D3DColorARGB(TechoDesv.AlphaX, TechoDesv.AlphaX, TechoDesv.AlphaX, TechoDesv.AlphaX)
  605. LuzGrh(1) = D3DColorARGB(TechoDesv.AlphaX, TechoDesv.AlphaX, TechoDesv.AlphaX, TechoDesv.AlphaX)
  606. LuzGrh(2) = D3DColorARGB(TechoDesv.AlphaX, TechoDesv.AlphaX, TechoDesv.AlphaX, TechoDesv.AlphaX)
  607. LuzGrh(3) = D3DColorARGB(TechoDesv.AlphaX, TechoDesv.AlphaX, TechoDesv.AlphaX, TechoDesv.AlphaX)
  608.  
  609. LuzMuerto = D3DColorARGB(255, 255, 255, 255)
  610.  
  611. If GetTickCount - lFrameTimer > 1000 Then
  612. FPS = FramesPerSecCounter
  613. FramesPerSecCounter = 0
  614. lFrameTimer = GetTickCount
  615.  
  616. End If
  617.  
  618. End Sub
  619.  
  620. Function InMapBounds(ByVal X As Integer, ByVal Y As Integer) As Boolean
  621.  
  622. '*****************************************************************
  623. 'Checks to see if a tile position is in the maps bounds
  624. '*****************************************************************
  625. If X < XMinMapSize Or X > XMaxMapSize Or Y < YMinMapSize Or Y > YMaxMapSize Then
  626. Exit Function
  627.  
  628. End If
  629.  
  630. InMapBounds = True
  631.  
  632. End Function
  633.  
  634. Public Sub Draw_Grhindex(ByVal grh_index As Integer, _
  635. ByVal X As Integer, _
  636. ByVal Y As Integer)
  637.  
  638. If grh_index <= 0 Then Exit Sub
  639.  
  640.  
  641. Device_Box_Textured_Render grh_index, X, Y, GrhData(grh_index).pixelWidth, GrhData(grh_index).pixelHeight, _
  642. Color_Normal, GrhData(grh_index).sX, GrhData(grh_index).sY
  643.  
  644. End Sub
  645.  
  646. 'AURASSSSSSSS
  647. Private Sub Draw_Aura(ByRef grh As grh, _
  648. ByVal X As Integer, _
  649. ByVal Y As Integer, _
  650. ByVal Center As Byte, _
  651. ByVal Animate As Byte, _
  652. Optional ByVal Alpha As Boolean, _
  653. Optional ByVal angle As Single)
  654.  
  655. Dim CurrentGrhIndex As Integer
  656. Dim Light(3) As Long
  657.  
  658. If grh.grhindex = 0 Then Exit Sub
  659.  
  660. If Animate Then
  661. If grh.Started = 1 Then
  662. grh.FrameCounter = grh.FrameCounter + (timerElapsedTime * GrhData(grh.grhindex).NumFrames / grh.Speed)
  663.  
  664. If grh.FrameCounter > GrhData(grh.grhindex).NumFrames Then
  665. grh.FrameCounter = (grh.FrameCounter Mod GrhData(grh.grhindex).NumFrames) + 1
  666.  
  667. If grh.Loops <> -1 Then
  668. If grh.Loops > 0 Then
  669. grh.Loops = grh.Loops - 1
  670. Else
  671. grh.Started = 0
  672.  
  673. End If
  674.  
  675. End If
  676.  
  677. End If
  678.  
  679. End If
  680.  
  681. End If
  682.  
  683. 'Figure out what frame to draw (always 1 if not animated)
  684. CurrentGrhIndex = GrhData(grh.grhindex).Frames(grh.FrameCounter)
  685.  
  686. 'Center Grh over X,Y pos
  687. If Center Then
  688.  
  689. If GrhData(CurrentGrhIndex).TileWidth <> 1 Then
  690. X = X - Int(GrhData(CurrentGrhIndex).TileWidth * (32 \ 2)) + 32 \ 2
  691.  
  692. End If
  693.  
  694. If GrhData(grh.grhindex).TileHeight <> 1 Then
  695. Y = Y - Int(GrhData(CurrentGrhIndex).TileHeight * 32) + 32
  696.  
  697. End If
  698.  
  699. End If
  700.  
  701. Light(0) = d3dcolorxrgb(LuchoAuraR, LuchoAuraG, LuchoAuraB)
  702. Light(1) = Light(0)
  703. Light(2) = Light(0)
  704. Light(3) = Light(0)
  705.  
  706. Device_Box_Textured_Render CurrentGrhIndex, X, Y, GrhData(CurrentGrhIndex).pixelWidth, GrhData( _
  707. CurrentGrhIndex).pixelHeight, Light(), GrhData(CurrentGrhIndex).sX, GrhData(CurrentGrhIndex).sY, Alpha, _
  708. angle
  709.  
  710. End Sub
  711.  
  712. Private Sub Draw_Grh(ByRef grh As grh, _
  713. ByVal X As Integer, _
  714. ByVal Y As Integer, _
  715. ByVal Center As Byte, _
  716. ByVal Animate As Byte, _
  717. ByRef Color() As Long, _
  718. Optional ByVal Alpha As Boolean, _
  719. Optional ByVal angle As Single, _
  720. Optional ByVal Invert_x As Boolean = False, _
  721. Optional ByVal Invert_y As Boolean = False)
  722.  
  723. Dim CurrentGrhIndex As Integer
  724.  
  725. If grh.grhindex = 0 Then Exit Sub
  726.  
  727. If Animate Then
  728. If grh.Started = 1 Then
  729. If Not Invert_y Then
  730. grh.FrameCounter = grh.FrameCounter + (timerElapsedTime * GrhData(grh.grhindex).NumFrames / grh.Speed)
  731. Else
  732. grh.FrameCounter = grh.FrameCounter
  733.  
  734. End If
  735.  
  736. If grh.FrameCounter > GrhData(grh.grhindex).NumFrames Then
  737. grh.FrameCounter = (grh.FrameCounter Mod GrhData(grh.grhindex).NumFrames) + 1
  738.  
  739. If grh.Loops <> -1 Then
  740. If grh.Loops > 0 Then
  741. grh.Loops = grh.Loops - 1
  742. Else
  743. grh.Started = 0
  744.  
  745. End If
  746.  
  747. End If
  748.  
  749. End If
  750.  
  751. End If
  752.  
  753. End If
  754.  
  755. 'Figure out what frame to draw (always 1 if not animated)
  756. CurrentGrhIndex = GrhData(grh.grhindex).Frames(grh.FrameCounter)
  757.  
  758. 'Center Grh over X,Y pos
  759. If Center Then
  760. If GrhData(CurrentGrhIndex).TileWidth <> 1 Then
  761. X = X - Int(GrhData(CurrentGrhIndex).TileWidth * (32 \ 2)) + 32 \ 2
  762.  
  763. End If
  764.  
  765. If GrhData(grh.grhindex).TileHeight <> 1 Then
  766. Y = Y - Int(GrhData(CurrentGrhIndex).TileHeight * 32) + 32
  767.  
  768. End If
  769.  
  770. End If
  771.  
  772. Device_Box_Textured_Render CurrentGrhIndex, X, Y, GrhData(CurrentGrhIndex).pixelWidth, GrhData( _
  773. CurrentGrhIndex).pixelHeight, Color, GrhData(CurrentGrhIndex).sX, GrhData( _
  774. CurrentGrhIndex).sY, Alpha, angle, 0, Invert_x, Invert_y
  775. 'exits:
  776.  
  777. End Sub
  778.  
  779. Sub ShowNextFrame()
  780. Static OffsetCounterX As Single
  781. Static OffsetCounterY As Single
  782.  
  783. If UserMoving Then
  784.  
  785. '****** Move screen Left and Right if needed ******
  786. If AddtoUserPos.X <> 0 Then
  787. OffsetCounterX = OffsetCounterX - ScrollPixelsPerFrameX * AddtoUserPos.X * timerTicksPerFrame
  788.  
  789. If Abs(OffsetCounterX) >= Abs(32 * AddtoUserPos.X) Then
  790. OffsetCounterX = 0
  791. AddtoUserPos.X = 0
  792. UserMoving = False
  793.  
  794. End If
  795.  
  796. End If
  797.  
  798. '****** Move screen Up and Down if needed ******
  799. If AddtoUserPos.Y <> 0 Then
  800. OffsetCounterY = OffsetCounterY - ScrollPixelsPerFrameY * AddtoUserPos.Y * timerTicksPerFrame
  801.  
  802. If Abs(OffsetCounterY) >= Abs(32 * AddtoUserPos.Y) Then
  803. OffsetCounterY = 0
  804. AddtoUserPos.Y = 0
  805. UserMoving = False
  806.  
  807. End If
  808.  
  809. End If
  810.  
  811. End If
  812.  
  813. Call RenderScreen(UserPos.X - AddtoUserPos.X, UserPos.Y - AddtoUserPos.Y, OffsetCounterX, OffsetCounterY)
  814. engine.Engine_ActFPS
  815.  
  816. End Sub
  817.  
  818. Sub RenderScreen(ByVal tilex As Integer, _
  819. ByVal tiley As Integer, _
  820. ByVal PixelOffsetX As Integer, _
  821. ByVal PixelOffsetY As Integer)
  822.  
  823. '**************************************************************
  824. 'Author: Aaron Perkins
  825. 'Last Modify Date: 8/14/2007
  826. 'Last modified by: Juan Martín Sotuyo Dodero (Maraxus)
  827. 'Renders everything to the viewport
  828. '**************************************************************
  829. ' On Error Resume Next
  830.  
  831. Dim Y As Long 'Keeps track of where on map we are
  832. Dim X As Long 'Keeps track of where on map we are
  833. Dim screenminY As Integer 'Start Y pos on current screen
  834. Dim screenmaxY As Integer 'End Y pos on current screen
  835. Dim screenminX As Integer 'Start X pos on current screen
  836. Dim screenmaxX As Integer 'End X pos on current screen
  837. Dim minY As Integer 'Start Y pos on current map
  838. Dim maxY As Integer 'End Y pos on current map
  839. Dim minX As Integer 'Start X pos on current map
  840. Dim maxX As Integer 'End X pos on current map
  841. Dim ScreenX As Integer 'Keeps track of where to place tile on screen
  842. Dim ScreenY As Integer 'Keeps track of where to place tile on screen
  843. Dim minXOffset As Integer
  844. Dim minYOffset As Integer
  845. Dim PixelOffsetXTemp As Integer 'For centering grhs
  846. Dim PixelOffsetYTemp As Integer 'For centering grhs
  847. Dim CurrentGrhIndex As Integer
  848. Dim offx As Integer
  849. Dim offy As Integer
  850. Dim I As Byte
  851.  
  852. 'Figure out Ends and Starts of screen
  853. screenminY = tiley - HalfWindowTileHeight
  854. screenmaxY = tiley + HalfWindowTileHeight
  855. screenminX = tilex - HalfWindowTileWidth
  856. screenmaxX = tilex + HalfWindowTileWidth
  857.  
  858. minY = screenminY - TileBufferSize
  859. maxY = screenmaxY + TileBufferSize
  860. minX = screenminX - TileBufferSize
  861. maxX = screenmaxX + TileBufferSize
  862.  
  863. 'Make sure mins and maxs are allways in map bounds
  864. If minY < XMinMapSize Then
  865. minYOffset = YMinMapSize - minY
  866. minY = YMinMapSize
  867.  
  868. End If
  869.  
  870. If maxY > YMaxMapSize Then maxY = YMaxMapSize
  871.  
  872. If minX < XMinMapSize Then
  873. minXOffset = XMinMapSize - minX
  874. minX = XMinMapSize
  875.  
  876. End If
  877.  
  878. If maxX > XMaxMapSize Then maxX = XMaxMapSize
  879.  
  880. 'If we can, we render around the view area to make it smoother
  881. If screenminY > YMinMapSize Then
  882. screenminY = screenminY - 1
  883. Else
  884. screenminY = 1
  885. ScreenY = 1
  886.  
  887. End If
  888.  
  889. If screenmaxY < YMaxMapSize Then screenmaxY = screenmaxY + 1
  890.  
  891. If screenminX > XMinMapSize Then
  892. screenminX = screenminX - 1
  893. Else
  894. screenminX = 1
  895. ScreenX = 1
  896.  
  897. End If
  898.  
  899. If screenmaxX < XMaxMapSize Then screenmaxX = screenmaxX + 1
  900.  
  901. 'Draw floor layer
  902. For Y = screenminY To screenmaxY
  903. For X = screenminX To screenmaxX
  904. 'Layer 1 **********************************
  905.  
  906.  
  907. Call Draw_Grh(MapData(X, Y).Graphic(1), (ScreenX - 1) * 32 + PixelOffsetX, (ScreenY - 1) * 32 + _
  908. PixelOffsetY, 0, 1, MapData(X, Y).light_value)
  909.  
  910. If MapData(X, Y).Graphic(2).grhindex <> 0 Then
  911. Call Draw_Grh(MapData(X, Y).Graphic(2), (ScreenX - 1) * 32 + PixelOffsetX, (ScreenY - 1) * 32 + _
  912. PixelOffsetY, 1, 1, MapData(X, Y).light_value)
  913.  
  914. End If
  915.  
  916.  
  917. '******************************************
  918. ScreenX = ScreenX + 1
  919. Next X
  920.  
  921. 'Reset ScreenX to original value and increment ScreenY
  922. ScreenX = ScreenX - X + screenminX
  923. ScreenY = ScreenY + 1
  924. Next Y
  925.  
  926. ScreenY = minYOffset - TileBufferSize
  927.  
  928. For Y = minY To maxY
  929. ScreenX = minXOffset - TileBufferSize
  930.  
  931. For X = minX To maxX
  932. PixelOffsetXTemp = ScreenX * 32 + PixelOffsetX
  933. PixelOffsetYTemp = ScreenY * 32 + PixelOffsetY
  934.  
  935. With MapData(X, Y)
  936. '******************************************
  937.  
  938. 'Object Layer **********************************
  939. If .ObjGrh.grhindex <> 0 Then
  940. Call Draw_Grh(.ObjGrh, PixelOffsetXTemp, PixelOffsetYTemp, 1, 1, MapData(X, Y).light_value)
  941.  
  942. End If
  943.  
  944. '***********************************************
  945.  
  946. 'Char layer ************************************
  947. If .charindex <> 0 Then
  948. Call Char_Render(.charindex, PixelOffsetXTemp, PixelOffsetYTemp, MapData(X, Y).light_value)
  949.  
  950. End If
  951.  
  952. '*************************************************
  953.  
  954. 'Layer 3 *****************************************
  955. If .Graphic(3).grhindex <> 0 Then
  956. Call Draw_Grh(.Graphic(3), PixelOffsetXTemp, PixelOffsetYTemp, 1, 1, MapData(X, Y).light_value)
  957.  
  958. End If
  959.  
  960. '************************************************
  961.  
  962. End With
  963.  
  964. ScreenX = ScreenX + 1
  965. Next X
  966.  
  967. ScreenY = ScreenY + 1
  968. Next Y
  969.  
  970. ScreenY = minYOffset - 5
  971. D3DDevice.SetRenderState D3DRS_SRCBLEND, D3DBLEND_ONE
  972. D3DDevice.SetRenderState D3DRS_DESTBLEND, D3DBLEND_ONE
  973.  
  974. ScreenY = minYOffset - TileBufferSize
  975.  
  976. For Y = minY To maxY
  977. ScreenX = minXOffset - TileBufferSize
  978.  
  979. For X = minX To maxX
  980.  
  981. With MapData(X, Y)
  982.  
  983. '***********************************************
  984. If .particle_group > 0 Then
  985.  
  986. Particle_Group_Render .particle_group, ScreenX * 32 + PixelOffsetX, ScreenY * 32 + PixelOffsetY
  987.  
  988. End If
  989.  
  990. End With
  991.  
  992. ScreenX = ScreenX + 1
  993. Next X
  994.  
  995. ScreenY = ScreenY + 1
  996. Next Y
  997.  
  998. D3DDevice.SetRenderState D3DRS_SRCBLEND, D3DBLEND_SRCALPHA
  999. D3DDevice.SetRenderState D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA
  1000.  
  1001. If bTecho Then
  1002. 'Draw blocked tiles and grid
  1003. ScreenY = minYOffset - TileBufferSize
  1004.  
  1005. For Y = minY To maxY
  1006. ScreenX = minXOffset - TileBufferSize
  1007.  
  1008. For X = minX To maxX
  1009.  
  1010. 'Layer 4 **********************************
  1011. If MapData(X, Y).Graphic(4).grhindex Then
  1012. Call Grh_Render(MapData(X, Y).Graphic(4), ScreenX * 32 + PixelOffsetX, ScreenY * 32 + _
  1013. PixelOffsetY, temp_rgb(), , , 1)
  1014.  
  1015. End If
  1016.  
  1017. '**********************************
  1018.  
  1019. ScreenX = ScreenX + 1
  1020. Next X
  1021.  
  1022. ScreenY = ScreenY + 1
  1023. Next Y
  1024.  
  1025. Else
  1026. ScreenY = minYOffset - TileBufferSize
  1027.  
  1028. For Y = minY To maxY
  1029. ScreenX = minXOffset - TileBufferSize
  1030.  
  1031. For X = minX To maxX
  1032.  
  1033. 'Layer 4 **********************************
  1034. If MapData(X, Y).Graphic(4).grhindex Then
  1035. If AlphaY = 130 Then
  1036. Call Draw_Grh(MapData(X, Y).Graphic(4), ScreenX * 32 + PixelOffsetX, ScreenY * 32 + _
  1037. PixelOffsetY, 1, 0, MapData(X, Y).light_value)
  1038. Else
  1039. Call Grh_Render(MapData(X, Y).Graphic(4), ScreenX * 32 + PixelOffsetX, ScreenY * 32 + _
  1040. PixelOffsetY, temp_rgb(), , , 1)
  1041.  
  1042. End If
  1043.  
  1044. End If
  1045.  
  1046. '**********************************
  1047.  
  1048. ScreenX = ScreenX + 1
  1049. Next X
  1050.  
  1051. ScreenY = ScreenY + 1
  1052. Next Y
  1053.  
  1054. End If
  1055.  
  1056. If Not NickAmiguito(1) = "" Then
  1057. If MouseNickAmiguito = 1 Then
  1058. Draw_FilledBox 105, 390, (((500) / (200 + 1 / 200)) * 32), 16, D3DColorARGB(255, 136, 40, 40), _
  1059. D3DColorARGB(255, 136, 0, 21)
  1060. ElseIf CartelAmiguito(1) = 1 Then
  1061. Draw_FilledBox 105, 390, (((500) / (200 + 1 / 200)) * 32), 16, D3DColorARGB(255, 60, 60, 0), D3DColorARGB( _
  1062. 255, 0, 0, 0)
  1063. Else
  1064. Draw_FilledBox 105, 390, (((500) / (200 + 1 / 200)) * 32), 16, D3DColorARGB(255, 40, 40, 40), _
  1065. D3DColorARGB(255, 0, 0, 0)
  1066.  
  1067. End If
  1068.  
  1069. Text_Render font_list(1), NickAmiguito(1), 390, 59, 169, 22, D3DColorARGB(200, 255, 255, 255), DT_CENTER, True
  1070.  
  1071. End If
  1072.  
  1073. If Not NickAmiguito(2) = "" Then
  1074. If MouseNickAmiguito = 2 Then
  1075. Draw_FilledBox 185, 390, (((500) / (200 + 1 / 200)) * 32), 16, D3DColorARGB(255, 136, 40, 40), _
  1076. D3DColorARGB(255, 136, 0, 21)
  1077. ElseIf CartelAmiguito(2) = 1 Then
  1078. Draw_FilledBox 185, 390, (((500) / (200 + 1 / 200)) * 32), 16, D3DColorARGB(255, 60, 60, 0), D3DColorARGB( _
  1079. 255, 0, 0, 0)
  1080. Else
  1081. Draw_FilledBox 185, 390, (((500) / (200 + 1 / 200)) * 32), 16, D3DColorARGB(255, 40, 40, 40), _
  1082. D3DColorARGB(255, 0, 0, 0)
  1083.  
  1084. End If
  1085.  
  1086. Text_Render font_list(1), NickAmiguito(2), 391, 140, 169, 21, D3DColorARGB(200, 255, 255, 255), DT_CENTER, False
  1087.  
  1088. End If
  1089.  
  1090. If Not NickAmiguito(3) = "" Then
  1091. If MouseNickAmiguito = 3 Then
  1092. Draw_FilledBox 265, 390, (((500) / (200 + 1 / 200)) * 32), 16, D3DColorARGB(255, 136, 40, 40), _
  1093. D3DColorARGB(255, 136, 0, 21)
  1094. ElseIf CartelAmiguito(3) = 1 Then
  1095. Draw_FilledBox 265, 390, (((500) / (200 + 1 / 200)) * 32), 16, D3DColorARGB(255, 60, 60, 0), D3DColorARGB( _
  1096. 255, 0, 0, 0)
  1097. Else
  1098. Draw_FilledBox 265, 390, (((500) / (200 + 1 / 200)) * 32), 16, D3DColorARGB(255, 40, 40, 40), _
  1099. D3DColorARGB(255, 0, 0, 0)
  1100.  
  1101. End If
  1102.  
  1103. Text_Render font_list(1), NickAmiguito(3), 391, 220, 169, 21, D3DColorARGB(200, 255, 255, 255), DT_CENTER, False
  1104.  
  1105. End If
  1106.  
  1107. If Not NickAmiguito(4) = "" Then
  1108. If MouseNickAmiguito = 4 Then
  1109. Draw_FilledBox 343, 390, (((500) / (200 + 1 / 200)) * 32), 16, D3DColorARGB(255, 136, 40, 40), _
  1110. D3DColorARGB(255, 136, 0, 21)
  1111. ElseIf CartelAmiguito(4) = 1 Then
  1112. Draw_FilledBox 343, 390, (((500) / (200 + 1 / 200)) * 32), 16, D3DColorARGB(255, 60, 60, 0), D3DColorARGB( _
  1113. 255, 0, 0, 0)
  1114. Else
  1115. Draw_FilledBox 343, 390, (((500) / (200 + 1 / 200)) * 32), 16, D3DColorARGB(255, 40, 40, 40), _
  1116. D3DColorARGB(255, 0, 0, 0)
  1117.  
  1118. End If
  1119.  
  1120. Text_Render font_list(1), NickAmiguito(4), 391, 296, 169, 21, D3DColorARGB(200, 255, 255, 255), DT_CENTER, False
  1121.  
  1122. End If
  1123.  
  1124. If Not NickAmiguito(5) = "" Then
  1125. If MouseNickAmiguito = 5 Then
  1126. Draw_FilledBox 420, 390, (((500) / (200 + 1 / 200)) * 32), 16, D3DColorARGB(255, 136, 40, 40), _
  1127. D3DColorARGB(255, 136, 0, 21)
  1128. ElseIf CartelAmiguito(5) = 1 Then
  1129. Draw_FilledBox 420, 390, (((500) / (200 + 1 / 200)) * 32), 16, D3DColorARGB(255, 60, 60, 0), D3DColorARGB( _
  1130. 255, 0, 0, 0)
  1131. Else
  1132. Draw_FilledBox 420, 390, (((500) / (200 + 1 / 200)) * 32), 16, D3DColorARGB(255, 40, 40, 40), _
  1133. D3DColorARGB(255, 0, 0, 0)
  1134.  
  1135. End If
  1136.  
  1137. Text_Render font_list(1), NickAmiguito(5), 391, 373, 169, 21, D3DColorARGB(200, 255, 255, 255), DT_CENTER, False
  1138.  
  1139. End If
  1140.  
  1141. Text_Render font_list(1), NombreMapa & "(" & UserMap & "," & UserPos.X & "," & UserPos.Y & ")", 0, 2, 400, 200, _
  1142. &HFFFFFFFF, DT_TOP Or DT_LEFT, False
  1143. Text_Render font_list(1), "Onlines: " & UsuariosOnline, 10, 2, 400, 200, &HFFFFFFFF, DT_TOP Or DT_LEFT, False
  1144.  
  1145. If SecondaryEffectIndex <> 0 Then
  1146. X = 250
  1147. Y = 0
  1148. Call Particle_Group_Render(SecondaryEffectIndex, X, Y)
  1149.  
  1150. End If
  1151.  
  1152. If ClimaPermanente > 0 Then
  1153. X = 250
  1154. Y = 0
  1155. Call Particle_Group_Render(SecondaryEffectIndex, X, Y)
  1156.  
  1157. End If
  1158.  
  1159. Light.Light_Render_All
  1160.  
  1161. End Sub
  1162.  
  1163. Private Function Geometry_Create_TLVertex(ByVal X As Single, _
  1164. ByVal Y As Single, _
  1165. ByVal Z As Single, _
  1166. ByVal rhw As Single, _
  1167. ByVal Color As Long, _
  1168. ByVal Specular As Long, _
  1169. tu As Single, _
  1170. ByVal tv As Single) As TLVERTEX
  1171. '**************************************************************
  1172. 'Author: Aaron Perkins
  1173. 'Last Modify Date: 10/07/2002
  1174. '**************************************************************
  1175. Geometry_Create_TLVertex.X = X
  1176. Geometry_Create_TLVertex.Y = Y
  1177. Geometry_Create_TLVertex.Z = Z
  1178. Geometry_Create_TLVertex.rhw = rhw
  1179. Geometry_Create_TLVertex.Color = Color
  1180. Geometry_Create_TLVertex.Specular = Specular
  1181. Geometry_Create_TLVertex.tu = tu
  1182. Geometry_Create_TLVertex.tv = tv
  1183.  
  1184. End Function
  1185.  
  1186. Private Function Geometry_Create_TLVertex2(X As Single, _
  1187. Y As Single, _
  1188. Z As Single, _
  1189. rhw As Single, _
  1190. Color As Long, _
  1191. Specular As Long, _
  1192. tu1 As Single, _
  1193. tv1 As Single, _
  1194. tu2 As Single, _
  1195. tv2 As Single) As TLVERTEX2
  1196. 'mz
  1197. Geometry_Create_TLVertex2.X = X
  1198. Geometry_Create_TLVertex2.Y = Y
  1199. Geometry_Create_TLVertex2.Z = Z
  1200. Geometry_Create_TLVertex2.rhw = rhw
  1201. Geometry_Create_TLVertex2.Color = Color
  1202. Geometry_Create_TLVertex2.Specular = Specular
  1203. Geometry_Create_TLVertex2.tu1 = tu1
  1204. Geometry_Create_TLVertex2.tv1 = tv1
  1205. Geometry_Create_TLVertex2.tu2 = tu2
  1206. Geometry_Create_TLVertex2.tv2 = tv2
  1207.  
  1208. End Function
  1209.  
  1210. Private Sub Geometry_Create_Box(ByRef verts() As TLVERTEX, _
  1211. ByRef dest As RECT, _
  1212. ByRef src As RECT, _
  1213. ByRef rgb_list() As Long, _
  1214. Optional ByRef Textures_Width As Long, _
  1215. Optional ByRef Textures_Height As Long, _
  1216. Optional ByVal angle As Single, _
  1217. Optional ByVal Invert_x As Boolean = False, _
  1218. Optional ByVal Invert_y As Boolean = False)
  1219. '**************************************************************
  1220. 'Author: Aaron Perkins
  1221. 'Modified by Juan Martín Sotuyo Dodero
  1222. 'Last Modify Date: 11/17/2002
  1223. '
  1224. ' * v1 * v3
  1225. ' |\ |
  1226. ' | \ |
  1227. ' | \ |
  1228. ' | \ |
  1229. ' | \|
  1230. ' * v0 * v2
  1231. '**************************************************************
  1232. Dim x_center As Single
  1233. Dim y_center As Single
  1234. Dim radius As Single
  1235. Dim x_Cor As Single
  1236. Dim y_Cor As Single
  1237. Dim left_point As Single
  1238. Dim right_point As Single
  1239. Dim Temp As Single
  1240. Dim auxr As RECT
  1241.  
  1242. If angle <> 0 Then
  1243. 'Center coordinates on screen of the square
  1244. x_center = dest.left + (dest.Right - dest.left) / 2
  1245. y_center = dest.top + (dest.bottom - dest.top) / 2
  1246.  
  1247. 'Calculate radius
  1248. radius = Sqr((dest.Right - x_center) ^ 2 + (dest.bottom - y_center) ^ 2)
  1249.  
  1250. 'Calculate left and right points
  1251. Temp = (dest.Right - x_center) / radius
  1252. right_point = Atn(Temp / Sqr(-Temp * Temp + 1))
  1253. left_point = PI - right_point
  1254.  
  1255. End If
  1256.  
  1257. 'Calculate screen coordinates of sprite, and only rotate if necessary
  1258. If angle = 0 Then
  1259. x_Cor = dest.left
  1260. y_Cor = dest.bottom
  1261. Else
  1262. x_Cor = x_center + Cos(-left_point - angle) * radius
  1263. y_Cor = y_center - Sin(-left_point - angle) * radius
  1264.  
  1265. End If
  1266.  
  1267. auxr = src
  1268.  
  1269. If angle < 0 Then
  1270. src.left = auxr.Right
  1271. src.Right = auxr.left
  1272.  
  1273. End If
  1274.  
  1275. If Invert_x Then
  1276. src.left = auxr.Right
  1277. src.Right = auxr.left
  1278.  
  1279. End If
  1280.  
  1281. If Invert_y Then
  1282. src.top = auxr.bottom
  1283. src.bottom = auxr.top
  1284.  
  1285. End If
  1286.  
  1287. '0 - Bottom left vertex
  1288. If Textures_Width And Textures_Height Then
  1289. verts(0) = Geometry_Create_TLVertex(x_Cor, y_Cor, 0, 1, rgb_list(0), 0, src.left / Textures_Width, ( _
  1290. src.bottom + 1) / Textures_Height)
  1291. Else
  1292. verts(0) = Geometry_Create_TLVertex(x_Cor, y_Cor, 0, 1, rgb_list(0), 0, 0, 0)
  1293.  
  1294. End If
  1295.  
  1296. 'Calculate screen coordinates of sprite, and only rotate if necessary
  1297. If angle = 0 Then
  1298. x_Cor = dest.left
  1299. y_Cor = dest.top
  1300. Else
  1301. x_Cor = x_center + Cos(left_point - angle) * radius
  1302. y_Cor = y_center - Sin(left_point - angle) * radius
  1303.  
  1304. End If
  1305.  
  1306. '1 - Top left vertex
  1307. If Textures_Width And Textures_Height Then
  1308. verts(1) = Geometry_Create_TLVertex(x_Cor, y_Cor, 0, 1, rgb_list(1), 0, src.left / Textures_Width, src.top / _
  1309. Textures_Height)
  1310. Else
  1311. verts(1) = Geometry_Create_TLVertex(x_Cor, y_Cor, 0, 1, rgb_list(1), 0, 0, 1)
  1312.  
  1313. End If
  1314.  
  1315. 'Calculate screen coordinates of sprite, and only rotate if necessary
  1316. If angle = 0 Then
  1317. x_Cor = dest.Right
  1318. y_Cor = dest.bottom
  1319. Else
  1320. x_Cor = x_center + Cos(-right_point - angle) * radius
  1321. y_Cor = y_center - Sin(-right_point - angle) * radius
  1322.  
  1323. End If
  1324.  
  1325. '2 - Bottom right vertex
  1326. If Textures_Width And Textures_Height Then
  1327. verts(2) = Geometry_Create_TLVertex(x_Cor, y_Cor, 0, 1, rgb_list(2), 0, (src.Right + 1) / Textures_Width, ( _
  1328. src.bottom + 1) / Textures_Height)
  1329. Else
  1330. verts(2) = Geometry_Create_TLVertex(x_Cor, y_Cor, 0, 1, rgb_list(2), 0, 1, 0)
  1331.  
  1332. End If
  1333.  
  1334. 'Calculate screen coordinates of sprite, and only rotate if necessary
  1335. If angle = 0 Then
  1336. x_Cor = dest.Right
  1337. y_Cor = dest.top
  1338. Else
  1339. x_Cor = x_center + Cos(right_point - angle) * radius
  1340. y_Cor = y_center - Sin(right_point - angle) * radius
  1341.  
  1342. End If
  1343.  
  1344. '3 - Top right vertex
  1345. If Textures_Width And Textures_Height Then
  1346. verts(3) = Geometry_Create_TLVertex(x_Cor, y_Cor, 0, 1, rgb_list(3), 0, (src.Right + 1) / Textures_Width, _
  1347. src.top / Textures_Height)
  1348. Else
  1349. verts(3) = Geometry_Create_TLVertex(x_Cor, y_Cor, 0, 1, rgb_list(3), 0, 1, 1)
  1350.  
  1351. End If
  1352.  
  1353. End Sub
  1354.  
  1355. Private Sub Device_Box_Textured_Render_Advance(ByVal grhindex As Long, _
  1356. ByVal dest_x As Integer, _
  1357. ByVal dest_y As Integer, _
  1358. ByVal src_width As Integer, _
  1359. ByVal src_height As Integer, _
  1360. ByRef rgb_list() As Long, _
  1361. ByVal src_x As Integer, _
  1362. ByVal src_y As Integer, _
  1363. ByVal dest_width As Integer, _
  1364. Optional ByVal dest_height As Integer, _
  1365. Optional ByVal alpha_blend As Boolean, _
  1366. Optional ByVal angle As Single)
  1367. '**************************************************************
  1368. 'Author: Aaron Perkins
  1369. 'Last Modify Date: 5/15/2003
  1370. 'Copies the Textures allowing resizing
  1371. 'Modified by Juan Martín Sotuyo Dodero
  1372. '**************************************************************
  1373. Static src_rect As RECT
  1374. Static dest_rect As RECT
  1375. Static temp_verts(3) As TLVERTEX
  1376. Static d3dTextures As D3D8Textures
  1377.  
  1378. If grhindex = 0 Then Exit Sub
  1379. Set d3dTextures.Texture = SurfaceDB.GetTexture(GrhData(grhindex).FileNum, d3dTextures.texwidth, _
  1380. d3dTextures.texheight)
  1381.  
  1382. 'Set up the source rectangle
  1383. With src_rect
  1384. .bottom = src_y + src_height
  1385. .left = src_x
  1386. .Right = src_x + src_width
  1387. .top = src_y
  1388.  
  1389. End With
  1390.  
  1391. 'Set up the destination rectangle
  1392. With dest_rect
  1393. .bottom = dest_y + dest_height
  1394. .left = dest_x
  1395. .Right = dest_x + dest_width
  1396. .top = dest_y
  1397.  
  1398. End With
  1399.  
  1400. 'Set up the TempVerts(3) vertices
  1401. Geometry_Create_Box temp_verts(), dest_rect, src_rect, rgb_list(), d3dTextures.texwidth, _
  1402. d3dTextures.texheight, angle
  1403.  
  1404. 'Set Textures
  1405. D3DDevice.SetTexture 0, d3dTextures.Texture
  1406.  
  1407. If alpha_blend Then
  1408. 'Set Rendering for alphablending
  1409. D3DDevice.SetRenderState D3DRS_SRCBLEND, D3DBLEND_ONE
  1410. D3DDevice.SetRenderState D3DRS_DESTBLEND, D3DBLEND_ONE
  1411.  
  1412. End If
  1413.  
  1414. 'Draw the triangles that make up our square Textures
  1415. D3DDevice.DrawPrimitiveUP D3DPT_TRIANGLESTRIP, 2, temp_verts(0), Len(temp_verts(0))
  1416.  
  1417. If alpha_blend Then
  1418. 'Set Rendering for colokeying
  1419. D3DDevice.SetRenderState D3DRS_SRCBLEND, D3DBLEND_SRCALPHA
  1420. D3DDevice.SetRenderState D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA
  1421.  
  1422. End If
  1423.  
  1424. End Sub
  1425.  
  1426. Public Sub Device_Box_Textured_Render(ByVal grhindex As Long, _
  1427. ByVal dest_x As Integer, _
  1428. ByVal dest_y As Integer, _
  1429. ByVal src_width As Integer, _
  1430. ByVal src_height As Integer, _
  1431. ByRef rgb_list() As Long, _
  1432. ByVal src_x As Integer, _
  1433. ByVal src_y As Integer, _
  1434. Optional ByVal alpha_blend As Boolean, _
  1435. Optional ByVal angle As Single, _
  1436. Optional ByVal Shadow As Byte = 0, _
  1437. Optional ByVal Invert_x As Boolean = False, _
  1438. Optional ByVal Invert_y As Boolean = False)
  1439. '**************************************************************
  1440. 'Author: Juan Martín Sotuyo Dodero
  1441. 'Last Modify Date: 2/12/2004
  1442. 'Just copies the Textures
  1443. '**************************************************************
  1444. Static src_rect As RECT
  1445. Static dest_rect As RECT
  1446. Static temp_verts(3) As TLVERTEX
  1447. Static d3dTextures As D3D8Textures
  1448.  
  1449. If grhindex = 0 Then Exit Sub
  1450. Set d3dTextures.Texture = SurfaceDB.GetTexture(GrhData(grhindex).FileNum, d3dTextures.texwidth, _
  1451. d3dTextures.texheight)
  1452.  
  1453. 'Set up the source rectangle
  1454. With src_rect
  1455. .bottom = src_y + src_height
  1456. .left = src_x
  1457. .Right = src_x + src_width
  1458. .top = src_y
  1459.  
  1460. End With
  1461.  
  1462. 'Set up the destination rectangle
  1463. With dest_rect
  1464. .bottom = dest_y + src_height
  1465. .left = dest_x
  1466. .Right = dest_x + src_width
  1467. .top = dest_y
  1468.  
  1469. End With
  1470.  
  1471. 'Set up the TempVerts(3) vertices
  1472. Geometry_Create_Box temp_verts(), dest_rect, src_rect, rgb_list(), d3dTextures.texwidth, _
  1473. d3dTextures.texheight, angle, Invert_x, Invert_y
  1474.  
  1475. 'Set Textures
  1476. D3DDevice.SetTexture 0, d3dTextures.Texture
  1477.  
  1478. If Shadow Then
  1479. temp_verts(1).X = temp_verts(1).X + src_width / 2
  1480. temp_verts(1).Y = temp_verts(1).Y - src_height / 2
  1481.  
  1482. temp_verts(3).X = temp_verts(3).X + src_width
  1483. temp_verts(3).Y = temp_verts(3).Y - src_width
  1484.  
  1485. End If
  1486.  
  1487. If alpha_blend Then
  1488. 'Set Rendering for alphablending
  1489. D3DDevice.SetRenderState D3DRS_SRCBLEND, D3DBLEND_ONE
  1490. D3DDevice.SetRenderState D3DRS_DESTBLEND, D3DBLEND_ONE
  1491.  
  1492. End If
  1493.  
  1494. 'Draw the triangles that make up our square Textures
  1495. D3DDevice.DrawPrimitiveUP D3DPT_TRIANGLESTRIP, 2, temp_verts(0), Len(temp_verts(0))
  1496.  
  1497. If alpha_blend Then
  1498. 'Set Rendering for colokeying
  1499. D3DDevice.SetRenderState D3DRS_SRCBLEND, D3DBLEND_SRCALPHA
  1500. D3DDevice.SetRenderState D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA
  1501.  
  1502. End If
  1503.  
  1504. End Sub
  1505.  
  1506. Public Sub Engine_MoveScreen(ByVal nHeading As E_Heading)
  1507. '******************************************
  1508. 'Starts the screen moving in a direction
  1509. '******************************************
  1510. Dim X As Integer
  1511. Dim Y As Integer
  1512. Dim tX As Integer
  1513. Dim tY As Integer
  1514.  
  1515. 'Figure out which way to move
  1516. Select Case nHeading
  1517.  
  1518. Case E_Heading.NORTH
  1519. Y = -1
  1520.  
  1521. Case E_Heading.EAST
  1522. X = 1
  1523.  
  1524. Case E_Heading.SOUTH
  1525. Y = 1
  1526.  
  1527. Case E_Heading.WEST
  1528. X = -1
  1529.  
  1530. End Select
  1531.  
  1532. 'Fill temp pos
  1533. tX = UserPos.X + X
  1534. tY = UserPos.Y + Y
  1535.  
  1536. 'Check to see if its out of bounds
  1537. If tX < MinXBorder Or tX > MaxXBorder Or tY < MinYBorder Or tY > MaxYBorder Then
  1538. Exit Sub
  1539. Else
  1540. 'Start moving... MainLoop does the rest
  1541. AddtoUserPos.X = X
  1542. UserPos.X = tX
  1543. AddtoUserPos.Y = Y
  1544. UserPos.Y = tY
  1545. UserMoving = 1
  1546.  
  1547. bTecho = IIf(MapData(UserPos.X, UserPos.Y).Trigger = 1 Or MapData(UserPos.X, UserPos.Y).Trigger = 2 Or _
  1548. MapData(UserPos.X, UserPos.Y).Trigger = 4, True, False)
  1549.  
  1550. End If
  1551.  
  1552. End Sub
  1553.  
  1554. Private Sub Char_Render(ByVal charindex As Long, _
  1555. ByVal PixelOffsetX As Integer, _
  1556. ByVal PixelOffsetY As Integer, _
  1557. ByRef Color() As Long)
  1558.  
  1559. '***************************************************
  1560. 'Author: Juan Martín Sotuyo Dodero (Maraxus)
  1561. 'Last Modify Date: 12/03/04
  1562. 'Draw char's to screen without offcentering them
  1563. '***************************************************
  1564. On Error Resume Next
  1565.  
  1566. Dim moved As Boolean
  1567. Dim Pos As Integer
  1568. Dim line As String
  1569. Dim Color As Long
  1570.  
  1571. With charlist(charindex)
  1572.  
  1573. If .Moving Then
  1574.  
  1575. 'If needed, move left and right
  1576. If .scrollDirectionX <> 0 Then
  1577. .MoveOffsetX = .MoveOffsetX + ScrollPixelsPerFrameX * Sgn(.scrollDirectionX) * timerTicksPerFrame
  1578.  
  1579. 'Start animations
  1580. 'TODO : Este parche es para evita los uncornos exploten al moverse!! REVER!!!
  1581. If .Body.Walk(.Heading).Speed > 0 Then .Body.Walk(.Heading).Started = 1
  1582. .arma.WeaponWalk(.Heading).Started = 1
  1583. .Escudo.ShieldWalk(.Heading).Started = 1
  1584.  
  1585. 'Char moved
  1586. moved = True
  1587.  
  1588. 'Check if we already got there
  1589. If (Sgn(.scrollDirectionX) = 1 And .MoveOffsetX >= 0) Or (Sgn(.scrollDirectionX) = -1 And _
  1590. .MoveOffsetX <= 0) Then
  1591. .MoveOffsetX = 0
  1592. .scrollDirectionX = 0
  1593.  
  1594. End If
  1595.  
  1596. End If
  1597.  
  1598. 'If needed, move up and down
  1599. If .scrollDirectionY <> 0 Then
  1600. .MoveOffsetY = .MoveOffsetY + ScrollPixelsPerFrameY * Sgn(.scrollDirectionY) * timerTicksPerFrame
  1601.  
  1602. 'Start animations
  1603. 'TODO : Este parche es para evita los uncornos exploten al moverse!! REVER!!!
  1604. If .Body.Walk(.Heading).Speed > 0 Then .Body.Walk(.Heading).Started = 1
  1605. .arma.WeaponWalk(.Heading).Started = 1
  1606. .Escudo.ShieldWalk(.Heading).Started = 1
  1607.  
  1608. 'Char moved
  1609. moved = True
  1610.  
  1611. 'Check if we already got there
  1612. If (Sgn(.scrollDirectionY) = 1 And .MoveOffsetY >= 0) Or (Sgn(.scrollDirectionY) = -1 And _
  1613. .MoveOffsetY <= 0) Then
  1614. .MoveOffsetY = 0
  1615. .scrollDirectionY = 0
  1616.  
  1617. End If
  1618.  
  1619. End If
  1620.  
  1621. End If
  1622.  
  1623. If UserCharIndex = MapData(X, Y).charindex And frmMain.Muerto.Visible = True Then
  1624. .Body.Walk(.Heading).grhindex = 0
  1625. .Head.Head(.Heading).grhindex = 0
  1626.  
  1627. End If
  1628.  
  1629. If .Ariete = True Then
  1630.  
  1631. .Body.Walk(.Heading).Started = 1
  1632.  
  1633. 'Char moved
  1634. moved = True
  1635.  
  1636. 'Check if we already got there
  1637. If (Sgn(.scrollDirectionY) = 1 And .MoveOffsetY >= 0) Or (Sgn(.scrollDirectionY) = -1 And .MoveOffsetY <= _
  1638. 0) Then
  1639. .MoveOffsetY = 0
  1640. .scrollDirectionY = 0
  1641.  
  1642. End If
  1643.  
  1644. End If
  1645.  
  1646. If .Heading = 0 Then .Heading = EAST
  1647.  
  1648. 'If done moving stop animation
  1649. If Not moved Then
  1650. 'Stop animations
  1651. .Body.Walk(.Heading).Started = 0
  1652. .Body.Walk(.Heading).FrameCounter = 1
  1653.  
  1654. .arma.WeaponWalk(.Heading).Started = 0
  1655. .arma.WeaponWalk(.Heading).FrameCounter = 1
  1656.  
  1657. .Escudo.ShieldWalk(.Heading).Started = 0
  1658. .Escudo.ShieldWalk(.Heading).FrameCounter = 1
  1659.  
  1660. .Moving = False
  1661.  
  1662. End If
  1663.  
  1664. PixelOffsetX = PixelOffsetX + .MoveOffsetX
  1665. PixelOffsetY = PixelOffsetY + .MoveOffsetY
  1666.  
  1667. If FrmOpciones.Checkreflejos = 1 And .invisible = False Then
  1668. If HayAgua(.Pos.X, .Pos.Y + 1) Then
  1669. If .Body.Walk(.Heading).grhindex Then Call Draw_Grh(.Body.Walk(.Heading), PixelOffsetX, PixelOffsetY _
  1670. + 40, 1, 1, Color, True, 0, False, True)
  1671.  
  1672. If UserEstado = 0 Then
  1673. Call Draw_Grh(.Head.Head(.Heading), PixelOffsetX - .Body.HeadOffset.X, PixelOffsetY - _
  1674. .Body.HeadOffset.Y + 11, 1, 0, Color, True, 0, False, True)
  1675. Else
  1676. Call Draw_Grh(.Head.Head(.Heading), PixelOffsetX - .Body.HeadOffset.X, PixelOffsetY - _
  1677. .Body.HeadOffset.Y + 24, 1, 0, Color, True, 0, False, True)
  1678.  
  1679. If .Casco.Head(.Heading).grhindex Then Call Draw_Grh(.Casco.Head(.Heading), PixelOffsetX - _
  1680. .Body.HeadOffset.X, PixelOffsetY - .Body.HeadOffset.Y + 11, 1, 1, Color, True, 0, False, _
  1681. True)
  1682.  
  1683. If .arma.WeaponWalk(.Heading).grhindex Then Call Draw_Grh(.arma.WeaponWalk(.Heading), _
  1684. PixelOffsetX, PixelOffsetY + 40, 1, 1, Color, True, 0, False, True)
  1685.  
  1686. If .Escudo.ShieldWalk(.Heading).grhindex Then Call Draw_Grh(.Escudo.ShieldWalk(.Heading), _
  1687. PixelOffsetX, PixelOffsetY + 40, 1, 1, Color, True, 0, False, True)
  1688.  
  1689. End If
  1690.  
  1691. End If
  1692.  
  1693. End If
  1694.  
  1695. If Not charlist(MapData(X, Y).charindex).invisible Or UserCharIndex = MapData(X, Y).charindex Then
  1696. 'Draw Body
  1697.  
  1698. If .Aura_Index > 0 And UserNavegando = False Then
  1699. If 1 = Aura(.Aura_Index).Giratoria Then
  1700. .Aura_Angle = .Aura_Angle + 0.006
  1701.  
  1702. If .Aura_Angle >= 180 Then .Aura_Angle = 0
  1703.  
  1704. End If
  1705.  
  1706. If Aura(.Aura_Index).Giratoria = 0 Then
  1707. .Aura_Angle = 0
  1708.  
  1709. End If
  1710.  
  1711. LuchoAuraR = Aura(.Aura_Index).Rojo
  1712. LuchoAuraG = Aura(.Aura_Index).Verde
  1713. LuchoAuraB = Aura(.Aura_Index).Azul
  1714.  
  1715. If Aura(.Aura_Index).offset > 0 Then
  1716. Call Draw_Aura(.Aura, PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y + Val( _
  1717. Aura(.Aura_Index).offset) + 65, 1, 0, True, .Aura_Angle)
  1718. ElseIf Aura(.Aura_Index).offset < 0 Then
  1719. Call Draw_Aura(.Aura, PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y + Val( _
  1720. Aura(.Aura_Index).offset) + 65, 1, 0, True, .Aura_Angle)
  1721. Else
  1722. Call Draw_Aura(.Aura, PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y + 65, _
  1723. 1, 0, True, .Aura_Angle)
  1724.  
  1725. End If
  1726.  
  1727. End If
  1728.  
  1729. If .AuraEspada_Index > 0 And UserNavegando = False Then
  1730. If 1 = Aura(.AuraEspada_Index).Giratoria Then
  1731. .AuraEspada_Angle = .AuraEspada_Angle + 0.006
  1732.  
  1733. If .AuraEspada_Angle >= 180 Then .AuraEspada_Angle = 0
  1734.  
  1735. End If
  1736.  
  1737. If Aura(.AuraEspada_Index).Giratoria = 0 Then
  1738. .AuraEspada_Angle = 0
  1739.  
  1740. End If
  1741.  
  1742. LuchoAuraR = Aura(.AuraEspada_Index).Rojo
  1743. LuchoAuraG = Aura(.AuraEspada_Index).Verde
  1744. LuchoAuraB = Aura(.AuraEspada_Index).Azul
  1745.  
  1746. If Aura(.AuraEspada_Index).offset > 0 Then
  1747. Call Draw_Aura(.AuraEspada, PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y _
  1748. + Val(Aura(.AuraEspada_Index).offset) + 65, 1, 0, True, .AuraEspada_Angle)
  1749. ElseIf Aura(.AuraEspada_Index).offset < 0 Then
  1750. Call Draw_Aura(.AuraEspada, PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y _
  1751. + Val(Aura(.AuraEspada_Index).offset) + 65, 1, 0, True, .AuraEspada_Angle)
  1752. Else
  1753. Call Draw_Aura(.AuraEspada, PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y _
  1754. + 65, 1, 0, True, .AuraEspada_Angle)
  1755.  
  1756. End If
  1757.  
  1758. End If
  1759.  
  1760. If .AuraEscudo_Index > 0 And UserNavegando = False Then
  1761. If 1 = Aura(.AuraEscudo_Index).Giratoria Then
  1762. .AuraEscudo_Angle = .AuraEscudo_Angle + 0.006
  1763.  
  1764. If .AuraEscudo_Angle >= 180 Then .AuraEscudo_Angle = 0
  1765.  
  1766. End If
  1767.  
  1768. If Aura(.AuraEscudo_Index).Giratoria = 0 Then
  1769. .AuraEscudo_Angle = 0
  1770.  
  1771. End If
  1772.  
  1773. LuchoAuraR = Aura(.AuraEscudo_Index).Rojo
  1774. LuchoAuraG = Aura(.AuraEscudo_Index).Verde
  1775. LuchoAuraB = Aura(.AuraEscudo_Index).Azul
  1776.  
  1777. If Aura(.AuraEscudo_Index).offset > 0 Then
  1778. Call Draw_Aura(.AuraEscudo, PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y _
  1779. + Val(Aura(.AuraEscudo_Index).offset) + 65, 1, 0, True, .AuraEscudo_Angle)
  1780. ElseIf Aura(.AuraEscudo_Index).offset < 0 Then
  1781. Call Draw_Aura(.AuraEscudo, PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y _
  1782. + Val(Aura(.AuraEscudo_Index).offset) + 65, 1, 0, True, .AuraEscudo_Angle)
  1783. Else
  1784. Call Draw_Aura(.AuraEscudo, PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y _
  1785. + 65, 1, 0, True, .AuraEscudo_Angle)
  1786.  
  1787. End If
  1788.  
  1789. End If
  1790.  
  1791. If .AuraTunica_Index > 0 And UserNavegando = False Then
  1792. If 1 = Aura(.AuraTunica_Index).Giratoria Then
  1793. .AuraTunica_Angle = .AuraTunica_Angle + 0.006
  1794.  
  1795. If .AuraTunica_Angle >= 180 Then .AuraTunica_Angle = 0
  1796.  
  1797. End If
  1798.  
  1799. If Aura(.AuraTunica_Index).Giratoria = 0 Then
  1800. .AuraTunica_Angle = 0
  1801.  
  1802. End If
  1803.  
  1804. LuchoAuraR = Aura(.AuraTunica_Index).Rojo
  1805. LuchoAuraG = Aura(.AuraTunica_Index).Verde
  1806. LuchoAuraB = Aura(.AuraTunica_Index).Azul
  1807.  
  1808. If Aura(.AuraTunica_Index).offset > 0 Then
  1809. Call Draw_Aura(.AuraTunica, PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y _
  1810. + Val(Aura(.AuraTunica_Index).offset) + 65, 1, 0, True, .AuraTunica_Angle)
  1811. ElseIf Aura(.AuraTunica_Index).offset < 0 Then
  1812. Call Draw_Aura(.AuraTunica, PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y _
  1813. + Val(Aura(.AuraTunica_Index).offset) + 65, 1, 0, True, .AuraTunica_Angle)
  1814. Else
  1815. Call Draw_Aura(.AuraTunica, PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y _
  1816. + 65, 1, 0, True, .AuraTunica_Angle)
  1817.  
  1818. End If
  1819.  
  1820. End If
  1821.  
  1822. If .AuraCasco_Index > 0 And UserNavegando = False Then
  1823. If 1 = Aura(.AuraCasco_Index).Giratoria Then
  1824. .AuraCasco_Angle = .AuraCasco_Angle + 0.006
  1825.  
  1826. If .AuraCasco_Angle >= 180 Then .AuraCasco_Angle = 0
  1827.  
  1828. End If
  1829.  
  1830. If Aura(.AuraCasco_Index).Giratoria = 0 Then
  1831. .AuraCasco_Angle = 0
  1832.  
  1833. End If
  1834.  
  1835. LuchoAuraR = Aura(.AuraCasco_Index).Rojo
  1836. LuchoAuraG = Aura(.AuraCasco_Index).Verde
  1837. LuchoAuraB = Aura(.AuraCasco_Index).Azul
  1838.  
  1839. If Aura(.AuraCasco_Index).offset > 0 Then
  1840. Call Draw_Aura(.AuraCasco, PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y + _
  1841. Val(Aura(.AuraCasco_Index).offset) + 65, 1, 0, True, .AuraCasco_Angle)
  1842. ElseIf Aura(.AuraCasco_Index).offset < 0 Then
  1843. Call Draw_Aura(.AuraCasco, PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y + _
  1844. Val(Aura(.AuraCasco_Index).offset) + 65, 1, 0, True, .AuraCasco_Angle)
  1845. Else
  1846. Call Draw_Aura(.AuraCasco, PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y + _
  1847. 65, 1, 0, True, .AuraCasco_Angle)
  1848.  
  1849. End If
  1850.  
  1851. End If
  1852.  
  1853. If .AuraAnillo_Index > 0 And UserNavegando = False Then
  1854. If 1 = Aura(.AuraAnillo_Index).Giratoria Then
  1855. .AuraAnillo_Angle = .AuraAnillo_Angle + 0.006
  1856.  
  1857. If .AuraAnillo_Angle >= 180 Then .AuraAnillo_Angle = 0
  1858.  
  1859. End If
  1860.  
  1861. If Aura(.AuraAnillo_Index).Giratoria = 0 Then
  1862. .AuraAnillo_Angle = 0
  1863.  
  1864. End If
  1865.  
  1866. LuchoAuraR = Aura(.AuraAnillo_Index).Rojo
  1867. LuchoAuraG = Aura(.AuraAnillo_Index).Verde
  1868. LuchoAuraB = Aura(.AuraAnillo_Index).Azul
  1869.  
  1870. If Aura(.AuraAnillo_Index).offset > 0 Then
  1871. Call Draw_Aura(.AuraAnillo, PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y _
  1872. + Val(Aura(.AuraAnillo_Index).offset) + 65, 1, 0, True, .AuraAnillo_Angle)
  1873. ElseIf Aura(.AuraAnillo_Index).offset < 0 Then
  1874. Call Draw_Aura(.AuraAnillo, PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y _
  1875. + Val(Aura(.AuraAnillo_Index).offset) + 65, 1, 0, True, .AuraAnillo_Angle)
  1876. Else
  1877. Call Draw_Aura(.AuraAnillo, PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y _
  1878. + 65, 1, 0, True, .AuraAnillo_Angle)
  1879.  
  1880. End If
  1881.  
  1882. End If
  1883.  
  1884. If .invisible And Not .priv > 0 Then
  1885. Draw_FilledBox 45, 42, 32, 7, D3DColorARGB(100, 230, 230, 230), D3DColorARGB(100, 150, 150, 150)
  1886. Draw_FilledBox 45, 42, (((TimI + 1 / 150) / (200 + 1 / 200)) * 32), 7, D3DColorARGB(100, 255, 255, _
  1887. 0), D3DColorARGB(1, 255, 255, 0)
  1888. Call Draw_Grhindex(24849, 45, 7)
  1889.  
  1890. End If
  1891.  
  1892. If UserParalizado Then
  1893. Draw_FilledBox 8, 42, 32, 7, D3DColorARGB(100, 230, 230, 230), D3DColorARGB(100, 150, 150, 150)
  1894. Draw_FilledBox 8, 42, (((TimR + 1 / 150) / (200 + 1 / 200)) * 32), 7, D3DColorARGB(100, 255, 255, 0), _
  1895. D3DColorARGB(1, 255, 255, 0)
  1896. Call Draw_Grhindex(24835, 8, 7)
  1897.  
  1898. End If
  1899.  
  1900. If Cuenta = True Then
  1901. Call Draw_Grhindex(Conteo, 210, 40)
  1902.  
  1903. End If
  1904.  
  1905. If Tiempo > 1 Then
  1906. Call Draw_Grhindex(Conteo, 195, 40)
  1907. Tiempo = Tiempo - 1
  1908.  
  1909. End If
  1910.  
  1911. If .Body.Walk(.Heading).grhindex Then
  1912. If FrmOpciones.Checksombras = 1 And .invisible = False Then
  1913. 'Call Draw_Grh_Sombra(.Body.Walk(.Heading), PixelOffsetX, PixelOffsetY, 1, 1, , X, Y, , 1)
  1914. Call Draw_Grh_Sombra(.Body.Walk(.Heading), PixelOffsetX - 6, PixelOffsetY, 1, 1, , , 1)
  1915.  
  1916. End If
  1917.  
  1918. Call Draw_Grh(.Body.Walk(.Heading), PixelOffsetX, PixelOffsetY, 1, 1, Color)
  1919.  
  1920. End If
  1921.  
  1922. If .Head.Head(.Heading).grhindex Then
  1923. If FrmOpciones.Checksombras = 1 And .invisible = False Then
  1924. Call Draw_Grh_Sombra(.Head.Head(.Heading), PixelOffsetX + .Body.HeadOffset.X + 5, PixelOffsetY + _
  1925. .Body.HeadOffset.Y - 8, 1, 0, , , 1)
  1926.  
  1927. End If
  1928.  
  1929. Call Draw_Grh(.Head.Head(.Heading), PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + _
  1930. .Body.HeadOffset.Y, 1, 0, Color)
  1931.  
  1932. If .Casco.Head(.Heading).grhindex Then Call Draw_Grh(.Casco.Head(.Heading), PixelOffsetX + _
  1933. .Body.HeadOffset.X + 1, PixelOffsetY + .Body.HeadOffset.Y, 1, 1, Color)
  1934.  
  1935. If .arma.WeaponWalk(.Heading).grhindex Then Call Draw_Grh(.arma.WeaponWalk(.Heading), PixelOffsetX + _
  1936. .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y + 38, 1, 1, Color)
  1937.  
  1938. If .Escudo.ShieldWalk(.Heading).grhindex Then Call Draw_Grh(.Escudo.ShieldWalk(.Heading), _
  1939. PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y + 38, 1, 1, Color)
  1940.  
  1941. End If
  1942.  
  1943. If UserCharIndex = MapData(X, Y).charindex And frmMain.Muerto.Visible = True Then
  1944. .Body.Walk(.Heading).grhindex = 0
  1945. .Head.Head(.Heading).grhindex = 0
  1946.  
  1947. End If
  1948.  
  1949. 'Draw name over head
  1950. If Nombres Then
  1951. If Len(.Nombre) > 0 Then
  1952. Pos = InStr(.Nombre, "<")
  1953.  
  1954. If Pos = 0 Then Pos = Len(.Nombre) + 2
  1955.  
  1956. Select Case .priv
  1957.  
  1958. Case 0
  1959.  
  1960. 'Azthenwok
  1961. Select Case .EsStatus
  1962.  
  1963. Case 0
  1964.  
  1965. If charlist(MapData(X, Y).charindex).invisible Then
  1966. Color = d3dcolorxrgb(ColoresPJ(24).r, ColoresPJ(24).g, ColoresPJ(24).B)
  1967. ElseIf .ColorBlue = 1 Then
  1968. Color = d3dcolorxrgb(ColoresPJ(49).r, ColoresPJ(49).g, ColoresPJ(49).B)
  1969. ElseIf .ColorRed = 1 Then
  1970. Color = d3dcolorxrgb(ColoresPJ(50).r, ColoresPJ(50).g, ColoresPJ(50).B)
  1971. ElseIf .EsNoble = 1 Then
  1972.  
  1973. Select Case SegundosNoble
  1974.  
  1975. Case 0
  1976. Color = d3dcolorxrgb(0, 255, 0)
  1977.  
  1978. Case 1
  1979. Color = d3dcolorxrgb(0, 245, 0)
  1980.  
  1981. Case 2
  1982. Color = d3dcolorxrgb(0, 235, 0)
  1983.  
  1984. Case 3
  1985. Color = d3dcolorxrgb(0, 225, 0)
  1986.  
  1987. Case 4
  1988. Color = d3dcolorxrgb(0, 215, 0)
  1989.  
  1990. Case 5
  1991. Color = d3dcolorxrgb(0, 205, 0)
  1992.  
  1993. Case 6
  1994. Color = d3dcolorxrgb(0, 195, 0)
  1995.  
  1996. Case 7
  1997. Color = d3dcolorxrgb(0, 185, 0)
  1998.  
  1999. Case 8
  2000. Color = d3dcolorxrgb(0, 175, 0)
  2001.  
  2002. Case 9
  2003. Color = d3dcolorxrgb(0, 165, 0)
  2004.  
  2005. Case 10
  2006. Color = d3dcolorxrgb(0, 155, 0)
  2007.  
  2008. Case 11
  2009. Color = d3dcolorxrgb(0, 145, 0)
  2010.  
  2011. Case 12
  2012. Color = d3dcolorxrgb(0, 135, 0)
  2013.  
  2014. Case 13
  2015. Color = d3dcolorxrgb(0, 125, 0)
  2016.  
  2017. Case 14
  2018. Color = d3dcolorxrgb(0, 115, 0)
  2019.  
  2020. Case 15
  2021. Color = d3dcolorxrgb(0, 125, 0)
  2022.  
  2023. Case 16
  2024. Color = d3dcolorxrgb(0, 135, 0)
  2025.  
  2026. Case 17
  2027. Color = d3dcolorxrgb(0, 145, 0)
  2028.  
  2029. Case 18
  2030. Color = d3dcolorxrgb(0, 155, 0)
  2031.  
  2032. Case 19
  2033. Color = d3dcolorxrgb(0, 165, 0)
  2034.  
  2035. Case 20
  2036. Color = d3dcolorxrgb(0, 175, 0)
  2037.  
  2038. Case 21
  2039. Color = d3dcolorxrgb(0, 185, 0)
  2040.  
  2041. Case 22
  2042. Color = d3dcolorxrgb(0, 195, 0)
  2043.  
  2044. Case 23
  2045. Color = d3dcolorxrgb(0, 205, 0)
  2046.  
  2047. Case 24
  2048. Color = d3dcolorxrgb(0, 215, 0)
  2049.  
  2050. Case 25
  2051. Color = d3dcolorxrgb(0, 225, 0)
  2052.  
  2053. Case 26
  2054. Color = d3dcolorxrgb(0, 235, 0)
  2055.  
  2056. Case 27
  2057. Color = d3dcolorxrgb(0, 245, 0)
  2058.  
  2059. Case 28
  2060. Color = d3dcolorxrgb(0, 255, 0)
  2061.  
  2062. End Select
  2063.  
  2064. ElseIf .GranPoder = 1 Then
  2065.  
  2066. If SegundosPoder < 13 Then
  2067. Color = d3dcolorxrgb(117 + SegundosPoder * 10, 117 + SegundosPoder * 10, _
  2068. 117 + SegundosPoder * 10)
  2069. ElseIf SegundosPoder >= 13 Then
  2070. Color = d3dcolorxrgb(117 - SegundosPoder * 10, 117 - SegundosPoder * 10, _
  2071. 117 - SegundosPoder * 10)
  2072.  
  2073. End If
  2074.  
  2075. ElseIf .TieneCastillos = 1 Then
  2076.  
  2077. Select Case SegundosCastillos
  2078.  
  2079. Case 0
  2080. Color = d3dcolorxrgb(255, 255, 200)
  2081.  
  2082. Case 1
  2083. Color = d3dcolorxrgb(255, 255, 190)
  2084.  
  2085. Case 2
  2086. Color = d3dcolorxrgb(255, 255, 180)
  2087.  
  2088. Case 3
  2089. Color = d3dcolorxrgb(255, 255, 175)
  2090.  
  2091. Case 4
  2092. Color = d3dcolorxrgb(255, 255, 160)
  2093.  
  2094. Case 5
  2095. Color = d3dcolorxrgb(255, 255, 150)
  2096.  
  2097. Case 6
  2098. Color = d3dcolorxrgb(255, 255, 140)
  2099.  
  2100. Case 7
  2101. Color = d3dcolorxrgb(255, 255, 130)
  2102.  
  2103. Case 8
  2104. Color = d3dcolorxrgb(255, 255, 120)
  2105.  
  2106. Case 9
  2107. Color = d3dcolorxrgb(255, 255, 110)
  2108.  
  2109. Case 10
  2110. Color = d3dcolorxrgb(255, 255, 100)
  2111.  
  2112. Case 11
  2113. Color = d3dcolorxrgb(255, 255, 90)
  2114.  
  2115. Case 12
  2116. Color = d3dcolorxrgb(255, 255, 80)
  2117.  
  2118. Case 13
  2119. Color = d3dcolorxrgb(255, 255, 70)
  2120.  
  2121. Case 14
  2122. Color = d3dcolorxrgb(255, 255, 60)
  2123.  
  2124. Case 15
  2125. Color = d3dcolorxrgb(255, 255, 50)
  2126.  
  2127. Case 16
  2128. Color = d3dcolorxrgb(255, 255, 40)
  2129.  
  2130. Case 17
  2131. Color = d3dcolorxrgb(255, 255, 50)
  2132.  
  2133. Case 18
  2134. Color = d3dcolorxrgb(255, 255, 60)
  2135.  
  2136. Case 19
  2137. Color = d3dcolorxrgb(255, 255, 70)
  2138.  
  2139. Case 20
  2140. Color = d3dcolorxrgb(255, 255, 80)
  2141.  
  2142. Case 21
  2143. Color = d3dcolorxrgb(255, 255, 90)
  2144.  
  2145. Case 22
  2146. Color = d3dcolorxrgb(255, 255, 100)
  2147.  
  2148. Case 23
  2149. Color = d3dcolorxrgb(255, 255, 110)
  2150.  
  2151. Case 24
  2152. Color = d3dcolorxrgb(255, 255, 120)
  2153.  
  2154. Case 25
  2155. Color = d3dcolorxrgb(255, 255, 130)
  2156.  
  2157. Case 26
  2158. Color = d3dcolorxrgb(255, 255, 140)
  2159.  
  2160. Case 27
  2161. Color = d3dcolorxrgb(255, 255, 150)
  2162.  
  2163. Case 28
  2164. Color = d3dcolorxrgb(255, 255, 160)
  2165.  
  2166. Case 29
  2167. Color = d3dcolorxrgb(255, 255, 170)
  2168.  
  2169. Case 30
  2170. Color = d3dcolorxrgb(255, 255, 180)
  2171.  
  2172. Case 31
  2173. Color = d3dcolorxrgb(255, 255, 190)
  2174.  
  2175. Case 32
  2176. Color = d3dcolorxrgb(255, 255, 200)
  2177.  
  2178. End Select
  2179.  
  2180. Else
  2181. Color = d3dcolorxrgb(ColoresPJ(48).r, ColoresPJ(48).g, ColoresPJ(48).B)
  2182.  
  2183. End If
  2184.  
  2185. Case 1
  2186.  
  2187. If charlist(MapData(X, Y).charindex).invisible Then
  2188. Color = d3dcolorxrgb(ColoresPJ(24).r, ColoresPJ(24).g, ColoresPJ(24).B)
  2189. ElseIf .ColorBlue = 1 Then
  2190. Color = d3dcolorxrgb(ColoresPJ(49).r, ColoresPJ(49).g, ColoresPJ(49).B)
  2191. ElseIf .ColorRed = 1 Then
  2192. Color = d3dcolorxrgb(ColoresPJ(50).r, ColoresPJ(50).g, ColoresPJ(50).B)
  2193. ElseIf .EsNoble = 1 Then
  2194.  
  2195. Select Case SegundosNoble
  2196.  
  2197. Case 0
  2198. Color = d3dcolorxrgb(0, 255, 0)
  2199.  
  2200. Case 1
  2201. Color = d3dcolorxrgb(0, 245, 0)
  2202.  
  2203. Case 2
  2204. Color = d3dcolorxrgb(0, 235, 0)
  2205.  
  2206. Case 3
  2207. Color = d3dcolorxrgb(0, 225, 0)
  2208.  
  2209. Case 4
  2210. Color = d3dcolorxrgb(0, 215, 0)
  2211.  
  2212. Case 5
  2213. Color = d3dcolorxrgb(0, 205, 0)
  2214.  
  2215. Case 6
  2216. Color = d3dcolorxrgb(0, 195, 0)
  2217.  
  2218. Case 7
  2219. Color = d3dcolorxrgb(0, 185, 0)
  2220.  
  2221. Case 8
  2222. Color = d3dcolorxrgb(0, 175, 0)
  2223.  
  2224. Case 9
  2225. Color = d3dcolorxrgb(0, 165, 0)
  2226.  
  2227. Case 10
  2228. Color = d3dcolorxrgb(0, 155, 0)
  2229.  
  2230. Case 11
  2231. Color = d3dcolorxrgb(0, 145, 0)
  2232.  
  2233. Case 12
  2234. Color = d3dcolorxrgb(0, 135, 0)
  2235.  
  2236. Case 13
  2237. Color = d3dcolorxrgb(0, 125, 0)
  2238.  
  2239. Case 14
  2240. Color = d3dcolorxrgb(0, 115, 0)
  2241.  
  2242. Case 15
  2243. Color = d3dcolorxrgb(0, 125, 0)
  2244.  
  2245. Case 16
  2246. Color = d3dcolorxrgb(0, 135, 0)
  2247.  
  2248. Case 17
  2249. Color = d3dcolorxrgb(0, 145, 0)
  2250.  
  2251. Case 18
  2252. Color = d3dcolorxrgb(0, 155, 0)
  2253.  
  2254. Case 19
  2255. Color = d3dcolorxrgb(0, 165, 0)
  2256.  
  2257. Case 20
  2258. Color = d3dcolorxrgb(0, 175, 0)
  2259.  
  2260. Case 21
  2261. Color = d3dcolorxrgb(0, 185, 0)
  2262.  
  2263. Case 22
  2264. Color = d3dcolorxrgb(0, 195, 0)
  2265.  
  2266. Case 23
  2267. Color = d3dcolorxrgb(0, 205, 0)
  2268.  
  2269. Case 24
  2270. Color = d3dcolorxrgb(0, 215, 0)
  2271.  
  2272. Case 25
  2273. Color = d3dcolorxrgb(0, 225, 0)
  2274.  
  2275. Case 26
  2276. Color = d3dcolorxrgb(0, 235, 0)
  2277.  
  2278. Case 27
  2279. Color = d3dcolorxrgb(0, 245, 0)
  2280.  
  2281. Case 28
  2282. Color = d3dcolorxrgb(0, 255, 0)
  2283.  
  2284. End Select
  2285.  
  2286. ElseIf .GranPoder = 1 Then
  2287.  
  2288. If SegundosPoder < 13 Then
  2289. Color = d3dcolorxrgb(0 + SegundosPoder * 10, 116 + SegundosPoder * 10, 232)
  2290. ElseIf SegundosPoder >= 13 Then
  2291. Color = d3dcolorxrgb(0 - SegundosPoder * 10, 116 - SegundosPoder * 10, 232)
  2292.  
  2293. End If
  2294.  
  2295. ElseIf .TieneCastillos = 1 Then
  2296.  
  2297. Select Case SegundosCastillos
  2298.  
  2299. Case 0
  2300. Color = d3dcolorxrgb(255, 255, 200)
  2301.  
  2302. Case 1
  2303. Color = d3dcolorxrgb(255, 255, 190)
  2304.  
  2305. Case 2
  2306. Color = d3dcolorxrgb(255, 255, 180)
  2307.  
  2308. Case 3
  2309. Color = d3dcolorxrgb(255, 255, 175)
  2310.  
  2311. Case 4
  2312. Color = d3dcolorxrgb(255, 255, 160)
  2313.  
  2314. Case 5
  2315. Color = d3dcolorxrgb(255, 255, 150)
  2316.  
  2317. Case 6
  2318. Color = d3dcolorxrgb(255, 255, 140)
  2319.  
  2320. Case 7
  2321. Color = d3dcolorxrgb(255, 255, 130)
  2322.  
  2323. Case 8
  2324. Color = d3dcolorxrgb(255, 255, 120)
  2325.  
  2326. Case 9
  2327. Color = d3dcolorxrgb(255, 255, 110)
  2328.  
  2329. Case 10
  2330. Color = d3dcolorxrgb(255, 255, 100)
  2331.  
  2332. Case 11
  2333. Color = d3dcolorxrgb(255, 255, 90)
  2334.  
  2335. Case 12
  2336. Color = d3dcolorxrgb(255, 255, 80)
  2337.  
  2338. Case 13
  2339. Color = d3dcolorxrgb(255, 255, 70)
  2340.  
  2341. Case 14
  2342. Color = d3dcolorxrgb(255, 255, 60)
  2343.  
  2344. Case 15
  2345. Color = d3dcolorxrgb(255, 255, 50)
  2346.  
  2347. Case 16
  2348. Color = d3dcolorxrgb(255, 255, 40)
  2349.  
  2350. Case 17
  2351. Color = d3dcolorxrgb(255, 255, 50)
  2352.  
  2353. Case 18
  2354. Color = d3dcolorxrgb(255, 255, 60)
  2355.  
  2356. Case 19
  2357. Color = d3dcolorxrgb(255, 255, 70)
  2358.  
  2359. Case 20
  2360. Color = d3dcolorxrgb(255, 255, 80)
  2361.  
  2362. Case 21
  2363. Color = d3dcolorxrgb(255, 255, 90)
  2364.  
  2365. Case 22
  2366. Color = d3dcolorxrgb(255, 255, 100)
  2367.  
  2368. Case 23
  2369. Color = d3dcolorxrgb(255, 255, 110)
  2370.  
  2371. Case 24
  2372. Color = d3dcolorxrgb(255, 255, 120)
  2373.  
  2374. Case 25
  2375. Color = d3dcolorxrgb(255, 255, 130)
  2376.  
  2377. Case 26
  2378. Color = d3dcolorxrgb(255, 255, 140)
  2379.  
  2380. Case 27
  2381. Color = d3dcolorxrgb(255, 255, 150)
  2382.  
  2383. Case 28
  2384. Color = d3dcolorxrgb(255, 255, 160)
  2385.  
  2386. Case 29
  2387. Color = d3dcolorxrgb(255, 255, 170)
  2388.  
  2389. Case 30
  2390. Color = d3dcolorxrgb(255, 255, 180)
  2391.  
  2392. Case 31
  2393. Color = d3dcolorxrgb(255, 255, 190)
  2394.  
  2395. Case 32
  2396. Color = d3dcolorxrgb(255, 255, 200)
  2397.  
  2398. End Select
  2399.  
  2400. Else
  2401. Color = d3dcolorxrgb(ColoresPJ(46).r, ColoresPJ(46).g, ColoresPJ(46).B)
  2402.  
  2403. End If
  2404.  
  2405. Case 2
  2406.  
  2407. If charlist(MapData(X, Y).charindex).invisible Then
  2408. Color = d3dcolorxrgb(ColoresPJ(24).r, ColoresPJ(24).g, ColoresPJ(24).B)
  2409. ElseIf .ColorBlue = 1 Then
  2410. Color = d3dcolorxrgb(ColoresPJ(49).r, ColoresPJ(49).g, ColoresPJ(49).B)
  2411. ElseIf .ColorRed = 1 Then
  2412. Color = d3dcolorxrgb(ColoresPJ(50).r, ColoresPJ(50).g, ColoresPJ(50).B)
  2413. ElseIf .EsNoble = 1 Then
  2414.  
  2415. Select Case SegundosNoble
  2416.  
  2417. Case 0
  2418. Color = d3dcolorxrgb(0, 255, 0)
  2419.  
  2420. Case 1
  2421. Color = d3dcolorxrgb(0, 245, 0)
  2422.  
  2423. Case 2
  2424. Color = d3dcolorxrgb(0, 235, 0)
  2425.  
  2426. Case 3
  2427. Color = d3dcolorxrgb(0, 225, 0)
  2428.  
  2429. Case 4
  2430. Color = d3dcolorxrgb(0, 215, 0)
  2431.  
  2432. Case 5
  2433. Color = d3dcolorxrgb(0, 205, 0)
  2434.  
  2435. Case 6
  2436. Color = d3dcolorxrgb(0, 195, 0)
  2437.  
  2438. Case 7
  2439. Color = d3dcolorxrgb(0, 185, 0)
  2440.  
  2441. Case 8
  2442. Color = d3dcolorxrgb(0, 175, 0)
  2443.  
  2444. Case 9
  2445. Color = d3dcolorxrgb(0, 165, 0)
  2446.  
  2447. Case 10
  2448. Color = d3dcolorxrgb(0, 155, 0)
  2449.  
  2450. Case 11
  2451. Color = d3dcolorxrgb(0, 145, 0)
  2452.  
  2453. Case 12
  2454. Color = d3dcolorxrgb(0, 135, 0)
  2455.  
  2456. Case 13
  2457. Color = d3dcolorxrgb(0, 125, 0)
  2458.  
  2459. Case 14
  2460. Color = d3dcolorxrgb(0, 115, 0)
  2461.  
  2462. Case 15
  2463. Color = d3dcolorxrgb(0, 125, 0)
  2464.  
  2465. Case 16
  2466. Color = d3dcolorxrgb(0, 135, 0)
  2467.  
  2468. Case 17
  2469. Color = d3dcolorxrgb(0, 145, 0)
  2470.  
  2471. Case 18
  2472. Color = d3dcolorxrgb(0, 155, 0)
  2473.  
  2474. Case 19
  2475. Color = d3dcolorxrgb(0, 165, 0)
  2476.  
  2477. Case 20
  2478. Color = d3dcolorxrgb(0, 175, 0)
  2479.  
  2480. Case 21
  2481. Color = d3dcolorxrgb(0, 185, 0)
  2482.  
  2483. Case 22
  2484. Color = d3dcolorxrgb(0, 195, 0)
  2485.  
  2486. Case 23
  2487. Color = d3dcolorxrgb(0, 205, 0)
  2488.  
  2489. Case 24
  2490. Color = d3dcolorxrgb(0, 215, 0)
  2491.  
  2492. Case 25
  2493. Color = d3dcolorxrgb(0, 225, 0)
  2494.  
  2495. Case 26
  2496. Color = d3dcolorxrgb(0, 235, 0)
  2497.  
  2498. Case 27
  2499. Color = d3dcolorxrgb(0, 245, 0)
  2500.  
  2501. Case 28
  2502. Color = d3dcolorxrgb(0, 255, 0)
  2503.  
  2504. End Select
  2505.  
  2506. ElseIf .GranPoder = 1 Then
  2507.  
  2508. If SegundosPoder < 13 Then
  2509. Color = d3dcolorxrgb(255, 25 + SegundosPoder * 10, 25 + SegundosPoder * 10)
  2510. ElseIf SegundosPoder >= 13 Then
  2511. Color = d3dcolorxrgb(255, 25 - SegundosPoder * 10, 25 - SegundosPoder * 10)
  2512.  
  2513. End If
  2514.  
  2515. ElseIf .TieneCastillos = 1 Then
  2516.  
  2517. Select Case SegundosCastillos
  2518.  
  2519. Case 0
  2520. Color = d3dcolorxrgb(255, 255, 200)
  2521.  
  2522. Case 1
  2523. Color = d3dcolorxrgb(255, 255, 190)
  2524.  
  2525. Case 2
  2526. Color = d3dcolorxrgb(255, 255, 180)
  2527.  
  2528. Case 3
  2529. Color = d3dcolorxrgb(255, 255, 175)
  2530.  
  2531. Case 4
  2532. Color = d3dcolorxrgb(255, 255, 160)
  2533.  
  2534. Case 5
  2535. Color = d3dcolorxrgb(255, 255, 150)
  2536.  
  2537. Case 6
  2538. Color = d3dcolorxrgb(255, 255, 140)
  2539.  
  2540. Case 7
  2541. Color = d3dcolorxrgb(255, 255, 130)
  2542.  
  2543. Case 8
  2544. Color = d3dcolorxrgb(255, 255, 120)
  2545.  
  2546. Case 9
  2547. Color = d3dcolorxrgb(255, 255, 110)
  2548.  
  2549. Case 10
  2550. Color = d3dcolorxrgb(255, 255, 100)
  2551.  
  2552. Case 11
  2553. Color = d3dcolorxrgb(255, 255, 90)
  2554.  
  2555. Case 12
  2556. Color = d3dcolorxrgb(255, 255, 80)
  2557.  
  2558. Case 13
  2559. Color = d3dcolorxrgb(255, 255, 70)
  2560.  
  2561. Case 14
  2562. Color = d3dcolorxrgb(255, 255, 60)
  2563.  
  2564. Case 15
  2565. Color = d3dcolorxrgb(255, 255, 50)
  2566.  
  2567. Case 16
  2568. Color = d3dcolorxrgb(255, 255, 40)
  2569.  
  2570. Case 17
  2571. Color = d3dcolorxrgb(255, 255, 50)
  2572.  
  2573. Case 18
  2574. Color = d3dcolorxrgb(255, 255, 60)
  2575.  
  2576. Case 19
  2577. Color = d3dcolorxrgb(255, 255, 70)
  2578.  
  2579. Case 20
  2580. Color = d3dcolorxrgb(255, 255, 80)
  2581.  
  2582. Case 21
  2583. Color = d3dcolorxrgb(255, 255, 90)
  2584.  
  2585. Case 22
  2586. Color = d3dcolorxrgb(255, 255, 100)
  2587.  
  2588. Case 23
  2589. Color = d3dcolorxrgb(255, 255, 110)
  2590.  
  2591. Case 24
  2592. Color = d3dcolorxrgb(255, 255, 120)
  2593.  
  2594. Case 25
  2595. Color = d3dcolorxrgb(255, 255, 130)
  2596.  
  2597. Case 26
  2598. Color = d3dcolorxrgb(255, 255, 140)
  2599.  
  2600. Case 27
  2601. Color = d3dcolorxrgb(255, 255, 150)
  2602.  
  2603. Case 28
  2604. Color = d3dcolorxrgb(255, 255, 160)
  2605.  
  2606. Case 29
  2607. Color = d3dcolorxrgb(255, 255, 170)
  2608.  
  2609. Case 30
  2610. Color = d3dcolorxrgb(255, 255, 180)
  2611.  
  2612. Case 31
  2613. Color = d3dcolorxrgb(255, 255, 190)
  2614.  
  2615. Case 32
  2616. Color = d3dcolorxrgb(255, 255, 200)
  2617.  
  2618. End Select
  2619.  
  2620. Else
  2621. Color = d3dcolorxrgb(ColoresPJ(47).r, ColoresPJ(47).g, ColoresPJ(47).B)
  2622.  
  2623. End If
  2624.  
  2625. Case 3
  2626.  
  2627. If charlist(MapData(X, Y).charindex).invisible Then
  2628. Color = d3dcolorxrgb(ColoresPJ(24).r, ColoresPJ(24).g, ColoresPJ(24).B)
  2629. ElseIf .ColorBlue = 1 Then
  2630. Color = d3dcolorxrgb(ColoresPJ(49).r, ColoresPJ(49).g, ColoresPJ(49).B)
  2631. ElseIf .ColorRed = 1 Then
  2632. Color = d3dcolorxrgb(ColoresPJ(50).r, ColoresPJ(50).g, ColoresPJ(50).B)
  2633. ElseIf .EsNoble = 1 Then
  2634.  
  2635. Select Case SegundosNoble
  2636.  
  2637. Case 0
  2638. Color = d3dcolorxrgb(0, 255, 0)
  2639.  
  2640. Case 1
  2641. Color = d3dcolorxrgb(0, 245, 0)
  2642.  
  2643. Case 2
  2644. Color = d3dcolorxrgb(0, 235, 0)
  2645.  
  2646. Case 3
  2647. Color = d3dcolorxrgb(0, 225, 0)
  2648.  
  2649. Case 4
  2650. Color = d3dcolorxrgb(0, 215, 0)
  2651.  
  2652. Case 5
  2653. Color = d3dcolorxrgb(0, 205, 0)
  2654.  
  2655. Case 6
  2656. Color = d3dcolorxrgb(0, 195, 0)
  2657.  
  2658. Case 7
  2659. Color = d3dcolorxrgb(0, 185, 0)
  2660.  
  2661. Case 8
  2662. Color = d3dcolorxrgb(0, 175, 0)
  2663.  
  2664. Case 9
  2665. Color = d3dcolorxrgb(0, 165, 0)
  2666.  
  2667. Case 10
  2668. Color = d3dcolorxrgb(0, 155, 0)
  2669.  
  2670. Case 11
  2671. Color = d3dcolorxrgb(0, 145, 0)
  2672.  
  2673. Case 12
  2674. Color = d3dcolorxrgb(0, 135, 0)
  2675.  
  2676. Case 13
  2677. Color = d3dcolorxrgb(0, 125, 0)
  2678.  
  2679. Case 14
  2680. Color = d3dcolorxrgb(0, 115, 0)
  2681.  
  2682. Case 15
  2683. Color = d3dcolorxrgb(0, 125, 0)
  2684.  
  2685. Case 16
  2686. Color = d3dcolorxrgb(0, 135, 0)
  2687.  
  2688. Case 17
  2689. Color = d3dcolorxrgb(0, 145, 0)
  2690.  
  2691. Case 18
  2692. Color = d3dcolorxrgb(0, 155, 0)
  2693.  
  2694. Case 19
  2695. Color = d3dcolorxrgb(0, 165, 0)
  2696.  
  2697. Case 20
  2698. Color = d3dcolorxrgb(0, 175, 0)
  2699.  
  2700. Case 21
  2701. Color = d3dcolorxrgb(0, 185, 0)
  2702.  
  2703. Case 22
  2704. Color = d3dcolorxrgb(0, 195, 0)
  2705.  
  2706. Case 23
  2707. Color = d3dcolorxrgb(0, 205, 0)
  2708.  
  2709. Case 24
  2710. Color = d3dcolorxrgb(0, 215, 0)
  2711.  
  2712. Case 25
  2713. Color = d3dcolorxrgb(0, 225, 0)
  2714.  
  2715. Case 26
  2716. Color = d3dcolorxrgb(0, 235, 0)
  2717.  
  2718. Case 27
  2719. Color = d3dcolorxrgb(0, 245, 0)
  2720.  
  2721. Case 28
  2722. Color = d3dcolorxrgb(0, 255, 0)
  2723.  
  2724. End Select
  2725.  
  2726. ElseIf .GranPoder = 1 Then
  2727.  
  2728. Select Case SegundosPoder
  2729.  
  2730. Case 0
  2731. Color = d3dcolorxrgb(225, 225, 225)
  2732.  
  2733. Case 1
  2734. Color = d3dcolorxrgb(215, 215, 215)
  2735.  
  2736. Case 2
  2737. Color = d3dcolorxrgb(210, 210, 210)
  2738.  
  2739. Case 3
  2740. Color = d3dcolorxrgb(200, 200, 200)
  2741.  
  2742. Case 4
  2743. Color = d3dcolorxrgb(190, 190, 190)
  2744.  
  2745. Case 5
  2746. Color = d3dcolorxrgb(180, 180, 180)
  2747.  
  2748. Case 6
  2749. Color = d3dcolorxrgb(170, 170, 170)
  2750.  
  2751. Case 7
  2752. Color = d3dcolorxrgb(160, 160, 160)
  2753.  
  2754. Case 8
  2755. Color = d3dcolorxrgb(150, 150, 150)
  2756.  
  2757. Case 9
  2758. Color = d3dcolorxrgb(140, 140, 140)
  2759.  
  2760. Case 10
  2761. Color = d3dcolorxrgb(130, 130, 130)
  2762.  
  2763. Case 11
  2764. Color = d3dcolorxrgb(120, 120, 120)
  2765.  
  2766. Case 12
  2767. Color = d3dcolorxrgb(110, 110, 110)
  2768.  
  2769. Case 13
  2770. Color = d3dcolorxrgb(90, 90, 90)
  2771.  
  2772. Case 14
  2773. Color = d3dcolorxrgb(100, 100, 100)
  2774.  
  2775. Case 15
  2776. Color = d3dcolorxrgb(110, 110, 110)
  2777.  
  2778. Case 16
  2779. Color = d3dcolorxrgb(120, 120, 120)
  2780.  
  2781. Case 17
  2782. Color = d3dcolorxrgb(130, 130, 130)
  2783.  
  2784. Case 18
  2785. Color = d3dcolorxrgb(140, 140, 140)
  2786.  
  2787. Case 19
  2788. Color = d3dcolorxrgb(150, 150, 150)
  2789.  
  2790. Case 20
  2791. Color = d3dcolorxrgb(160, 160, 160)
  2792.  
  2793. Case 21
  2794. Color = d3dcolorxrgb(170, 170, 170)
  2795.  
  2796. Case 22
  2797. Color = d3dcolorxrgb(180, 180, 180)
  2798.  
  2799. Case 23
  2800. Color = d3dcolorxrgb(190, 190, 190)
  2801.  
  2802. Case 24
  2803. Color = d3dcolorxrgb(200, 200, 200)
  2804.  
  2805. End Select
  2806.  
  2807. ElseIf .TieneCastillos = 1 Then
  2808.  
  2809. Select Case SegundosCastillos
  2810.  
  2811. Case 0
  2812. Color = d3dcolorxrgb(255, 255, 200)
  2813.  
  2814. Case 1
  2815. Color = d3dcolorxrgb(255, 255, 190)
  2816.  
  2817. Case 2
  2818. Color = d3dcolorxrgb(255, 255, 180)
  2819.  
  2820. Case 3
  2821. Color = d3dcolorxrgb(255, 255, 175)
  2822.  
  2823. Case 4
  2824. Color = d3dcolorxrgb(255, 255, 160)
  2825.  
  2826. Case 5
  2827. Color = d3dcolorxrgb(255, 255, 150)
  2828.  
  2829. Case 6
  2830. Color = d3dcolorxrgb(255, 255, 140)
  2831.  
  2832. Case 7
  2833. Color = d3dcolorxrgb(255, 255, 130)
  2834.  
  2835. Case 8
  2836. Color = d3dcolorxrgb(255, 255, 120)
  2837.  
  2838. Case 9
  2839. Color = d3dcolorxrgb(255, 255, 110)
  2840.  
  2841. Case 10
  2842. Color = d3dcolorxrgb(255, 255, 100)
  2843.  
  2844. Case 11
  2845. Color = d3dcolorxrgb(255, 255, 90)
  2846.  
  2847. Case 12
  2848. Color = d3dcolorxrgb(255, 255, 80)
  2849.  
  2850. Case 13
  2851. Color = d3dcolorxrgb(255, 255, 70)
  2852.  
  2853. Case 14
  2854. Color = d3dcolorxrgb(255, 255, 60)
  2855.  
  2856. Case 15
  2857. Color = d3dcolorxrgb(255, 255, 50)
  2858.  
  2859. Case 16
  2860. Color = d3dcolorxrgb(255, 255, 40)
  2861.  
  2862. Case 17
  2863. Color = d3dcolorxrgb(255, 255, 50)
  2864.  
  2865. Case 18
  2866. Color = d3dcolorxrgb(255, 255, 60)
  2867.  
  2868. Case 19
  2869. Color = d3dcolorxrgb(255, 255, 70)
  2870.  
  2871. Case 20
  2872. Color = d3dcolorxrgb(255, 255, 80)
  2873.  
  2874. Case 21
  2875. Color = d3dcolorxrgb(255, 255, 90)
  2876.  
  2877. Case 22
  2878. Color = d3dcolorxrgb(255, 255, 100)
  2879.  
  2880. Case 23
  2881. Color = d3dcolorxrgb(255, 255, 110)
  2882.  
  2883. Case 24
  2884. Color = d3dcolorxrgb(255, 255, 120)
  2885.  
  2886. Case 25
  2887. Color = d3dcolorxrgb(255, 255, 130)
  2888.  
  2889. Case 26
  2890. Color = d3dcolorxrgb(255, 255, 140)
  2891.  
  2892. Case 27
  2893. Color = d3dcolorxrgb(255, 255, 150)
  2894.  
  2895. Case 28
  2896. Color = d3dcolorxrgb(255, 255, 160)
  2897.  
  2898. Case 29
  2899. Color = d3dcolorxrgb(255, 255, 170)
  2900.  
  2901. Case 30
  2902. Color = d3dcolorxrgb(255, 255, 180)
  2903.  
  2904. Case 31
  2905. Color = d3dcolorxrgb(255, 255, 190)
  2906.  
  2907. Case 32
  2908. Color = d3dcolorxrgb(255, 255, 200)
  2909.  
  2910. End Select
  2911.  
  2912. Else
  2913. Color = d3dcolorxrgb(ColoresPJ(49).r, ColoresPJ(49).g, ColoresPJ(49).B)
  2914.  
  2915. End If
  2916.  
  2917. Case 4
  2918.  
  2919. If charlist(MapData(X, Y).charindex).invisible Then
  2920. Color = d3dcolorxrgb(ColoresPJ(24).r, ColoresPJ(24).g, ColoresPJ(24).B)
  2921. ElseIf .ColorBlue = 1 Then
  2922. Color = d3dcolorxrgb(ColoresPJ(49).r, ColoresPJ(49).g, ColoresPJ(49).B)
  2923. ElseIf .ColorRed = 1 Then
  2924. Color = d3dcolorxrgb(ColoresPJ(50).r, ColoresPJ(50).g, ColoresPJ(50).B)
  2925. ElseIf .EsNoble = 1 Then
  2926.  
  2927. Select Case SegundosNoble
  2928.  
  2929. Case 0
  2930. Color = d3dcolorxrgb(0, 255, 0)
  2931.  
  2932. Case 1
  2933. Color = d3dcolorxrgb(0, 245, 0)
  2934.  
  2935. Case 2
  2936. Color = d3dcolorxrgb(0, 235, 0)
  2937.  
  2938. Case 3
  2939. Color = d3dcolorxrgb(0, 225, 0)
  2940.  
  2941. Case 4
  2942. Color = d3dcolorxrgb(0, 215, 0)
  2943.  
  2944. Case 5
  2945. Color = d3dcolorxrgb(0, 205, 0)
  2946.  
  2947. Case 6
  2948. Color = d3dcolorxrgb(0, 195, 0)
  2949.  
  2950. Case 7
  2951. Color = d3dcolorxrgb(0, 185, 0)
  2952.  
  2953. Case 8
  2954. Color = d3dcolorxrgb(0, 175, 0)
  2955.  
  2956. Case 9
  2957. Color = d3dcolorxrgb(0, 165, 0)
  2958.  
  2959. Case 10
  2960. Color = d3dcolorxrgb(0, 155, 0)
  2961.  
  2962. Case 11
  2963. Color = d3dcolorxrgb(0, 145, 0)
  2964.  
  2965. Case 12
  2966. Color = d3dcolorxrgb(0, 135, 0)
  2967.  
  2968. Case 13
  2969. Color = d3dcolorxrgb(0, 125, 0)
  2970.  
  2971. Case 14
  2972. Color = d3dcolorxrgb(0, 115, 0)
  2973.  
  2974. Case 15
  2975. Color = d3dcolorxrgb(0, 125, 0)
  2976.  
  2977. Case 16
  2978. Color = d3dcolorxrgb(0, 135, 0)
  2979.  
  2980. Case 17
  2981. Color = d3dcolorxrgb(0, 145, 0)
  2982.  
  2983. Case 18
  2984. Color = d3dcolorxrgb(0, 155, 0)
  2985.  
  2986. Case 19
  2987. Color = d3dcolorxrgb(0, 165, 0)
  2988.  
  2989. Case 20
  2990. Color = d3dcolorxrgb(0, 175, 0)
  2991.  
  2992. Case 21
  2993. Color = d3dcolorxrgb(0, 185, 0)
  2994.  
  2995. Case 22
  2996. Color = d3dcolorxrgb(0, 195, 0)
  2997.  
  2998. Case 23
  2999. Color = d3dcolorxrgb(0, 205, 0)
  3000.  
  3001. Case 24
  3002. Color = d3dcolorxrgb(0, 215, 0)
  3003.  
  3004. Case 25
  3005. Color = d3dcolorxrgb(0, 225, 0)
  3006.  
  3007. Case 26
  3008. Color = d3dcolorxrgb(0, 235, 0)
  3009.  
  3010. Case 27
  3011. Color = d3dcolorxrgb(0, 245, 0)
  3012.  
  3013. Case 28
  3014. Color = d3dcolorxrgb(0, 255, 0)
  3015.  
  3016. End Select
  3017.  
  3018. ElseIf .GranPoder = 1 Then
  3019.  
  3020. Select Case SegundosPoder
  3021.  
  3022. Case 0
  3023. Color = d3dcolorxrgb(225, 225, 225)
  3024.  
  3025. Case 1
  3026. Color = d3dcolorxrgb(215, 215, 215)
  3027.  
  3028. Case 2
  3029. Color = d3dcolorxrgb(210, 210, 210)
  3030.  
  3031. Case 3
  3032. Color = d3dcolorxrgb(200, 200, 200)
  3033.  
  3034. Case 4
  3035. Color = d3dcolorxrgb(190, 190, 190)
  3036.  
  3037. Case 5
  3038. Color = d3dcolorxrgb(180, 180, 180)
  3039.  
  3040. Case 6
  3041. Color = d3dcolorxrgb(170, 170, 170)
  3042.  
  3043. Case 7
  3044. Color = d3dcolorxrgb(160, 160, 160)
  3045.  
  3046. Case 8
  3047. Color = d3dcolorxrgb(150, 150, 150)
  3048.  
  3049. Case 9
  3050. Color = d3dcolorxrgb(140, 140, 140)
  3051.  
  3052. Case 10
  3053. Color = d3dcolorxrgb(130, 130, 130)
  3054.  
  3055. Case 11
  3056. Color = d3dcolorxrgb(120, 120, 120)
  3057.  
  3058. Case 12
  3059. Color = d3dcolorxrgb(110, 110, 110)
  3060.  
  3061. Case 13
  3062. Color = d3dcolorxrgb(90, 90, 90)
  3063.  
  3064. Case 14
  3065. Color = d3dcolorxrgb(100, 100, 100)
  3066.  
  3067. Case 15
  3068. Color = d3dcolorxrgb(110, 110, 110)
  3069.  
  3070. Case 16
  3071. Color = d3dcolorxrgb(120, 120, 120)
  3072.  
  3073. Case 17
  3074. Color = d3dcolorxrgb(130, 130, 130)
  3075.  
  3076. Case 18
  3077. Color = d3dcolorxrgb(140, 140, 140)
  3078.  
  3079. Case 19
  3080. Color = d3dcolorxrgb(150, 150, 150)
  3081.  
  3082. Case 20
  3083. Color = d3dcolorxrgb(160, 160, 160)
  3084.  
  3085. Case 21
  3086. Color = d3dcolorxrgb(170, 170, 170)
  3087.  
  3088. Case 22
  3089. Color = d3dcolorxrgb(180, 180, 180)
  3090.  
  3091. Case 23
  3092. Color = d3dcolorxrgb(190, 190, 190)
  3093.  
  3094. Case 24
  3095. Color = d3dcolorxrgb(200, 200, 200)
  3096.  
  3097. End Select
  3098.  
  3099. ElseIf .TieneCastillos = 1 Then
  3100.  
  3101. Select Case SegundosCastillos
  3102.  
  3103. Case 0
  3104. Color = d3dcolorxrgb(255, 255, 200)
  3105.  
  3106. Case 1
  3107. Color = d3dcolorxrgb(255, 255, 190)
  3108.  
  3109. Case 2
  3110. Color = d3dcolorxrgb(255, 255, 180)
  3111.  
  3112. Case 3
  3113. Color = d3dcolorxrgb(255, 255, 175)
  3114.  
  3115. Case 4
  3116. Color = d3dcolorxrgb(255, 255, 160)
  3117.  
  3118. Case 5
  3119. Color = d3dcolorxrgb(255, 255, 150)
  3120.  
  3121. Case 6
  3122. Color = d3dcolorxrgb(255, 255, 140)
  3123.  
  3124. Case 7
  3125. Color = d3dcolorxrgb(255, 255, 130)
  3126.  
  3127. Case 8
  3128. Color = d3dcolorxrgb(255, 255, 120)
  3129.  
  3130. Case 9
  3131. Color = d3dcolorxrgb(255, 255, 110)
  3132.  
  3133. Case 10
  3134. Color = d3dcolorxrgb(255, 255, 100)
  3135.  
  3136. Case 11
  3137. Color = d3dcolorxrgb(255, 255, 90)
  3138.  
  3139. Case 12
  3140. Color = d3dcolorxrgb(255, 255, 80)
  3141.  
  3142. Case 13
  3143. Color = d3dcolorxrgb(255, 255, 70)
  3144.  
  3145. Case 14
  3146. Color = d3dcolorxrgb(255, 255, 60)
  3147.  
  3148. Case 15
  3149. Color = d3dcolorxrgb(255, 255, 50)
  3150.  
  3151. Case 16
  3152. Color = d3dcolorxrgb(255, 255, 40)
  3153.  
  3154. Case 17
  3155. Color = d3dcolorxrgb(255, 255, 50)
  3156.  
  3157. Case 18
  3158. Color = d3dcolorxrgb(255, 255, 60)
  3159.  
  3160. Case 19
  3161. Color = d3dcolorxrgb(255, 255, 70)
  3162.  
  3163. Case 20
  3164. Color = d3dcolorxrgb(255, 255, 80)
  3165.  
  3166. Case 21
  3167. Color = d3dcolorxrgb(255, 255, 90)
  3168.  
  3169. Case 22
  3170. Color = d3dcolorxrgb(255, 255, 100)
  3171.  
  3172. Case 23
  3173. Color = d3dcolorxrgb(255, 255, 110)
  3174.  
  3175. Case 24
  3176. Color = d3dcolorxrgb(255, 255, 120)
  3177.  
  3178. Case 25
  3179. Color = d3dcolorxrgb(255, 255, 130)
  3180.  
  3181. Case 26
  3182. Color = d3dcolorxrgb(255, 255, 140)
  3183.  
  3184. Case 27
  3185. Color = d3dcolorxrgb(255, 255, 150)
  3186.  
  3187. Case 28
  3188. Color = d3dcolorxrgb(255, 255, 160)
  3189.  
  3190. Case 29
  3191. Color = d3dcolorxrgb(255, 255, 170)
  3192.  
  3193. Case 30
  3194. Color = d3dcolorxrgb(255, 255, 180)
  3195.  
  3196. Case 31
  3197. Color = d3dcolorxrgb(255, 255, 190)
  3198.  
  3199. Case 32
  3200. Color = d3dcolorxrgb(255, 255, 200)
  3201.  
  3202. End Select
  3203.  
  3204. Else
  3205. Color = d3dcolorxrgb(ColoresPJ(50).r, ColoresPJ(50).g, ColoresPJ(50).B)
  3206.  
  3207. End If
  3208.  
  3209. Case 5
  3210.  
  3211. If charlist(MapData(X, Y).charindex).invisible Then
  3212. Color = d3dcolorxrgb(ColoresPJ(24).r, ColoresPJ(24).g, ColoresPJ(24).B)
  3213. ElseIf .ColorBlue = 1 Then
  3214. Color = d3dcolorxrgb(ColoresPJ(49).r, ColoresPJ(49).g, ColoresPJ(49).B)
  3215. ElseIf .ColorRed = 1 Then
  3216. Color = d3dcolorxrgb(ColoresPJ(50).r, ColoresPJ(50).g, ColoresPJ(50).B)
  3217. ElseIf .EsNoble = 1 Then
  3218.  
  3219. Select Case SegundosNoble
  3220.  
  3221. Case 0
  3222. Color = d3dcolorxrgb(0, 255, 0)
  3223.  
  3224. Case 1
  3225. Color = d3dcolorxrgb(0, 245, 0)
  3226.  
  3227. Case 2
  3228. Color = d3dcolorxrgb(0, 235, 0)
  3229.  
  3230. Case 3
  3231. Color = d3dcolorxrgb(0, 225, 0)
  3232.  
  3233. Case 4
  3234. Color = d3dcolorxrgb(0, 215, 0)
  3235.  
  3236. Case 5
  3237. Color = d3dcolorxrgb(0, 205, 0)
  3238.  
  3239. Case 6
  3240. Color = d3dcolorxrgb(0, 195, 0)
  3241.  
  3242. Case 7
  3243. Color = d3dcolorxrgb(0, 185, 0)
  3244.  
  3245. Case 8
  3246. Color = d3dcolorxrgb(0, 175, 0)
  3247.  
  3248. Case 9
  3249. Color = d3dcolorxrgb(0, 165, 0)
  3250.  
  3251. Case 10
  3252. Color = d3dcolorxrgb(0, 155, 0)
  3253.  
  3254. Case 11
  3255. Color = d3dcolorxrgb(0, 145, 0)
  3256.  
  3257. Case 12
  3258. Color = d3dcolorxrgb(0, 135, 0)
  3259.  
  3260. Case 13
  3261. Color = d3dcolorxrgb(0, 125, 0)
  3262.  
  3263. Case 14
  3264. Color = d3dcolorxrgb(0, 115, 0)
  3265.  
  3266. Case 15
  3267. Color = d3dcolorxrgb(0, 125, 0)
  3268.  
  3269. Case 16
  3270. Color = d3dcolorxrgb(0, 135, 0)
  3271.  
  3272. Case 17
  3273. Color = d3dcolorxrgb(0, 145, 0)
  3274.  
  3275. Case 18
  3276. Color = d3dcolorxrgb(0, 155, 0)
  3277.  
  3278. Case 19
  3279. Color = d3dcolorxrgb(0, 165, 0)
  3280.  
  3281. Case 20
  3282. Color = d3dcolorxrgb(0, 175, 0)
  3283.  
  3284. Case 21
  3285. Color = d3dcolorxrgb(0, 185, 0)
  3286.  
  3287. Case 22
  3288. Color = d3dcolorxrgb(0, 195, 0)
  3289.  
  3290. Case 23
  3291. Color = d3dcolorxrgb(0, 205, 0)
  3292.  
  3293. Case 24
  3294. Color = d3dcolorxrgb(0, 215, 0)
  3295.  
  3296. Case 25
  3297. Color = d3dcolorxrgb(0, 225, 0)
  3298.  
  3299. Case 26
  3300. Color = d3dcolorxrgb(0, 235, 0)
  3301.  
  3302. Case 27
  3303. Color = d3dcolorxrgb(0, 245, 0)
  3304.  
  3305. Case 28
  3306. Color = d3dcolorxrgb(0, 255, 0)
  3307.  
  3308. End Select
  3309.  
  3310. ElseIf .GranPoder = 1 Then
  3311.  
  3312. Select Case SegundosPoder
  3313.  
  3314. Case 0
  3315. Color = d3dcolorxrgb(225, 225, 225)
  3316.  
  3317. Case 1
  3318. Color = d3dcolorxrgb(215, 215, 215)
  3319.  
  3320. Case 2
  3321. Color = d3dcolorxrgb(210, 210, 210)
  3322.  
  3323. Case 3
  3324. Color = d3dcolorxrgb(200, 200, 200)
  3325.  
  3326. Case 4
  3327. Color = d3dcolorxrgb(190, 190, 190)
  3328.  
  3329. Case 5
  3330. Color = d3dcolorxrgb(180, 180, 180)
  3331.  
  3332. Case 6
  3333. Color = d3dcolorxrgb(170, 170, 170)
  3334.  
  3335. Case 7
  3336. Color = d3dcolorxrgb(160, 160, 160)
  3337.  
  3338. Case 8
  3339. Color = d3dcolorxrgb(150, 150, 150)
  3340.  
  3341. Case 9
  3342. Color = d3dcolorxrgb(140, 140, 140)
  3343.  
  3344. Case 10
  3345. Color = d3dcolorxrgb(130, 130, 130)
  3346.  
  3347. Case 11
  3348. Color = d3dcolorxrgb(120, 120, 120)
  3349.  
  3350. Case 12
  3351. Color = d3dcolorxrgb(110, 110, 110)
  3352.  
  3353. Case 13
  3354. Color = d3dcolorxrgb(90, 90, 90)
  3355.  
  3356. Case 14
  3357. Color = d3dcolorxrgb(100, 100, 100)
  3358.  
  3359. Case 15
  3360. Color = d3dcolorxrgb(110, 110, 110)
  3361.  
  3362. Case 16
  3363. Color = d3dcolorxrgb(120, 120, 120)
  3364.  
  3365. Case 17
  3366. Color = d3dcolorxrgb(130, 130, 130)
  3367.  
  3368. Case 18
  3369. Color = d3dcolorxrgb(140, 140, 140)
  3370.  
  3371. Case 19
  3372. Color = d3dcolorxrgb(150, 150, 150)
  3373.  
  3374. Case 20
  3375. Color = d3dcolorxrgb(160, 160, 160)
  3376.  
  3377. Case 21
  3378. Color = d3dcolorxrgb(170, 170, 170)
  3379.  
  3380. Case 22
  3381. Color = d3dcolorxrgb(180, 180, 180)
  3382.  
  3383. Case 23
  3384. Color = d3dcolorxrgb(190, 190, 190)
  3385.  
  3386. Case 24
  3387. Color = d3dcolorxrgb(200, 200, 200)
  3388.  
  3389. End Select
  3390.  
  3391. ElseIf .TieneCastillos = 1 Then
  3392.  
  3393. Select Case SegundosCastillos
  3394.  
  3395. Case 0
  3396. Color = d3dcolorxrgb(255, 255, 200)
  3397.  
  3398. Case 1
  3399. Color = d3dcolorxrgb(255, 255, 190)
  3400.  
  3401. Case 2
  3402. Color = d3dcolorxrgb(255, 255, 180)
  3403.  
  3404. Case 3
  3405. Color = d3dcolorxrgb(255, 255, 175)
  3406.  
  3407. Case 4
  3408. Color = d3dcolorxrgb(255, 255, 160)
  3409.  
  3410. Case 5
  3411. Color = d3dcolorxrgb(255, 255, 150)
  3412.  
  3413. Case 6
  3414. Color = d3dcolorxrgb(255, 255, 140)
  3415.  
  3416. Case 7
  3417. Color = d3dcolorxrgb(255, 255, 130)
  3418.  
  3419. Case 8
  3420. Color = d3dcolorxrgb(255, 255, 120)
  3421.  
  3422. Case 9
  3423. Color = d3dcolorxrgb(255, 255, 110)
  3424.  
  3425. Case 10
  3426. Color = d3dcolorxrgb(255, 255, 100)
  3427.  
  3428. Case 11
  3429. Color = d3dcolorxrgb(255, 255, 90)
  3430.  
  3431. Case 12
  3432. Color = d3dcolorxrgb(255, 255, 80)
  3433.  
  3434. Case 13
  3435. Color = d3dcolorxrgb(255, 255, 70)
  3436.  
  3437. Case 14
  3438. Color = d3dcolorxrgb(255, 255, 60)
  3439.  
  3440. Case 15
  3441. Color = d3dcolorxrgb(255, 255, 50)
  3442.  
  3443. Case 16
  3444. Color = d3dcolorxrgb(255, 255, 40)
  3445.  
  3446. Case 17
  3447. Color = d3dcolorxrgb(255, 255, 50)
  3448.  
  3449. Case 18
  3450. Color = d3dcolorxrgb(255, 255, 60)
  3451.  
  3452. Case 19
  3453. Color = d3dcolorxrgb(255, 255, 70)
  3454.  
  3455. Case 20
  3456. Color = d3dcolorxrgb(255, 255, 80)
  3457.  
  3458. Case 21
  3459. Color = d3dcolorxrgb(255, 255, 90)
  3460.  
  3461. Case 22
  3462. Color = d3dcolorxrgb(255, 255, 100)
  3463.  
  3464. Case 23
  3465. Color = d3dcolorxrgb(255, 255, 110)
  3466.  
  3467. Case 24
  3468. Color = d3dcolorxrgb(255, 255, 120)
  3469.  
  3470. Case 25
  3471. Color = d3dcolorxrgb(255, 255, 130)
  3472.  
  3473. Case 26
  3474. Color = d3dcolorxrgb(255, 255, 140)
  3475.  
  3476. Case 27
  3477. Color = d3dcolorxrgb(255, 255, 150)
  3478.  
  3479. Case 28
  3480. Color = d3dcolorxrgb(255, 255, 160)
  3481.  
  3482. Case 29
  3483. Color = d3dcolorxrgb(255, 255, 170)
  3484.  
  3485. Case 30
  3486. Color = d3dcolorxrgb(255, 255, 180)
  3487.  
  3488. Case 31
  3489. Color = d3dcolorxrgb(255, 255, 190)
  3490.  
  3491. Case 32
  3492. Color = d3dcolorxrgb(255, 255, 200)
  3493.  
  3494. End Select
  3495.  
  3496. Else
  3497. Color = d3dcolorxrgb(ColoresPJ(5).r, ColoresPJ(5).g, ColoresPJ(5).B)
  3498.  
  3499. End If
  3500.  
  3501. 'Consejo caos
  3502. Case 6
  3503.  
  3504. If charlist(MapData(X, Y).charindex).invisible Then
  3505. Color = d3dcolorxrgb(ColoresPJ(24).r, ColoresPJ(24).g, ColoresPJ(24).B)
  3506. ElseIf .ColorBlue = 1 Then
  3507. Color = d3dcolorxrgb(ColoresPJ(49).r, ColoresPJ(49).g, ColoresPJ(49).B)
  3508. ElseIf .ColorRed = 1 Then
  3509. Color = d3dcolorxrgb(ColoresPJ(50).r, ColoresPJ(50).g, ColoresPJ(50).B)
  3510. ElseIf .EsNoble = 1 Then
  3511.  
  3512. Select Case SegundosNoble
  3513.  
  3514. Case 0
  3515. Color = d3dcolorxrgb(0, 255, 0)
  3516.  
  3517. Case 1
  3518. Color = d3dcolorxrgb(0, 245, 0)
  3519.  
  3520. Case 2
  3521. Color = d3dcolorxrgb(0, 235, 0)
  3522.  
  3523. Case 3
  3524. Color = d3dcolorxrgb(0, 225, 0)
  3525.  
  3526. Case 4
  3527. Color = d3dcolorxrgb(0, 215, 0)
  3528.  
  3529. Case 5
  3530. Color = d3dcolorxrgb(0, 205, 0)
  3531.  
  3532. Case 6
  3533. Color = d3dcolorxrgb(0, 195, 0)
  3534.  
  3535. Case 7
  3536. Color = d3dcolorxrgb(0, 185, 0)
  3537.  
  3538. Case 8
  3539. Color = d3dcolorxrgb(0, 175, 0)
  3540.  
  3541. Case 9
  3542. Color = d3dcolorxrgb(0, 165, 0)
  3543.  
  3544. Case 10
  3545. Color = d3dcolorxrgb(0, 155, 0)
  3546.  
  3547. Case 11
  3548. Color = d3dcolorxrgb(0, 145, 0)
  3549.  
  3550. Case 12
  3551. Color = d3dcolorxrgb(0, 135, 0)
  3552.  
  3553. Case 13
  3554. Color = d3dcolorxrgb(0, 125, 0)
  3555.  
  3556. Case 14
  3557. Color = d3dcolorxrgb(0, 115, 0)
  3558.  
  3559. Case 15
  3560. Color = d3dcolorxrgb(0, 125, 0)
  3561.  
  3562. Case 16
  3563. Color = d3dcolorxrgb(0, 135, 0)
  3564.  
  3565. Case 17
  3566. Color = d3dcolorxrgb(0, 145, 0)
  3567.  
  3568. Case 18
  3569. Color = d3dcolorxrgb(0, 155, 0)
  3570.  
  3571. Case 19
  3572. Color = d3dcolorxrgb(0, 165, 0)
  3573.  
  3574. Case 20
  3575. Color = d3dcolorxrgb(0, 175, 0)
  3576.  
  3577. Case 21
  3578. Color = d3dcolorxrgb(0, 185, 0)
  3579.  
  3580. Case 22
  3581. Color = d3dcolorxrgb(0, 195, 0)
  3582.  
  3583. Case 23
  3584. Color = d3dcolorxrgb(0, 205, 0)
  3585.  
  3586. Case 24
  3587. Color = d3dcolorxrgb(0, 215, 0)
  3588.  
  3589. Case 25
  3590. Color = d3dcolorxrgb(0, 225, 0)
  3591.  
  3592. Case 26
  3593. Color = d3dcolorxrgb(0, 235, 0)
  3594.  
  3595. Case 27
  3596. Color = d3dcolorxrgb(0, 245, 0)
  3597.  
  3598. Case 28
  3599. Color = d3dcolorxrgb(0, 255, 0)
  3600.  
  3601. End Select
  3602.  
  3603. ElseIf .GranPoder = 1 Then
  3604.  
  3605. Select Case SegundosPoder
  3606.  
  3607. Case 0
  3608. Color = d3dcolorxrgb(225, 225, 225)
  3609.  
  3610. Case 1
  3611. Color = d3dcolorxrgb(215, 215, 215)
  3612.  
  3613. Case 2
  3614. Color = d3dcolorxrgb(210, 210, 210)
  3615.  
  3616. Case 3
  3617. Color = d3dcolorxrgb(200, 200, 200)
  3618.  
  3619. Case 4
  3620. Color = d3dcolorxrgb(190, 190, 190)
  3621.  
  3622. Case 5
  3623. Color = d3dcolorxrgb(180, 180, 180)
  3624.  
  3625. Case 6
  3626. Color = d3dcolorxrgb(170, 170, 170)
  3627.  
  3628. Case 7
  3629. Color = d3dcolorxrgb(160, 160, 160)
  3630.  
  3631. Case 8
  3632. Color = d3dcolorxrgb(150, 150, 150)
  3633.  
  3634. Case 9
  3635. Color = d3dcolorxrgb(140, 140, 140)
  3636.  
  3637. Case 10
  3638. Color = d3dcolorxrgb(130, 130, 130)
  3639.  
  3640. Case 11
  3641. Color = d3dcolorxrgb(120, 120, 120)
  3642.  
  3643. Case 12
  3644. Color = d3dcolorxrgb(110, 110, 110)
  3645.  
  3646. Case 13
  3647. Color = d3dcolorxrgb(90, 90, 90)
  3648.  
  3649. Case 14
  3650. Color = d3dcolorxrgb(100, 100, 100)
  3651.  
  3652. Case 15
  3653. Color = d3dcolorxrgb(110, 110, 110)
  3654.  
  3655. Case 16
  3656. Color = d3dcolorxrgb(120, 120, 120)
  3657.  
  3658. Case 17
  3659. Color = d3dcolorxrgb(130, 130, 130)
  3660.  
  3661. Case 18
  3662. Color = d3dcolorxrgb(140, 140, 140)
  3663.  
  3664. Case 19
  3665. Color = d3dcolorxrgb(150, 150, 150)
  3666.  
  3667. Case 20
  3668. Color = d3dcolorxrgb(160, 160, 160)
  3669.  
  3670. Case 21
  3671. Color = d3dcolorxrgb(170, 170, 170)
  3672.  
  3673. Case 22
  3674. Color = d3dcolorxrgb(180, 180, 180)
  3675.  
  3676. Case 23
  3677. Color = d3dcolorxrgb(190, 190, 190)
  3678.  
  3679. Case 24
  3680. Color = d3dcolorxrgb(200, 200, 200)
  3681.  
  3682. End Select
  3683.  
  3684. ElseIf .TieneCastillos = 1 Then
  3685.  
  3686. Select Case SegundosCastillos
  3687.  
  3688. Case 0
  3689. Color = d3dcolorxrgb(255, 255, 200)
  3690.  
  3691. Case 1
  3692. Color = d3dcolorxrgb(255, 255, 190)
  3693.  
  3694. Case 2
  3695. Color = d3dcolorxrgb(255, 255, 180)
  3696.  
  3697. Case 3
  3698. Color = d3dcolorxrgb(255, 255, 175)
  3699.  
  3700. Case 4
  3701. Color = d3dcolorxrgb(255, 255, 160)
  3702.  
  3703. Case 5
  3704. Color = d3dcolorxrgb(255, 255, 150)
  3705.  
  3706. Case 6
  3707. Color = d3dcolorxrgb(255, 255, 140)
  3708.  
  3709. Case 7
  3710. Color = d3dcolorxrgb(255, 255, 130)
  3711.  
  3712. Case 8
  3713. Color = d3dcolorxrgb(255, 255, 120)
  3714.  
  3715. Case 9
  3716. Color = d3dcolorxrgb(255, 255, 110)
  3717.  
  3718. Case 10
  3719. Color = d3dcolorxrgb(255, 255, 100)
  3720.  
  3721. Case 11
  3722. Color = d3dcolorxrgb(255, 255, 90)
  3723.  
  3724. Case 12
  3725. Color = d3dcolorxrgb(255, 255, 80)
  3726.  
  3727. Case 13
  3728. Color = d3dcolorxrgb(255, 255, 70)
  3729.  
  3730. Case 14
  3731. Color = d3dcolorxrgb(255, 255, 60)
  3732.  
  3733. Case 15
  3734. Color = d3dcolorxrgb(255, 255, 50)
  3735.  
  3736. Case 16
  3737. Color = d3dcolorxrgb(255, 255, 40)
  3738.  
  3739. Case 17
  3740. Color = d3dcolorxrgb(255, 255, 50)
  3741.  
  3742. Case 18
  3743. Color = d3dcolorxrgb(255, 255, 60)
  3744.  
  3745. Case 19
  3746. Color = d3dcolorxrgb(255, 255, 70)
  3747.  
  3748. Case 20
  3749. Color = d3dcolorxrgb(255, 255, 80)
  3750.  
  3751. Case 21
  3752. Color = d3dcolorxrgb(255, 255, 90)
  3753.  
  3754. Case 22
  3755. Color = d3dcolorxrgb(255, 255, 100)
  3756.  
  3757. Case 23
  3758. Color = d3dcolorxrgb(255, 255, 110)
  3759.  
  3760. Case 24
  3761. Color = d3dcolorxrgb(255, 255, 120)
  3762.  
  3763. Case 25
  3764. Color = d3dcolorxrgb(255, 255, 130)
  3765.  
  3766. Case 26
  3767. Color = d3dcolorxrgb(255, 255, 140)
  3768.  
  3769. Case 27
  3770. Color = d3dcolorxrgb(255, 255, 150)
  3771.  
  3772. Case 28
  3773. Color = d3dcolorxrgb(255, 255, 160)
  3774.  
  3775. Case 29
  3776. Color = d3dcolorxrgb(255, 255, 170)
  3777.  
  3778. Case 30
  3779. Color = d3dcolorxrgb(255, 255, 180)
  3780.  
  3781. Case 31
  3782. Color = d3dcolorxrgb(255, 255, 190)
  3783.  
  3784. Case 32
  3785. Color = d3dcolorxrgb(255, 255, 200)
  3786.  
  3787. End Select
  3788.  
  3789. Else
  3790. Color = d3dcolorxrgb(ColoresPJ(6).r, ColoresPJ(6).g, ColoresPJ(6).B)
  3791.  
  3792. End If
  3793.  
  3794. Case 8
  3795.  
  3796. If charlist(MapData(X, Y).charindex).invisible Then
  3797. Color = d3dcolorxrgb(ColoresPJ(24).r, ColoresPJ(24).g, ColoresPJ(24).B)
  3798. ElseIf .ColorBlue = 1 Then
  3799. Color = d3dcolorxrgb(ColoresPJ(49).r, ColoresPJ(49).g, ColoresPJ(49).B)
  3800. ElseIf .ColorRed = 1 Then
  3801. Color = d3dcolorxrgb(ColoresPJ(50).r, ColoresPJ(50).g, ColoresPJ(50).B)
  3802. ElseIf .EsNoble = 1 Then
  3803.  
  3804. Select Case SegundosNoble
  3805.  
  3806. Case 0
  3807. Color = d3dcolorxrgb(0, 255, 0)
  3808.  
  3809. Case 1
  3810. Color = d3dcolorxrgb(0, 245, 0)
  3811.  
  3812. Case 2
  3813. Color = d3dcolorxrgb(0, 235, 0)
  3814.  
  3815. Case 3
  3816. Color = d3dcolorxrgb(0, 225, 0)
  3817.  
  3818. Case 4
  3819. Color = d3dcolorxrgb(0, 215, 0)
  3820.  
  3821. Case 5
  3822. Color = d3dcolorxrgb(0, 205, 0)
  3823.  
  3824. Case 6
  3825. Color = d3dcolorxrgb(0, 195, 0)
  3826.  
  3827. Case 7
  3828. Color = d3dcolorxrgb(0, 185, 0)
  3829.  
  3830. Case 8
  3831. Color = d3dcolorxrgb(0, 175, 0)
  3832.  
  3833. Case 9
  3834. Color = d3dcolorxrgb(0, 165, 0)
  3835.  
  3836. Case 10
  3837. Color = d3dcolorxrgb(0, 155, 0)
  3838.  
  3839. Case 11
  3840. Color = d3dcolorxrgb(0, 145, 0)
  3841.  
  3842. Case 12
  3843. Color = d3dcolorxrgb(0, 135, 0)
  3844.  
  3845. Case 13
  3846. Color = d3dcolorxrgb(0, 125, 0)
  3847.  
  3848. Case 14
  3849. Color = d3dcolorxrgb(0, 115, 0)
  3850.  
  3851. Case 15
  3852. Color = d3dcolorxrgb(0, 125, 0)
  3853.  
  3854. Case 16
  3855. Color = d3dcolorxrgb(0, 135, 0)
  3856.  
  3857. Case 17
  3858. Color = d3dcolorxrgb(0, 145, 0)
  3859.  
  3860. Case 18
  3861. Color = d3dcolorxrgb(0, 155, 0)
  3862.  
  3863. Case 19
  3864. Color = d3dcolorxrgb(0, 165, 0)
  3865.  
  3866. Case 20
  3867. Color = d3dcolorxrgb(0, 175, 0)
  3868.  
  3869. Case 21
  3870. Color = d3dcolorxrgb(0, 185, 0)
  3871.  
  3872. Case 22
  3873. Color = d3dcolorxrgb(0, 195, 0)
  3874.  
  3875. Case 23
  3876. Color = d3dcolorxrgb(0, 205, 0)
  3877.  
  3878. Case 24
  3879. Color = d3dcolorxrgb(0, 215, 0)
  3880.  
  3881. Case 25
  3882. Color = d3dcolorxrgb(0, 225, 0)
  3883.  
  3884. Case 26
  3885. Color = d3dcolorxrgb(0, 235, 0)
  3886.  
  3887. Case 27
  3888. Color = d3dcolorxrgb(0, 245, 0)
  3889.  
  3890. Case 28
  3891. Color = d3dcolorxrgb(0, 255, 0)
  3892.  
  3893. End Select
  3894.  
  3895. ElseIf .GranPoder = 1 Then
  3896.  
  3897. Select Case SegundosPoder
  3898.  
  3899. Case 0
  3900. Color = d3dcolorxrgb(225, 225, 225)
  3901.  
  3902. Case 1
  3903. Color = d3dcolorxrgb(215, 215, 215)
  3904.  
  3905. Case 2
  3906. Color = d3dcolorxrgb(210, 210, 210)
  3907.  
  3908. Case 3
  3909. Color = d3dcolorxrgb(200, 200, 200)
  3910.  
  3911. Case 4
  3912. Color = d3dcolorxrgb(190, 190, 190)
  3913.  
  3914. Case 5
  3915. Color = d3dcolorxrgb(180, 180, 180)
  3916.  
  3917. Case 6
  3918. Color = d3dcolorxrgb(170, 170, 170)
  3919.  
  3920. Case 7
  3921. Color = d3dcolorxrgb(160, 160, 160)
  3922.  
  3923. Case 8
  3924. Color = d3dcolorxrgb(150, 150, 150)
  3925.  
  3926. Case 9
  3927. Color = d3dcolorxrgb(140, 140, 140)
  3928.  
  3929. Case 10
  3930. Color = d3dcolorxrgb(130, 130, 130)
  3931.  
  3932. Case 11
  3933. Color = d3dcolorxrgb(120, 120, 120)
  3934.  
  3935. Case 12
  3936. Color = d3dcolorxrgb(110, 110, 110)
  3937.  
  3938. Case 13
  3939. Color = d3dcolorxrgb(90, 90, 90)
  3940.  
  3941. Case 14
  3942. Color = d3dcolorxrgb(100, 100, 100)
  3943.  
  3944. Case 15
  3945. Color = d3dcolorxrgb(110, 110, 110)
  3946.  
  3947. Case 16
  3948. Color = d3dcolorxrgb(120, 120, 120)
  3949.  
  3950. Case 17
  3951. Color = d3dcolorxrgb(130, 130, 130)
  3952.  
  3953. Case 18
  3954. Color = d3dcolorxrgb(140, 140, 140)
  3955.  
  3956. Case 19
  3957. Color = d3dcolorxrgb(150, 150, 150)
  3958.  
  3959. Case 20
  3960. Color = d3dcolorxrgb(160, 160, 160)
  3961.  
  3962. Case 21
  3963. Color = d3dcolorxrgb(170, 170, 170)
  3964.  
  3965. Case 22
  3966. Color = d3dcolorxrgb(180, 180, 180)
  3967.  
  3968. Case 23
  3969. Color = d3dcolorxrgb(190, 190, 190)
  3970.  
  3971. Case 24
  3972. Color = d3dcolorxrgb(200, 200, 200)
  3973.  
  3974. End Select
  3975.  
  3976. ElseIf .TieneCastillos = 1 Then
  3977.  
  3978. Select Case SegundosCastillos
  3979.  
  3980. Case 0
  3981. Color = d3dcolorxrgb(255, 255, 200)
  3982.  
  3983. Case 1
  3984. Color = d3dcolorxrgb(255, 255, 190)
  3985.  
  3986. Case 2
  3987. Color = d3dcolorxrgb(255, 255, 180)
  3988.  
  3989. Case 3
  3990. Color = d3dcolorxrgb(255, 255, 175)
  3991.  
  3992. Case 4
  3993. Color = d3dcolorxrgb(255, 255, 160)
  3994.  
  3995. Case 5
  3996. Color = d3dcolorxrgb(255, 255, 150)
  3997.  
  3998. Case 6
  3999. Color = d3dcolorxrgb(255, 255, 140)
  4000.  
  4001. Case 7
  4002. Color = d3dcolorxrgb(255, 255, 130)
  4003.  
  4004. Case 8
  4005. Color = d3dcolorxrgb(255, 255, 120)
  4006.  
  4007. Case 9
  4008. Color = d3dcolorxrgb(255, 255, 110)
  4009.  
  4010. Case 10
  4011. Color = d3dcolorxrgb(255, 255, 100)
  4012.  
  4013. Case 11
  4014. Color = d3dcolorxrgb(255, 255, 90)
  4015.  
  4016. Case 12
  4017. Color = d3dcolorxrgb(255, 255, 80)
  4018.  
  4019. Case 13
  4020. Color = d3dcolorxrgb(255, 255, 70)
  4021.  
  4022. Case 14
  4023. Color = d3dcolorxrgb(255, 255, 60)
  4024.  
  4025. Case 15
  4026. Color = d3dcolorxrgb(255, 255, 50)
  4027.  
  4028. Case 16
  4029. Color = d3dcolorxrgb(255, 255, 40)
  4030.  
  4031. Case 17
  4032. Color = d3dcolorxrgb(255, 255, 50)
  4033.  
  4034. Case 18
  4035. Color = d3dcolorxrgb(255, 255, 60)
  4036.  
  4037. Case 19
  4038. Color = d3dcolorxrgb(255, 255, 70)
  4039.  
  4040. Case 20
  4041. Color = d3dcolorxrgb(255, 255, 80)
  4042.  
  4043. Case 21
  4044. Color = d3dcolorxrgb(255, 255, 90)
  4045.  
  4046. Case 22
  4047. Color = d3dcolorxrgb(255, 255, 100)
  4048.  
  4049. Case 23
  4050. Color = d3dcolorxrgb(255, 255, 110)
  4051.  
  4052. Case 24
  4053. Color = d3dcolorxrgb(255, 255, 120)
  4054.  
  4055. Case 25
  4056. Color = d3dcolorxrgb(255, 255, 130)
  4057.  
  4058. Case 26
  4059. Color = d3dcolorxrgb(255, 255, 140)
  4060.  
  4061. Case 27
  4062. Color = d3dcolorxrgb(255, 255, 150)
  4063.  
  4064. Case 28
  4065. Color = d3dcolorxrgb(255, 255, 160)
  4066.  
  4067. Case 29
  4068. Color = d3dcolorxrgb(255, 255, 170)
  4069.  
  4070. Case 30
  4071. Color = d3dcolorxrgb(255, 255, 180)
  4072.  
  4073. Case 31
  4074. Color = d3dcolorxrgb(255, 255, 190)
  4075.  
  4076. Case 32
  4077. Color = d3dcolorxrgb(255, 255, 200)
  4078.  
  4079. End Select
  4080.  
  4081. Else
  4082. Color = d3dcolorxrgb(ColoresPJ(22).r, ColoresPJ(22).g, ColoresPJ(22).B)
  4083.  
  4084. End If
  4085.  
  4086. End Select
  4087.  
  4088. Case Is > 0 'admin
  4089.  
  4090. If .EsNoble = 1 Then
  4091.  
  4092. Select Case SegundosNoble
  4093.  
  4094. Case 0
  4095. Color = d3dcolorxrgb(0, 255, 0)
  4096.  
  4097. Case 1
  4098. Color = d3dcolorxrgb(0, 245, 0)
  4099.  
  4100. Case 2
  4101. Color = d3dcolorxrgb(0, 235, 0)
  4102.  
  4103. Case 3
  4104. Color = d3dcolorxrgb(0, 225, 0)
  4105.  
  4106. Case 4
  4107. Color = d3dcolorxrgb(0, 215, 0)
  4108.  
  4109. Case 5
  4110. Color = d3dcolorxrgb(0, 205, 0)
  4111.  
  4112. Case 6
  4113. Color = d3dcolorxrgb(0, 195, 0)
  4114.  
  4115. Case 7
  4116. Color = d3dcolorxrgb(0, 185, 0)
  4117.  
  4118. Case 8
  4119. Color = d3dcolorxrgb(0, 175, 0)
  4120.  
  4121. Case 9
  4122. Color = d3dcolorxrgb(0, 165, 0)
  4123.  
  4124. Case 10
  4125. Color = d3dcolorxrgb(0, 155, 0)
  4126.  
  4127. Case 11
  4128. Color = d3dcolorxrgb(0, 145, 0)
  4129.  
  4130. Case 12
  4131. Color = d3dcolorxrgb(0, 135, 0)
  4132.  
  4133. Case 13
  4134. Color = d3dcolorxrgb(0, 125, 0)
  4135.  
  4136. Case 14
  4137. Color = d3dcolorxrgb(0, 115, 0)
  4138.  
  4139. Case 15
  4140. Color = d3dcolorxrgb(0, 125, 0)
  4141.  
  4142. Case 16
  4143. Color = d3dcolorxrgb(0, 135, 0)
  4144.  
  4145. Case 17
  4146. Color = d3dcolorxrgb(0, 145, 0)
  4147.  
  4148. Case 18
  4149. Color = d3dcolorxrgb(0, 155, 0)
  4150.  
  4151. Case 19
  4152. Color = d3dcolorxrgb(0, 165, 0)
  4153.  
  4154. Case 20
  4155. Color = d3dcolorxrgb(0, 175, 0)
  4156.  
  4157. Case 21
  4158. Color = d3dcolorxrgb(0, 185, 0)
  4159.  
  4160. Case 22
  4161. Color = d3dcolorxrgb(0, 195, 0)
  4162.  
  4163. Case 23
  4164. Color = d3dcolorxrgb(0, 205, 0)
  4165.  
  4166. Case 24
  4167. Color = d3dcolorxrgb(0, 215, 0)
  4168.  
  4169. Case 25
  4170. Color = d3dcolorxrgb(0, 225, 0)
  4171.  
  4172. Case 26
  4173. Color = d3dcolorxrgb(0, 235, 0)
  4174.  
  4175. Case 27
  4176. Color = d3dcolorxrgb(0, 245, 0)
  4177.  
  4178. Case 28
  4179. Color = d3dcolorxrgb(0, 255, 0)
  4180.  
  4181. End Select
  4182.  
  4183. Else
  4184. Color = d3dcolorxrgb(ColoresPJ(.priv).r, ColoresPJ(.priv).g, ColoresPJ(.priv).B)
  4185.  
  4186. End If
  4187.  
  4188. Case Else 'el resto
  4189. Color = d3dcolorxrgb(ColoresPJ(.priv).r, ColoresPJ(.priv).g, ColoresPJ(.priv).B)
  4190.  
  4191. End Select
  4192.  
  4193. 'Jerarquias Azthenwok
  4194. If .priv <> 0 Then
  4195. If .priv = 1 And .EsNoble = 0 Then 'CONSE
  4196. Call Texto.Engine_Text_Draw(PixelOffsetX + 16, PixelOffsetY + 45, "<Game Master>" & line, _
  4197. Color, , DT_CENTER)
  4198. ElseIf .priv = 2 And .EsNoble = 0 Then 'SEMI DIOS
  4199. Call Texto.Engine_Text_Draw(PixelOffsetX + 16, PixelOffsetY + 45, "<Game Master>" & line, _
  4200. Color, , DT_CENTER)
  4201. ElseIf .priv = 3 And .EsNoble = 0 Then 'EVENT
  4202. Call Texto.Engine_Text_Draw(PixelOffsetX + 16, PixelOffsetY + 45, "<Game Master>" & line, _
  4203. Color, , DT_CENTER)
  4204. ElseIf .priv = 4 And .EsNoble = 0 Then 'DIOS
  4205. Call Texto.Engine_Text_Draw(PixelOffsetX + 16, PixelOffsetY + 45, "<Game Master>" & line, _
  4206. Color, , DT_CENTER)
  4207. ElseIf .priv = 5 And .EsNoble = 0 Then 'DESARROLLADOR
  4208. Call Texto.Engine_Text_Draw(PixelOffsetX + 16, PixelOffsetY + 45, "<Desarrollador>" & _
  4209. line, Color, , DT_CENTER)
  4210. ElseIf .priv = 8 And .EsNoble = 0 Then 'GRANDIOS
  4211. Call Texto.Engine_Text_Draw(PixelOffsetX + 16, PixelOffsetY + 45, "<Game Master>" & line, _
  4212. Color, , DT_CENTER)
  4213. ElseIf .priv = 9 And .EsNoble = 0 Then 'COORAINDOR
  4214. Call Texto.Engine_Text_Draw(PixelOffsetX + 16, PixelOffsetY + 45, "<Coordinador de GMs>" _
  4215. & line, Color, , DT_CENTER)
  4216. ElseIf .priv = 10 And .EsNoble = 0 Then 'DIRECTOR
  4217. Call Texto.Engine_Text_Draw(PixelOffsetX + 16, PixelOffsetY + 45, "<Director de GMs>" & _
  4218. line, Color, , DT_CENTER)
  4219. ElseIf .priv = 11 And .EsNoble = 0 Then 'ADMIN
  4220. Call Texto.Engine_Text_Draw(PixelOffsetX + 16, PixelOffsetY + 45, "<Administrador>" & _
  4221. line, Color, , DT_CENTER)
  4222.  
  4223. End If
  4224.  
  4225. End If
  4226.  
  4227. 'Nick
  4228. line = left$(.Nombre, Pos - 2)
  4229.  
  4230. If .Estrellita = 1 And Not .invisible = True Then
  4231. Call Draw_Grh(.Estrellitax, PixelOffsetX - Len(line) * 3, PixelOffsetY + 31, 1, 1, Color)
  4232.  
  4233. End If
  4234.  
  4235. If UserReputacione >= 2500 And Not .invisible = True Then
  4236. Call Draw_Grh(.Emblema, PixelOffsetX + Len(line) * 7, PixelOffsetY + 31, 1, 1, Color)
  4237.  
  4238. End If
  4239.  
  4240. Call Texto.Engine_Text_Draw(PixelOffsetX + 16, PixelOffsetY + 30, line, Color, , DT_CENTER)
  4241.  
  4242. 'Clan
  4243. 'Evitamos que se le vea el clan a los GMs / Azthenwok /
  4244. If .priv = 0 Then
  4245. line = Mid$(.Nombre, Pos)
  4246.  
  4247. Call Texto.Engine_Text_Draw(PixelOffsetX + 16, PixelOffsetY + 45, line, Color, , DT_CENTER)
  4248.  
  4249. End If
  4250.  
  4251. End If
  4252.  
  4253. End If
  4254.  
  4255. Else
  4256.  
  4257. 'Draw Alpha Body
  4258. 'Dibujado del pj en alpha
  4259. 'Gus.Canaria
  4260. 'If .Muerto = True Then Call Grh_Render(.Body.Walk(.Heading), PixelOffsetX, PixelOffsetY, , True)
  4261. ' If .Head.Head(.Heading).grhindex Then _
  4262. ' Call Grh_Render(.Head.Head(.Heading), PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y, LuzGrh(), , , True)
  4263. ' If .Casco.Head(.Heading).grhindex Then _
  4264. ' Call Grh_Render(.Casco.Head(.Heading), PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y, LuzGrh(), , , True)
  4265. ' If .arma.WeaponWalk(.Heading).grhindex Then _
  4266. Call Grh_Render(.arma.WeaponWalk(.Heading), PixelOffsetX, PixelOffsetY, LuzGrh(), , , True)
  4267. ' If .Escudo.ShieldWalk(.Heading).grhindex Then _
  4268. ' Call Grh_Render(.Escudo.ShieldWalk(.Heading), PixelOffsetX, PixelOffsetY, LuzGrh(), , , True)
  4269. End If 'If not visible
  4270.  
  4271. ''Update dialogs
  4272. Call Dialogos.UpdateDialogPos(PixelOffsetX + .Body.HeadOffset.X - 168, PixelOffsetY + .Body.HeadOffset.Y, _
  4273. charindex)
  4274.  
  4275. 'particulas para meditar
  4276. Dim I As Integer
  4277.  
  4278. If .particle_count > 0 Then
  4279.  
  4280. For I = 1 To .particle_count
  4281.  
  4282. If .particle_group(I) > 0 Then
  4283. Particle_Group_Render .particle_group(I), PixelOffsetX, PixelOffsetY
  4284.  
  4285. End If
  4286.  
  4287. Next I
  4288.  
  4289. End If
  4290.  
  4291. 'Draw FX
  4292. If .FxIndex <> 0 Then
  4293.  
  4294. If .UsandoCarita = 1 Then
  4295. Call Draw_Grh(.Fx, PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y - 20, 1, 1, _
  4296. Color, True)
  4297. Else
  4298. Call Draw_Grh(.Fx, PixelOffsetX + FxData(.FxIndex).OffsetX, PixelOffsetY + FxData(.FxIndex).OffsetY, _
  4299. 1, 1, Color, True)
  4300.  
  4301. End If
  4302.  
  4303. If .Fx.Started = 0 Then .FxIndex = 0
  4304.  
  4305. End If
  4306.  
  4307. End With
  4308.  
  4309. End Sub
  4310.  
  4311. Public Sub Start()
  4312.  
  4313. Dim f As Boolean
  4314. Dim ulttick As Long, esttick As Long
  4315. Dim timers(1 To 2) As Long
  4316. Dim LoopC As Integer
  4317.  
  4318. 'day_r_old = luz_dia(Hour(Time)).r
  4319. 'day_g_old = luz_dia(Hour(Time)).g
  4320. 'day_b_old = luz_dia(Hour(Time)).B
  4321. 'base_light = ARGB(day_r_old, day_g_old, day_b_old, 255)
  4322.  
  4323. Ambiente_Initialize
  4324.  
  4325. 'On Error Resume Next ' putos timers!!!!!
  4326.  
  4327. Do While prgRun
  4328.  
  4329. If FrmConnect.Visible = True Then
  4330. DibujarConectar
  4331. Render
  4332.  
  4333. End If
  4334.  
  4335. If FrmCrearPj.Visible = True Then
  4336. DibujarCrearpj
  4337. Render
  4338.  
  4339. End If
  4340.  
  4341. 'TODO : Porque el pausado de 20 ms???
  4342. If GetTickCount - lastTime > 60 Then
  4343. If Not pausa And frmMain.Visible And Not frmForo.Visible And Not frmComerciar.Visible And Not _
  4344. frmBancoObj.Visible And Not FrmBanco.Visible Then
  4345. CheckKeys
  4346. lastTime = GetTickCount
  4347.  
  4348. End If
  4349.  
  4350. End If
  4351.  
  4352. If frmMain.WindowState <> vbMinimized And frmMain.Visible = True Then
  4353. engine.Render
  4354. engine.DrawInv
  4355.  
  4356. Else
  4357. Sleep 10&
  4358.  
  4359. End If
  4360.  
  4361. Ambiente_CheckState
  4362.  
  4363. Rem Limitar FPS
  4364. 'While (GetTickCount - lFrameLimiter) < FramesPerSecCounter
  4365. 'Sleep 1
  4366. 'Wend
  4367. While (GetTickCount - fpsLastCheck) \ 10 < FramesPerSecCounter
  4368.  
  4369. Sleep 5
  4370. Wend
  4371.  
  4372. lFrameLimiter = GetTickCount
  4373. FramesPerSecCounter = FramesPerSecCounter + 1
  4374. timerElapsedTime = GetElapsedTime()
  4375. timerTicksPerFrame = timerElapsedTime * engineBaseSpeed
  4376. particletimer = timerElapsedTime * 0.5
  4377.  
  4378. esttick = GetTickCount
  4379.  
  4380. For LoopC = 1 To UBound(timers)
  4381. timers(LoopC) = timers(LoopC) + (esttick - ulttick)
  4382.  
  4383. 'Timer de trabajo
  4384. If timers(1) >= tUs Then
  4385. timers(1) = 0
  4386. NoPuedeUsar = False
  4387.  
  4388. End If
  4389.  
  4390. 'timer de attaque (77)
  4391. If timers(2) >= tAt Then
  4392. timers(2) = 0
  4393. UserCanAttack = 1
  4394. UserPuedeRefrescar = True
  4395.  
  4396. End If
  4397.  
  4398. Next LoopC
  4399.  
  4400. ulttick = GetTickCount
  4401.  
  4402. DoEvents
  4403. Loop
  4404.  
  4405. engine.Engine_Deinit
  4406.  
  4407. EngineRun = False
  4408. frmCargando.Show
  4409.  
  4410. 'Destruimos los objetos públicos creados
  4411. Set SurfaceDB = Nothing
  4412. Set Dialogos = Nothing
  4413. Set DialogosClanes = Nothing
  4414. Set Audio = Nothing
  4415. Set Inventario = Nothing
  4416.  
  4417. Call UnloadAllForms
  4418.  
  4419. End
  4420.  
  4421. End Sub
  4422.  
  4423. Public Sub SetCharacterFx(ByVal charindex As Integer, _
  4424. ByVal Fx As Integer, _
  4425. ByVal Loops As Integer)
  4426.  
  4427. '***************************************************
  4428. 'Author: Juan Martín Sotuyo Dodero (Maraxus)
  4429. 'Last Modify Date: 12/03/04
  4430. 'Sets an FX to the character.
  4431. '***************************************************
  4432. With charlist(charindex)
  4433. .FxIndex = Fx
  4434.  
  4435. If .FxIndex > 0 Then
  4436. Call InitGrh(.Fx, FxData(Fx).Animacion)
  4437.  
  4438. .Fx.Loops = Loops
  4439.  
  4440. End If
  4441.  
  4442. End With
  4443.  
  4444. End Sub
  4445.  
  4446. Public Sub Char_Move_by_Head(ByVal charindex As Integer, ByVal nHeading As E_Heading)
  4447. '*****************************************************************
  4448. 'Starts the movement of a character in nHeading direction
  4449. '*****************************************************************
  4450. Dim addx As Integer
  4451. Dim addy As Integer
  4452. Dim X As Integer
  4453. Dim Y As Integer
  4454. Dim nX As Integer
  4455. Dim nY As Integer
  4456.  
  4457. With charlist(charindex)
  4458. X = .Pos.X
  4459. Y = .Pos.Y
  4460.  
  4461. 'Figure out which way to move
  4462. Select Case nHeading
  4463.  
  4464. Case E_Heading.NORTH
  4465. addy = -1
  4466.  
  4467. Case E_Heading.EAST
  4468. addx = 1
  4469.  
  4470. Case E_Heading.SOUTH
  4471. addy = 1
  4472.  
  4473. Case E_Heading.WEST
  4474. addx = -1
  4475.  
  4476. End Select
  4477.  
  4478. nX = X + addx
  4479. nY = Y + addy
  4480.  
  4481. If nX < 1 Or nX > 100 Or nY < 1 Or nY > 100 Then Exit Sub
  4482. MapData(nX, nY).charindex = charindex
  4483. .Pos.X = nX
  4484. .Pos.Y = nY
  4485. MapData(X, Y).charindex = 0
  4486.  
  4487. .MoveOffsetX = -1 * (32 * addx)
  4488. .MoveOffsetY = -1 * (32 * addy)
  4489.  
  4490. .Moving = 1
  4491. .Heading = nHeading
  4492.  
  4493. .scrollDirectionX = addx
  4494. .scrollDirectionY = addy
  4495.  
  4496. End With
  4497.  
  4498. If UserEstado <> 1 Then Call DoPasosFx(charindex)
  4499.  
  4500. 'areas viejos
  4501. If (nY < MinLimiteY) Or (nY > MaxLimiteY) Or (nX < MinLimiteX) Or (nX > MaxLimiteX) Then
  4502. Call EraseChar(charindex)
  4503.  
  4504. End If
  4505.  
  4506. End Sub
  4507.  
  4508. Public Sub Char_Move_by_Pos(ByVal charindex As Integer, _
  4509. ByVal nX As Integer, _
  4510. ByVal nY As Integer)
  4511.  
  4512. If charindex = UserCharIndex And UserParalizado Then Exit Sub
  4513.  
  4514. On Error Resume Next
  4515.  
  4516. Dim X As Integer
  4517. Dim Y As Integer
  4518. Dim addx As Integer
  4519. Dim addy As Integer
  4520. Dim nHeading As E_Heading
  4521.  
  4522. With charlist(charindex)
  4523. X = .Pos.X
  4524. Y = .Pos.Y
  4525.  
  4526. MapData(X, Y).charindex = 0
  4527.  
  4528. addx = nX - X
  4529. addy = nY - Y
  4530.  
  4531. If Sgn(addx) = 1 Then
  4532. nHeading = E_Heading.EAST
  4533.  
  4534. End If
  4535.  
  4536. If Sgn(addx) = -1 Then
  4537. nHeading = E_Heading.WEST
  4538.  
  4539. End If
  4540.  
  4541. If Sgn(addy) = -1 Then
  4542. nHeading = E_Heading.NORTH
  4543.  
  4544. End If
  4545.  
  4546. If Sgn(addy) = 1 Then
  4547. nHeading = E_Heading.SOUTH
  4548.  
  4549. End If
  4550.  
  4551. MapData(nX, nY).charindex = charindex
  4552.  
  4553. .Pos.X = nX
  4554. .Pos.Y = nY
  4555.  
  4556. .MoveOffsetX = -1 * (32 * addx)
  4557. .MoveOffsetY = -1 * (32 * addy)
  4558.  
  4559. .Moving = 1
  4560. .Heading = nHeading
  4561.  
  4562. .scrollDirectionX = Sgn(addx)
  4563. .scrollDirectionY = Sgn(addy)
  4564.  
  4565. 'parche para que no medite cuando camina
  4566. If .FxIndex = FxMeditar.CHICO Or .FxIndex = FxMeditar.GRANDE Or .FxIndex = FxMeditar.MEDIANO Or .FxIndex = _
  4567. FxMeditar.XGRANDE Or .FxIndex = FxMeditar.TRANSFO Then
  4568. .FxIndex = 0
  4569.  
  4570. End If
  4571.  
  4572. End With
  4573.  
  4574. If Not EstaPCarea(charindex) Then
  4575. Call Dialogos.RemoveDialog(charindex)
  4576.  
  4577. 'Call Hits.RemoveHit(CharIndex)
  4578. End If
  4579.  
  4580. If (nY < MinLimiteY) Or (nY > MaxLimiteY) Or (nX < MinLimiteX) Or (nX > MaxLimiteX) Then
  4581. Call EraseChar(charindex)
  4582.  
  4583. End If
  4584.  
  4585. End Sub
  4586.  
  4587. Private Function EstaPCarea(ByVal charindex As Integer) As Boolean
  4588.  
  4589. With charlist(charindex).Pos
  4590. EstaPCarea = .X > UserPos.X - MinXBorder And .X < UserPos.X + MinXBorder And .Y > UserPos.Y - MinYBorder And _
  4591. .Y < UserPos.Y + MinYBorder
  4592.  
  4593. End With
  4594.  
  4595. End Function
  4596.  
  4597. Public Function RemoveCharAparence(ByVal charindex As Integer, _
  4598. ByVal Muerto As Integer, _
  4599. ByVal Body As Integer, _
  4600. ByVal Head As Integer, _
  4601. ByVal Heading As E_Heading, _
  4602. ByVal tempint As Integer, _
  4603. ByVal tempweap As Integer, _
  4604. ByVal tempesc As Integer, _
  4605. ByVal Fx As Integer, _
  4606. ByVal Loops As Integer)
  4607.  
  4608. charindex = charindex
  4609. charlist(charindex).Muerto = Muerto = 500
  4610.  
  4611. If Body > NumCuerpos Then
  4612. frmMensaje.Msg = "El body no existe."
  4613. frmMensaje.Show , frmMain
  4614. Exit Function
  4615.  
  4616. End If
  4617.  
  4618. charlist(charindex).Body = BodyData(Body)
  4619. charlist(charindex).Head = HeadData(Head)
  4620. charlist(charindex).Heading = Heading
  4621. charlist(charindex).FxIndex = Fx
  4622. charlist(charindex).Fx.Loops = Loops
  4623. tempint = tempint
  4624.  
  4625. If tempint <> 0 Then charlist(charindex).arma = WeaponAnimData(tempint)
  4626. tempint = tempweap
  4627.  
  4628. If tempint <> 0 Then charlist(charindex).Escudo = ShieldAnimData(tempint)
  4629. tempint = tempesc
  4630.  
  4631. If tempint <> 0 Then charlist(charindex).Casco = CascoAnimData(tempint)
  4632. Call SetCharacterFx(charindex, charlist(charindex).FxIndex, charlist(charindex).Fx.Loops)
  4633.  
  4634. Call RefreshAllChars
  4635.  
  4636. End Function
  4637.  
  4638. Public Sub Draw_FilledBox(ByVal X As Integer, _
  4639. ByVal Y As Integer, _
  4640. ByVal Width As Integer, _
  4641. ByVal Height As Integer, _
  4642. Color As Long, _
  4643. outlinecolor As Long)
  4644.  
  4645. Static box_rect As RECT
  4646. Static Outline As RECT
  4647. Static rgb_list(3) As Long
  4648. Static rgb_list2(3) As Long
  4649. Static Vertex(3) As TLVERTEX
  4650. Static Vertex2(3) As TLVERTEX
  4651.  
  4652. rgb_list(0) = Color
  4653. rgb_list(1) = Color
  4654. rgb_list(2) = Color
  4655. rgb_list(3) = Color
  4656.  
  4657. rgb_list2(0) = outlinecolor
  4658. rgb_list2(1) = outlinecolor
  4659. rgb_list2(2) = outlinecolor
  4660. rgb_list2(3) = outlinecolor
  4661.  
  4662. With box_rect
  4663. .bottom = Y + Height - 1
  4664. .left = X
  4665. .Right = X + Width - 1
  4666. .top = Y
  4667.  
  4668. End With
  4669.  
  4670. With Outline
  4671. .bottom = Y + Height
  4672. .left = X - 1
  4673. .Right = X + Width
  4674. .top = Y - 1
  4675.  
  4676. End With
  4677.  
  4678. Geometry_Create_Box Vertex2(), Outline, Outline, rgb_list2(), 0, 0
  4679. Geometry_Create_Box Vertex(), box_rect, box_rect, rgb_list(), 0, 0
  4680.  
  4681. D3DDevice.SetTexture 0, Nothing
  4682. D3DDevice.DrawPrimitiveUP D3DPT_TRIANGLESTRIP, 2, Vertex2(0), Len(Vertex2(0))
  4683. D3DDevice.DrawPrimitiveUP D3DPT_TRIANGLESTRIP, 2, Vertex(0), Len(Vertex(0))
  4684.  
  4685. End Sub
  4686.  
  4687. Public Sub DrawInv()
  4688. Static re As RECT
  4689. re.left = 0
  4690. re.top = 0
  4691. re.bottom = 160
  4692. re.Right = 160
  4693.  
  4694. D3DDevice.Clear 0, ByVal 0, D3DCLEAR_TARGET, 0, 0, 0
  4695. D3DDevice.BeginScene
  4696.  
  4697. Inventario.DrawInventory
  4698.  
  4699. D3DDevice.EndScene
  4700. D3DDevice.Present re, ByVal 0, frmMain.picInv.hWnd, ByVal 0
  4701.  
  4702. End Sub
  4703.  
  4704. Public Sub GrhRenderToHdc(ByVal grh_index As Long, _
  4705. desthDC As Long, _
  4706. ByVal screen_x As Integer, _
  4707. ByVal screen_y As Integer, _
  4708. Optional transparent As Boolean = False)
  4709.  
  4710. Dim file_path As String
  4711. Dim src_x As Integer
  4712. Dim src_y As Integer
  4713. Dim src_width As Integer
  4714. Dim src_height As Integer
  4715. Dim hdcsrc As Long
  4716. Dim MaskDC As Long
  4717. Dim PrevObj As Long
  4718. Dim PrevObj2 As Long
  4719.  
  4720. If grh_index <= 0 Then Exit Sub
  4721.  
  4722. 'If it's animated switch grh_index to first frame
  4723. If GrhData(grh_index).NumFrames <> 1 Then
  4724. grh_index = GrhData(grh_index).Frames(1)
  4725.  
  4726. End If
  4727.  
  4728. file_path = DirGraficos & GrhData(grh_index).FileNum & ".bmp"
  4729.  
  4730. src_x = GrhData(grh_index).sX
  4731. src_y = GrhData(grh_index).sY
  4732. src_width = GrhData(grh_index).pixelWidth
  4733. src_height = GrhData(grh_index).pixelHeight
  4734.  
  4735. hdcsrc = CreateCompatibleDC(desthDC)
  4736. PrevObj = SelectObject(hdcsrc, LoadPicture(file_path))
  4737.  
  4738. If transparent = False Then
  4739. BitBlt desthDC, screen_x, screen_y, src_width, src_height, hdcsrc, src_x, src_y, vbSrcCopy
  4740. Else
  4741. MaskDC = CreateCompatibleDC(desthDC)
  4742.  
  4743. PrevObj2 = SelectObject(MaskDC, LoadPicture(file_path))
  4744.  
  4745. Grh_Create_Mask hdcsrc, MaskDC, src_x, src_y, src_width, src_height
  4746.  
  4747. 'Render tranparently
  4748. BitBlt desthDC, screen_x, screen_y, src_width, src_height, MaskDC, src_x, src_y, vbSrcAnd
  4749. BitBlt desthDC, screen_x, screen_y, src_width, src_height, hdcsrc, src_x, src_y, vbSrcPaint
  4750.  
  4751. Call DeleteObject(SelectObject(MaskDC, PrevObj2))
  4752.  
  4753. DeleteDC MaskDC
  4754.  
  4755. End If
  4756.  
  4757. Call DeleteObject(SelectObject(hdcsrc, PrevObj))
  4758. DeleteDC hdcsrc
  4759.  
  4760. Exit Sub
  4761.  
  4762. End Sub
  4763.  
  4764. Private Sub Draw_Grh_Sombra(ByRef grh As grh, _
  4765. ByVal X As Integer, _
  4766. ByVal Y As Integer, _
  4767. ByVal Center As Byte, _
  4768. ByVal Animate As Byte, _
  4769. Optional ByVal Alpha As Boolean, _
  4770. Optional ByVal angle As Single, _
  4771. Optional ByVal Shadow As Byte = 0)
  4772.  
  4773. Dim CurrentGrhIndex As Integer
  4774.  
  4775. If grh.grhindex = 0 Then Exit Sub
  4776. If Animate Then
  4777. If grh.Started = 1 Then
  4778. If grh.FrameCounter > GrhData(grh.grhindex).NumFrames Then
  4779. grh.FrameCounter = (grh.FrameCounter Mod GrhData(grh.grhindex).NumFrames) + 1
  4780.  
  4781. If grh.Loops <> -1 Then
  4782. If grh.Loops > 0 Then
  4783. grh.Loops = grh.Loops - 1
  4784. Else
  4785. grh.Started = 0
  4786.  
  4787. End If
  4788.  
  4789. End If
  4790.  
  4791. End If
  4792.  
  4793. End If
  4794.  
  4795. End If
  4796.  
  4797. 'Figure out what frame to draw (always 1 if not animated)
  4798. CurrentGrhIndex = GrhData(grh.grhindex).Frames(grh.FrameCounter)
  4799.  
  4800. 'Center Grh over X,Y pos
  4801. If Center Then
  4802. If GrhData(CurrentGrhIndex).TileWidth <> 1 Then
  4803. X = X - Int(GrhData(CurrentGrhIndex).TileWidth * (32 \ 2)) + 32 \ 2
  4804.  
  4805. End If
  4806.  
  4807. If GrhData(grh.grhindex).TileHeight <> 1 Then
  4808. Y = Y - Int(GrhData(CurrentGrhIndex).TileHeight * 32) + 32
  4809.  
  4810. End If
  4811.  
  4812. End If
  4813.  
  4814. Dim shadowRgb(3) As Long
  4815. shadowRgb(0) = 1677721600
  4816. shadowRgb(1) = 1677721600
  4817. shadowRgb(2) = 1677721600
  4818. shadowRgb(3) = 1677721600
  4819.  
  4820. Device_Box_Textured_Render CurrentGrhIndex, X + 5, Y + 8, (GrhData(CurrentGrhIndex).pixelWidth / 1.4), (GrhData( _
  4821. CurrentGrhIndex).pixelHeight / 1.6), shadowRgb(), GrhData(CurrentGrhIndex).sX, GrhData( _
  4822. CurrentGrhIndex).sY, Alpha, angle, 1
  4823.  
  4824. End Sub
  4825.  
  4826. '----------------------------------------PARTICULAS---------------------------------
  4827. Private Sub Convert_Heading_to_Direction(ByVal Heading As Long, _
  4828. ByRef direction_x As Integer, _
  4829. ByRef direction_y As Integer)
  4830. '**************************************************************
  4831. 'Author: Aaron Perkins
  4832. 'Last Modify Date: 10/07/2002
  4833. '
  4834. '**************************************************************
  4835. Dim addy As Long
  4836. Dim addx As Long
  4837.  
  4838. 'Figure out which way to move
  4839. Select Case Heading
  4840.  
  4841. Case 1
  4842. addy = -1
  4843.  
  4844. Case 2
  4845. addx = 1
  4846.  
  4847. Case 3
  4848. addy = 1
  4849.  
  4850. Case 4
  4851. addx = -1
  4852.  
  4853. End Select
  4854.  
  4855. direction_x = direction_x + addx
  4856. direction_y = direction_y + addy
  4857.  
  4858. End Sub
  4859.  
  4860. Private Function Particle_Group_Next_Open() As Long
  4861.  
  4862. '*****************************************************************
  4863. 'Author: Aaron Perkins
  4864. 'Last Modify Date: 10/07/2002
  4865. '
  4866. '*****************************************************************
  4867. On Error GoTo ErrorHandler:
  4868.  
  4869. Dim LoopC As Long
  4870.  
  4871. If particle_group_last = 0 Then
  4872. Particle_Group_Next_Open = 1
  4873. Exit Function
  4874.  
  4875. End If
  4876.  
  4877. LoopC = 1
  4878.  
  4879. Do Until particle_group_list(LoopC).active = False
  4880.  
  4881. If LoopC = particle_group_last Then
  4882. Particle_Group_Next_Open = particle_group_last + 1
  4883. Exit Function
  4884.  
  4885. End If
  4886.  
  4887. LoopC = LoopC + 1
  4888. Loop
  4889.  
  4890. Particle_Group_Next_Open = LoopC
  4891. Exit Function
  4892. ErrorHandler:
  4893. Particle_Group_Next_Open = 1
  4894.  
  4895. End Function
  4896.  
  4897. Public Function Particle_Group_Create(ByVal map_x As Integer, _
  4898. ByVal map_y As Integer, _
  4899. ByRef grh_index_list() As Long, _
  4900. ByRef rgb_list() As Long, _
  4901. Optional ByVal particle_count As Long = 20, _
  4902. Optional ByVal stream_type As Long = 1, _
  4903. Optional ByVal alpha_blend As Boolean, _
  4904. Optional ByVal alive_counter As Long = -1, _
  4905. Optional ByVal frame_speed As Single = 0.5, _
  4906. Optional ByVal id As Long, _
  4907. Optional ByVal X1 As Integer, _
  4908. Optional ByVal Y1 As Integer, _
  4909. Optional ByVal angle As Integer, _
  4910. Optional ByVal vecx1 As Integer, _
  4911. Optional ByVal vecx2 As Integer, _
  4912. Optional ByVal vecy1 As Integer, _
  4913. Optional ByVal vecy2 As Integer, _
  4914. Optional ByVal life1 As Integer, _
  4915. Optional ByVal life2 As Integer, _
  4916. Optional ByVal fric As Integer, _
  4917. Optional ByVal spin_speedL As Single, _
  4918. Optional ByVal gravity As Boolean, _
  4919. Optional grav_strength As Long, _
  4920. Optional bounce_strength As Long, _
  4921. Optional ByVal X2 As Integer, Optional ByVal Y2 As Integer, Optional ByVal XMove As Boolean, Optional ByVal move_x1 As Integer, Optional ByVal move_x2 As Integer, Optional ByVal move_y1 As Integer, Optional ByVal move_y2 As Integer, Optional ByVal YMove As Boolean, Optional ByVal spin_speedH As Single, Optional ByVal spin As Boolean, Optional grh_resize As Boolean, Optional grh_resizex As Integer, Optional grh_resizey As Integer) As Long
  4922.  
  4923. '**************************************************************
  4924. 'Author: Aaron Perkins
  4925. 'Last Modify Date: 12/15/2002
  4926. 'Returns the particle_group_index if successful, else 0
  4927. '**************************************************************
  4928. If (map_x <> -1) And (map_y <> -1) Then
  4929. If Map_Particle_Group_Get(map_x, map_y) = 0 Then
  4930. Particle_Group_Create = Particle_Group_Next_Open
  4931. Particle_Group_Make Particle_Group_Create, map_x, map_y, particle_count, stream_type, grh_index_list(), _
  4932. rgb_list(), alpha_blend, alive_counter, frame_speed, id, X1, Y1, angle, vecx1, vecx2, vecy1, _
  4933. vecy2, life1, life2, fric, spin_speedL, gravity, grav_strength, bounce_strength, X2, Y2, XMove, _
  4934. move_x1, move_x2, move_y1, move_y2, YMove, spin_speedH, spin, grh_resize, grh_resizex, grh_resizey
  4935.  
  4936. End If
  4937.  
  4938. Else
  4939. Particle_Group_Create = Particle_Group_Next_Open
  4940. Particle_Group_Make Particle_Group_Create, map_x, map_y, particle_count, stream_type, grh_index_list(), _
  4941. rgb_list(), alpha_blend, alive_counter, frame_speed, id, X1, Y1, angle, vecx1, vecx2, vecy1, vecy2, _
  4942. life1, life2, fric, spin_speedL, gravity, grav_strength, bounce_strength, X2, Y2, XMove, move_x1, _
  4943. move_x2, move_y1, move_y2, YMove, spin_speedH, spin, grh_resize, grh_resizex, grh_resizey
  4944.  
  4945. End If
  4946.  
  4947. End Function
  4948.  
  4949. Public Function Particle_Group_Remove(ByVal particle_group_index As Long) As Boolean
  4950.  
  4951. '*****************************************************************
  4952. 'Author: Aaron Perkins
  4953. 'Last Modify Date: 1/04/2003
  4954. '
  4955. '*****************************************************************
  4956. 'Make sure it's a legal index
  4957. If Particle_Group_Check(particle_group_index) Then
  4958. Particle_Group_Destroy particle_group_index
  4959. Particle_Group_Remove = True
  4960.  
  4961. End If
  4962.  
  4963. End Function
  4964.  
  4965. Public Function Particle_Group_Remove_All() As Boolean
  4966. '*****************************************************************
  4967. 'Author: Aaron Perkins
  4968. 'Last Modify Date: 1/04/2003
  4969. '
  4970. '*****************************************************************
  4971. Dim Index As Long
  4972.  
  4973. For Index = 1 To particle_group_last
  4974.  
  4975. 'Make sure it's a legal index
  4976. If Particle_Group_Check(Index) Then
  4977. If Index <> SecondaryEffectIndex Then Particle_Group_Destroy Index
  4978. ' Particle_Group_Destroy Index
  4979.  
  4980. End If
  4981.  
  4982. Next Index
  4983.  
  4984. Particle_Group_Remove_All = True
  4985.  
  4986. End Function
  4987.  
  4988. Public Function Particle_Group_Find(ByVal id As Long) As Long
  4989.  
  4990. '*****************************************************************
  4991. 'Author: Aaron Perkins
  4992. 'Last Modify Date: 1/04/2003
  4993. 'Find the index related to the handle
  4994. '*****************************************************************
  4995. On Error GoTo ErrorHandler:
  4996.  
  4997. Dim LoopC As Long
  4998.  
  4999. LoopC = 1
  5000.  
  5001. Do Until particle_group_list(LoopC).id = id
  5002.  
  5003. If LoopC = particle_group_last Then
  5004. Particle_Group_Find = 0
  5005. Exit Function
  5006.  
  5007. End If
  5008.  
  5009. LoopC = LoopC + 1
  5010. Loop
  5011.  
  5012. Particle_Group_Find = LoopC
  5013. Exit Function
  5014. ErrorHandler:
  5015. Particle_Group_Find = 0
  5016.  
  5017. End Function
  5018.  
  5019. Private Sub Particle_Group_Make(ByVal particle_group_index As Long, _
  5020. ByVal map_x As Integer, _
  5021. ByVal map_y As Integer, _
  5022. ByVal particle_count As Long, _
  5023. ByVal stream_type As Long, _
  5024. ByRef grh_index_list() As Long, _
  5025. ByRef rgb_list() As Long, _
  5026. Optional ByVal alpha_blend As Boolean, _
  5027. Optional ByVal alive_counter As Long = -1, _
  5028. Optional ByVal frame_speed As Single = 0.5, _
  5029. Optional ByVal id As Long, _
  5030. Optional ByVal X1 As Integer, _
  5031. Optional ByVal Y1 As Integer, _
  5032. Optional ByVal angle As Integer, _
  5033. Optional ByVal vecx1 As Integer, _
  5034. Optional ByVal vecx2 As Integer, _
  5035. Optional ByVal vecy1 As Integer, _
  5036. Optional ByVal vecy2 As Integer, _
  5037. Optional ByVal life1 As Integer, _
  5038. Optional ByVal life2 As Integer, _
  5039. Optional ByVal fric As Integer, _
  5040. Optional ByVal spin_speedL As Single, _
  5041. Optional ByVal gravity As Boolean, _
  5042. Optional grav_strength As Long, _
  5043. Optional bounce_strength As Long, Optional ByVal X2 As Integer, Optional ByVal Y2 As Integer, Optional ByVal XMove As Boolean, Optional ByVal move_x1 As Integer, Optional ByVal move_x2 As Integer, Optional ByVal move_y1 As Integer, Optional ByVal move_y2 As Integer, Optional ByVal YMove As Boolean, Optional ByVal spin_speedH As Single, Optional ByVal spin As Boolean, Optional grh_resize As Boolean, Optional grh_resizex As Integer, Optional grh_resizey As Integer)
  5044.  
  5045. '*****************************************************************
  5046. 'Author: Aaron Perkins
  5047. 'Last Modify Date: 10/07/2002
  5048. 'Makes a new particle effect
  5049. '*****************************************************************
  5050.  
  5051. 'Update array size
  5052. If particle_group_index > particle_group_last Then
  5053. particle_group_last = particle_group_index
  5054. ReDim Preserve particle_group_list(1 To particle_group_last)
  5055.  
  5056. End If
  5057.  
  5058. particle_group_count = particle_group_count + 1
  5059.  
  5060. 'Make active
  5061. particle_group_list(particle_group_index).active = True
  5062.  
  5063. 'Map pos
  5064. If (map_x <> -1) And (map_y <> -1) Then
  5065. particle_group_list(particle_group_index).map_x = map_x
  5066. particle_group_list(particle_group_index).map_y = map_y
  5067.  
  5068. End If
  5069.  
  5070. 'Grh list
  5071. ReDim particle_group_list(particle_group_index).grh_index_list(1 To UBound(grh_index_list))
  5072. particle_group_list(particle_group_index).grh_index_list() = grh_index_list()
  5073. particle_group_list(particle_group_index).grh_index_count = UBound(grh_index_list)
  5074.  
  5075. 'Sets alive vars
  5076. If alive_counter = -1 Then
  5077. particle_group_list(particle_group_index).alive_counter = -1
  5078. particle_group_list(particle_group_index).never_die = True
  5079. Else
  5080. particle_group_list(particle_group_index).alive_counter = alive_counter
  5081. particle_group_list(particle_group_index).never_die = False
  5082.  
  5083. End If
  5084.  
  5085. 'alpha blending
  5086. particle_group_list(particle_group_index).alpha_blend = alpha_blend
  5087.  
  5088. 'stream type
  5089. particle_group_list(particle_group_index).stream_type = stream_type
  5090.  
  5091. 'speed
  5092. particle_group_list(particle_group_index).frame_speed = frame_speed
  5093.  
  5094. particle_group_list(particle_group_index).X1 = X1
  5095. particle_group_list(particle_group_index).Y1 = Y1
  5096. particle_group_list(particle_group_index).X2 = X2
  5097. particle_group_list(particle_group_index).Y2 = Y2
  5098. particle_group_list(particle_group_index).angle = angle
  5099. particle_group_list(particle_group_index).vecx1 = vecx1
  5100. particle_group_list(particle_group_index).vecx2 = vecx2
  5101. particle_group_list(particle_group_index).vecy1 = vecy1
  5102. particle_group_list(particle_group_index).vecy2 = vecy2
  5103. particle_group_list(particle_group_index).life1 = life1
  5104. particle_group_list(particle_group_index).life2 = life2
  5105. particle_group_list(particle_group_index).fric = fric
  5106. particle_group_list(particle_group_index).spin = spin
  5107. particle_group_list(particle_group_index).spin_speedL = spin_speedL
  5108. particle_group_list(particle_group_index).spin_speedH = spin_speedH
  5109. particle_group_list(particle_group_index).gravity = gravity
  5110. particle_group_list(particle_group_index).grav_strength = grav_strength
  5111. particle_group_list(particle_group_index).bounce_strength = bounce_strength
  5112. particle_group_list(particle_group_index).XMove = XMove
  5113. particle_group_list(particle_group_index).YMove = YMove
  5114. particle_group_list(particle_group_index).move_x1 = move_x1
  5115. particle_group_list(particle_group_index).move_x2 = move_x2
  5116. particle_group_list(particle_group_index).move_y1 = move_y1
  5117. particle_group_list(particle_group_index).move_y2 = move_y2
  5118.  
  5119. particle_group_list(particle_group_index).rgb_list(0) = rgb_list(0)
  5120. particle_group_list(particle_group_index).rgb_list(1) = rgb_list(1)
  5121. particle_group_list(particle_group_index).rgb_list(2) = rgb_list(2)
  5122. particle_group_list(particle_group_index).rgb_list(3) = rgb_list(3)
  5123.  
  5124. particle_group_list(particle_group_index).grh_resize = grh_resize
  5125. particle_group_list(particle_group_index).grh_resizex = grh_resizex
  5126. particle_group_list(particle_group_index).grh_resizey = grh_resizey
  5127.  
  5128. 'create particle stream
  5129. particle_group_list(particle_group_index).particle_count = particle_count
  5130. ReDim particle_group_list(particle_group_index).particle_stream(1 To particle_count)
  5131.  
  5132. 'plot particle group on map
  5133. If (map_x <> -1) And (map_y <> -1) Then
  5134. MapData(map_x, map_y).particle_group = particle_group_index
  5135.  
  5136. End If
  5137.  
  5138. End Sub
  5139.  
  5140. Private Sub Particle_Render(ByRef temp_particle As Particle, _
  5141. ByVal screen_x As Integer, _
  5142. ByVal screen_y As Integer, _
  5143. ByVal grh_index As Long, _
  5144. ByRef rgb_list() As Long, _
  5145. Optional ByVal alpha_blend As Boolean, _
  5146. Optional ByVal no_move As Boolean, _
  5147. Optional ByVal X1 As Integer, _
  5148. Optional ByVal Y1 As Integer, _
  5149. Optional ByVal angle As Integer, _
  5150. Optional ByVal vecx1 As Integer, _
  5151. Optional ByVal vecx2 As Integer, _
  5152. Optional ByVal vecy1 As Integer, _
  5153. Optional ByVal vecy2 As Integer, _
  5154. Optional ByVal life1 As Integer, _
  5155. Optional ByVal life2 As Integer, _
  5156. Optional ByVal fric As Integer, _
  5157. Optional ByVal spin_speedL As Single, _
  5158. Optional ByVal gravity As Boolean, _
  5159. Optional grav_strength As Long, _
  5160. Optional ByVal bounce_strength As Long, _
  5161. Optional ByVal X2 As Integer, _
  5162. Optional ByVal Y2 As Integer, _
  5163. Optional ByVal XMove As Boolean, _
  5164. Optional ByVal move_x1 As Integer, Optional ByVal move_x2 As Integer, Optional ByVal move_y1 As Integer, Optional ByVal move_y2 As Integer, Optional ByVal YMove As Boolean, Optional ByVal spin_speedH As Single, Optional ByVal spin As Boolean, Optional grh_resize As Boolean, Optional grh_resizex As Integer, Optional grh_resizey As Integer)
  5165. '**************************************************************
  5166. 'Author: Aaron Perkins
  5167. 'Last Modify Date: 4/24/2003
  5168. '
  5169. '**************************************************************
  5170.  
  5171. If no_move = False Then
  5172. If temp_particle.alive_counter = 0 Then
  5173. InitGrh temp_particle.grh, grh_index, alpha_blend
  5174. temp_particle.X = RandomNumber(X1, X2)
  5175. temp_particle.Y = RandomNumber(Y1, Y2)
  5176. temp_particle.vector_x = RandomNumber(vecx1, vecx2)
  5177. temp_particle.vector_y = RandomNumber(vecy1, vecy2)
  5178. temp_particle.angle = angle
  5179. temp_particle.alive_counter = RandomNumber(life1, life2)
  5180. temp_particle.friction = fric
  5181. Else
  5182.  
  5183. 'Continue old particle
  5184. 'Do gravity
  5185. If gravity = True Then
  5186. temp_particle.vector_y = temp_particle.vector_y + grav_strength
  5187.  
  5188. If temp_particle.Y > 0 Then
  5189. 'bounce
  5190. temp_particle.vector_y = bounce_strength
  5191.  
  5192. End If
  5193.  
  5194. End If
  5195.  
  5196. 'Do rotation
  5197. If spin = True Then temp_particle.grh.angle = temp_particle.grh.angle + (RandomNumber(spin_speedL, _
  5198. spin_speedH) / 100)
  5199.  
  5200. If temp_particle.angle >= 360 Then
  5201. temp_particle.angle = 0
  5202.  
  5203. End If
  5204.  
  5205. If XMove = True Then temp_particle.vector_x = RandomNumber(move_x1, move_x2)
  5206. If YMove = True Then temp_particle.vector_y = RandomNumber(move_y1, move_y2)
  5207.  
  5208. End If
  5209.  
  5210. 'Add in vector
  5211. temp_particle.X = temp_particle.X + (temp_particle.vector_x \ temp_particle.friction)
  5212. temp_particle.Y = temp_particle.Y + (temp_particle.vector_y \ temp_particle.friction)
  5213.  
  5214. 'decrement counter
  5215. temp_particle.alive_counter = temp_particle.alive_counter - 1
  5216.  
  5217. End If
  5218.  
  5219. 'Draw it
  5220. If grh_resize = True Then
  5221. If temp_particle.grh.grhindex Then
  5222. Grh_Render_Advance temp_particle.grh, temp_particle.X + screen_x, temp_particle.Y + screen_y, _
  5223. grh_resizex, grh_resizey, rgb_list(), True, True, alpha_blend
  5224. Exit Sub
  5225.  
  5226. End If
  5227.  
  5228. End If
  5229.  
  5230. 'Draw it
  5231. If temp_particle.grh.grhindex Then
  5232. Grh_Render temp_particle.grh, temp_particle.X + screen_x, temp_particle.Y + screen_y, rgb_list(), 1, False, _
  5233. True, True
  5234.  
  5235. End If
  5236.  
  5237. End Sub
  5238.  
  5239. Private Sub Particle_Group_Render(ByVal particle_group_index As Long, _
  5240. ByVal screen_x As Integer, _
  5241. ByVal screen_y As Integer)
  5242. '*****************************************************************
  5243. 'Author: Aaron Perkins
  5244. 'Last Modify Date: 12/15/2002
  5245. 'Renders a particle stream at a paticular screen point
  5246. '*****************************************************************
  5247. Dim LoopC As Long
  5248. Dim temp_rgb(0 To 3) As Long
  5249. Dim no_move As Boolean
  5250.  
  5251. 'Set colors
  5252. temp_rgb(0) = particle_group_list(particle_group_index).rgb_list(0)
  5253. temp_rgb(1) = particle_group_list(particle_group_index).rgb_list(1)
  5254. temp_rgb(2) = particle_group_list(particle_group_index).rgb_list(2)
  5255. temp_rgb(3) = particle_group_list(particle_group_index).rgb_list(3)
  5256.  
  5257. If particle_group_list(particle_group_index).alive_counter Then
  5258.  
  5259. 'See if it is time to move a particle
  5260. particle_group_list(particle_group_index).frame_counter = particle_group_list( _
  5261. particle_group_index).frame_counter + timerTicksPerFrame
  5262.  
  5263. If particle_group_list(particle_group_index).frame_counter > particle_group_list( _
  5264. particle_group_index).frame_speed Then
  5265. particle_group_list(particle_group_index).frame_counter = 0
  5266. no_move = False
  5267. Else
  5268. no_move = True
  5269.  
  5270. End If
  5271.  
  5272. 'If it's still alive render all the particles inside
  5273. For LoopC = 1 To particle_group_list(particle_group_index).particle_count
  5274.  
  5275. 'Render particle
  5276. Particle_Render particle_group_list(particle_group_index).particle_stream(LoopC), screen_x, screen_y, _
  5277. particle_group_list(particle_group_index).grh_index_list(Round(RandomNumber(1, _
  5278. particle_group_list(particle_group_index).grh_index_count), 0)), temp_rgb(), particle_group_list( _
  5279. particle_group_index).alpha_blend, no_move, particle_group_list(particle_group_index).X1, _
  5280. particle_group_list(particle_group_index).Y1, particle_group_list(particle_group_index).angle, _
  5281. particle_group_list(particle_group_index).vecx1, particle_group_list(particle_group_index).vecx2, _
  5282. particle_group_list(particle_group_index).vecy1, particle_group_list(particle_group_index).vecy2, _
  5283. particle_group_list(particle_group_index).life1, particle_group_list(particle_group_index).life2, _
  5284. particle_group_list(particle_group_index).fric, particle_group_list( _
  5285. particle_group_index).spin_speedL, particle_group_list(particle_group_index).gravity, _
  5286. particle_group_list(particle_group_index).grav_strength, particle_group_list( _
  5287. particle_group_index).bounce_strength, particle_group_list(particle_group_index).X2, _
  5288. particle_group_list(particle_group_index).Y2, particle_group_list(particle_group_index).XMove, _
  5289. particle_group_list(particle_group_index).move_x1, particle_group_list( _
  5290. particle_group_index).move_x2, particle_group_list(particle_group_index).move_y1, _
  5291. particle_group_list(particle_group_index).move_y2, particle_group_list( _
  5292. particle_group_index).YMove, particle_group_list(particle_group_index).spin_speedH, _
  5293. particle_group_list(particle_group_index).spin, particle_group_list( _
  5294. particle_group_index).grh_resize, particle_group_list(particle_group_index).grh_resizex, _
  5295. particle_group_list(particle_group_index).grh_resizey
  5296.  
  5297. Next LoopC
  5298.  
  5299. If no_move = False Then
  5300.  
  5301. 'Update the group alive counter
  5302. If particle_group_list(particle_group_index).never_die = False Then
  5303. particle_group_list(particle_group_index).alive_counter = particle_group_list( _
  5304. particle_group_index).alive_counter - 1
  5305.  
  5306. End If
  5307.  
  5308. End If
  5309.  
  5310. Else
  5311. 'If it's dead destroy it
  5312. particle_group_list(particle_group_index).particle_count = particle_group_list( _
  5313. particle_group_index).particle_count - 1
  5314.  
  5315. If particle_group_list(particle_group_index).particle_count <= 0 Then Particle_Group_Destroy _
  5316. particle_group_index
  5317.  
  5318. End If
  5319.  
  5320. End Sub
  5321.  
  5322. Public Function Particle_Type_Get(ByVal particle_index As Long) As Long
  5323.  
  5324. '*****************************************************************
  5325. 'Author: Juan Martín Sotuyo Dodero ([URL='mailto:juansotuyo@hotmail.com']juansotuyo@hotmail.com[/URL])
  5326. 'Last Modify Date: 8/27/2003
  5327. 'Returns the stream type of a particle stream
  5328. '*****************************************************************
  5329. If Particle_Group_Check(particle_index) Then
  5330. Particle_Type_Get = particle_group_list(particle_index).stream_type
  5331.  
  5332. End If
  5333.  
  5334. End Function
  5335.  
  5336. Private Function Particle_Group_Check(ByVal particle_group_index As Long) As Boolean
  5337.  
  5338. '**************************************************************
  5339. 'Author: Aaron Perkins
  5340. 'Last Modify Date: 1/04/2003
  5341. '
  5342. '**************************************************************
  5343. 'check index
  5344. If particle_group_index > 0 And particle_group_index <= particle_group_last Then
  5345. If particle_group_list(particle_group_index).active Then
  5346. Particle_Group_Check = True
  5347.  
  5348. End If
  5349.  
  5350. End If
  5351.  
  5352. End Function
  5353.  
  5354. Public Function Particle_Group_Map_Pos_Set(ByVal particle_group_index As Long, _
  5355. ByVal map_x As Long, _
  5356. ByVal map_y As Long) As Boolean
  5357.  
  5358. '**************************************************************
  5359. 'Author: Aaron Perkins
  5360. 'Last Modify Date: 5/27/2003
  5361. 'Returns true if successful, else false
  5362. '**************************************************************
  5363. 'Make sure it's a legal index
  5364. If Particle_Group_Check(particle_group_index) Then
  5365.  
  5366. 'Make sure it's a legal move
  5367. If InMapBounds(map_x, map_y) Then
  5368. 'Move it
  5369. particle_group_list(particle_group_index).map_x = map_x
  5370. particle_group_list(particle_group_index).map_y = map_y
  5371.  
  5372. Particle_Group_Map_Pos_Set = True
  5373.  
  5374. End If
  5375.  
  5376. End If
  5377.  
  5378. End Function
  5379.  
  5380. Public Function Particle_Group_Move(ByVal particle_group_index As Long, _
  5381. ByVal Heading As Long) As Boolean
  5382. '**************************************************************
  5383. 'Author: Aaron Perkins
  5384. 'Last Modify Date: 5/27/2003
  5385. 'Returns true if successful, else false
  5386. '**************************************************************
  5387. Dim map_x As Long
  5388. Dim map_y As Long
  5389. Dim nX As Integer
  5390. Dim nY As Integer
  5391.  
  5392. 'Check for valid heading
  5393. If Heading < 1 Or Heading > 8 Then
  5394. Particle_Group_Move = False
  5395. Exit Function
  5396.  
  5397. End If
  5398.  
  5399. 'Make sure it's a legal index
  5400. If Particle_Group_Check(particle_group_index) Then
  5401.  
  5402. map_x = particle_group_list(particle_group_index).map_x
  5403. map_y = particle_group_list(particle_group_index).map_y
  5404.  
  5405. nX = map_x
  5406. nY = map_y
  5407.  
  5408. Convert_Heading_to_Direction Heading, nX, nY
  5409.  
  5410. 'Make sure it's a legal move
  5411. If InMapBounds(nX, nY) Then
  5412. 'Move it
  5413. particle_group_list(particle_group_index).map_x = nX
  5414. particle_group_list(particle_group_index).map_y = nY
  5415.  
  5416. Particle_Group_Move = True
  5417.  
  5418. End If
  5419.  
  5420. End If
  5421.  
  5422. End Function
  5423.  
  5424. Private Sub Particle_Group_Destroy(ByVal particle_group_index As Long)
  5425. '**************************************************************
  5426. 'Author: Aaron Perkins
  5427. 'Last Modify Date: 10/07/2002
  5428. '
  5429. '**************************************************************
  5430. Dim Temp As particle_group
  5431. Dim I As Integer
  5432.  
  5433. If particle_group_list(particle_group_index).map_x > 0 And particle_group_list(particle_group_index).map_y > 0 Then
  5434. MapData(particle_group_list(particle_group_index).map_x, particle_group_list( _
  5435. particle_group_index).map_y).particle_group = 0
  5436. ElseIf particle_group_list(particle_group_index).char_index Then
  5437.  
  5438. If Char_Check(particle_group_list(particle_group_index).char_index) Then
  5439.  
  5440. For I = 1 To charlist(particle_group_list(particle_group_index).char_index).particle_count
  5441.  
  5442. If charlist(particle_group_list(particle_group_index).char_index).particle_group(I) = _
  5443. particle_group_index Then
  5444. charlist(particle_group_list(particle_group_index).char_index).particle_group(I) = 0
  5445. Exit For
  5446.  
  5447. End If
  5448.  
  5449. Next I
  5450.  
  5451. End If
  5452.  
  5453. ElseIf particle_group_index = SecondaryEffectIndex Then
  5454. SecondaryEffectIndex = 0
  5455.  
  5456. End If
  5457.  
  5458. particle_group_list(particle_group_index) = Temp
  5459.  
  5460. 'Update array size
  5461. If particle_group_index = particle_group_last Then
  5462.  
  5463. Do Until particle_group_list(particle_group_last).active
  5464. particle_group_last = particle_group_last - 1
  5465.  
  5466. If particle_group_last = 0 Then
  5467. particle_group_count = 0
  5468. Exit Sub
  5469.  
  5470. End If
  5471.  
  5472. Loop
  5473. ReDim Preserve particle_group_list(1 To particle_group_last)
  5474.  
  5475. End If
  5476.  
  5477. particle_group_count = particle_group_count - 1
  5478.  
  5479. End Sub
  5480.  
  5481. Private Sub Char_Particle_Group_Make(ByVal particle_group_index As Long, _
  5482. ByVal char_index As Integer, _
  5483. ByVal particle_char_index As Integer, _
  5484. ByVal particle_count As Long, _
  5485. ByVal stream_type As Long, _
  5486. ByRef grh_index_list() As Long, _
  5487. ByRef rgb_list() As Long, _
  5488. Optional ByVal alpha_blend As Boolean, _
  5489. Optional ByVal alive_counter As Long = -1, _
  5490. Optional ByVal frame_speed As Single = 0.5, _
  5491. Optional ByVal id As Long, _
  5492. Optional ByVal X1 As Integer, _
  5493. Optional ByVal Y1 As Integer, _
  5494. Optional ByVal angle As Integer, _
  5495. Optional ByVal vecx1 As Integer, _
  5496. Optional ByVal vecx2 As Integer, _
  5497. Optional ByVal vecy1 As Integer, _
  5498. Optional ByVal vecy2 As Integer, _
  5499. Optional ByVal life1 As Integer, _
  5500. Optional ByVal life2 As Integer, _
  5501. Optional ByVal fric As Integer, _
  5502. Optional ByVal spin_speedL As Single, _
  5503. Optional ByVal gravity As Boolean, _
  5504. Optional grav_strength As Long, _
  5505. Optional bounce_strength As Long, Optional ByVal X2 As Integer, Optional ByVal Y2 As Integer, Optional ByVal XMove As Boolean, Optional ByVal move_x1 As Integer, Optional ByVal move_x2 As Integer, Optional ByVal move_y1 As Integer, Optional ByVal move_y2 As Integer, Optional ByVal YMove As Boolean, Optional ByVal spin_speedH As Single, Optional ByVal spin As Boolean, Optional grh_resize As Boolean, Optional grh_resizex As Integer, Optional grh_resizey As Integer)
  5506.  
  5507. '*****************************************************************
  5508. 'Author: Aaron Perkins
  5509. 'Modified by: Ryan Cain (Onezero)
  5510. 'Last Modify Date: 5/15/2003
  5511. 'Makes a new particle effect
  5512. 'Modified by Juan Martín Sotuyo Dodero
  5513. '*****************************************************************
  5514. 'Update array size
  5515. If particle_group_index > particle_group_last Then
  5516. particle_group_last = particle_group_index
  5517. ReDim Preserve particle_group_list(1 To particle_group_last)
  5518.  
  5519. End If
  5520.  
  5521. particle_group_count = particle_group_count + 1
  5522.  
  5523. 'Make active
  5524. particle_group_list(particle_group_index).active = True
  5525.  
  5526. 'Char index
  5527. particle_group_list(particle_group_index).char_index = char_index
  5528.  
  5529. 'Grh list
  5530. ReDim particle_group_list(particle_group_index).grh_index_list(1 To UBound(grh_index_list))
  5531. particle_group_list(particle_group_index).grh_index_list() = grh_index_list()
  5532. particle_group_list(particle_group_index).grh_index_count = UBound(grh_index_list)
  5533.  
  5534. 'Sets alive vars
  5535. If alive_counter = -1 Then
  5536. particle_group_list(particle_group_index).alive_counter = -1
  5537. particle_group_list(particle_group_index).never_die = True
  5538. Else
  5539. particle_group_list(particle_group_index).alive_counter = alive_counter
  5540. particle_group_list(particle_group_index).never_die = False
  5541.  
  5542. End If
  5543.  
  5544. 'alpha blending
  5545. particle_group_list(particle_group_index).alpha_blend = alpha_blend
  5546.  
  5547. 'stream type
  5548. particle_group_list(particle_group_index).stream_type = stream_type
  5549.  
  5550. 'speed
  5551. particle_group_list(particle_group_index).frame_speed = frame_speed
  5552.  
  5553. particle_group_list(particle_group_index).X1 = X1
  5554. particle_group_list(particle_group_index).Y1 = Y1
  5555. particle_group_list(particle_group_index).X2 = X2
  5556. particle_group_list(particle_group_index).Y2 = Y2
  5557. particle_group_list(particle_group_index).angle = angle
  5558. particle_group_list(particle_group_index).vecx1 = vecx1
  5559. particle_group_list(particle_group_index).vecx2 = vecx2
  5560. particle_group_list(particle_group_index).vecy1 = vecy1
  5561. particle_group_list(particle_group_index).vecy2 = vecy2
  5562. particle_group_list(particle_group_index).life1 = life1
  5563. particle_group_list(particle_group_index).life2 = life2
  5564. particle_group_list(particle_group_index).fric = fric
  5565. particle_group_list(particle_group_index).spin = spin
  5566. particle_group_list(particle_group_index).spin_speedL = spin_speedL
  5567. particle_group_list(particle_group_index).spin_speedH = spin_speedH
  5568. particle_group_list(particle_group_index).gravity = gravity
  5569. particle_group_list(particle_group_index).grav_strength = grav_strength
  5570. particle_group_list(particle_group_index).bounce_strength = bounce_strength
  5571. particle_group_list(particle_group_index).XMove = XMove
  5572. particle_group_list(particle_group_index).YMove = YMove
  5573. particle_group_list(particle_group_index).move_x1 = move_x1
  5574. particle_group_list(particle_group_index).move_x2 = move_x2
  5575. particle_group_list(particle_group_index).move_y1 = move_y1
  5576. particle_group_list(particle_group_index).move_y2 = move_y2
  5577.  
  5578. 'color
  5579. particle_group_list(particle_group_index).rgb_list(0) = rgb_list(0)
  5580. particle_group_list(particle_group_index).rgb_list(1) = rgb_list(1)
  5581. particle_group_list(particle_group_index).rgb_list(2) = rgb_list(2)
  5582. particle_group_list(particle_group_index).rgb_list(3) = rgb_list(3)
  5583.  
  5584. particle_group_list(particle_group_index).grh_resize = grh_resize
  5585. particle_group_list(particle_group_index).grh_resizex = grh_resizex
  5586. particle_group_list(particle_group_index).grh_resizey = grh_resizey
  5587.  
  5588. 'handle
  5589. particle_group_list(particle_group_index).id = id
  5590.  
  5591. 'create particle stream
  5592. particle_group_list(particle_group_index).particle_count = particle_count
  5593. ReDim particle_group_list(particle_group_index).particle_stream(1 To particle_count)
  5594.  
  5595. 'plot particle group on char
  5596. charlist(char_index).particle_group(particle_char_index) = particle_group_index
  5597.  
  5598. End Sub
  5599.  
  5600. Public Function Char_Particle_Group_Create(ByVal char_index As Integer, _
  5601. ByRef grh_index_list() As Long, _
  5602. ByRef rgb_list() As Long, _
  5603. Optional ByVal particle_count As Long = 20, _
  5604. Optional ByVal stream_type As Long = 1, _
  5605. Optional ByVal alpha_blend As Boolean, _
  5606. Optional ByVal alive_counter As Long = -1, _
  5607. Optional ByVal frame_speed As Single = 0.5, _
  5608. Optional ByVal id As Long, _
  5609. Optional ByVal X1 As Integer, _
  5610. Optional ByVal Y1 As Integer, _
  5611. Optional ByVal angle As Integer, _
  5612. Optional ByVal vecx1 As Integer, _
  5613. Optional ByVal vecx2 As Integer, _
  5614. Optional ByVal vecy1 As Integer, _
  5615. Optional ByVal vecy2 As Integer, _
  5616. Optional ByVal life1 As Integer, _
  5617. Optional ByVal life2 As Integer, _
  5618. Optional ByVal fric As Integer, _
  5619. Optional ByVal spin_speedL As Single, _
  5620. Optional ByVal gravity As Boolean, _
  5621. Optional grav_strength As Long, _
  5622. Optional bounce_strength As Long, _
  5623. Optional ByVal X2 As Integer, _
  5624. Optional ByVal Y2 As Integer, Optional ByVal XMove As Boolean, Optional ByVal move_x1 As Integer, Optional ByVal move_x2 As Integer, Optional ByVal move_y1 As Integer, Optional ByVal move_y2 As Integer, Optional ByVal YMove As Boolean, Optional ByVal spin_speedH As Single, Optional ByVal spin As Boolean, Optional grh_resize As Boolean, Optional grh_resizex As Integer, Optional grh_resizey As Integer) As Long
  5625. '**************************************************************
  5626. 'Author: Augusto José Rando
  5627. '**************************************************************
  5628. Dim char_part_free_index As Integer
  5629.  
  5630. 'If Char_Particle_Group_Find(char_index, stream_type) Then Exit Function ' hay que ver si dejar o sacar esto...
  5631. If Not Char_Check(char_index) Then Exit Function
  5632. char_part_free_index = Char_Particle_Group_Next_Open(char_index)
  5633.  
  5634. If char_part_free_index > 0 Then
  5635. Char_Particle_Group_Create = Particle_Group_Next_Open
  5636. Char_Particle_Group_Make Char_Particle_Group_Create, char_index, char_part_free_index, particle_count, _
  5637. stream_type, grh_index_list(), rgb_list(), alpha_blend, alive_counter, frame_speed, id, X1, Y1, _
  5638. angle, vecx1, vecx2, vecy1, vecy2, life1, life2, fric, spin_speedL, gravity, grav_strength, _
  5639. bounce_strength, X2, Y2, XMove, move_x1, move_x2, move_y1, move_y2, YMove, spin_speedH, spin, _
  5640. grh_resize, grh_resizex, grh_resizey
  5641.  
  5642. End If
  5643.  
  5644. End Function
  5645.  
  5646. Private Function Char_Particle_Group_Find(ByVal char_index As Integer, _
  5647. ByVal stream_type As Long) As Integer
  5648. '*****************************************************************
  5649. 'Author: Augusto José Rando
  5650. 'Modified: returns slot or -1
  5651. '*****************************************************************
  5652.  
  5653. Dim I As Integer
  5654.  
  5655. For I = 1 To charlist(char_index).particle_count
  5656.  
  5657. If particle_group_list(charlist(char_index).particle_group(I)).stream_type = stream_type Then
  5658. Char_Particle_Group_Find = charlist(char_index).particle_group(I)
  5659. Exit Function
  5660.  
  5661. End If
  5662.  
  5663. Next I
  5664.  
  5665. Char_Particle_Group_Find = -1
  5666.  
  5667. End Function
  5668.  
  5669. Private Function Char_Particle_Group_Next_Open(ByVal char_index As Integer) As Integer
  5670.  
  5671. '*****************************************************************
  5672. 'Author: Augusto José Rando
  5673. '*****************************************************************
  5674. On Error GoTo ErrorHandler:
  5675.  
  5676. Dim LoopC As Long
  5677.  
  5678. If charlist(char_index).particle_count = 0 Then
  5679. charlist(char_index).particle_count = 1
  5680. ReDim charlist(char_index).particle_group(1 To 1) As Long
  5681. Char_Particle_Group_Next_Open = 1
  5682. Exit Function
  5683.  
  5684. End If
  5685.  
  5686. LoopC = 1
  5687.  
  5688. Do Until charlist(char_index).particle_group(LoopC) = 0
  5689.  
  5690. If LoopC = charlist(char_index).particle_count Then
  5691. Char_Particle_Group_Next_Open = charlist(char_index).particle_count + 1
  5692. charlist(char_index).particle_count = Char_Particle_Group_Next_Open
  5693. ReDim Preserve charlist(char_index).particle_group(1 To Char_Particle_Group_Next_Open) As Long
  5694. Exit Function
  5695.  
  5696. End If
  5697.  
  5698. LoopC = LoopC + 1
  5699. Loop
  5700.  
  5701. Char_Particle_Group_Next_Open = LoopC
  5702.  
  5703. Exit Function
  5704.  
  5705. ErrorHandler:
  5706. charlist(char_index).particle_count = 1
  5707. ReDim charlist(char_index).particle_group(1 To 1) As Long
  5708. Char_Particle_Group_Next_Open = 1
  5709.  
  5710. End Function
  5711.  
  5712. Public Function Char_Particle_Group_Remove(ByVal char_index As Integer, _
  5713. ByVal stream_type As Long)
  5714. '**************************************************************
  5715. 'Author: Augusto José Rando
  5716. '**************************************************************
  5717. Dim char_part_index As Integer
  5718.  
  5719. If Char_Check(char_index) Then
  5720. char_part_index = Char_Particle_Group_Find(char_index, stream_type)
  5721.  
  5722. If char_part_index = -1 Then Exit Function
  5723. Call Particle_Group_Remove(char_part_index)
  5724.  
  5725. End If
  5726.  
  5727. End Function
  5728.  
  5729. Public Function Char_Particle_Group_Remove_All(ByVal char_index As Integer)
  5730. '**************************************************************
  5731. 'Author: Augusto José Rando
  5732. '**************************************************************
  5733. Dim I As Integer
  5734.  
  5735. If Char_Check(char_index) Then
  5736.  
  5737. For I = 1 To charlist(char_index).particle_count
  5738.  
  5739. If charlist(char_index).particle_group(I) <> 0 Then Call Particle_Group_Remove(charlist( _
  5740. char_index).particle_group(I))
  5741. Next I
  5742.  
  5743. End If
  5744.  
  5745. End Function
  5746.  
  5747. Public Function Map_Particle_Group_Get(ByVal map_x As Integer, _
  5748. ByVal map_y As Integer) As Long
  5749.  
  5750. If InMapBounds(map_x, map_y) Then
  5751. Map_Particle_Group_Get = MapData(map_x, map_y).particle_group
  5752. Else
  5753. Map_Particle_Group_Get = 0
  5754.  
  5755. End If
  5756.  
  5757. End Function
  5758.  
  5759. Private Sub Grh_Render_Advance(ByRef grh As grh, _
  5760. ByVal screen_x As Integer, _
  5761. ByVal screen_y As Integer, _
  5762. ByVal Height As Integer, _
  5763. ByVal Width As Integer, _
  5764. ByRef rgb_list() As Long, _
  5765. Optional ByVal h_center As Boolean, _
  5766. Optional ByVal v_center As Boolean, _
  5767. Optional ByVal alpha_blend As Boolean = False)
  5768. '**************************************************************
  5769. 'Author: Juan Martín Sotuyo Dodero ([URL='mailto:juansotuyo@hotmail.com']juansotuyo@hotmail.com[/URL])
  5770. 'Last Modify Date: 11/19/2003
  5771. 'Similar to Grh_Render, but let´s you resize the Grh
  5772. '**************************************************************
  5773. Dim tile_width As Integer
  5774. Dim tile_height As Integer
  5775. Dim grh_index As Long
  5776.  
  5777. 'Animation
  5778. If grh.Started Then
  5779. grh.FrameCounter = grh.FrameCounter + (timerTicksPerFrame * grh.Speed)
  5780.  
  5781. If grh.FrameCounter > GrhData(grh.grhindex).NumFrames Then
  5782. 'If Grh.noloop Then
  5783. ' Grh.FrameCounter = GrhData(Grh.GrhIndex).NumFrames
  5784. 'Else
  5785. grh.FrameCounter = 1
  5786.  
  5787. 'End If
  5788. End If
  5789.  
  5790. End If
  5791.  
  5792. 'Figure out what frame to draw (always 1 if not animated)
  5793. If grh.FrameCounter = 0 Then grh.FrameCounter = 1
  5794. grh_index = GrhData(grh.grhindex).Frames(grh.FrameCounter)
  5795.  
  5796. 'Center Grh over X, Y pos
  5797. If GrhData(grh.grhindex).TileWidth <> 1 Then
  5798. screen_x = screen_x - Int(GrhData(grh.grhindex).TileWidth * (32 \ 2)) + 32 \ 2
  5799.  
  5800. End If
  5801.  
  5802. If GrhData(grh.grhindex).TileHeight <> 1 Then
  5803. screen_y = screen_y - Int(GrhData(grh.grhindex).TileHeight * 32) + 32
  5804.  
  5805. End If
  5806.  
  5807. 'Draw it to device
  5808. Device_Box_Textured_Render_Advance grh_index, screen_x, screen_y, GrhData(grh_index).pixelWidth, GrhData( _
  5809. grh_index).pixelHeight, rgb_list, GrhData(grh_index).sX, GrhData(grh_index).sY, Width, Height, _
  5810. alpha_blend ', grh.angle
  5811.  
  5812. End Sub
  5813.  
  5814. Private Function Char_Check(ByVal char_index As Integer) As Boolean
  5815.  
  5816. 'check char_index
  5817. If char_index > 0 And char_index <= LastChar Then
  5818. Char_Check = (charlist(char_index).Heading > 0)
  5819.  
  5820. End If
  5821.  
  5822. End Function
  5823.  
  5824. Private Sub Grh_Render(ByRef grh As grh, _
  5825. ByVal screen_x As Integer, _
  5826. ByVal screen_y As Integer, _
  5827. ByRef rgb_list() As Long, _
  5828. Optional ByVal h_centered As Boolean = True, _
  5829. Optional ByVal v_centered As Boolean = True, _
  5830. Optional ByVal alpha_blend As Boolean = False, _
  5831. Optional ByVal KillAnim As Boolean = 0)
  5832.  
  5833. '**************************************************************
  5834. 'Author: Aaron Perkins
  5835. 'Last Modify Date: 2/28/2003
  5836. 'Modified by Juan Martín Sotuyo Dodero
  5837. 'Added centering
  5838. '**************************************************************
  5839. On Error Resume Next
  5840.  
  5841. Dim tile_width As Integer
  5842. Dim tile_height As Integer
  5843. Dim grh_index As Long
  5844.  
  5845. If grh.grhindex = 0 Then Exit Sub
  5846.  
  5847. 'Animation
  5848. If grh.Started = 1 Then
  5849. grh.FrameCounter = grh.FrameCounter + (timerElapsedTime * GrhData(grh.grhindex).NumFrames / grh.Speed)
  5850.  
  5851. If grh.FrameCounter > GrhData(grh.grhindex).NumFrames Then
  5852. grh.FrameCounter = (grh.FrameCounter Mod GrhData(grh.grhindex).NumFrames) + 1
  5853.  
  5854. If grh.Loops <> -1 Then
  5855. If grh.Loops > 0 Then
  5856. grh.Loops = grh.Loops - 1
  5857. Else
  5858. grh.Started = 0
  5859.  
  5860. End If
  5861.  
  5862. End If
  5863.  
  5864. End If
  5865.  
  5866. End If
  5867.  
  5868. 'Figure out what frame to draw (always 1 if not animated)
  5869. If grh.FrameCounter = 0 Then grh.FrameCounter = 1
  5870. 'If Not Grh_Check(Grh.grhindex) Then Exit Sub
  5871. grh_index = GrhData(grh.grhindex).Frames(grh.FrameCounter)
  5872.  
  5873. If grh_index <= 0 Then Exit Sub
  5874. If GrhData(grh_index).FileNum = 0 Then Exit Sub
  5875.  
  5876. 'Modified by Augusto José Rando
  5877. 'Simplier function - according to basic ORE engine
  5878. If h_centered Then
  5879. If GrhData(grh.grhindex).TileWidth <> 1 Then
  5880. screen_x = screen_x - Int(GrhData(grh.grhindex).TileWidth * (32 \ 2)) + 32 \ 2
  5881.  
  5882. End If
  5883.  
  5884. End If
  5885.  
  5886. If v_centered Then
  5887. If GrhData(grh.grhindex).TileHeight <> 1 Then
  5888. screen_y = screen_y - Int(GrhData(grh.grhindex).TileHeight * 32) + 32
  5889.  
  5890. End If
  5891.  
  5892. End If
  5893.  
  5894. 'Draw it to device
  5895. Device_Box_Textured_Render grh_index, screen_x, screen_y, GrhData(grh_index).pixelWidth, GrhData( _
  5896. grh_index).pixelHeight, rgb_list(), GrhData(grh_index).sX, GrhData(grh_index).sY, alpha_blend
  5897.  
  5898. End Sub
  5899.  
  5900. Private Sub Grh_Create_Mask(ByRef hdcsrc As Long, _
  5901. ByRef MaskDC As Long, _
  5902. ByVal src_x As Integer, _
  5903. ByVal src_y As Integer, _
  5904. ByVal src_width As Integer, _
  5905. ByVal src_height As Integer)
  5906. Dim X As Integer
  5907. Dim Y As Integer
  5908. Dim TransColor As Long
  5909. Dim ColorKey As String
  5910.  
  5911. ColorKey = "0"
  5912. TransColor = &H0
  5913.  
  5914. 'Make it a mask (set background to black and foreground to white)
  5915. 'And set the sprite's background white
  5916. For Y = src_y To src_height + src_y
  5917. For X = src_x To src_width + src_x
  5918.  
  5919. If GetPixel(hdcsrc, X, Y) = TransColor Then
  5920. SetPixel MaskDC, X, Y, vbWhite
  5921. SetPixel hdcsrc, X, Y, vbBlack
  5922. Else
  5923. SetPixel MaskDC, X, Y, vbBlack
  5924.  
  5925. End If
  5926.  
  5927. Next X
  5928. Next Y
  5929.  
  5930. End Sub
  5931.  
  5932. '---------------------------------------FIN PARTICULAS-------------------------------
  5933.  
  5934. Public Sub Render()
  5935. '*****************************************************
  5936. '****** Coded by Menduz ([email=lord.yo.wo@gmail.com]lord.yo.wo@gmail.com[/email]) *******
  5937. '*****************************************************
  5938.  
  5939. Static dre As RECT
  5940. dre.left = 0
  5941. dre.top = 0
  5942. dre.bottom = 407
  5943. dre.Right = 522
  5944.  
  5945. D3DDevice.BeginScene
  5946. D3DDevice.Clear 0, ByVal 0, D3DCLEAR_TARGET, 0, 0, 0
  5947.  
  5948. ShowNextFrame
  5949.  
  5950. frmMain.FpsMain.Caption = FPS
  5951. 'SendData "FPS " & FPS
  5952.  
  5953. Call Dialogos.Render
  5954. Call DialogosClanes.Draw
  5955.  
  5956. D3DDevice.EndScene
  5957. D3DDevice.Present dre, ByVal 0, frmMain.renderer.hWnd, ByVal 0
  5958.  
  5959. End Sub
  5960.  
  5961. Public Sub DibujarConectar()
  5962.  
  5963. D3DDevice.Clear 0, ByVal 0, D3DCLEAR_TARGET, 0, 0, 0
  5964. D3DDevice.BeginScene
  5965.  
  5966. Dim X As Long
  5967. Dim Y As Long
  5968.  
  5969. '// Draw layer 1
  5970.  
  5971. For Y = 1 To 19
  5972. For X = 1 To 25
  5973.  
  5974. With MapData(37 + X, 70 + Y)
  5975.  
  5976. 'Layer 1 **********************************
  5977. If .Graphic(1).grhindex <> 0 Then
  5978. Call Draw_Grh(.Graphic(1), (X - 1) * 32, (Y - 1) * 32, 1, 0, color_Conectar)
  5979. ' Call Draw_Grh(.Graphic(1), (X - 1) * 32, _
  5980. (Y - 1) * 32, 1, 0, , X, Y)
  5981.  
  5982. End If
  5983.  
  5984. '******************************************
  5985. End With
  5986.  
  5987. Next X
  5988. Next Y
  5989.  
  5990. 'capa2
  5991. For Y = 1 To 19
  5992. For X = 1 To 25
  5993.  
  5994. With MapData(37 + X, 70 + Y)
  5995.  
  5996. If .Graphic(2).grhindex <> 0 Then
  5997. Call Draw_Grh(.Graphic(2), (X - 1) * 32, (Y - 1) * 32, 1, 0, color_Conectar)
  5998. 'Call Draw_Grh(.Graphic(2), (X - 1) * 32, _
  5999. (Y - 1) * 32, 1, 0, , X, Y)
  6000.  
  6001. End If
  6002.  
  6003. End With
  6004.  
  6005. Next X
  6006. Next Y
  6007.  
  6008. 'objeto
  6009. For Y = 1 To 19
  6010. For X = 1 To 25
  6011.  
  6012. With MapData(37 + X, 70 + Y)
  6013.  
  6014. If .ObjGrh.grhindex <> 0 Then
  6015. 'Call Draw_Grh(.Graphic(3), (X - 1) * 32, (Y - 1) * 32, 60, 30, , 37 + X, 23 + Y)
  6016. Call Draw_Grh(.ObjGrh, (X - 1) * 32, (Y - 1) * 32, 1, 0, color_Conectar)
  6017.  
  6018. End If
  6019.  
  6020. End With
  6021.  
  6022. Next X
  6023. Next Y
  6024.  
  6025. 'capa3
  6026. For Y = 1 To 19
  6027. For X = 1 To 25
  6028.  
  6029. With MapData(37 + X, 70 + Y)
  6030.  
  6031. If .Graphic(3).grhindex <> 0 Then
  6032. Call Draw_Grh(.Graphic(3), (X - 1) * 32, (Y - 1) * 32, 1, 0, color_Conectar)
  6033. 'Call Draw_Grh(.Graphic(3), (X - 1) * 32, _
  6034. (Y - 1) * 32, 1, 0, , X, Y)
  6035.  
  6036. End If
  6037.  
  6038. End With
  6039.  
  6040. Next X
  6041. Next Y
  6042.  
  6043. 'particulas
  6044. For Y = 1 To 19
  6045. For X = 1 To 25
  6046.  
  6047. With MapData(37 + X, 70 + Y)
  6048.  
  6049. '***********************************************
  6050. If .particle_group > 0 Then
  6051.  
  6052. Particle_Group_Render .particle_group, (X - 1) * 32, (Y - 1) * 32
  6053.  
  6054. End If
  6055.  
  6056. End With
  6057.  
  6058. Next X
  6059. Next Y
  6060.  
  6061. Static re As RECT
  6062. re.left = 0
  6063. re.top = 0
  6064. re.bottom = 600
  6065. re.Right = 800
  6066.  
  6067. Call Draw_Grhindex(31623, 0, 0)
  6068.  
  6069. If ButtonLogin = "Iluminado" Then
  6070. Call Draw_Grhindex(31625, 338, 340)
  6071. ElseIf ButtonLogin = "Normal" Then
  6072. Call Draw_Grhindex(31624, 338, 340)
  6073.  
  6074. End If
  6075.  
  6076. If ButtonRecuperar = "Iluminado" Then
  6077. Call Draw_Grhindex(31627, 175, 542)
  6078. ElseIf ButtonRecuperar = "Normal" Then
  6079. Call Draw_Grhindex(31626, 175, 542)
  6080.  
  6081. End If
  6082.  
  6083. If ButtonCrear = "Iluminado" Then
  6084. Call Draw_Grhindex(31629, 343, 542)
  6085. ElseIf ButtonCrear = "Normal" Then
  6086. Call Draw_Grhindex(31628, 343, 542)
  6087.  
  6088. End If
  6089.  
  6090. If ButtonWeb = "Iluminado" Then
  6091. Call Draw_Grhindex(31631, 510, 542)
  6092. ElseIf ButtonWeb = "Normal" Then
  6093. Call Draw_Grhindex(31630, 510, 542)
  6094.  
  6095. End If
  6096.  
  6097. Call Draw_Grhindex(22656, 180, 430)
  6098. Call Draw_Grhindex(22656, 600, 430)
  6099.  
  6100. If ClickeoTextCuenta = True Then
  6101. If (BarritaTextConnect / 2) = Int((BarritaTextConnect / 2)) Then
  6102. Draw_FilledBox 415 + (Len(TextBoxCuenta) * 3.4), 240, 1, 11, D3DColorARGB(100, 255, 255, 0), D3DColorARGB( _
  6103. 100, 255, 255, 0)
  6104.  
  6105. End If
  6106.  
  6107. ElseIf ClickeoTextPassw = True Then
  6108.  
  6109. If (BarritaTextConnect / 2) = Int((BarritaTextConnect / 2)) Then
  6110. Draw_FilledBox 415 + (Len(TextBoxPassw) * 3.4), 305, 1, 11, D3DColorARGB(100, 255, 255, 0), D3DColorARGB( _
  6111. 100, 255, 255, 0)
  6112.  
  6113. End If
  6114.  
  6115. End If
  6116.  
  6117. If ClickeoTextCuenta = True Then
  6118. Text_Render font_list(1), TextBoxCuenta, 240, 330, 169, 21, D3DColorARGB(200, 164, 161, 69), DT_CENTER, True
  6119. Else
  6120. Text_Render font_list(1), TextBoxCuenta, 240, 330, 169, 21, D3DColorARGB(200, 164, 161, 160), DT_CENTER, True
  6121.  
  6122. End If
  6123.  
  6124. If ClickeoTextPassw = True Then
  6125. Text_Render font_list(1), TextBoxPasswR, 305, 330, 169, 21, D3DColorARGB(200, 164, 161, 69), DT_CENTER, True
  6126. Else
  6127. Text_Render font_list(1), TextBoxPasswR, 305, 330, 169, 21, D3DColorARGB(200, 164, 161, 160), DT_CENTER, True
  6128.  
  6129. End If
  6130.  
  6131. 'Text_Render font_list(1), "Millenium Ao 2016", 587, 360, 110, 20, D3DColorARGB(255, 255, 255, 0), DT_TOP Or DT_LEFT, True
  6132. 'Text_Render font_list(1), "Fps:" & FPS, 50, 30, 50, 20, D3DColorARGB(255, 255, 255, 1), DT_TOP Or DT_LEFT, True
  6133.  
  6134. ' Light.Create_Light_To_Map 50, 32, 22, 25, 25, 25
  6135. ' Light.Create_Light_To_Map 50, 32, 7, 25, 25, 25
  6136. ' Light.Create_Light_To_Map 45, 32, 5, 25, 25, 25
  6137. ' Light.Create_Light_To_Map 55, 32, 5, 25, 25, 25
  6138. ' Light.Create_Light_To_Map 50, 36, 5, 25, 25, 25
  6139. 'Light.Create_Light_To_Map 48, 36, 4, 25, 25, 25
  6140.  
  6141. 'Light.Light_Render_All
  6142.  
  6143. D3DDevice.EndScene
  6144. D3DDevice.Present re, ByVal 0, FrmConnect.renderer.hWnd, ByVal 0
  6145.  
  6146. End Sub
  6147.  
  6148. Public Sub DibujarCrearpj()
  6149.  
  6150. D3DDevice.Clear 0, ByVal 0, D3DCLEAR_TARGET, 0, 0, 0
  6151. D3DDevice.BeginScene
  6152.  
  6153. Dim X As Long
  6154. Dim Y As Long
  6155.  
  6156. '// Draw layer 1
  6157.  
  6158. For Y = 1 To 19
  6159. For X = 1 To 25
  6160.  
  6161. With MapData(37 + X, 70 + Y)
  6162.  
  6163. 'Layer 1 **********************************
  6164. If .Graphic(1).grhindex <> 0 Then
  6165. Call Draw_Grh(.Graphic(1), (X - 1) * 32, (Y - 1) * 32, 1, 0, color_Conectar)
  6166.  
  6167. End If
  6168.  
  6169. '******************************************
  6170. End With
  6171.  
  6172. Next X
  6173. Next Y
  6174.  
  6175. 'capa2
  6176. For Y = 1 To 19
  6177. For X = 1 To 25
  6178.  
  6179. With MapData(37 + X, 70 + Y)
  6180.  
  6181. If .Graphic(2).grhindex <> 0 Then
  6182. Call Draw_Grh(.Graphic(2), (X - 1) * 32, (Y - 1) * 32, 1, 0, color_Conectar)
  6183.  
  6184. End If
  6185.  
  6186. End With
  6187.  
  6188. Next X
  6189. Next Y
  6190.  
  6191. 'objeto
  6192. For Y = 1 To 19
  6193. For X = 1 To 25
  6194.  
  6195. With MapData(37 + X, 70 + Y)
  6196.  
  6197. If .ObjGrh.grhindex <> 0 Then
  6198. Call Draw_Grh(.ObjGrh, (X - 1) * 32, (Y - 1) * 32, 1, 0, color_Conectar)
  6199.  
  6200. End If
  6201.  
  6202. End With
  6203.  
  6204. Next X
  6205. Next Y
  6206.  
  6207. 'capa3
  6208. For Y = 1 To 19
  6209. For X = 1 To 25
  6210.  
  6211. With MapData(37 + X, 70 + Y)
  6212.  
  6213. If .Graphic(3).grhindex <> 0 Then
  6214. Call Draw_Grh(.Graphic(3), (X - 1) * 32, (Y - 1) * 32, 1, 0, color_Conectar)
  6215.  
  6216. End If
  6217.  
  6218. End With
  6219.  
  6220. Next X
  6221. Next Y
  6222.  
  6223. 'particulas
  6224. For Y = 1 To 19
  6225. For X = 1 To 25
  6226.  
  6227. With MapData(37 + X, 70 + Y)
  6228.  
  6229. '***********************************************
  6230. If .particle_group > 0 Then
  6231. Particle_Group_Render .particle_group, (X - 1) * 32, (Y - 1) * 32
  6232.  
  6233. End If
  6234.  
  6235. End With
  6236.  
  6237. Next X
  6238. Next Y
  6239.  
  6240. Static re As RECT
  6241. re.left = 0
  6242. re.top = 0
  6243. re.bottom = 600
  6244. re.Right = 800
  6245.  
  6246. With FrmCrearPj
  6247. 'Botones y Main
  6248. Call Draw_Grhindex(28979, .Main.left, .Main.top)
  6249.  
  6250. Call Draw_Grhindex(28982, .CrearPersonaje.left, .CrearPersonaje.top)
  6251. Call Draw_Grhindex(28985, .Volver.left, .Volver.top)
  6252.  
  6253. If BotonCrearArriba = 1 Then
  6254. Call Draw_Grhindex(28981, .CrearPersonaje.left, .CrearPersonaje.top)
  6255. Call Draw_Grhindex(28985, .Volver.left, .Volver.top)
  6256.  
  6257. End If
  6258.  
  6259. If BotonCrearApretado = 1 Then
  6260. Call Draw_Grhindex(28980, .CrearPersonaje.left, .CrearPersonaje.top)
  6261. Call Draw_Grhindex(28985, .Volver.left, .Volver.top)
  6262.  
  6263. End If
  6264.  
  6265. If BotonVolverArriba = 1 Then
  6266. Call Draw_Grhindex(28982, .CrearPersonaje.left, .CrearPersonaje.top)
  6267. Call Draw_Grhindex(28984, .Volver.left, .Volver.top)
  6268.  
  6269. End If
  6270.  
  6271. If BotonVolverApretado = 1 Then
  6272. Call Draw_Grhindex(28982, .CrearPersonaje.left, .CrearPersonaje.top)
  6273. Call Draw_Grhindex(28983, .Volver.left, .Volver.top)
  6274.  
  6275. End If
  6276.  
  6277. 'Genero
  6278. Call Draw_Grhindex(28974, .Hombre.left, .Hombre.top)
  6279. Call Draw_Grhindex(28976, .Mujer.left, .Mujer.top)
  6280.  
  6281. 'Genero Clickeado
  6282. If SexoClickeado = "Hombre" Then
  6283. Call Draw_Grhindex(28973, .Hombre.left, .Hombre.top)
  6284. Call Draw_Grhindex(28976, .Mujer.left, .Mujer.top)
  6285.  
  6286. End If
  6287.  
  6288. If SexoClickeado = "Mujer" Then
  6289. Call Draw_Grhindex(28975, .Mujer.left, .Mujer.top)
  6290. Call Draw_Grhindex(28974, .Hombre.left, .Hombre.top)
  6291.  
  6292. End If
  6293.  
  6294. 'Raza
  6295. Call Draw_Grhindex(28972, .Humano.left, .Humano.top)
  6296. Call Draw_Grhindex(28964, .Elfo.left, .Elfo.top)
  6297. Call Draw_Grhindex(28966, .ElfoOscuro.left, .ElfoOscuro.top)
  6298. Call Draw_Grhindex(28968, .Enano.left, .Enano.top)
  6299. Call Draw_Grhindex(28970, .Gnomo.left, .Gnomo.top)
  6300.  
  6301. 'Raza clickeada
  6302. If RazaClickeada = "Humano" Then
  6303. Call Draw_Grhindex(28971, .Humano.left, .Humano.top)
  6304.  
  6305. End If
  6306.  
  6307. If RazaClickeada = "Elfo" Then
  6308. Call Draw_Grhindex(28963, .Elfo.left, .Elfo.top)
  6309.  
  6310. End If
  6311.  
  6312. If RazaClickeada = "Elfo Oscuro" Then
  6313. Call Draw_Grhindex(28965, .ElfoOscuro.left, .ElfoOscuro.top)
  6314.  
  6315. End If
  6316.  
  6317. If RazaClickeada = "Enano" Then
  6318. Call Draw_Grhindex(28967, .Enano.left, .Enano.top)
  6319.  
  6320. End If
  6321.  
  6322. If RazaClickeada = "Gnomo" Then
  6323. Call Draw_Grhindex(28969, .Gnomo.left, .Gnomo.top)
  6324.  
  6325. End If
  6326.  
  6327. 'Raza clickeada anterior
  6328. If RazaClickeadaAnterior = "Humano" Then
  6329. Call Draw_Grhindex(28972, .Humano.left, .Humano.top)
  6330.  
  6331. End If
  6332.  
  6333. If RazaClickeadaAnterior = "Elfo" Then
  6334. Call Draw_Grhindex(28964, .Elfo.left, .Elfo.top)
  6335.  
  6336. End If
  6337.  
  6338. If RazaClickeadaAnterior = "Elfo Oscuro" Then
  6339. Call Draw_Grhindex(28966, .ElfoOscuro.left, .ElfoOscuro.top)
  6340.  
  6341. End If
  6342.  
  6343. If RazaClickeadaAnterior = "Enano" Then
  6344. Call Draw_Grhindex(28968, .Enano.left, .Enano.top)
  6345.  
  6346. End If
  6347.  
  6348. If RazaClickeadaAnterior = "Gnomo" Then
  6349. Call Draw_Grhindex(28970, .Gnomo.left, .Gnomo.top)
  6350.  
  6351. End If
  6352.  
  6353. 'Clase
  6354. Call Draw_Grhindex(28954, .Mago.left, .Mago.top)
  6355. Call Draw_Grhindex(28952, .Guerrero.left, .Guerrero.top)
  6356. Call Draw_Grhindex(28958, .Paladin.left, .Paladin.top)
  6357. Call Draw_Grhindex(28948, .Clerigo.left, .Clerigo.top)
  6358. Call Draw_Grhindex(28942, .Asesino.left, .Asesino.top)
  6359. Call Draw_Grhindex(28944, .Bardo.left, .Bardo.top)
  6360. Call Draw_Grhindex(28950, .Druida.left, .Druida.top)
  6361. Call Draw_Grhindex(28946, .Cazador.left, .Cazador.top)
  6362. Call Draw_Grhindex(28956, .Ladron.left, .Ladron.top)
  6363.  
  6364. 'Clase clickeado
  6365. If ClaseClickeada = "Mago" Then
  6366. Call Draw_Grhindex(28953, .Mago.left, .Mago.top)
  6367.  
  6368. End If
  6369.  
  6370. If ClaseClickeada = "Guerrero" Then
  6371. Call Draw_Grhindex(28951, .Guerrero.left, .Guerrero.top)
  6372.  
  6373. End If
  6374.  
  6375. If ClaseClickeada = "Paladin" Then
  6376. Call Draw_Grhindex(28957, .Paladin.left, .Paladin.top)
  6377.  
  6378. End If
  6379.  
  6380. If ClaseClickeada = "Clerigo" Then
  6381. Call Draw_Grhindex(28947, .Clerigo.left, .Clerigo.top)
  6382.  
  6383. End If
  6384.  
  6385. If ClaseClickeada = "Asesino" Then
  6386. Call Draw_Grhindex(28941, .Asesino.left, .Asesino.top)
  6387.  
  6388. End If
  6389.  
  6390. If ClaseClickeada = "Bardo" Then
  6391. Call Draw_Grhindex(28943, .Bardo.left, .Bardo.top)
  6392.  
  6393. End If
  6394.  
  6395. If ClaseClickeada = "Druida" Then
  6396. Call Draw_Grhindex(28949, .Druida.left, .Druida.top)
  6397.  
  6398. End If
  6399.  
  6400. If ClaseClickeada = "Cazador" Then
  6401. Call Draw_Grhindex(28945, .Cazador.left, .Cazador.top)
  6402.  
  6403. End If
  6404.  
  6405. If ClaseClickeada = "Ladron" Then
  6406. Call Draw_Grhindex(28955, .Ladron.left, .Ladron.top)
  6407.  
  6408. End If
  6409.  
  6410. 'Clase clickeado anterior
  6411. If ClaseClickeadaAnterior = "Mago" Then
  6412. Call Draw_Grhindex(28954, .Mago.left, .Mago.top)
  6413.  
  6414. End If
  6415.  
  6416. If ClaseClickeadaAnterior = "Guerrero" Then
  6417. Call Draw_Grhindex(28952, .Guerrero.left, .Guerrero.top)
  6418.  
  6419. End If
  6420.  
  6421. If ClaseClickeadaAnterior = "Paladin" Then
  6422. Call Draw_Grhindex(28958, .Paladin.left, .Paladin.top)
  6423.  
  6424. End If
  6425.  
  6426. If ClaseClickeadaAnterior = "Clerigo" Then
  6427. Call Draw_Grhindex(28948, .Clerigo.left, .Clerigo.top)
  6428.  
  6429. End If
  6430.  
  6431. If ClaseClickeadaAnterior = "Asesino" Then
  6432. Call Draw_Grhindex(28942, .Asesino.left, .Asesino.top)
  6433.  
  6434. End If
  6435.  
  6436. If ClaseClickeadaAnterior = "Bardo" Then
  6437. Call Draw_Grhindex(28944, .Bardo.left, .Bardo.top)
  6438.  
  6439. End If
  6440.  
  6441. If ClaseClickeadaAnterior = "Druida" Then
  6442. Call Draw_Grhindex(28950, .Druida.left, .Druida.top)
  6443.  
  6444. End If
  6445.  
  6446. If ClaseClickeadaAnterior = "Cazador" Then
  6447. Call Draw_Grhindex(28946, .Cazador.left, .Cazador.top)
  6448.  
  6449. End If
  6450.  
  6451. If ClaseClickeadaAnterior = "Ladron" Then
  6452. Call Draw_Grhindex(28956, .Ladron.left, .Ladron.top)
  6453.  
  6454. End If
  6455.  
  6456. 'Existe el pj o no
  6457. If EstadoPj = 1 Then
  6458. Call Draw_Grhindex(28978, .EstadoPj.left, .EstadoPj.top)
  6459. Else
  6460. Call Draw_Grhindex(28977, .EstadoPj.left, .EstadoPj.top)
  6461.  
  6462. End If
  6463.  
  6464. End With
  6465.  
  6466. Text_Render font_list(1), "Millenium Ao 2016", 587, 360, 110, 20, D3DColorARGB(255, 255, 255, 0), DT_TOP Or _
  6467. DT_LEFT, True
  6468. Text_Render font_list(1), "Fps:" & FPS, 50, 30, 50, 20, D3DColorARGB(255, 255, 255, 1), DT_TOP Or DT_LEFT, True
  6469.  
  6470. D3DDevice.EndScene
  6471. D3DDevice.Present re, ByVal 0, FrmCrearPj.renderer.hWnd, ByVal 0
  6472.  
  6473. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement