-showbat returns the base attack cooldown (aka Agility = 0).
It doesn't matter if you have more agility.
If you want to know the actual attack cooldown use -showas.
The code isn't obfuscated at all. You should learn about JASS.
Take this one as example:
1) This function is based on a unit using a spell (EVENT_PLAYER_UNIT_SPELL_EFFECT) :
Code:
function InitTrig_Weapon_SRG takes nothing returns nothing
set gg_trg_Weapon_SRG=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_Weapon_SRG,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(gg_trg_Weapon_SRG,Condition(function Trig_Weapon_SRG_Conditions))
call TriggerAddAction(gg_trg_Weapon_SRG,function Trig_Weapon_SRG_Actions)
endfunction
2) What spell? A0XQ = Merge Skill
Code:
function Trig_Weapon_SRG_Conditions takes nothing returns boolean
if(not(GetSpellAbilityId()=='A0XQ'))then
return false
endif
return true
endfunction
3) For example:
If you have the items I018 ("Corrupted Sword") and I051 ("Sapphire Parts") in your item slot
Code:
function Trig_Weapon_SRG_Func001C takes nothing returns boolean
if(not(UnitHasItemOfTypeBJ(GetTriggerUnit(),'I018')==true))then
return false
endif
if(not(UnitHasItemOfTypeBJ(GetTriggerUnit(),'I05I')==true))then
return false
endif
return true
endfunction
You'll be able to forge the I0AF ("Unholy Sword") item.
Code:
if(Trig_Weapon_SRG_Func001C())then
call RemoveItem(GetItemOfTypeFromUnitBJ(GetTriggerUnit(),'I018'))
call RemoveItem(GetItemOfTypeFromUnitBJ(GetTriggerUnit(),'I05I'))
call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIim\\AIimTarget.mdl")
call DestroyEffectBJ(GetLastCreatedEffectBJ())
call UnitAddItemByIdSwapped('I0AF',GetTriggerUnit())
else
endif