Hey guys, I'm trying to make a modification on sudden death rune. I want this:
IF IM ATACKING A PLAYER
IF MY VOCATION ID IS "X" AND MY PLAYER TARGET VOCATION ID IS "Y" THEN IT'S TRUE
ELSE IS FALSE
TRUE DAMAGE = MY NEW DAMAGE
FALSE DAMAGE = NORMAL GAME SD
Here the SD original script.
Ty for your time!
i've made some progress scripting it, but the getattackedvocation is wrong because i don't know what is the code:
http://postimg.org/image/4i792d6t3/
I did a more recent updage, show more or less what i'm looking for, but i really dont know what codes to use to get the if part that I just wrote after "--"
IF IM ATACKING A PLAYER
IF MY VOCATION ID IS "X" AND MY PLAYER TARGET VOCATION ID IS "Y" THEN IT'S TRUE
ELSE IS FALSE
TRUE DAMAGE = MY NEW DAMAGE
FALSE DAMAGE = NORMAL GAME SD
Here the SD original script.
Code:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
function onGetFormulaValues(player, level, maglevel)
min = -((level / 5) + (maglevel * 4.3) + 32)
max = -((level / 5) + (maglevel * 7.4) + 48)
return min, max
end
combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
function onCastSpell(creature, var, isHotkey)
return combat:execute(creature, var)
end
Ty for your time!
i've made some progress scripting it, but the getattackedvocation is wrong because i don't know what is the code:
http://postimg.org/image/4i792d6t3/
Code:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
local combat2 = Combat()
function getCreatureTarget(cid)
local c = Creature(cid)
if c ~= nil then
local target = c:getTarget()
local creatvoc = target:getVocation()
return target ~= nil and target:getId() or 0
end
return
end
local vocsmulti = {
[1] = {atack = 17, 18, 19, 20}, --Human warrior
[2] = {atack = 17, 18, 19, 20}, --Human paladin
[3] = {atack = 17, 18, 19, 20}, --Human Druid
[4] = {atack = 17, 18, 19, 20}, --Human wizard
[5] = {atack = 13, 14, 15, 16}, ---Elf warrior
[6] = {atack = 13, 14, 15, 16}, --Elf paladin
[7] = {atack = 13, 14, 15, 16}, --Elf Druid
[8] = {atack = 13, 14, 15, 16}, --Elf wizard
[9] = {atack = 21, 22, 23, 24}, --Dwarf warrior
[10] = {atack = 21, 22, 23, 24}, --Dwarf paladin
[11] = {atack = 21, 22, 23, 24}, --Dwarf Druid
[12] = {atack = 21, 22, 23, 24}, --Dwarf wizard
[13] = {atack = 1, 2, 3, 4}, --Orc warrior
[14] = {atack = 1, 2, 3, 4}, --Orc paladin
[15] = {atack = 1, 2, 3, 4}, --Orc Druid
[16] = {atack = 1, 2, 3, 4}, --Orc wizard
[17] = {atack = 9, 10, 11, 12}, --Ancestral warrior
[18] = {atack = 9, 10, 11, 12}, --Ancestral paladin
[19] = {atack = 9, 10, 11, 12}, --Ancestral Druid
[20] = {atack = 9, 10, 11, 12}, --Ancestral wizard
[21] = {atack = 5, 6, 7, 8}, --Walking Dead warrior
[22] = {atack = 5, 6, 7, 8}, --Walking Dead paladin
[23] = {atack = 5, 6, 7, 8}, --Walking Dead druid
[24] = {atack = 5, 6, 7, 8}, --Walking Dead wizard
}
-- local Target = Creature:getTarget()
-- local Targethp = target:gethealthmax()
-- if target:getVocation() == vocsmulti[attacking:getVocation():getBase():getId()].atack then
-- DMG = targethp / 5
-- else
-- DMG = 0
-- end
-- use DMG in combat 2 (where is write maxhp, that actually i just used it for testing)
function onGetFormulaValues(player, level, maglevel)
local min = -((level / 5) + (maglevel * 4.3) + 32)
local max = -((level / 5) + (maglevel * 7.4) + 48)
return min, max
end
combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
local function bleeds(creature,var,target)
return combat2:execute(creature, var)
end
local function start2(creature,var)
return combat:execute(creature, var)
end
function onCastSpell(creature, var, isHotkey)
local maxhp = creature:getMaxHealth()
addEvent(start2, 0, creature.uid, var)
if creature:getMana() == 20000 then -- this is just a condition that i used to test, the real one should be: if DMG > 0 then
local condition = Condition(CONDITION_BLEEDING)
combat2:setParameter(CONDITION_PARAM_DELAYED, 1)
combat2:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_BLOODYSTEPS)
condition:addDamage(5, 2000, maxhp / 10)
combat2:setCondition(condition)
return combat2:execute(creature, var)
end
return true
end
I did a more recent updage, show more or less what i'm looking for, but i really dont know what codes to use to get the if part that I just wrote after "--"
Last edited: