PE LUA Help menu

User Tag List

Thread: PE LUA Help

Page 2 of 2 FirstFirst 12
Results 16 to 18 of 18
  1. #16
    Guvnor's Avatar Master Sergeant
    Reputation
    7
    Join Date
    Feb 2013
    Posts
    94
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wish someone could set up another PE forums but not have the unlocker on it so all you great coders have a place to help out us noobs with the coding like this would be GREAT!!!

    PE LUA Help
  2. #17
    Tiger23078001's Avatar Member
    Reputation
    1
    Join Date
    Mar 2014
    Posts
    36
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by RedRussian View Post
    OP, for the purpose of DoT (or heavy casts like Chaos Bolt) snapshotting you might want to know only the present and future (I prefer to call it "projected") value of your stats. I use my custom rotation engine but I think the following approach could implemented in PE as well.

    1. I use some abstract score of buff's utility called "Burst rating". The score for each buff of interest is set manually.
    The table of such buffs of interest is as follows. I filled it with some sample content:
    Code:
    RRR_DB.bursts = {
    --[<buff_id>] = { rating = <buff_burst_rating> },
    --ratings are purely imaginary though they can be interpreted as "main stat value"
        --general INT
        [105702] = { rating = 4000 },    --potion MoP
        [104993] = { rating = 1650 },     --jade spirit
        [125487] = { rating = 2000 },    --lightweave INT
        [96230]  = { rating = 1920 },    --synapse springs INT
        [126705] = { rating = 6750 },    --pvp proc trinket INT
        [126683] = { rating = 5000 },    --pvp use trinket INT
        
        --druid
        [102560] = { rating = 9000 },    --incarnation
        [112071] = { rating = 9000 },    --celestial alignment
        [124974] = { rating = 4000 },    --nature's vigil
    }
    2. Then you need to store info of all buffs you get. How you do so is entirely of your choosing, but the result you should aim for is a table contating buff_id as keys and buff_info (table) as values, which would be updated on various events concerning your buffs.

    3. Given the tables of bursts of interest and your current buffs, you need a function to calculate and project your burst rating.
    Mine looks as follows:
    Code:
    function ProjectBurstRating(horizon)
    --NOTE
    --for every horizon, epsilon > 0 : ProjectBurstRating(horizon) >= ProjectBurstRating(horizon + epsilon)
        horizon = horizon or 0
        local current_time = GetTime()
        local burst_rating = 1
        local first_expiry_in = math.huge
        for id, burst_info in pairs(RRR_DB.bursts) do
            local buff = RRR_PlayerInfo.player_data.buffs[id] --it's the table of stored buffs
            if buff then
                burst_rating = burst_rating + burst_info.rating * buff.num_stacks
                local buff_expiry_in = buff.expiry_time - current_time
                if buff_expiry_in <= first_expiry_in then
                    first_expiry_in = buff_expiry_in
                end
                if buff.expiry_time - current_time <= horizon then
                    burst_rating = burst_rating - burst_info.rating * buff.num_stacks
                end
            end
        end
        return burst_rating, first_expiry_in
    end
    4. Given the knowledge of your current and future "power", it's easy to decide whether it's time to refresh your DoTs or cast a long yet powerful cast.
    Chaos Bolt example:
    Code:
    local critical_ratio = 1.5
    if ( ProjectBurstRating( CB_cast_time + 0.5 ) / ProjectBurstRating(0) ) >= critical_ratio then  --our bursts are about to expire!
       CastSpellByID(CB_id)
    end
    I have handling "buffs" down, but I need to get the cast time of Chaos Bolt and be able to compare it to the duration of the buffs that are up.

    For instance if my CB is 2.5 seconds long and my trinket is up for only 2.0 seconds then I don't want to cast CB. I'm not new to the WoW API and Lua so I'm not sure how to get the value of the chaos bolt cast time with "GetSpellInfo()".

  3. #18
    RedRussian's Avatar Banned CoreCoins Purchaser Authenticator enabled
    Reputation
    221
    Join Date
    Nov 2012
    Posts
    430
    Thanks G/R
    2/3
    Trade Feedback
    2 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    GetSpellInfo() does return the cast time of a spell in ms.
    GetSpellInfo - World of Warcraft Programming: A Guide and Reference for Creating WoW Addons

Page 2 of 2 FirstFirst 12

Similar Threads

  1. [Help] Need LUA help? Post here!
    By EcHoEs in forum World of Warcraft Emulator Servers
    Replies: 20
    Last Post: 10-03-2010, 01:18 PM
  2. [Help] i need Lua help with this script...
    By Ellenor in forum World of Warcraft Emulator Servers
    Replies: 25
    Last Post: 03-03-2008, 03:45 PM
  3. LUA help
    By stoneharry in forum World of Warcraft Emulator Servers
    Replies: 16
    Last Post: 02-25-2008, 03:27 PM
  4. Lua help
    By reconz in forum World of Warcraft Emulator Servers
    Replies: 12
    Last Post: 02-18-2008, 07:03 PM
  5. Lua help
    By Tom_2001 in forum World of Warcraft Emulator Servers
    Replies: 10
    Last Post: 02-04-2008, 12:17 PM
All times are GMT -5. The time now is 05:31 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search