I have a number of issues. First and foremost I want this MUI and MPI. It needs to be spammable. Current Trigger below.
[del]a. I've been trying to remove the BJ's. There are still some in there but I've gotten tired today. I'll look at them later.[/del] Done
1. Is the spell Mui?
2. For some reason it doesn't damage any mines that are laid next to it, but it does effect all other units. The unit being created is a custom unit based off Goblin Mine. I want to be able to set off chain reactions.
3. Hows my Jassing? Give me feedback please. I want to improve.
3b. I'm having trouble with those TriggerSleepActions. I've looked into timers but I'm finding my brain has shut off and I can't concentrate enough to get the timer ideas.
4. I'm trying to head this into structs. Would someone be kind enough to guide me to that?
[del]5. I'm trying to allow for 5 different mines. Should I just make separate function for each one or is it possible to do conditions and variables that change depending on what ability is cast and what units are to be created?[/del] Done
*Edit: Removed the old triggers.
[del]a. I've been trying to remove the BJ's. There are still some in there but I've gotten tired today. I'll look at them later.[/del] Done
1. Is the spell Mui?
2. For some reason it doesn't damage any mines that are laid next to it, but it does effect all other units. The unit being created is a custom unit based off Goblin Mine. I want to be able to set off chain reactions.
3. Hows my Jassing? Give me feedback please. I want to improve.
3b. I'm having trouble with those TriggerSleepActions. I've looked into timers but I'm finding my brain has shut off and I can't concentrate enough to get the timer ideas.
4. I'm trying to head this into structs. Would someone be kind enough to guide me to that?
[del]5. I'm trying to allow for 5 different mines. Should I just make separate function for each one or is it possible to do conditions and variables that change depending on what ability is cast and what units are to be created?[/del] Done
Current Trigger
JASS:
//-------Mine Spells Integer Block
constant function ProxRawCode takes nothing returns integer
return 039;A00Z039; //Proximity Mine Spell
endfunction
constant function FoFRawCode takes nothing returns integer
return 039;A011039; //FoF Mine Spell
endfunction
constant function HomeRawCode takes nothing returns integer
return 039;A012039; //Homing Mine Spell
endfunction
constant function StealthRawCode takes nothing returns integer
return 039;A014039; //Stealth Mine Spell
endfunction
constant function AcidRawCode takes nothing returns integer
return 039;A015039; //Acid Mine Spell
endfunction
function Trig_CreateProximityMineJass2_Conditions takes nothing returns boolean
if ((GetSpellAbilityId()==ProxRawCode())) then
set udg_LastMine[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] = 1
return GetSpellAbilityId()==ProxRawCode()
endif
if ((GetSpellAbilityId()==FoFRawCode())) then
set udg_LastMine[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] = 2
return GetSpellAbilityId() == FoFRawCode()
endif
if ((GetSpellAbilityId()==HomeRawCode())) then
set udg_LastMine[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] = 3
return GetSpellAbilityId()==HomeRawCode()
endif
if ((GetSpellAbilityId()==StealthRawCode())) then
set udg_LastMine[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] = 4
return GetSpellAbilityId()==StealthRawCode()
endif
if ((GetSpellAbilityId()==AcidRawCode())) then
set udg_LastMine[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] = 5
return GetSpellAbilityId()==AcidRawCode()
endif
return false
endfunction
//--------Mine Units
function MineID takes nothing returns integer
if (udg_LastMine[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))]) == 1 then
return 039;n003039; //Proximity Mine Spell
endif
if (udg_LastMine[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))]) == 2 then
return 039;n005039; //FoF Mine Spell
endif
if (udg_LastMine[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))]) == 3 then
return 039;n002039; //Homing Mine Spell
endif
if (udg_LastMine[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))]) == 4 then
return 039;n000039; //Stealth Mine Spell
endif
if (udg_LastMine[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))]) == 5 then
return 039;n004039; //Acid Mine Spell
endif
return 0
endfunction
//-------Generic Mine stuff
constant function MineFuse takes nothing returns real
return 6.
endfunction
constant function MineBlastRadius takes nothing returns real
return 200. //Mine Blast Radius
endfunction
constant function MineDamage takes nothing returns real
return 300. //Proximity Mine Damage
endfunction
function Trig_CreateProximityMineJass2_Actions takes nothing returns nothing
local unit Caster = GetTriggerUnit()
local real CasterX = GetUnitX(Caster)
local real CasterY = GetUnitY(Caster)
local real CasterFace = GetUnitFacing(Caster)
local unit Mine
local unit Explosion
set Mine = CreateUnit(GetOwningPlayer(Caster), MineID(), CasterX, CasterY, bj_UNIT_FACING)
call UnitApplyTimedLife(Mine ,039;BTLF039;, MineFuse())
call TriggerSleepAction(MineFuse())
set Explosion = CreateUnit(GetOwningPlayer(Caster),039;h00Q039;,GetUnitX(Mine),GetUnitY(Mine),bj_UNIT_FACING)
call UnitDamagePoint(Mine, 0, MineBlastRadius(), GetUnitX(Mine), GetUnitY(Mine), MineDamage(), true, false, ATTACK_TYPE_MELEE, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS)
call UnitApplyTimedLife(Explosion, 039;BTLF039;, 2)
set Caster = null
set Mine = null
set Explosion = null
endfunction
//===========================================================================
function InitTrig_CreateProximityMineJass2 takes nothing returns nothing
set gg_trg_CreateProximityMineJass2 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_CreateProximityMineJass2, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_CreateProximityMineJass2, Condition( function Trig_CreateProximityMineJass2_Conditions ) )
call TriggerAddAction( gg_trg_CreateProximityMineJass2, function Trig_CreateProximityMineJass2_Actions )
endfunction
*Edit: Removed the old triggers.