dropz
Member
- Joined
- May 4, 2022
- Messages
- 46
- Reaction score
- 24
suppp guys!!
i've searched here for this solution but dont found it... im even reup a old thread about it and had some tries to the solution but nothing worked properly
so i thought to create a new one to try solve it and maybe help others in the future whos looking for the same solution...
well as i wrote in the title, i want to players get able to hit whole stack with runes but just for agressive runes if i found a solution that be applicable for the healing runes too for example not is the point cuz will be "wrong" in my view ifs for example people who use a UH in stack heal all the players but for attack runes it must happens to hit all them...
i tried solve this editing some stuffs in .lua/.xml and didnt get success..
i tried too edit few lines of the source code in spells.cpp in the function of CombatSpell::castSpell :
but didnt get succeed too..
so if someone knows how to deal with that, i will be very grateful.
note: im using a nostalrius tfs 1.2 to old protocol 772 (old school xD)
thats the old thread what i reup for some tries:
there u can found few tries for this issue but until now nothing worked properly...
thanks in advance <3
editing the post and explaining whats happened, the problem was solved!!!
first of all i want to thanks @Sarah Wesker!! "you gave me the knife so its was just i slice"
if u are using the tfs 1.2 like im, u dont need add a new one line of code in spells and create another file for the runes, u can do that:
first of all change the needtarget="1" to needtarget="0" in the respective lines of target runes what u want to hit whole stack.
example:
after that you go to the /data/spells/scripts/runes/rune.lua in this case for me sudden death.lua and there you can keep your formulas, just adding in the final the function onCastSpell and the .lua will stay like that:
note: pay attention on the variables, they must be equal the other runes
i've searched here for this solution but dont found it... im even reup a old thread about it and had some tries to the solution but nothing worked properly
so i thought to create a new one to try solve it and maybe help others in the future whos looking for the same solution...
well as i wrote in the title, i want to players get able to hit whole stack with runes but just for agressive runes if i found a solution that be applicable for the healing runes too for example not is the point cuz will be "wrong" in my view ifs for example people who use a UH in stack heal all the players but for attack runes it must happens to hit all them...
i tried solve this editing some stuffs in .lua/.xml and didnt get success..
i tried too edit few lines of the source code in spells.cpp in the function of CombatSpell::castSpell :
but didnt get succeed too..
so if someone knows how to deal with that, i will be very grateful.
note: im using a nostalrius tfs 1.2 to old protocol 772 (old school xD)
thats the old thread what i reup for some tries:
Hit whole stack [TFS 1.2]
Hi, I wonder how can i make that for example SD damage a whole stack. Which means if 10 players are on eachother it should damage everyone expect the caster. I use tfs 1.2 Thanks
otland.net
there u can found few tries for this issue but until now nothing worked properly...
thanks in advance <3
editing the post and explaining whats happened, the problem was solved!!!
first of all i want to thanks @Sarah Wesker!! "you gave me the knife so its was just i slice"
if u are using the tfs 1.2 like im, u dont need add a new one line of code in spells and create another file for the runes, u can do that:
first of all change the needtarget="1" to needtarget="0" in the respective lines of target runes what u want to hit whole stack.
example:
Lua:
<rune name="Sudden Death" id="3155" allowfaruse="1" charges="1" needtarget="0" maglv="15" blocktype="solid" script="runes/sudden death.lua" />
after that you go to the /data/spells/scripts/runes/rune.lua in this case for me sudden death.lua and there you can keep your formulas, just adding in the final the function onCastSpell and the .lua will stay like that:
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_DEATH)
function onGetFormulaValues(player, level, maglevel)
local base = 150
local variation = 20
local formula = 3 * maglevel + (2 * level)
local min = (formula * (base - variation)) / 100
local max = (formula * (base + variation)) / 100
return -min, -max
end
combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
function onCastSpell(player, variant, isHotkey)
local tile = Tile(variant:getPosition())
if tile then
local topVisibleCreature = tile:getTopVisibleCreature(player)
if topVisibleCreature then
if topVisibleCreature:getId() ~= player:getId() and (not topVisibleCreature:isPlayer() or not topVisibleCreature:getGroup():getAccess()) then
return combat:execute(player, variant)
end
end
local bottomVisibleCreature = tile:getBottomVisibleCreature(player)
if bottomVisibleCreature then
if bottomVisibleCreature:getId() ~= player:getId() and (not bottomVisibleCreature:isPlayer() or not bottomVisibleCreature:getGroup():getAccess()) then
return combat:execute(player, variant)
end
end
end
player:getPosition():sendMagicEffect(CONST_ME_POFF)
player:sendCancelMessage(RETURNVALUE_CANONLYUSETHISRUNEONCREATURES)
return false
end
note: pay attention on the variables, they must be equal the other runes
Last edited: