Name | Type | is_array | initial_value |
aaa_caster | location | No | |
aaa_target | location | No | |
Aeon_Boss | unit | No | |
Aeon_Charges_Amount | real | No | |
Aeon_Conflagrate_Index | integer | No | |
Aeon_Conflagrate_Target_SipFlm | unit | Yes | |
Aeon_Conflagrate_TargGroup | group | No | |
Aeon_Conflagrate_TargPosition | location | No | |
Aeon_Enemy_Target_Unit | unit | No | |
Aeon_Erruption_Dummy_Caster | unit | No | |
Aeon_Flame_Strike_Timer | timer | No | |
Aeon_Focus_Effect | effect | No | |
Aeon_Focus_Target | unit | No | |
Aeon_Fury | boolean | No | |
Aeon_Generator_AboutToBeCharge | unit | No | |
Aeon_Generator_Count | real | No | |
Aeon_Generator_Positions | location | Yes | |
Aeon_Generators | unit | Yes | |
Aeon_Generators_Group | group | Yes | |
Aeon_Immolate_Timer | timer | No | |
Aeon_KB_Distance | real | No | |
Aeon_KB_FacingAngle | real | No | |
Aeon_KB_Target | unit | No | |
Aeon_KB_TargetPosition | location | No | |
Aeon_Lava_Core_Point | location | Yes | |
Aeon_Lava_Pool_Timer | timer | No | |
Aeon_Lightnings | lightning | Yes | |
Aeon_Meteor | unit | Yes | |
Aeon_Meteor_Point | location | Yes | |
Aeon_Meteor_Timer | timer | No | |
Aeon_Meteror_Effects | effect | Yes | |
Aeon_Orb_Circle_Points | location | Yes | |
Aeon_Orbs_Group | group | No | |
Aeon_Siphon_Fire_Countdown | integer | Yes | |
Aeon_Siphon_Flame_Max_Index | integer | No | |
Aeon_Siphon_Flame_Min_Index | integer | No | 1 |
Aeontimer2 | timer | No | |
AncDruidStaffRandom | integer | No | |
AnDruidStaffCooldown | timer | No | |
Arcane_Dominion_Level | integer | No | |
Arcane_Dominion_NumberOfUnits | integer | No | |
BatteryRandom | integer | No | |
Blast_Target_Group | group | No | |
Blizzard_Cast_Area | location | No | |
Bloodbane_Group | group | No | |
Bloodbane_Level | integer | No | |
Bloodbane_NumberOfUnits | integer | No | |
Boss_Enemy_Target | unit | No | |
Boss_Enemy_Target_Group | group | No | |
Boss_Enemy_Target_Position | location | No | |
Consecrated_Ground_Dummy | unit | No | |
Consecrated_Ground_Lightnings | lightning | No | |
Consecrated_Ground_Points | location | Yes | |
Counterleaderboard | integer | No | |
Empowering_Light_Group | group | No | |
Empowering_Light_Level | integer | No | |
Empowering_Light_Value | real | No | |
Feral_Attack_Count | real | No | |
Feral_Swipe_Caster | unit | No | |
Feral_Swipe_Level | integer | No | |
Feral_Swipe_Target | unit | No | |
Firebolt_Volley_Caster | unit | No | |
Firebolt_Volley_Shooters | group | No | |
Firebolt_Volley_Targeting | unit | No | |
Firebolt_Volley_Targets | group | No | |
Fissure_Caster | unit | No | |
Fissure_Caster_Angle | real | No | |
Fissure_Dummy | unit | No | |
Fissure_Next_Position | location | No | |
Force_Shield_Target | unit | No | |
ForkedLightningTarget | group | No | |
Game_Change_Owner_Hero | unit | No | |
Game_Change_Owner_Regions | rect | Yes | |
Game_Changing_Hero_String | string | No | |
Game_Create_Hero_Point | location | No | |
Game_Creep_Training | unit | No | |
Game_Helper_On_Off | boolean | No | true |
Game_Hero_Buying_Potion | unit | No | |
Game_Hero_ChoicesLeft | integer | No | 5 |
Game_Hero_Helper | unit | No | |
Game_Hero_Pick_Allowance | boolean | Yes | true |
Game_Hero_Pick_Text | location | No | |
Game_Hero_Sour_Milk | unit | No | |
Game_Hero_Spawned | unit | No | |
Game_Picked_Hero | unit | No | |
Game_Player_Picking | player | No | |
Game_Player_Pickinggrp | force | No | |
Game_Players_Hostiles_Group | force | No | |
Game_Sour_Milk_On_Off | boolean | No | true |
Handicap | string | No | |
Healing_Touch_Empower_Value | integer | No | |
Hero_Player_Pick | unit | Yes | |
Hero_Revive_DeadHero | unit | Yes | |
Hero_Revive_Spot | location | No | |
Heroes | unit | Yes | |
Heroes_Creep_Centre_Return | location | No | |
Heroes_Initialization_Pick | group | No | |
Heroes_Position | location | Yes | |
IronChain | itemcode | No | I009 |
IRS_Hashtable | hashtable | No | |
IRS_String | string | Yes | |
IRS_Switch | boolean | No | |
Ivodine_First_Aid_Caster | unit | No | |
Ivodine_First_Aid_Count | integer | No | |
Ivodine_First_Aid_Level | integer | No | |
Ivodine_First_Aid_Target | unit | No | |
Ivodine_Guardian_Target | unit | No | |
JD_Angle | real | Yes | |
JD_Counter | real | Yes | |
JD_Distances | real | Yes | |
JD_Effect | string | Yes | |
JD_Group | group | No | |
JD_Integers | integer | Yes | |
JD_LevelOfAbility | integer | Yes | |
JD_PickGroup | group | No | |
JD_ReachedDistance | real | Yes | |
JD_SpeedUnits | real | Yes | |
JD_TempPoint | location | Yes | |
JD_TreesDestroy | boolean | Yes | |
JD_Unit | unit | Yes | |
JDA_DestroyTrees_Dash | boolean | No | |
JDA_LevelOfAbility | integer | No | |
JDA_SpecialEffect | string | No | |
JDA_Speed | real | No | |
JDA_TargetPoint | location | No | |
JDA_Unit | unit | No | |
k | ordercode | No | |
KB_Angle | real | Yes | |
KB_Casters | unit | Yes | |
KB_CountBuffs | integer | No | |
KB_DestroyTrees | boolean | Yes | |
KB_EffectCounter | integer | Yes | |
KB_EffectCounter2 | integer | Yes | |
KB_Effects_1 | string | Yes | |
KB_Effects_2 | string | Yes | |
KB_GeneralIntegers | integer | 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 | |
KucaPaca_Centre | location | Yes | |
KucaPaca_Grave | unit | No | |
KucaPaca_Kuca | unit | No | |
KucaPaca_Paca | unit | No | |
KucaPaca_Spy_Prey_Dummy | unit | No | |
KucaPaca_Spy_Prey_Effect | effect | No | |
KucaPaca_Spy_Prey_Target | unit | No | |
KucaPaca_Spy_Prey_TargGroup | group | Yes | |
KucaPaca_Spy_Prey_Timer | timer | No | |
Motorbreath_Points | location | Yes | |
Mouzyy_Fochscrowl_Mouz | group | No | |
Natures_Grace_Level | integer | No | |
Necromancer_Skeleton_Count | integer | No | |
Number | integer | No | |
Player | player | Yes | |
Players_Group | force | No | |
PowerGenerators | group | No | |
Pure_Shadow | unit | No | |
Pure_Shadow_Timer | timer | No | |
Rnd | integer | No | |
Shadow_Volley_Caster | unit | No | |
Shadow_Volley_Targeting | unit | No | |
Shadow_Volley_Targets | group | No | |
ShadowVolleyShooters | group | No | |
ShaedArain_Blizzard_Dummy | unit | No | |
ShaedArain_Blizzard_Region | location | No | |
ShaedArain_Boss | unit | No | |
ShaedArain_Boss_Location | location | No | |
ShaedArain_Centre_Point | location | No | |
ShaedArain_Lightnings | lightning | Yes | |
ShaedArain_Number_OfParasites | real | No | |
ShaedArain_NumberOf_Summoners | real | No | |
ShaedArain_Parasite_Target | unit | No | |
ShaedArain_Parasites_Group | group | Yes | |
ShaedArain_Provoke_DamageCount | real | No | |
ShaedArain_RandomRegions | rect | Yes | |
ShaedArain_SkeletonsT1 | unitcode | Yes | |
ShaedArain_SkeletonsT2 | unitcode | Yes | |
ShaedArain_Soul_Blast_Caster | unit | No | |
ShaedArain_Soul_Blast_Targets | unit | Yes | |
ShaedArain_SoulBlast_TargPoint | location | Yes | |
ShaedArain_Summon_Effect | effect | No | |
ShaedArain_Summoner_Spawn | location | Yes | |
ShaedArain_Summoners | unit | Yes | |
ShaedArain_Summoners_Group | group | No | |
ShaedArain_Timer | timer | No | |
shiet | real | No | |
Shockwave_Angle | real | No | |
Shockwave_Group | group | Yes | |
Shockwave_Point | location | Yes | |
Simple_Spell_Caster | unit | No | |
Simple_Spell_Caster_Position | location | No | |
Simple_Spell_Dummy | unit | No | |
Simple_Spell_Level | integer | No | |
Simple_Spell_Target | unit | No | |
Simple_Spell_Target_Position | location | No | |
Snuff_Silence | timer | No | |
Snuff_Silenced | group | No | |
Soul_Blast_Caster | unit | No | |
Soul_Blast_Target | unit | Yes | |
SpecProc | integer | No | |
Temp_Integer | integer | No | |
TreantGuardian | group | No | |
UncontrolledMissile_Random | integer | No | |
Vengeance_Damage | real | No | |
Vengeance_Target | unit | No | |
WolfSkullHelmWearer | group | No | |
WolfSkullHelmWolfSummon | group | No | |
XReadIndex | integer | No | |
XWriteIndex | integer | No |
//***************************************************************************************
//* *
//* ITEM RESTRICTION SYSTEM (IRS) *
//* *
//* Author: Doomlord *
//* Version: 1.0d *
//* *
//* Credits: *
//* + Vexorian: SimError [url]http://www.wc3c.net/showthread.php?t=101260[/url] *
//* + Magtheridon96: Help with code optimization *
//* + SeriousEnemy: Help with code optimization *
//* *
//***************************************************************************************
//*************************************************************************
//* INTRODUCTION: *
//* *
//* A simple system that allows for easy registration of requirements to *
//* carry a specific item type. This system also utilizes Custom Scripts *
//* to make it GUI-friendly. *
//* *
//* In addition, there is a tiny snippet that allows you to register *
//* unit type(s) as a "class". This can be referenced later by using the *
//* hashtable key (<Unit Raw Code>, 0) from IRS_Hashtable which will *
//* give you the class string of said unit. *
//* *
//*************************************************************************
//*******************
//* REQUIREMENTS: *
//* *
//* None *
//* *
//*******************
//************************************************************************************************************************************************
//* INSTALLATION INSTRUCTION: *
//* *
//* Step 1: Copy the code for SimError to your map's Map Header Custom Code. *
//* *
//* Step 2: Copy the whole IRS folder to your map. Don't forget to turn on "Automatically create unknown variables while pasting trigger data". *
//* *
//* Step 3: Create a trigger that runs at Map Initialization. It will be where you register the items and Heroes. *
//* *
//* Step 4: Register your desired unit type(s) as specific classes. Multiple unit types can be registered as one single type of Hero class. *
//* *
//* Step 5: Register your items as examplified in the Item Declaration trigger. Remember to use Map Initialization event. *
//* *
//************************************************************************************************************************************************
//**************************************************************************************
//* Class Registration API *
//* *
//* call IRS_ClassRegistration (integer unitRawCode, string className) *
//* *
//**************************************************************************************
//**************************************************************************
//* Item Requirement Registration API *
//* *
//* call IRS_ItemRegistration (integer itemRawCode, string itemClass, *
//* string heroClass, integer minLvl, integer minStr, integer minAgi, *
//* integer minInt) *
//* *
//**************************************************************************
//=====================================================================================
// Item Pickup Check
function IRS_ItemAcquireCheck takes nothing returns boolean
local unit u = GetTriggerUnit ()
local item it = GetManipulatedItem ()
local integer i = GetItemTypeId (it)
local integer k
local integer j = 0
if LoadStr(udg_IRS_Hashtable, GetUnitTypeId(u), 0) != LoadStr(udg_IRS_Hashtable, i, 1) and LoadStr(udg_IRS_Hashtable, i, 1) != null then
call IRS_SimError(udg_IRS_String[0] + " " + LoadStr(udg_IRS_Hashtable, i, 1))
call RemoveItem(it)
return false
endif
loop
exitwhen j > 5
if LoadStr(udg_IRS_Hashtable, GetItemTypeId(UnitItemInSlot (u, j)), 0) == LoadStr(udg_IRS_Hashtable, i, 0) and UnitItemInSlot (u, j) != it and LoadStr(udg_IRS_Hashtable, i, 0) != null then
if udg_IRS_Switch then
call IRS_SimNotify(udg_IRS_String[6] + " " + LoadStr(udg_IRS_Hashtable, i, 0))
call UnitRemoveItem(u, UnitItemInSlot (u, j))
call UnitRemoveItem(u, it)
call UnitAddItem(u, it)
else
call IRS_SimError(udg_IRS_String[1] + " " + LoadStr(udg_IRS_Hashtable, i, 0))
call RemoveItem(it)
endif
return false
endif
set j = j + 1
endloop
set k = LoadInteger(udg_IRS_Hashtable, i, 2)
if GetUnitLevel(u) < k then
call IRS_SimError(udg_IRS_String[2] + " " + I2S(k))
call UnitRemoveItem(u, it)
return false
endif
set k = LoadInteger(udg_IRS_Hashtable, i, 3)
if GetHeroStr(u, true) < k then
call IRS_SimError(udg_IRS_String[3] + " " + I2S(k))
call UnitRemoveItem(u, it)
return false
endif
set k = LoadInteger(udg_IRS_Hashtable, i, 4)
if GetHeroAgi(u, true) < k then
call IRS_SimError(udg_IRS_String[4] + " " + I2S(k))
call UnitRemoveItem(u, it)
return false
endif
set k = LoadInteger(udg_IRS_Hashtable, i, 5)
if GetHeroInt(u, true) < k then
call IRS_SimError(udg_IRS_String[5] + " " + I2S(k))
call UnitRemoveItem(u, it)
return false
endif
set it = null
set u = null
return false
endfunction
// Class Registration
function IRS_ClassRegistration takes integer unitType, string class returns nothing
call SaveStr (udg_IRS_Hashtable, unitType, 0, class)
endfunction
// Item Requirement Registration
function IRS_RegisterRestrictedItem takes integer itemRawCode, string itemClass, string heroClass, integer minLvl, integer minStr, integer minAgi, integer minInt returns nothing
call SaveStr (udg_IRS_Hashtable, itemRawCode, 0, itemClass)
call SaveStr (udg_IRS_Hashtable, itemRawCode, 1, heroClass)
call SaveInteger (udg_IRS_Hashtable, itemRawCode, 2, minLvl)
call SaveInteger (udg_IRS_Hashtable, itemRawCode, 3, minStr)
call SaveInteger (udg_IRS_Hashtable, itemRawCode, 4, minAgi)
call SaveInteger (udg_IRS_Hashtable, itemRawCode, 5, minInt)
endfunction
//===========================================================================
function InitTrig_IRS takes nothing returns nothing
local trigger acquireItem = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(acquireItem, EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerAddCondition(acquireItem, Condition(function IRS_ItemAcquireCheck))
set udg_IRS_Hashtable = InitHashtable()
set acquireItem = null
endfunction