HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Volcano-The Hero Ability

05-28-2004, 08:34 AM#1
Kam
I downloaded the Volcano ability from this site, assimilated it into my map and changed the necessary data to match mine. Here is the scenario:
Player 1 is Orc. I gave the Arch mage the Volcano as his ultimate, and stuck him in under player 1 even though player 1 is orc. (This was so I could just hit the test button and see if it worked.) I did so and was pleased to see it work perfectly. I then tested it as a human player and made the arch mage and went to test it on some creeps, and nothing happened. I know I changed the right data because it works for Player 1(Orc), but when I try it on Player 5(Human) it does not work. Maybe this is a programming issue or something, but I really need an answer to this.
05-28-2004, 10:55 AM#2
johnfn
Can you provide the triggers? Other than that, most people are too lazy to download a map and do everything you said just to test if a spell works. I think though, that it has to do with the player being coded into the spell, but I cant be sure unless I see the spell.
05-28-2004, 07:15 PM#3
Kam
Here is the code for the spell:

//===========================================================================
// Trigger: Volcano
// Script Author: Darky27
// Info: Erupts a big volcano
//===========================================================================

function Trig_Volcano_Conditions takes nothing returns boolean
return ( GetSpellAbilityId() == 'A00B' )
endfunction

function Trig_Volcano_Actions takes nothing returns nothing
local effect array effects
local location targetpoint = udg_VolcanoLoc
call TriggerExecute( udg_VolcanoTriggers[1] )

call TerrainDeformationCraterBJ( 0.50, true, targetpoint, 400.00, -450.00 )
call TerrainDeformationCraterBJ( 0.50, true, targetpoint, 200.00, 400.00 )
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 6
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call AddSpecialEffectLocBJ( PolarProjectionBJ(targetpoint, 100.00, ( I2R(GetForLoopIndexA()) * 60.00 )), "Objects\\Spawnmodels\\Human\\FragmentationShards\\FragBoomSpawn.mdl" )
call AddSpecialEffectLocBJ( PolarProjectionBJ(targetpoint, 100.00, ( I2R(GetForLoopIndexA()) * 60.00 )), "Objects\\Spawnmodels\\Undead\\ImpaleTargetDust\\ImpaleTargetDust.mdl" )
call AddSpecialEffectLocBJ( PolarProjectionBJ(targetpoint, 100.00, ( I2R(GetForLoopIndexA()) * 60.00 )), "Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl" )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call TriggerSleepAction( 0.50 )
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 6
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call AddSpecialEffectLocBJ( PolarProjectionBJ(targetpoint, 100.00, ( I2R(GetForLoopIndexA()) * 60.00 )), "Doodads\\Cinematic\\FireRockSmall\\FireRockSmall.mdl" )
set effects[GetForLoopIndexA() * 2] = GetLastCreatedEffectBJ()
call AddSpecialEffectLocBJ( PolarProjectionBJ(targetpoint, 100.00, ( I2R(GetForLoopIndexA()) * 60.00 )), "Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl" )
set effects[(GetForLoopIndexA() * 2) + 1] = GetLastCreatedEffectBJ()
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call AddSpecialEffectLocBJ( targetpoint, "Doodads\\Cinematic\\TownBurningFireEmitter\\TownBurningFireEmitter.mdl" )
set effects[1] = GetLastCreatedEffectBJ()
call TriggerSleepAction( 22.00 )
call TerrainDeformationCraterBJ( 0.50, true, targetpoint, 400.00, 450.00 )
call TerrainDeformationCraterBJ( 0.50, true, targetpoint, 200.00, -400.00 )
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 6
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call DestroyEffectBJ( effects[GetForLoopIndexA() * 2] )
call DestroyEffectBJ( effects[(GetForLoopIndexA() * 2) + 1] )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call DestroyEffectBJ( effects[1] )
endfunction

function Trig_Volcano_Target_Conditions takes nothing returns boolean
return ( GetIssuedOrderIdBJ() == String2OrderIdBJ("silence") )
endfunction

function Trig_Volcano_Target_Actions takes nothing returns nothing
set udg_VolcanoLoc = GetOrderPointLoc()
endfunction

