Currently I made a system that would make an creep drop a random item. Those items are linked to some array variables ( item-types).
Initialization from the GUI variables :
So CreepDropItem equals to an Item-type variable.
The next trigger I made was in JASS, giving a chance that a creep drops something.
But I think I did something wrong since a creep never dropped an item.
Code:
Can someone help me to find the answer? thanks ...
Initialization from the GUI variables :
Code:
Start Init
Events
Map initialization
Conditions
Actions
-------- Items --------
Set CreepDropItem[1] = Leather
Set CreepDropItem[2] = Potion of Healing
Set CreepDropItem[3] = Wooden Stick
Set CreepDropItem[4] = Broken Buckler
Wait 5.00 seconds
Custom script: call DestroyTrigger(GetTriggeringTrigger())
So CreepDropItem equals to an Item-type variable.
The next trigger I made was in JASS, giving a chance that a creep drops something.
But I think I did something wrong since a creep never dropped an item.
Code:
JASS:
function Trig_Dropping_Copy_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetDyingUnit()) == Player(PLAYER_NEUTRAL_AGGRESSIVE) ) ) then
return false
endif
return true
endfunction
function Trig_Dropping_Copy_Func003C takes nothing returns boolean
if ( not ( 'c' == 12 ) ) then
return false
endif
return true
endfunction
function Trig_Dropping_Copy_Actions takes nothing returns nothing
local integer c = GetRandomInt(1, 15)
if ( Trig_Dropping_Copy_Func003C() ) then
call CreateItemLoc( udg_CreepDropItem[GetRandomInt(1, 4)], GetUnitLoc(GetDyingUnit()) )
else
call DoNothing( )
endif
endfunction
//===========================================================================
function InitTrig_Dropping takes nothing returns nothing
set gg_trg_Dropping = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Dropping, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Dropping, Condition( function Trig_Dropping_Copy_Conditions ) )
call TriggerAddAction( gg_trg_Dropping, function Trig_Dropping_Copy_Actions )
endfunction
Can someone help me to find the answer? thanks ...