HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Machinegun trigger.

12-10-2004, 03:48 PM#1
sPyRaLz
Im trying to create a spell trigger that will increase a units attack speed to enough to make the attack animation look like a gatling gun.

Ive tried doing this by setting a trigger to increase the agility of the specific unit using the skill, at the same time reducing its damage, since gatling gun speed does major damage.

This will work if i increase the agility by like.. 10-20K.. and that would majorly increase the armour of the unit to godly levels, that i do not want. apart from adjusting the game constants, is there a way i can instead adjust the cooldown of the hero unit to give him super fast attacks?

Because i just cant seem to figure it out :\
12-10-2004, 04:05 PM#2
Anitarf
I'm not sure where the problem is. Can't you use abilities like frenzy or pasive abilities like the gloves of haste ability to increase attack speed as much as you wish?
12-10-2004, 04:18 PM#3
sPyRaLz
Quote:
Originally Posted by Anitarf
I'm not sure where the problem is. Can't you use abilities like frenzy or pasive abilities like the gloves of haste ability to increase attack speed as much as you wish?

I might be able to, but its gona be kinda confusing. Coz the skill machinegun im using is ment to have 4 levels. so basically it has a duration that lasts longer for each level. what i could do is, something like, whenever the ability is used, replace the ability machinegun with a clone > modified frenzy, to increase the attack speed. then after the duration is over, switch it back.
If i just used unholy frenzy as it is, an aura, ill have a permanant machinegun effect, but thats not what i want. coz i want to be able to switch between normal slow attks and machinegun.

thanks for the idea =)
12-10-2004, 05:06 PM#4
Arohk
you want it work over some seconds or do you want it so you can turn it on/off. thats not clear for me.

if you want it over some time just use a modiefied berserk ability.
12-10-2004, 05:44 PM#5
sPyRaLz
I originally wanted to be able to turn it on and off, but i couldnt find an appropriate spell for it, so i scrapped that idea and at the moment i have it scripted to give an amount of bullets upon usage.

The ability then switches out for unholy frenzy, until the bullets run out, then it switches back. but i dont know if it will work since it may not allow me to apply any skill points when the skill is replaced.. im going to test it *now*

I would be really grateful if you could help me find a way so i can turn it on and off.
Ie. When machinegun is turned on, hero gains gatling attack speed, but with every shot fired, it deducts one mana (which will serve as the bullets perhaps.)
And it also reduces damage to 1, or as low as it can get. 10 RPS x 5 seconds = 50 hits.. 50 dmg..
Overall, i need to try and balance it, no rpg is fun when there's no challenge. IE.. an overpowered machinegun skill.

The timings are as follows for now.
10 seconds at level 1, 20 for 2 and so on until level 4.
Imo.. it might be a bit too much. 5 secs is enough to waste a boss if u fire 50 shots at 3 damage each.

The best thing however i can think of is. When machinegun is used, it adds a certain number of bullets, displayed on a leaderboard. With every bullet fired, one bullet disappears. Until there are no bullets left. However.. i am having trouble figuring this one out as well. If you could think of a way it can be done i would be grateful as well. here is the current code's that are relevant.


Quote:
Originally Posted by First trigger
:
function Trig_Machinegun_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'AOwk' ) ) then
return false
endif
return true
endfunction

function Trig_Machinegun_Func005C takes nothing returns boolean
if ( not ( udg_j == 1 ) ) then
return false
endif
return true
endfunction

function Trig_Machinegun_Func006C takes nothing returns boolean
if ( not ( udg_j == 2 ) ) then
return false
endif
return true
endfunction

function Trig_Machinegun_Func007C takes nothing returns boolean
if ( not ( udg_j == 3 ) ) then
return false
endif
return true
endfunction

function Trig_Machinegun_Func008C takes nothing returns boolean
if ( not ( udg_j == 4 ) ) then
return false
endif
return true
endfunction

