HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Mining.

08-04-2008, 03:22 AM#1
Azhag
Alright, so what I need for a trigger is.

Player 1's hero has a Mining pick (basic), of certain level, and clicks on the pick in his inventory, then clicks on say a mine.
The unit either starts attacking the mine, or enter's it. If the unit attacks the mine, the player will lose control of him while he mines.
20 Seconds later, or a time that I choose, the unit stops attack the mine or leaves it, and recieves an item.

What I also need with this trigger, is that for different levels of a mine, require a certain level of Mining Pick.

Does this make any sense.?
08-04-2008, 10:09 AM#2
Gorman
Ok, im just goint to do the whole thing (hope you dont mind)... Done!

Trigger:
Mining
Collapse Events
Unit - A unit Begins casting an ability
Collapse Conditions
Or - Any (Conditions) are true
Collapse Conditions
(Ability being cast) Equal to Mining pick ability 1
(Ability being cast) Equal to Mining pick ability 2
(Ability being cast) Equal to Mining pick ability 3
Etc... for all mining picks, as each use a different ability
Collapse Actions
Set NumberOfOres = 8
Set NumberOfPicks = 8
Custom script: local unit udg_MiningUnit
Custom script: local integer udg_PickLevel
Custom script: local integer udg_OreLevel
-------- Find the Pick level --------
Collapse For each (Integer A) from 1 to NumberOfPicks, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Ability being cast) Equal to MinePicks[(Integer A)]
Collapse Then - Actions
Set PickLevel = (Integer A)
Else - Actions
-------- Find the Ore level --------
Collapse For each (Integer A) from 1 to NumberOfOres, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Ores[(Integer A)] Equal to (Unit-type of (Target unit of ability being cast))
Collapse Then - Actions
Set OreLevel = (Integer A)
Else - Actions
-------- See if pick is high enough level --------
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
PickLevel Greater than or equal to OreLevel
Collapse Then - Actions
-------- Mine the ore if pick level is high enough --------
Unit - Add Locusu to (Triggering unit)
Animation - Play (Triggering unit)'s attack, looping animation
Wait 10.00 seconds
Animation - Reset (Triggering unit)'s animation
Unit - Remove Locust from (Triggering unit)
Hero - Create OreMined[OreLevel] and give it to (Triggering unit)
Collapse Else - Actions
-------- If its too low, dont do, and display a message! --------
Unit - Order (Triggering unit) to Stop
Game - Display to (All players matching ((Owner of (Triggering unit)) Equal to (Matching player))) the text: Pick level is not high enough.
Custom script: set udg_MiningUnit = null
08-04-2008, 11:33 AM#3
Blubb-Tec
mhh I remember that there are abilities that don't work on creeps above a certain level, but I'm not sure if that level was a property of the ability or a gpc...
08-04-2008, 12:23 PM#4
Gorman
Well,,,, yes some abilities dont, such as Charm, but its a field, and its irrelevant.
08-04-2008, 03:45 PM#5
Azhag
Thank you Gorman, I will give this a try.