//TESH.scrollpos=0
//TESH.alwaysfold=0
Name | Type | is_array | initial_value |
AI | force | Yes | |
AIName | string | Yes | |
AIOffense | group | No | |
AIRetreat | group | No | |
Animation | string | Yes | |
BlackHoleArea | location | No | |
BlackHoleBall | unit | No | |
BlackHoleCaster | unit | No | |
BlackHoleKB | group | No | |
BlendAngle | real | No | |
BlendCaster | unit | No | |
BlendCasterOwn | player | No | |
BlendLoc | location | Yes | |
BlendLocCaster | location | No | |
BlendSpawn | unit | Yes | |
BlendTimes | real | No | |
ChaoticMeteor | group | No | |
ChaoticMeteorLoc1 | location | Yes | |
ChaoticMeteorLoc2 | location | Yes | |
ChaoticMeteorPoint | location | No | |
ChaoticMeteorReal | integer | No | |
ChaoticMeteorTarget | unit | No | |
CItemType | itemcode | Yes | |
Cloned_Unit | unit | Yes | |
Color | string | Yes | |
CreepTimes | integer | No | |
DarkLordPresentCaster | unit | No | |
DarkLordPresentLoc | location | No | |
DarkLordPresentTarget | unit | No | |
DieOwner | player | No | |
FatalSlashCaster | unit | No | |
FatalSlashCastLoc | location | Yes | |
FatalSlashDamage | real | No | |
FatalSlashEffect | effect | Yes | |
FatalSlashTarget | unit | No | |
FatalSlashTargetLoc | location | Yes | |
FinalAura | unit | No | |
FireAndDragon | unit | No | |
FireBlastDamage | real | No | |
FireBreathCaster | unit | No | |
FireBreathDamage | integer | No | |
FireBreathLevel | integer | No | |
FireBreathLoc | location | No | |
FireBreathTarget | unit | No | |
FireImpulesCaster | unit | No | |
FireImpulesPosition | location | No | |
FireOfDragon | group | No | |
FireOfDragonAngle | real | No | |
FireOfDragonArt | effect | No | |
FireOfDragonCaster | unit | No | |
FireOfDragonCasterLoc | location | No | |
FireOfDragonDamage | real | No | |
FireOfDragonKB1 | location | No | |
FireOfDragonKB2 | location | No | |
FireOfDragonMove1 | location | No | |
FireOfDragonMove2 | location | No | |
FireOfDragonTarget | unit | No | |
FireOfDragonTargetLoc | location | No | |
FlamingTornadoCaster | unit | No | |
FlamingTornadoCastOwn | player | No | |
FlamingTornadoDamage | real | Yes | |
FlamingTornadoDamaged | group | Yes | |
FlamingTornadoDummies | unit | No | |
FlamingTornadoGroup | group | No | |
FlamingTornadoGroupTarget | group | Yes | |
FlamingTornadoLoc | location | No | |
FlamingTornadoLocCast | location | Yes | |
FlamingTornadoMove | location | Yes | |
FlamingTornadoMoveSpeed | real | No | |
FlamingTornadoNumber | real | No | |
FlamingTornadoPos | location | No | |
FlamingTornadoTarget | unit | No | |
FlamingTornadoTargetMove | unit | No | |
FlashSlashMirrorStrikeCaster | unit | No | |
FlashSlashMirrorStrikeTarget | unit | No | |
FullBusterCannon | unit | No | |
FullBusterCannonAngle | location | No | |
GravityShock | group | No | |
GravityShockCast | unit | No | |
GravityShockPoint | location | No | |
GravityWaveReal | integer | No | |
GrillShotCaster | unit | No | |
GrillShotTarget | unit | No | |
HellFireBlast | unit | No | |
Hero | string | Yes | |
HeroTemp | unitcode | No | |
HeroType | unitcode | Yes | |
HeroUnit | group | No | |
HintGame | string | Yes | |
HostileLoc | location | Yes | |
HostileNumber | integer | Yes | |
HostileReal | integer | No | |
HostileType | unitcode | Yes | |
HowlOfPainCaster | unit | No | |
HowlOfPainGroup | group | No | |
HowlOfPainTarget | unit | No | |
IceBlastCaster | location | No | |
IceBlastTarget | location | No | |
IllusionStrikeInfinity | unit | No | |
KB_Angle | real | Yes | |
KB_Casters | unit | Yes | |
KB_CountBuffs | integer | No | |
KB_DestroyTrees | boolean | Yes | |
KB_Effects_1 | string | Yes | |
KB_Effects_2 | string | Yes | |
KB_GeneralIntegers | integervar | Yes | |
KB_KnockbackedUnits | group | No | |
KB_Levels | integer | Yes | |
KB_MaxDistance | real | Yes | |
KB_ReachedDistance | real | Yes | |
KB_ReducedReal | real | No | |
KB_ReduceSpeedReal | real | Yes | |
KB_SpecificSpeed | real | Yes | |
KB_StartPositions | location | Yes | |
KB_TempPoint | location | Yes | |
KB_TempReal | real | No | |
KB_TotalKnockUnits | integer | No | |
KB_Units | unit | Yes | |
KBA_Caster | unit | No | |
KBA_DestroyTrees | boolean | No | |
KBA_DistancePerLevel | real | No | |
KBA_Level | integer | No | |
KBA_SpecialEffects | string | Yes | |
KBA_Speed | real | No | |
KBA_StartingPosition | location | No | |
KBA_TargetUnit | unit | No | |
KillPoint | real | Yes | |
LavaExplode | unit | No | |
LavaExplodeDamage | real | No | |
LavaExplodeLoc | location | Yes | |
LavaExplodeOwner | player | No | |
LavaExplodePoint | location | No | |
LavaExplodeRange | real | No | |
LearnRagon | integer | No | |
LevelUp | integer | No | |
LevelUpAI | group | No | |
LostMultiUnit | group | Yes | |
LS_Dummy | unit | No | |
LS_GeneralInteger | integervar | No | |
LS_Groups | group | Yes | |
LS_TempPoint | location | Yes | |
MaskOfShadowAttacked | unit | No | |
MaskofShadowAttackedLoc | location | No | |
MaskofShadowAttacker | unit | No | |
MaskofShadowAttackerLoc1 | location | No | |
MaskofShadowAttackerLoc2 | location | No | |
MaximumFlasher | location | No | |
MaximumFlasherTarget | location | No | |
MaximumFlasherUnit | unit | Yes | |
MedalNumber | real | No | |
MultiBoard | multiboard | No | |
MultiboardName | string | Yes | |
NeutralHostile | group | No | |
NumberAssister | real | Yes | |
OneSecond | unit | No | |
Owning | real | Yes | |
PickEnter | location | No | |
PickSpawn | location | No | |
PlayBackAngle | real | Yes | |
PlayBackCaster | unit | No | |
PlayBackPosition | location | Yes | |
PlayBackTarget | unit | No | |
PlayBackTimes | real | No | |
RageAngle | real | No | |
RageCaster | unit | No | |
RageTarget | unit | No | |
RageTargetLoc1 | location | No | |
RageTargetLoc2 | location | No | |
Rampage_Effect | effect | Yes | |
Rampage_Effect_Copy | effect | Yes | |
Rampage_Increment | integer | No | |
Rampage_Increment_Copy | integer | No | |
Rampage_Point | location | Yes | |
Rampage_Point_Copy | location | Yes | |
Rampage_UGroup | group | No | |
Rampage_UGroup_Copy | group | No | |
Rampage_Unit | unit | Yes | |
Rampage_Unit_Copy | unit | Yes | |
RapidAttack | unit | No | |
RapidAttackAngle | real | No | |
RapidAttackTarget | unit | No | |
RapidHeavySlashLoc | location | Yes | |
RapisHeavySlashCaster | unit | No | |
RapisHeavySlashDamage | real | No | |
RapisHeavySlashTarget | unit | No | |
Red | unit | No | |
Regain | group | No | |
Selector | unit | Yes | |
SelectorAP | unit | Yes | |
SelectorLocTemp | location | No | |
Shadow_Chance | real | No | |
Shadow_Damage | real | No | |
Shadow_Effect | effect | Yes | |
Shadow_Loc | location | Yes | |
Shadow_Loop | integer | No | |
Shadow_Unit | unit | Yes | |
ShadowEater | unit | No | |
ShadowStrikeCaster | unit | No | |
ShadowStrikeTarget | unit | No | |
SloMoArt | group | No | |
SloMoReal | real | No | |
SloMoTarget | group | No | |
Sonic_Storm_Angle | real | No | |
Sonic_Storm_Caster | unit | No | |
Sonic_Storm_Effect | effect | Yes | |
Sonic_Storm_Increment | integer | No | |
Sonic_Storm_Point | location | Yes | |
Sonic_Storm_Target | unit | No | |
SoundMulti | sound | Yes | |
SoundSpree | sound | Yes | |
Spin_Combat_Chance | integer | No | |
Spin_Combat_Chance_Copy | integer | No | |
Spin_Combat_Unit | unit | Yes | |
Spin_Combat_Unit_Copy | unit | Yes | |
Spree | group | Yes | |
Sprint | unit | No | |
TempEff | boolean | No | |
TempLoc | location | No | |
TempReal | real | No | |
TempUnit | unit | No | |
ThunderBlast | location | No | |
ThunderBlastCaster | unit | No | |
ThunderEdgeCaster | unit | No | |
ThunderEdgeCasterLoc | location | No | |
ThunderEdgeTarget | unit | No | |
ThunderEdgeTargetLoc1 | location | No | |
ThunderEdgeTargetLoc2 | location | No | |
ThunderEdgeTargetLoc3 | location | No | |
TimeSlashCaster | unit | No | |
TimeSLashSound | sound | No | |
TimeSlashTarget | unit | No | |
TotalHero | integer | No | |
TotemSmashCaster | unit | No | |
TotemSmashTarget | unit | No | |
Unit | unit | Yes | |
WindOfDoom_Angle | real | No | |
WindOfDoom_Caster | unit | No | |
WindOfDoom_Damage | real | No | |
WindOfDoom_Effect | effect | Yes | |
WindOfDoom_Loc | location | Yes | |
WindOfDoom_Loop | integer | No | |
ZDeath | integer | Yes | |
ZKill | integer | Yes | |
ZMultiBoard | multiboard | No | |
ZRemaining | integer | No | |
ZRow | integer | Yes |
//TESH.scrollpos=0
//TESH.alwaysfold=0
library DDItemCombineBasic initializer Init
globals
// *** Edit to your own will ***
private constant string ITEM_COMBINE_EFFECT = "Abilities\\Spells\\Items\\AIlm\\AIlmTarget.mdl"
private constant string ATTACH_POINT = "origin"
// *** End edit ***
private sound ItemCombineSound = null
private integer array CType[8191]
private integer ItemN = 0
endglobals
function NewItemGroup takes nothing returns nothing
local integer i = ItemN*6 + 7
local integer h = 1
set ItemN = ItemN + 1
loop
exitwhen (h == 7)
set udg_CItemType[i] = udg_CItemType[h]
set udg_CItemType[h] = 0
set h = h + 1
set i = i + 1
endloop
set CType[ItemN-1] = udg_CItemType[0]
set udg_CItemType[0] = 0
endfunction
private function UnitRemoveItemById takes unit whichUnit, integer itemId returns nothing
local integer i = 0
local item it
loop
exitwhen (i >= bj_MAX_INVENTORY)
set it = UnitItemInSlot(whichUnit, i)
if GetItemTypeId(it) == itemId then
call RemoveItem(it)
exitwhen (true)
endif
set i = i + 1
endloop
set it = null
endfunction
private function Actions takes nothing returns nothing
local integer n = 0
local integer array it
local integer i = 7
local integer h = 0
local integer x = 0
local unit u = GetTriggerUnit()
local boolean b = true
local integer y = 0
local integer z = 0
local integer array hero_item_type
// Get hero items
loop
exitwhen (x >= bj_MAX_INVENTORY)
set hero_item_type[x] = GetItemTypeId(UnitItemInSlot(u, x))
set x = x + 1
endloop
loop
exitwhen (n >= ItemN)
set h = i + 6
set x = 0
set it[x] = hero_item_type[x]
set x = x + 1
set it[x] = hero_item_type[x]
set x = x + 1
set it[x] = hero_item_type[x]
set x = x + 1
set it[x] = hero_item_type[x]
set x = x + 1
set it[x] = hero_item_type[x]
set x = x + 1
set it[x] = hero_item_type[x]
set x = x + 1
set y = 0 // N of items that hero has ()
set z = 0 // N of items needed ()
loop
exitwhen (i >= h or udg_CItemType[i] == 0)
set z = z + 1
// Does unit contain item n
set x = 0
loop
exitwhen (x >= bj_MAX_INVENTORY)
if (it[x] == udg_CItemType[i]) then
// Kick out the item
set it[x] = 0
set y = y + 1
// And increase by 1
exitwhen (true)
endif
set x = x + 1
endloop
set i = i + 1
endloop
set i = h
if (y == z) then
set h = i
set i = i-6
loop
exitwhen (i > h or udg_CItemType[i] == 0)
call UnitRemoveItemById(u, udg_CItemType[i])
set i = i + 1
endloop
call UnitAddItemById(u, CType[n])
call SetSoundPosition(ItemCombineSound, GetUnitX(u), GetUnitY(u), 0.)
call StartSound(ItemCombineSound)
call DestroyEffect(AddSpecialEffectTarget(ITEM_COMBINE_EFFECT, u, ATTACH_POINT))
set u = null
return
endif
set n = n + 1
endloop
endfunction
//===========================================================================
private function Init takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddAction( t, function Actions )
call Preload(ITEM_COMBINE_EFFECT)
set ItemCombineSound = CreateSound( "Abilities\\Spells\\Orc\\MirrorImage\\MirrorImage.wav", false, true, true, 10, 10, "" )
call SetSoundParamsFromLabel( ItemCombineSound, "MirrorImage" )
call SetSoundDuration( ItemCombineSound, 1756 )
call SetSoundPitch(ItemCombineSound, 1.2)
call SetSoundVolume(ItemCombineSound, 100)
endfunction
endlibrary