function Trig_Machinegun_Actions takes nothing returns nothing
call UnitRemoveAbilityBJ( 'AOwk', GetTriggerUnit() )
call UnitRemoveBuffBJ( 'BOwk', GetTriggerUnit() )
call TriggerSleepAction( 0.01 )
call UnitAddAbilityBJ( 'AUau', GetTriggerUnit() )
if ( Trig_Machinegun_Func005C() ) then
set udg_h = 100
call CreateLeaderboardBJ( GetPlayersByMapControl(GetPlayerController(GetOwningPlayer(GetTriggerUnit()))), ( "|cffffcc00Bullets remaining|r:" + I2S(udg_h) ) )
call LeaderboardDisplayBJ( true, GetLastCreatedLeaderboard() )
call EnableTrigger( gg_trg_Machinegun_bullets )
else
endif
if ( Trig_Machinegun_Func006C() ) then
set udg_h = 200
call CreateLeaderboardBJ( GetPlayersByMapControl(GetPlayerController(GetOwningPlayer(GetTriggerUnit()))), ( "|cffffcc00Bullets remaining|r:" + I2S(udg_h) ) )
call LeaderboardDisplayBJ( true, GetLastCreatedLeaderboard() )
call EnableTrigger( gg_trg_Machinegun_bullets )
else
endif
if ( Trig_Machinegun_Func007C() ) then
set udg_h = 300
call CreateLeaderboardBJ( GetPlayersByMapControl(GetPlayerController(GetOwningPlayer(GetTriggerUnit()))), ( "|cffffcc00Bullets remaining|r:" + I2S(udg_h) ) )
call LeaderboardDisplayBJ( true, GetLastCreatedLeaderboard() )
call EnableTrigger( gg_trg_Machinegun_bullets )
else
endif
if ( Trig_Machinegun_Func008C() ) then
set udg_h = 400
call CreateLeaderboardBJ( GetPlayersByMapControl(GetPlayerController(GetOwningPlayer(GetTriggerUnit()))), ( "|cffffcc00Bullets remaining|r:" + I2S(udg_h) ) )
call LeaderboardDisplayBJ( true, GetLastCreatedLeaderboard() )
call EnableTrigger( gg_trg_Machinegun_bullets )
else
endif
endfunction

//===========================================================================
function InitTrig_Machinegun takes nothing returns nothing
set gg_trg_Machinegun = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Machinegun, gg_unit_Hmkg_0000, EVENT_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Machinegun, Condition( function Trig_Machinegun_Conditions ) )
call TriggerAddAction( gg_trg_Machinegun, function Trig_Machinegun_Actions )
endfunction

Second trigger:
function Trig_Machinegun_bullets_Func002C takes nothing returns boolean
if ( not ( udg_h > 0 ) ) then
return false
endif
return true
endfunction

function Trig_Machinegun_bullets_Actions takes nothing returns nothing
set udg_h = ( udg_h - 1 )
if ( Trig_Machinegun_bullets_Func002C() ) then
call LeaderboardSetLabelBJ( GetLastCreatedLeaderboard(), ( "|cfffcc00Bullets remaining|r:" + I2S(udg_h) ) )
else
call DestroyLeaderboardBJ( GetLastCreatedLeaderboard() )
call QuestMessageBJ( udg_char1[10], bj_QUESTMESSAGE_ALWAYSHINT, "TRIGSTR_671" )
call UnitRemoveAbilityBJ( 'AUau', gg_unit_Hmkg_0000 )
call TriggerSleepAction( 0.01 )
call UnitAddAbilityBJ( 'AOwk', gg_unit_Hmkg_0000 )
call TriggerSleepAction( 0.01 )
call DisableTrigger( GetTriggeringTrigger() )
endif
endfunction

//===========================================================================
function InitTrig_Machinegun_bullets takes nothing returns nothing
set gg_trg_Machinegun_bullets = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Machinegun_bullets, 0.10 )
call TriggerAddAction( gg_trg_Machinegun_bullets, function Trig_Machinegun_bullets_Actions )
endfunction
12-10-2004, 05:45 PM#6
Anitarf
Yeah, if you want it to work for some time, use berserk or frenzy (which is not an aura, but an autocast ability used by the beastmaster's quillbeast and looks like bloodlust)