Werewolf
Forbidden Ascension
- Joined
- Jul 15, 2012
- Messages
- 886
- Reaction score
- 123
Alright, im looking for a spell that when cast will increase the elemental resistance of a specific element like fire to a player or monster/ or ether. I found this spell a while back that uses charges and makes you 100% immune to elemental damage, but is it possible to make it only a small % of elemental dmg?
--[[
* *\ /* *\
*_____* *________* *|* *________* *\_____*/
****** Mirror && Ultimate Shields ******/
** ** SP Edition by Cybermaster ** **/
****** * | * ******/
* *|* */
**/ \**/
*****/
*
]]--
local energy = createConditionObject(CONDITION_ENERGY)
setConditionParam(energy, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(energy, 5, 2000, -10)
local poison = createConditionObject(CONDITION_POISON)
setConditionParam(poison, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(poison, 5, 2000, -10)
local fire = createConditionObject(CONDITION_FIRE)
setConditionParam(fire, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(fire, 5, 2000, -10)
local freezing = createConditionObject(CONDITION_FREEZING)
setConditionParam(freezing, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(freezing, 5, 2000, -10)
local dazzled = createConditionObject(CONDITION_DAZZLED)
setConditionParam(dazzled, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(dazzled, 5, 2000, -10)
local cursed = createConditionObject(CONDITION_CURSED)
setConditionParam(cursed, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(cursed, 5, 2000, -10)
local Physical = createConditionObject(CONDITION_PHYSICAL)
setConditionParam(Physical, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(Physical, 5, 2000, -10)
local mirrorCounterAttack = 'damage' --OPTIONS: 'condition'/'damage'/'both'
local e,d,k = { --combat type and distance shoot effect, and storages
[COMBAT_ENERGYDAMAGE] = {35,energy },
[COMBAT_EARTHDAMAGE] = {29,poison },
[COMBAT_POISONDAMAGE] = {14,poison },
[COMBAT_PHYSICALDAMAGE] = {1,physical },
[COMBAT_FIREDAMAGE] = {3, fire },
[COMBAT_ICEDAMAGE] = {28,freezing},
[COMBAT_HOLYDAMAGE] = {30,dazzled },
[COMBAT_DEATHDAMAGE] = {31,cursed }
},
5701, --magic
5702 --melee
function doKinaShield(p, effect)
local pos = { --do not modify
{x=p.x+1,y=p.y,z=p.z },
{x=p.x+1,y=p.y+1,z=p.z},
{x=p.x,y=p.y+1,z=p.z },
{x=p.x-1,y=p.y+1,z=p.z},
{x=p.x-1,y=p.y,z=p.z },
{x=p.x-1,y=p.y-1,z=p.z},
{x=p.x,y=p.y-1,z=p.z },
{x=p.x+1,y=p.y-1,z=p.z}
}
for i = 1, #pos do
doSendDistanceShoot(p, pos, effect)
end
end
function onStatsChange(cid, attacker, type, combat, value)
if isGuardian(cid) and isCreature(attacker) and e[combat] and getCreatureStorage(cid, d) > 0 then
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_RED)
doCreatureSetStorage(cid, d, getCreatureStorage(cid, d)-1)
doSendDistanceShoot(getThingPos(cid), getThingPos(attacker), e[combat][1])
doPlayerSendCancel(cid, 'Your mirror shield has '.. (getCreatureStorage(cid,d) > 0 and getCreatureStorage(cid,d) or 'no') ..' charges left.')
if mirrorCounterAttack == 'condition' then
doTargetCombatCondition(cid, attacker, e[combat][2], CONST_ME_MAGIC_RED)
elseif mirrorCounterAttack == 'damage' then
doTargetCombatHealth(cid, attacker, combat, -value, -value, CONST_ME_MAGIC_RED)
elseif mirrorCounterAttack == 'both' then
doTargetCombatCondition(cid, attacker, e[combat][2], CONST_ME_MAGIC_RED)
doTargetCombatHealth(cid, attacker, combat, -value, -value, CONST_ME_MAGIC_RED)
end
return false
elseif isGuardian(cid) and isCreature(attacker) and e[combat] and getCreatureStorage(cid, k) > 0 then
doKinaShield(getThingPos(cid), e[combat][1])
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_RED)
doCreatureSetStorage(cid, k, getCreatureStorage(cid, k)-1)
doPlayerSendCancel(cid, 'Your ultimate shield has '.. (getCreatureStorage(cid,k) > 0 and getCreatureStorage(cid,k) or 'no') ..' charges left.')
return false
end
return true
end
--[[
* *\ /* *\
*_____* *________* *|* *________* *\_____*/
****** Mirror && Ultimate Shields ******/
** ** SP Edition by Cybermaster ** **/
****** * | * ******/
* *|* */
**/ \**/
*****/
*
]]--
local energy = createConditionObject(CONDITION_ENERGY)
setConditionParam(energy, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(energy, 5, 2000, -10)
local poison = createConditionObject(CONDITION_POISON)
setConditionParam(poison, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(poison, 5, 2000, -10)
local fire = createConditionObject(CONDITION_FIRE)
setConditionParam(fire, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(fire, 5, 2000, -10)
local freezing = createConditionObject(CONDITION_FREEZING)
setConditionParam(freezing, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(freezing, 5, 2000, -10)
local dazzled = createConditionObject(CONDITION_DAZZLED)
setConditionParam(dazzled, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(dazzled, 5, 2000, -10)
local cursed = createConditionObject(CONDITION_CURSED)
setConditionParam(cursed, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(cursed, 5, 2000, -10)
local Physical = createConditionObject(CONDITION_PHYSICAL)
setConditionParam(Physical, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(Physical, 5, 2000, -10)
local mirrorCounterAttack = 'damage' --OPTIONS: 'condition'/'damage'/'both'
local e,d,k = { --combat type and distance shoot effect, and storages
[COMBAT_ENERGYDAMAGE] = {35,energy },
[COMBAT_EARTHDAMAGE] = {29,poison },
[COMBAT_POISONDAMAGE] = {14,poison },
[COMBAT_PHYSICALDAMAGE] = {1,physical },
[COMBAT_FIREDAMAGE] = {3, fire },
[COMBAT_ICEDAMAGE] = {28,freezing},
[COMBAT_HOLYDAMAGE] = {30,dazzled },
[COMBAT_DEATHDAMAGE] = {31,cursed }
},
5701, --magic
5702 --melee
function doKinaShield(p, effect)
local pos = { --do not modify
{x=p.x+1,y=p.y,z=p.z },
{x=p.x+1,y=p.y+1,z=p.z},
{x=p.x,y=p.y+1,z=p.z },
{x=p.x-1,y=p.y+1,z=p.z},
{x=p.x-1,y=p.y,z=p.z },
{x=p.x-1,y=p.y-1,z=p.z},
{x=p.x,y=p.y-1,z=p.z },
{x=p.x+1,y=p.y-1,z=p.z}
}
for i = 1, #pos do
doSendDistanceShoot(p, pos, effect)
end
end
function onStatsChange(cid, attacker, type, combat, value)
if isGuardian(cid) and isCreature(attacker) and e[combat] and getCreatureStorage(cid, d) > 0 then
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_RED)
doCreatureSetStorage(cid, d, getCreatureStorage(cid, d)-1)
doSendDistanceShoot(getThingPos(cid), getThingPos(attacker), e[combat][1])
doPlayerSendCancel(cid, 'Your mirror shield has '.. (getCreatureStorage(cid,d) > 0 and getCreatureStorage(cid,d) or 'no') ..' charges left.')
if mirrorCounterAttack == 'condition' then
doTargetCombatCondition(cid, attacker, e[combat][2], CONST_ME_MAGIC_RED)
elseif mirrorCounterAttack == 'damage' then
doTargetCombatHealth(cid, attacker, combat, -value, -value, CONST_ME_MAGIC_RED)
elseif mirrorCounterAttack == 'both' then
doTargetCombatCondition(cid, attacker, e[combat][2], CONST_ME_MAGIC_RED)
doTargetCombatHealth(cid, attacker, combat, -value, -value, CONST_ME_MAGIC_RED)
end
return false
elseif isGuardian(cid) and isCreature(attacker) and e[combat] and getCreatureStorage(cid, k) > 0 then
doKinaShield(getThingPos(cid), e[combat][1])
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_RED)
doCreatureSetStorage(cid, k, getCreatureStorage(cid, k)-1)
doPlayerSendCancel(cid, 'Your ultimate shield has '.. (getCreatureStorage(cid,k) > 0 and getCreatureStorage(cid,k) or 'no') ..' charges left.')
return false
end
return true
end