waaaks!
Zinctified
- Reaction score
- 255
ive created a spell that blocks any damage taken, from attacks, spells, etc.
the spell is a chance based 5%/10%/15%/20%, blocks damage and damages the damage source equal to the damage dealt, it blocks damage perfectly, but sometimes when a damage is blocked, it doesnt just block the damage but also gives an amount of hp to the unit, just like healing it
the trigger adds hp to the damaged unit equal to the damage taken, that makes the spell look like its blocking the damage dealt, but sometimes it just heals the unit, i suspected that sometimes the trigger doubles the amount damage dealt and add that to the unit's hp
lets say the unit takes 30 damage, that means it adds 30 hp to the unit, but the problem is, sometimes it gives 60 hp to the unit instead of 30, making it like a heal spell
if u still didnt get my point, play RotG Reborn v2.05, type "-ap" to choose from any tavern, use Chaos Emperor, type "-ml" if ur the only player playing, max out Chaos Immunity spell and go to the enemy's fountain, there u will observe that the fountain is damaging u rapidly, but sometimes it gives u hp
that healing thingy is the problem, i need to remove that and fix the spell by just blocking the damage taken, not healing the unit
heres the code
is there a way i can fix the healing thingy?
thanks
the spell is a chance based 5%/10%/15%/20%, blocks damage and damages the damage source equal to the damage dealt, it blocks damage perfectly, but sometimes when a damage is blocked, it doesnt just block the damage but also gives an amount of hp to the unit, just like healing it
the trigger adds hp to the damaged unit equal to the damage taken, that makes the spell look like its blocking the damage dealt, but sometimes it just heals the unit, i suspected that sometimes the trigger doubles the amount damage dealt and add that to the unit's hp
lets say the unit takes 30 damage, that means it adds 30 hp to the unit, but the problem is, sometimes it gives 60 hp to the unit instead of 30, making it like a heal spell
if u still didnt get my point, play RotG Reborn v2.05, type "-ap" to choose from any tavern, use Chaos Emperor, type "-ml" if ur the only player playing, max out Chaos Immunity spell and go to the enemy's fountain, there u will observe that the fountain is damaging u rapidly, but sometimes it gives u hp
that healing thingy is the problem, i need to remove that and fix the spell by just blocking the damage taken, not healing the unit
heres the code
JASS:
scope ChaosImmunity
private function Conditions takes nothing returns boolean
return GetLearnedSkill() == 039;A036039;
endfunction
private function Check takes nothing returns boolean
return GetUnitAbilityLevel(GetTriggerUnit(), 039;A036039;) > 0
endfunction
private function Start takes nothing returns nothing
local trigger t = GetTriggeringTrigger()
local unit cast = GetTriggerUnit()
local unit targ = GetEventDamageSource()
local real dmg = GetEventDamage()
local integer l = GetUnitAbilityLevel(cast, 039;A036039;)
if GetRandomInt(1, 100) <= 5*l and dmg < 10000 then
call SetUnitState(cast, UNIT_STATE_LIFE, GetUnitState(cast, UNIT_STATE_LIFE) + dmg)
call CreateInstantEffectTarget("Abilities\\Weapons\\DragonHawkMissile\\DragonHawkMissile.mdl", cast, "chest")
if IsUnitType(targ, UNIT_TYPE_STRUCTURE) == false then
call UnitDamageTarget(cast, targ, dmg, true, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, null)
endif
endif
call DisableTrigger(t)
call EnableTrigger(t)
set t = null
set cast = null
set targ = null
endfunction
private function Actions takes nothing returns nothing
local unit cast = GetTriggerUnit()
local trigger t = CreateTrigger()
call TriggerRegisterUnitEvent( t, cast, EVENT_UNIT_DAMAGED )
call TriggerAddCondition( t, Condition( function Check ) )
call TriggerAddAction( t, function Start )
endfunction
//===========================================================================
public function InitTrig takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_HERO_SKILL )
call TriggerAddCondition( t, Condition( function Conditions ) )
call TriggerAddAction( t, function Actions )
set t = null
endfunction
endscope
is there a way i can fix the healing thingy?
thanks