#450 fix race requirement support on SpellDamage

已关闭
image2 年之前创建 · 3 条评论
image 评论于 2 年之前

there was supposed to be some lua_race_id which is just silly, instead we will do the same design we use for quest kill requirements, check race, race type and base race type

SpellDamage arguments 7+ can supply a class or race id

SpellDamage(caster, type, min_damage, max_damage, crit_mod, no_calcs, class/race_id, ...more class/race_id)

there was supposed to be some lua_race_id which is just silly, instead we will do the same design we use for quest kill requirements, check race, race type and base race type SpellDamage arguments 7+ can supply a class or race id SpellDamage(caster, type, min_damage, max_damage, crit_mod, no_calcs, class/race_id, ...more class/race_id)
image 评论于 2 年之前
协作者

This should allow for support of spells like Fury's Tempest which has specific racial damage

This should allow for support of spells like Fury's Tempest which has specific racial damage
image 评论于 2 年之前
协作者

heres my updated script for Tempest which is working as expected (does racial damage after initial damage) -- will require a code update to fix the lua SpellDamage to properly check race id values

funny enough we don't have any elemental mobs described in our race_types table or anything else so I just created a spawn to test this with. Content team has some work to do with race types for elementals :D

heres my updated script for Tempest which is working as expected (does racial damage after initial damage) -- will require a code update to fix the lua SpellDamage to properly check race id values funny enough we don't have any elemental mobs described in our race_types table or anything else so I just created a spawn to test this with. Content team has some work to do with race types for elementals :D
image 评论于 2 年之前
协作者
--[[
    Script Name    : Spells/Priest/Druid/Fury/Tempest.lua
    Script Author  : Jabantiz
    Script Date    : 2014.01.14 02:01:11 
                   : (Updated by Emagi for elemental damage 2022.07.16)
    Script Purpose : 
                   : 
--]]

function cast(Caster, Target, DmgType, MinVal, MaxVal)
    processDamage(Caster, Target, DmgType, MinVal, MaxVal)
end

function tick(Caster, Target, DmgType, MinVal, MaxVal)
    processDamage(Caster, Target, DmgType, MinVal, MaxVal)
end

function processDamage(Caster, Target, DmgType, MinVal, MaxVal)
    -- Inflicts 7 - 8 cold damage on target instantly and every 2 seconds
    if MaxVal ~= nil and MinVal < MaxVal then
        SpellDamage(Target, DmgType, math.random(MinVal, MaxVal))
    else
        SpellDamage(Target, DmgType, MinVal)
    end

    -- Inflicts 7 - 8 cold damage on target instantly and every 2 seconds
    --     If target is elemental
    --  WOODELEMENTAL       154
    --  AIRELEMENTAL        242
    --  EARTHELEMENTAL      248
    --  ELEMENTAL           250
    --  FIREELEMENTAL       254
    --  WATERELEMENTAL      266
    if MaxVal ~= nil and MinVal < MaxVal then
        SpellDamage(Target, DmgType, math.random(MinVal, MaxVal), 0, 0, 154, 242, 248, 250, 254, 266)
    else
        SpellDamage(Target, DmgType, MinVal, 0, 0, 0, 154, 242, 248, 250, 254, 266)
    end
end
``` --[[ Script Name : Spells/Priest/Druid/Fury/Tempest.lua Script Author : Jabantiz Script Date : 2014.01.14 02:01:11 : (Updated by Emagi for elemental damage 2022.07.16) Script Purpose : : --]] function cast(Caster, Target, DmgType, MinVal, MaxVal) processDamage(Caster, Target, DmgType, MinVal, MaxVal) end function tick(Caster, Target, DmgType, MinVal, MaxVal) processDamage(Caster, Target, DmgType, MinVal, MaxVal) end function processDamage(Caster, Target, DmgType, MinVal, MaxVal) -- Inflicts 7 - 8 cold damage on target instantly and every 2 seconds if MaxVal ~= nil and MinVal < MaxVal then SpellDamage(Target, DmgType, math.random(MinVal, MaxVal)) else SpellDamage(Target, DmgType, MinVal) end -- Inflicts 7 - 8 cold damage on target instantly and every 2 seconds -- If target is elemental -- WOODELEMENTAL 154 -- AIRELEMENTAL 242 -- EARTHELEMENTAL 248 -- ELEMENTAL 250 -- FIREELEMENTAL 254 -- WATERELEMENTAL 266 if MaxVal ~= nil and MinVal < MaxVal then SpellDamage(Target, DmgType, math.random(MinVal, MaxVal), 0, 0, 154, 242, 248, 250, 254, 266) else SpellDamage(Target, DmgType, MinVal, 0, 0, 0, 154, 242, 248, 250, 254, 266) end end ```
image2 年之前 关闭
登录 并参与到对话中。
正在加载...
取消
保存
这个人很懒,什么都没留下。