Doom-Angel
Jass User (Just started using NewGen)
- Reaction score
- 167
that would make me a lot of triggering................................
isn't there any easier way?
isn't there any easier way?
Master said:P.S: How could a Peasant...hold an item by default?
Peasant Item
Events
Unit - A unit Finishes training a unit
Conditions
(Unit-type of (Trained unit)) Equal to Peasant
Actions
Hero - Create Claws of Attack +15 and give it to (Trained unit)
Stat Change
Events
Unit - A unit Acquires an item
Conditions
(Item-type of (Item being manipulated)) Equal to Claws of Attack +15
Actions
Set YourHero = Paladin 0002 <gen>
Unit - Add Item Damage Bonus (+15) to YourHero
Event
Map initialize
Condition
Action
Set Ability[1] = Attack + 15
Set Ability[2] = Defence + 5
Set Ability[3] = Attack + 10
Set Ability[4] = Defence + 2
Set Item[1] = Claws of attack +15
Set Item[2] = Leather Armor +5
Set Item[3] = Claws of attack +10
Set Item[4] = Leather Armor +2
Event
Unit - A Unit Acquire an Item
Condition
Action
For Each (Integer A) from 1 to 4 Do (Actions)
Loop
If (Condition) Then (Action) Else (Action)
If - Condition
(Item Being Manipulated) Equal to Item[(Integer A)]
Then - Action
Remove (Item Being Manipulated) from (Hero Manipulating Item)
Add Ability[(Integer A)] to (Hero Manipulating Item)
Event
Map initialize
Condition
Action
Set Ability[1] = Attack + 15
Set Ability[2] = Defence + 5
Set Ability[3] = Attack + 10
Set Ability[4] = Defence + 2
Set Ability2[1] = Defence + 5
Set Ability2[2] = Attack + 15
Set Ability2[3] = Defence + 2
Set Ability2[4] = Attack + 10
Set Item[1] = Claws of attack +15
Set Item[2] = Leather Armor +5
Set Item[3] = Claws of attack +10
Set Item[4] = Leather Armor +2
Event
Unit - A Unit Acquire an Item
Condition
Action
For Each (Integer A) from 1 to 4 Do (Actions)
Loop
If (Condition) Then (Action) Else (Action)
If - Condition
(Item Being Manipulated) Equal to Item[(Integer A)]
Then - Action
Remove (Item Being Manipulated) from (Hero Manipulating Item)
Add Ability[(Integer A)] to (Hero Manipulating Item)
Add Ability2[(Integer A)] to (Hero Manipulating Item)
Add Item table to (Last created unit)
function ItemTable000000_DropItems takes nothing returns nothing
local widget trigWidget = null
local unit trigUnit = null
local integer itemID = 0
local boolean canDrop = true
set trigWidget = bj_lastDyingWidget
if (trigWidget == null) then
set trigUnit = GetTriggerUnit()
endif
if (trigUnit != null) then
set canDrop = not IsUnitHidden(trigUnit)
if (canDrop and GetChangingUnit() != null) then
set canDrop = (GetChangingUnitPrevOwner() == Player(PLAYER_NEUTRAL_AGGRESSIVE))
endif
endif
if (canDrop) then
// Item set 0
call RandomDistReset( )
call RandomDistAddItem( 'ches', 50 )
call RandomDistAddItem( 'mort', 50 )
set itemID = RandomDistChoose( )
if (trigUnit != null) then
call UnitDropItem( trigUnit, itemID )
else
call WidgetDropItem( trigWidget, itemID )
endif
endif
set bj_lastDyingWidget = null
call DestroyTrigger(GetTriggeringTrigger())
endfunction
yea i guess that's too much of a complicated trigger to do and i rather using already the simple normal dropping trigger system..........
anyway thx for the info +Rep
Item Pools are like Item Drops from Creeps. Here is an example :
Code:function Unit000005_DropItems takes nothing returns nothing [B]//This is started whenever the unit dies, from a trigger[/B] local widget trigWidget = null [B]//Widget, can handle units, doodads,..[/B] local unit trigUnit = null [B]// = bj_lastDyingWidget, equal to last dying handle[/B] local integer itemID = 0 [B]//itemId[/B] local boolean canDrop = true [B]//Is able to drop[/B] set trigWidget = bj_lastDyingWidget [B]// Fixes a value to trigWidget[/B] if (trigWidget == null) then [B]//If the trigWidget equal to nothing (no handle), then trigUnit = Triggering unit[/B] set trigUnit = GetTriggerUnit() [B]//Set trigUnit to triggering unit[/B] endif if (trigUnit != null) then [B]//If the trigUnit equal to nothing (No unit), then do actions[/B] set canDrop = not IsUnitHidden(trigUnit) [B]//Checks if canDrop not equal to if the trigUnit is hidden[/B] if (canDrop and GetChangingUnit() != null) then [B]//ChangingUnit() returns unit, if canDrop and GetChangingUnit = null, then do actions[/B] set canDrop = (GetChangingUnitPrevOwner() == Player(PLAYER_NEUTRAL_AGGRESSIVE)) [B]//Gives a boolean value to canDrop[/B] endif [B]//If/Then Actions ends[/B] endif [B]//If/Then Actions ends[/B] if (canDrop) then [B]//If canDrop equal to .. true[/B] [B]// Item set 0[/B] call RandomDistReset( ) [B]//Resets the DistCount[/B] call RandomDistAddItem( ChooseRandomItemEx( ITEM_TYPE_POWERUP, 2 ), 100 ) [B]//Determines a item for the drop and its chance to be dropped[/B] set itemID = RandomDistChoose( ) [B]//Percentage to drop[/B] if (trigUnit != null) then [B]//If trigUnit equal to No unit[/B] call UnitDropItem( trigUnit, itemID ) [B]//Drop the item from the RandomDistAddItem selected item, in this, it is a Random Powerup[/B] else [B]//Else[/B] call WidgetDropItem( trigWidget, itemID ) [B]//Drop item again[/B] endif [B]//If/Then/Else Action ends[/B] endif [B]//If/Then Action ends[/B] set bj_lastDyingWidget = null [B]//Nullifies bj_lastDyingWidfget[/B] call DestroyTrigger(GetTriggeringTrigger()) [B]//Destroys this trigger[/B] endfunction
They give a chance to drop an item from a pool.
It takes an integer. There is ever a specific Id for each item. Ctrl +D to see them.
Oh, right. SorryYes, you can. But, that's the 1 by 1 method he talked about and didn't want...
so from what i understand u meant to detect when u unit learns a skill and add it to variable but yet i tried it and i can't since i don't have any option to do something like:Though it should be rather easy to keep a list of spells the unit learns or gets from buying or so.
Set Ability = (Learned Ability)