Infinitegde
O.O
- Reaction score
- 86
Sorry for the slow day everyone Guests are staying over for a couple days and have to keep them company. I'll be busy for the next few days...
@jig7c: Sorry It's not. I post as soon as the spell is done...
Though I finished your spell Renendaru.
I reworked everything, and didn't use structs because I was unsure if you had already used structs. It's mainly in Jass, a little bit of vJass. Anyway here it is.
Also, might have a few bugs... Not sure...
MUI, and vJass.
Description: Time Rupture saves the state of units near him. Save includes Life, Mana, Position, and a few buffs. This *might* bug if you remove the unit. Why? Does not save EXP meaning if you *remove* (if you kill it, it's fine) the hero, it won't revive it.
Code
Time Rupture
TG_Help
Times Gamble
Buff Functions
@jig7c: Sorry It's not. I post as soon as the spell is done...
Though I finished your spell Renendaru.
I reworked everything, and didn't use structs because I was unsure if you had already used structs. It's mainly in Jass, a little bit of vJass. Anyway here it is.
Also, might have a few bugs... Not sure...
MUI, and vJass.
Description: Time Rupture saves the state of units near him. Save includes Life, Mana, Position, and a few buffs. This *might* bug if you remove the unit. Why? Does not save EXP meaning if you *remove* (if you kill it, it's fine) the hero, it won't revive it.
Code
Time Rupture
JASS:
function Trig_Time_Rupture_Conditions takes nothing returns boolean
return ( GetSpellAbilityId() == 039;A000039; )
endfunction
globals
unit array TG_U
unit array TG_Caster
integer array TG_UT
string array TG_Buffs
real array TG_HP
real array TG_MP
real array TG_X
real array TG_Y
real array TG_SECONDS
endglobals
function Trig_Time_Rupture_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit gU
local integer lvl = GetUnitAbilityLevel(u,039;A000039;)
local integer i = 0
local group g = CreateGroup()
call GroupEnumUnitsInRange(g,GetUnitX(u),GetUnitY(u),500+(lvl*200), null)
loop
set gU = FirstOfGroup(g)
exitwhen gU==null
call GroupRemoveUnit(g,gU)
loop
exitwhen i > 200
if(TG_Caster<i> == null) then
set TG_U<i> = gU
set TG_Caster<i> = u
set TG_HP<i> = GetUnitState(gU,UNIT_STATE_LIFE)
set TG_MP<i> = GetUnitState(gU,UNIT_STATE_MANA)
set TG_X<i> = GetUnitX(gU)
set TG_Y<i> = GetUnitY(gU)
set TG_SECONDS<i> = 0
if (IsUnitType(gU, UNIT_TYPE_HERO) == false) then
set TG_UT<i> = GetUnitTypeId(gU)
endif
set TG_Buffs<i> = GetBuffs(gU)
exitwhen true
endif
set i = i+1
endloop
endloop
call DestroyGroup(g)
set g = null
set u = null
set gU= null
endfunction
//===========================================================================
function InitTrig_Time_Rupture takes nothing returns nothing
set gg_trg_Time_Rupture = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Time_Rupture, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Time_Rupture, Condition( function Trig_Time_Rupture_Conditions ) )
call TriggerAddAction( gg_trg_Time_Rupture, function Trig_Time_Rupture_Actions )
endfunction</i></i></i></i></i></i></i></i></i></i>
TG_Help
JASS:
function Trig_TG_Help_Actions takes nothing returns nothing
local integer i = 0
loop
exitwhen i > 200
set TG_SECONDS<i> = TG_SECONDS<i> + 1
if TG_SECONDS<i> > 30 then
set TG_Caster<i> = null
endif
set i = i + 1
endloop
endfunction
//===========================================================================
function InitTrig_TG_Help takes nothing returns nothing
set gg_trg_TG_Help = CreateTrigger( )
call TriggerRegisterTimerEvent( gg_trg_TG_Help, 1.00,true )
call TriggerAddAction( gg_trg_TG_Help, function Trig_TG_Help_Actions )
endfunction
</i></i></i></i>
Times Gamble
JASS:
function Trig_Times_Gamble_Conditions takes nothing returns boolean
return ( GetSpellAbilityId() == 039;A001039; )
endfunction
function Trig_Times_Gamble_Actions takes nothing returns nothing
local integer i = GetRandomInt(0,100)
local integer count = 0
local player p
local unit u = GetTriggerUnit()
local integer lvl = GetUnitAbilityLevel(u,039;A001039;)
if(i < 5 - lvl) then
call KillUnit(u)
elseif(i < 10) then
call IssueImmediateOrder(u,"stop")
call SetUnitState(u,UNIT_STATE_LIFE,0.15*GetUnitState(u,UNIT_STATE_LIFE))
else
if (i < 80-(4*lvl)) then
call IssueImmediateOrder(u,"stop")
call SetUnitState(u,UNIT_STATE_LIFE,0.30*GetUnitState(u,UNIT_STATE_LIFE))
endif
loop
exitwhen count >200
if(TG_Caster[count] == u) then
if (GetUnitState(TG_U[count],UNIT_STATE_LIFE)<=0) and TG_HP[count] > 0 then
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\ReviveHuman\\ReviveHuman.mdl",TG_X[count],TG_Y[count]))
if (IsUnitType(TG_U[count], UNIT_TYPE_HERO) == false) then
set p = GetOwningPlayer(TG_U[count])
call RemoveUnit(TG_U[count])
set TG_U[count] = CreateUnit(p,TG_UT[count],TG_X[count],TG_Y[count],0)
else
call ReviveHero(TG_U[count],TG_X[count],TG_Y[count],false)
endif
endif
call UnitRemoveBuffs(TG_U[count],true,true)
call DealBuffs(TG_Buffs[count], TG_U[count])
call IssueImmediateOrder(TG_U[count],"stop")
call UnitRemoveAbility(TG_U[count],039;B000039;)
call SetUnitX(TG_U[count],TG_X[count])
call SetUnitY(TG_U[count],TG_Y[count])
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl",TG_X[count],TG_Y[count]))
if (TG_Caster[count] != TG_U[count]) then
call SetUnitState(TG_U[count], UNIT_STATE_LIFE, TG_HP[count])
call SetUnitState(TG_U[count], UNIT_STATE_MANA, TG_MP[count])
endif
set TG_Caster[count] = null
endif
set count = count+1
endloop
endif
endfunction
//===========================================================================
function InitTrig_Times_Gamble takes nothing returns nothing
set gg_trg_Times_Gamble = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Times_Gamble, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Times_Gamble, Condition( function Trig_Times_Gamble_Conditions ) )
call TriggerAddAction( gg_trg_Times_Gamble, function Trig_Times_Gamble_Actions )
endfunction
Buff Functions
JASS:
library CustomFunc
function GetBuffs takes unit gU returns string
local string B = ""
if (GetUnitAbilityLevel(gU,039;Bpoi039;)>0 or GetUnitAbilityLevel(gU,039;Bpsd039;)>0) then
set B = B + "Y"
else
set B = B + "N"
endif
if (GetUnitAbilityLevel(gU,039;Bfro039;)>0) then
set B = B + "Y"
else
set B = B + "N"
endif
if (GetUnitAbilityLevel(gU,039;BSTN039;)>0 or GetUnitAbilityLevel(gU,039;BPSE039;)>0) then
set B = B + "Y"
else
set B = B + "N"
endif
if (GetUnitAbilityLevel(gU,039;Bslo039;)>0) then
set B = B + "Y"
else
set B = B + "N"
endif
return B
endfunction
function DealBuffs takes string b , unit u returns nothing
local real HP = GetUnitState(u,UNIT_STATE_LIFE)
local unit d
call SetUnitState(u,UNIT_STATE_LIFE,GetUnitState(u,UNIT_STATE_MAX_LIFE))
if( SubString(b,0,1) == "Y" ) then
set d = CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE),039;u000039;,GetUnitX(u),GetUnitY(u),0)
call UnitAddAbility(d,039;Aslo039;)
call IssueTargetOrder(d,"slow",u)
call UnitApplyTimedLife(d,039;BTLF039;,1.10)
endif
call SetUnitState(u,UNIT_STATE_LIFE,GetUnitState(u,UNIT_STATE_MAX_LIFE))
if( SubString(b,1,2) == "Y" ) then
set d = CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE),039;u000039;,GetUnitX(u),GetUnitY(u),0)
call UnitAddAbility(d,039;AUfn039;)
call IssueTargetOrder(d,"frostnova",u)
call UnitApplyTimedLife(d,039;BTLF039;,1.10)
endif
call SetUnitState(u,UNIT_STATE_LIFE,GetUnitState(u,UNIT_STATE_MAX_LIFE))
if( SubString(b,2,3) == "Y" ) then
set d = CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE),039;u000039;,GetUnitX(u),GetUnitY(u),0)
call UnitAddAbility(d,039;A002039;)
call IssueImmediateOrder(d, "stomp")
call UnitApplyTimedLife(d,039;BTLF039;, 1.50)
endif
call SetUnitState(u,UNIT_STATE_LIFE,GetUnitState(u,UNIT_STATE_MAX_LIFE))
if( SubString(b,3,4) == "Y" ) then
set d = CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE),039;u000039;,GetUnitX(u),GetUnitY(u),0)
call UnitAddAbility(d,039;Apoi039;)
call IssueTargetOrder(d,"attack",u)
call UnitApplyTimedLife(d,039;BTLF039;,1.10)
endif
call SetUnitState(u,UNIT_STATE_LIFE,GetUnitState(u,UNIT_STATE_MAX_LIFE))
endfunction
endlibrary