function Trig_Volcano_Attack_Actions takes nothing returns nothing
local integer i = 1
local integer j
local unit array volcano
local location target
local location targetpoint = udg_VolcanoLoc
set j = 1
loop
exitwhen j > 3
call CreateNUnitsAtLoc( 1, 'e002', Player(0), targetpoint, bj_UNIT_FACING )
set volcano[((j-1)*3)+1] = GetLastCreatedUnit()
call SetUnitPathing( GetLastCreatedUnit(), false )
call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
call SetUnitPositionLoc( GetLastCreatedUnit(), targetpoint )
call SetUnitInvulnerable( GetLastCreatedUnit(), true )
call CreateNUnitsAtLoc( 1, 'e003', Player(0), targetpoint, bj_UNIT_FACING )
set volcano[((j-1)*3)+2] = GetLastCreatedUnit()
call SetUnitPathing( GetLastCreatedUnit(), false )
call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
call SetUnitPositionLoc( GetLastCreatedUnit(), targetpoint )
call SetUnitInvulnerable( GetLastCreatedUnit(), true )
call CreateNUnitsAtLoc( 1, 'e004', Player(0), targetpoint, bj_UNIT_FACING )
set volcano[((j-1)*3)+3] = GetLastCreatedUnit()
call SetUnitPathing( GetLastCreatedUnit(), false )
call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
call SetUnitPositionLoc( GetLastCreatedUnit(), targetpoint )
call SetUnitInvulnerable( GetLastCreatedUnit(), true )
set j = j + 1
endloop
loop
exitwhen i > 22
set j = 1
loop
exitwhen j > 9
set target = PolarProjectionBJ(targetpoint, GetRandomReal(300.00, 700.00), GetRandomDirectionDeg())
call IssuePointOrderLocBJ( volcano[j], "attackground", target )

set udg_VolcanoTarget = target
set udg_VolcanoTime = 1.6 * ((DistanceBetweenPoints(GetUnitLoc(volcano[j]), target)) / 500)
call TriggerExecute( udg_VolcanoTriggers[2] )

set j = j + 1
endloop
call TriggerSleepAction( 0.8 )
set i = i + 1
endloop
set j = 1
loop
exitwhen j > 9
call UnitRemoveAbilityBJ( 'Aloc', volcano[j] )
call RemoveUnit( volcano[j] )
set j = j + 1
endloop
endfunction

function Trig_Volcano_Damage_Group takes nothing returns boolean
return (( IsUnitType(GetFilterUnit(), UNIT_TYPE_GROUND) == true ) and ( IsUnitEnemy(GetFilterUnit(), Player(0)) == true ))
endfunction

function Trig_Volcano_Damage_Actions takes nothing returns nothing
local real time = udg_VolcanoTime
local location target = udg_VolcanoTarget
local effect fire
local unit Target2
local group DamageGroup = GetUnitsInRangeOfLocMatching(300.00, target, Condition(function Trig_Volcano_Damage_Group))
call TriggerSleepAction( time )
call AddSpecialEffectLocBJ( target, "Abilities\\Weapons\\SteamTank\\SteamTankImpact.mdl" )
set fire = GetLastCreatedEffectBJ()
call TriggerSleepAction( 1.0 )
call DestroyEffectBJ( fire )
loop
set Target2 = GroupPickRandomUnit(DamageGroup)
exitwhen Target2 == null
call SetUnitLifeBJ( Target2, ( GetUnitStateSwap(UNIT_STATE_LIFE, Target2) - 40 ) )
call GroupRemoveUnitSimple( Target2, DamageGroup )
endloop
endfunction

//===========================================================================
function InitTrig_Volcano takes nothing returns nothing
local trigger Volcano_Target = CreateTrigger( )
set udg_VolcanoTriggers[1] = CreateTrigger( )
set udg_VolcanoTriggers[2] = CreateTrigger( )
set gg_trg_Volcano = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Volcano, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Volcano, Condition( function Trig_Volcano_Conditions ) )
call TriggerAddAction( gg_trg_Volcano, function Trig_Volcano_Actions )
call TriggerRegisterPlayerUnitEventSimple( Volcano_Target, Player(0), EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER )
call TriggerAddCondition( Volcano_Target, Condition( function Trig_Volcano_Target_Conditions ) )
call TriggerAddAction( Volcano_Target, function Trig_Volcano_Target_Actions )
call TriggerAddAction( udg_VolcanoTriggers[1], function Trig_Volcano_Attack_Actions )
call TriggerAddAction( udg_VolcanoTriggers[2], function Trig_Volcano_Damage_Actions )
endfunction

Hope this helps.
05-28-2004, 08:21 PM#4
johnfn
Ok, I dont know much about JASS, but it looks to me like which player it is is indeed hardcoded into the function. Do a search and replace. Search for Player(0) , replace it with GetOwningPlayer(GetTriggerUnit()) .That might work. Tell me what happens.
05-28-2004, 09:15 PM#5
Kam
Quote:
Originally Posted by johnfn
Do a search and replace. Search for Player(0) , replace it with GetOwningPlayer(GetTriggerUnit()) .That might work. Tell me what happens.

I searched through it and replaced all of them, but it still does not work. Mabye there is another specific being dictated somewhere? (Is the a search and replace command or something, manually takes a long time.)
05-28-2004, 10:00 PM#6
johnfn
You should probably just PM darky, because I dont know much JASS as I mentioned earlier. Either that or just post this in the JASS development forums. After you do that, then PM darky. Just my idea since I dont have a clue whats going on :-p