Bombard
Screenshots:
Code:
Delayed Water Nova
Screenshots:
Code:
Sheep Mines
Screenshots:
Code:
Enjoy..
EDIT: Updated.
Screenshots:
Code:
JASS:
scope Bombard
//Configuration
globals
private integer SpellID = 039;A002039;
// Raw code of the "Bombard" ability
private integer BombardID = 039;h002039;
// Raw code of the "Bombard Dummy" unit
private integer EndL = 6
// Number of rockets which would hail down before the big rocket comes
endglobals
// End of configuration
// Do not edit below unless you know what you are doing
function BCond takes nothing returns boolean
return GetSpellAbilityId() == SpellID
endfunction
function BMain takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer i = EndL
local real x = GetLocationX(GetSpellTargetLoc())
local real y = GetLocationY(GetSpellTargetLoc())
local rect r = Rect(x-170*.5,y-170*.5,x+170*.5,y+170*.5)
local real x2 = GetRandomReal(GetRectMinX(r),GetRectMaxX(r))
local real y2 = GetRandomReal(GetRectMinY(r),GetRectMaxY(r))
local integer g = 1
local unit d
loop
exitwhen g > i
set d = CreateUnit(GetOwningPlayer(u),BombardID,x2,y2,GetRandomReal(0.0,360.0))
call SetUnitFlyHeight(d,0,3000)
call UnitApplyTimedLife(d,039;BTLF039;,1.48)
call TriggerSleepAction(0.4)
set d = null
set g=g+1
endloop
set d = CreateUnit(GetOwningPlayer(u),BombardID,x2,y2,GetRandomReal(0.0,360.0))
call SetUnitFlyHeight(d,0,3000)
call UnitApplyTimedLife(d, 039;BTLF039;, 1.48)
call SetUnitScale(d,3,3,3)
call UnitDamagePoint(d,1.48,170,x2,y2,200,false,true,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
call TriggerSleepAction(1.48)
call RemoveRect(r)
set r = null
set g =1
set r = Rect(x2-170*.5,y2-170*.5,x2+170*.5,y2+170*.5)
loop
exitwhen g>7
set x2 = GetRandomReal(GetRectMinX(r),GetRectMaxX(r))
set y2 = GetRandomReal(GetRectMinY(r),GetRectMaxY(r))
call DestroyEffect(AddSpecialEffect("war3mapImported\\NewGroundEX.mdx",x2,y2))
call UnitDamagePoint(u,1.48,170,x2,y2,60,false,true,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
set g = g+1
call TriggerSleepAction(0)
endloop
set d = null
set u = null
set r = null
endfunction
//===========================================================================
function InitTrig_Bombard takes nothing returns nothing
call OnAbilityEffect(SpellID, "BMain")
endfunction
endscope
Delayed Water Nova
Screenshots:
Code:
JASS:
globals
integer spellId = 039;A001039;
// The "Delayed Water Nova" ability raw code.
integer dummyId = 039;A000039;
// The Delayed Water Nova Dummy Ability" raw code.
real waittime = 0.03
// The time that should be waited before the nova is executed.
endglobals
scope DelayedWaterNova
struct WNStruct
unit WNUnit
location WNLoc
location WNTemp
integer WNInt
endstruct
public function WNCond takes nothing returns boolean
return ( GetSpellAbilityId() == spellId )
endfunction
function WNMain takes nothing returns nothing
local WNStruct data = WNStruct.create()
set data.WNUnit= GetTriggerUnit()
set data.WNLoc= GetUnitLoc(data.WNUnit)
call TriggerSleepAction(waittime)
call CasterSetCastSourceLoc(data.WNLoc)
call CasterSetRecycleDelay(4)
set data.WNInt= 1
loop
exitwhen data.WNInt> 60
set data.WNTemp= PolarProjectionBJ(data.WNLoc, 30.0, data.WNInt*6)
call CasterCastAbilityPointLoc( GetOwningPlayer(data.WNUnit), dummyId, "shockwave", data.WNTemp, false)
call RemoveLocation(data.WNTemp)
set data.WNInt= data.WNInt+1
endloop
call RemoveLocation(data.WNLoc)
set data.WNLoc= null
set data.WNTemp= null
set data.WNUnit= null
call data.destroy()
endfunction
endscope
//===========================================================================
function InitTrig_DelayedWaterNova takes nothing returns nothing
local trigger t = GetTriggeringTrigger()
call OnAbilityEffect(spellId, "WNMain")
endfunction
Sheep Mines
Screenshots:
Code:
JASS:
globals
// Configuration
integer SMSpellId = 039;A003039;
//Raw code of the main ability.
integer SMSheepId = 039;h003039;
//Raw code of the sheep unit.
integer SMDummyId = 039;h001039;
//Raw code of the dummy unit.
real SMWait = GetRandomReal(.25,.75)
//Real time waited between the sheeps creation.
real SMDamage = GetUnitAbilityLevel(GetTriggerUnit(), SMSpellId)*5+30
//The damage done when a sheep explodes.
integer SMFlyId = 039;A004039;
//The Sheep Fly ability.
// End of configuration
endglobals
// Do not edit below unless you know what you are doing
scope SheepMines
function SMConds takes nothing returns boolean
return ( GetSpellAbilityId() == SMSpellId )
endfunction
struct SMStruct
unit u
rect r
location l
location temp
integer int
unit f
endstruct
function SMMain takes nothing returns nothing
local SMStruct dat = SMStruct.create()
set dat.u = GetTriggerUnit()
set dat.l = GetUnitLoc(dat.u)
set dat.r = RectFromCenterSizeBJ(dat.l, 500.0, 500.0)
set dat.int = 1
loop
set dat.temp = GetRandomLocInRect(dat.r)
exitwhen dat.int>GetRandomInt(10,15)
set dat.f=CreateUnitAtLoc(GetOwningPlayer(dat.u), SMSheepId, dat.temp, 0.0)
call AddSpecialEffectTargetUnitBJ( "origin", dat.f, "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call DestroyEffect(GetLastCreatedEffectBJ())
call UnitApplyTimedLife(dat.f, 039;BTLF039;, GetRandomReal(7.0,14.0))
set dat.int = dat.int + 1
set dat.f=null
call TriggerSleepAction(SMWait)
endloop
call dat.destroy()
endfunction
endscope
//===========================================================================
function InitTrig_SheepMines takes nothing returns nothing
call OnAbilityEffect(SMSpellId, "SMMain")
endfunction
JASS:
function SDCond takes nothing returns boolean
return GetUnitTypeId (GetDyingUnit ()) == SMSheepId
endfunction
function SDMain takes nothing returns nothing
local unit u = GetDyingUnit()
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local unit d
call UnitDamagePoint(u, 0, 300.0,x,y, SMDamage,false, true, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
call DestroyEffect (AddSpecialEffect ("Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl", x, y))
set d=CreateUnit(GetOwningPlayer(u), SMDummyId, x,y, GetRandomReal(0.0, 360.0))
call UnitAddAbility(d, SMFlyId)
call IssuePointOrder(d, "impale", x,y)
call UnitApplyTimedLife(d, 039;BTLF039;, 2.0)
endfunction
//===========================================================================
function InitTrig_SheepsDies takes nothing returns nothing
set gg_trg_SheepsDies = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_SheepsDies, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_SheepsDies, Condition( function SDCond ) )
call TriggerAddAction( gg_trg_SheepsDies, function SDMain )
endfunction
Enjoy..
EDIT: Updated.