jackall
You can change this now in User CP.
- Reaction score
- 37
Hello there...lame entry.......
Anyways, i was bored the other day and thought about making some spells which i actually did.
Here they are(code only, no screens):
Mana Blade(lame name...i know)
First trigger that adds damage and a 20% chance to burn 100 mana from the target
Second trigger that regenerates some mana every second
NOTE: i used a global in the regeneration trigger because the weapon is supposed to be unique
Fire Shield(lame name #2)
Just one trigger that creates a dummy unit and then.....oh just read the code and you'll more than likely figure out what it does
Nature's Armor(originality hurts to me...)
I really hope this will help someone aaaaaaaaand i'll try to make some more
Anyways, i was bored the other day and thought about making some spells which i actually did.
Here they are(code only, no screens):
Mana Blade(lame name...i know)
First trigger that adds damage and a 20% chance to burn 100 mana from the target
JASS:
function MainFuncMBBD takes nothing returns nothing
local unit damager = GetEventDamageSource()
local unit dummy = CreateUnit(GetOwningPlayer(damager),039;h000039;,GetUnitX(damager),GetUnitY(damager),0)
local real damage = (GetUnitState(damager,UNIT_STATE_MANA)*.01)
local unit damaged = GetTriggerUnit()
local integer chance = GetRandomInt(0,100)
call DisableTrigger(GetTriggeringTrigger())
call ApplyDummyLife(dummy,1)
call SetUnitPathing(dummy,false)
if GetUnitAbilityLevel(damaged,039;B001039;)>0 then
call UnitDamageTargetBJ(dummy,damaged,damage,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNKNOWN)
else
endif
if chance<=20 then
call SetUnitState(damaged,UNIT_STATE_MANA,(GetUnitState(damaged,UNIT_STATE_MANA)-100))
endif
call EnableTrigger(GetTriggeringTrigger())
set dummy = null
set damaged = null
set damager = null
endfunction
function InitTrig_Mana_Blade_Damage takes nothing returns nothing
set gg_trg_Mana_Blade_Damage = CreateTrigger()
call TriggerAddAction(gg_trg_Mana_Blade_Damage,function MainFuncMBBD)
endfunction
Second trigger that regenerates some mana every second
JASS:
function MainFuncMBBR takes nothing returns nothing
local unit wielder = udg_ManaBladeWielder
local real manaToadd = GetUnitState(wielder,UNIT_STATE_MANA)+(GetUnitState(wielder,UNIT_STATE_MAX_MANA)*0.05)
call SetUnitState(wielder,UNIT_STATE_MANA,manaToadd)
endfunction
function InitTrig_Mana_Blade_Reg takes nothing returns nothing
set gg_trg_Mana_Blade_Reg = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic(gg_trg_Mana_Blade_Reg,1)
call TriggerAddAction(gg_trg_Mana_Blade_Reg,function MainFuncMBBR)
endfunction
NOTE: i used a global in the regeneration trigger because the weapon is supposed to be unique
Fire Shield(lame name #2)
Just one trigger that creates a dummy unit and then.....oh just read the code and you'll more than likely figure out what it does
JASS:
function MainFuncFS takes nothing returns nothing
local unit damager = GetEventDamageSource()
local unit damaged = GetTriggerUnit()
local unit dummy = CreateUnit(GetOwningPlayer(damaged),039;h000039;,GetUnitX(damager),GetUnitY(damager),0)
local integer chance = GetRandomInt(0,100)
call ApplyDummyLife(dummy,1)
call SetUnitPathing(dummy,false)
if chance<=25 and GetUnitAbilityLevel(damaged,039;B002039;)>0 then
call UnitAddAbility(dummy,039;A008039;)
call SetUnitAbilityLevel(dummy,039;A008039;,1)
call IssueTargetOrder(dummy,"acidbomb",damager)
else
endif
set dummy = null
set damaged = null
set damager = null
endfunction
function InitTrig_Fire_Shield takes nothing returns nothing
set gg_trg_Fire_Shield = CreateTrigger()
call TriggerAddAction(gg_trg_Fire_Shield,function MainFuncFS)
endfunction
Nature's Armor(originality hurts to me...)
JASS:
function MainFuncNAP takes nothing returns nothing
local unit damaged = GetTriggerUnit()
local unit damager = GetEventDamageSource()
local unit dummy = CreateUnit(GetOwningPlayer(damaged),039;h000039;,GetUnitX(damager),GetUnitY(damager),0)
call SetUnitPathing(dummy,false)
call ApplyDummyLife(dummy,1)
if GetUnitAbilityLevel(damaged,039;B004039;) > 0 then
call UnitAddAbility(dummy,039;A00A039;)
call SetUnitAbilityLevel(dummy,039;A00A039;,1)
call IssueTargetOrder(dummy,"acidbomb",damager)
endif
set dummy = null
set damaged = null
set damager = null
endfunction
function InitTrig_Natures_Armor_Poison takes nothing returns nothing
set gg_trg_Natures_Armor_Poison = CreateTrigger()
call TriggerAddAction(gg_trg_Natures_Armor_Poison,function MainFuncNAP)
endfunction
I really hope this will help someone aaaaaaaaand i'll try to make some more