Results 1 to 5 of 5

Thread: World of Warcraft Spell Cooldown Effect [VB.Net 2008, 2010 & VB6][DirectX]

  1. #1

    Thread Starter
    College Grad!!! Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,333

    World of Warcraft Spell Cooldown Effect [VB.Net 2008, 2010 & VB6][DirectX]

    I had this code for quite sometime, and it was a royal pain to figure it out on my own. Because there is no source code on the internet other than mine that reveals this effect. For those who havent played World of Warcraft, your user interface that has a bunch of attacks, spells, and/or healing ability icons. When you click on one, depending on the ability, itll do one of two things. Either do a global cooldown, which prevents you from pressing any icon for a fraction of a second, or do that as well as put that ability on a cooldown for a certain duration of time. As its on cooldown, regardless of the type of cooldown, the entire icon will darken, and you'll see a dial spin around slowly lighting the icon back up. And here is how I did it. I used 2 squares. One square for the spell icon. And another that simply darkens it, only its rotated 45 degrees as a diamond. That dark square diamond is split into 8 polygons like a pizza, and its clipped around the regular square, so you can only see it within that square. I then shrink one polygon of the diamond pie one by one which coincides with realtime depending on what value you put for the cooldown amount until the time expires. Its accurate down to the very fraction of a millisecond through and through. If you want 10 minute cooldown, itll do it precisely. Or how bout 0.5 seconds. Not only did I do it using VB.Net, but also VB6. So here are both versions open source. Enjoy



    Note: Niya claims that the VB.Net version of the spell cooldown had issues on his or her computer and not the VB6 one cause that one worked. I think its a she. But yet it works perfectly on mine. So if it looks like these pics in this link let me know: Possible Anomalies
    Attached Files Attached Files

  2. #2

    Thread Starter
    College Grad!!! Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,333

    Re: World of Warcraft Spell Cooldown Effect [VB.Net 2008, 2010 & VB6][DirectX]

    I managed to simulate the error that Niya had so if you are in windowed mode and you maximize it, itll cause a black polygon to cover the spell icon. Reason why is because of Device.Reset(Screen). So over in your frmMain_Resize event, copy and paste this and it should fix the problem:

    vb Code:
    1. Private Sub frmMain_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
    2.         If Fullscreen_Enabled = False Then
    3.             Running = False
    4.             Device.Reset(Screen)
    5.             Device.SetRenderState(RenderStates.AlphaBlendEnable, True)
    6.             'Needed for alphablending
    7.             '----------------------------------------------------------------------------------------------------
    8.             Device.SetTextureStageState(0, TextureStageStates.ColorOperation, TextureOperation.Modulate)
    9.             Device.SetTextureStageState(0, TextureStageStates.ColorArgument1, TextureArgument.TextureColor)
    10.             Device.SetTextureStageState(0, TextureStageStates.ColorArgument2, TextureArgument.Diffuse)
    11.  
    12.             Device.SetTextureStageState(0, TextureStageStates.AlphaOperation, TextureOperation.Modulate)
    13.             Device.SetTextureStageState(0, TextureStageStates.AlphaArgument1, TextureArgument.TextureColor)
    14.             Device.SetTextureStageState(0, TextureStageStates.AlphaArgument2, TextureArgument.Diffuse)
    15.  
    16.             Device.SetRenderState(RenderStates.SourceBlend, Blend.SourceAlpha)
    17.             Device.SetRenderState(RenderStates.DestinationBlend, Blend.InvSourceAlpha)
    18.             Device.SetRenderState(RenderStates.BlendOperation, TextureOperation.Add)
    19.             '----------------------------------------------------------------------------------------------------
    20.  
    21.             'These lines are not needed, but it's nice to be able to filter the
    22.             'textures to make them look nicer.
    23.             Device.SetSamplerState(0, SamplerStageStates.MinFilter, TextureFilter.Point)
    24.             Device.SetSamplerState(0, SamplerStageStates.MagFilter, TextureFilter.Point)
    25.             Application.DoEvents()
    26.             Running = True
    27.         End If
    28.     End Sub

  3. #3
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: World of Warcraft Spell Cooldown Effect [VB.Net 2008, 2010 & VB6][DirectX]

    Sorry I took so long to get back to you on this. We had celebrations over here and I was offline gettin drunk for the weekend

    That code didn't fix the issue over here. It made in worst in fact. Now resizing doesn't fix the glitch.

    Btw, I tried everything you suggested in the other thread and to no avail ....Except for running it on another PC. I will try that and see if the issue comes up and get back to you.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  4. #4
    New Member
    Join Date
    Feb 2017
    Posts
    1

    Re: World of Warcraft Spell Cooldown Effect [VB.Net 2008, 2010 & VB6][DirectX]

    I can't download WoW Cooldown VB6 file... why?

  5. #5

    Thread Starter
    College Grad!!! Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,333

    Re: World of Warcraft Spell Cooldown Effect [VB.Net 2008, 2010 & VB6][DirectX]

    Hmmmm that is strange. I'll have to fix that if I can find the original code. The others download just fine at least.

    [EDIT] Unfortunately I lost the code due to a corrupt harddrive from a few months ago. So what I'm gonna do is remake it in VB6, C#, and C++ with some improvements such as the "After effect" once the cooldown is over, which could literally be anything. Might even wrap it into a class for UI purposes in an RPG. I did it once before in Java for Android and it worked perfectly off of the phone and tablet. So gimme time

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width