Hope this is a simple one
So I'm implementing BPower's Equipment System and things are going really good. However, I'm not great with jass in general and now I got some vjass going on and - man I need some help.
When getting the "equip" system attached to a unit, the demo map has it created and then assigned.
I have edited BPower's documentation at the point I need help. It has to be possible to assign the equip variable in an easier way than creating the unit right? Or maybe not?
Oh and Happy New Year!
So I'm implementing BPower's Equipment System and things are going really good. However, I'm not great with jass in general and now I got some vjass going on and - man I need some help.
When getting the "equip" system attached to a unit, the demo map has it created and then assigned.
JASS:
scope SetupEquipment initializer Initialize
private struct InitFirst extends array
private static method init takes nothing returns nothing
/**
* Init all classes and items in a module initializer to avoid ingame malfunction.
*
* A class has an unique integer key and an empty slot icon ability.
*
* For easy access, define each class in the globals of the Equipment library as:
*
* --> constant integer ITEM_CLASS_EXAMPLE = x
*
*/
call RegisterEquipmentClass(ITEM_CLASS_MAINHAND, 'A00D')
call RegisterEquipmentClass(ITEM_CLASS_OFFHAND, 'A00E')
call RegisterEquipmentClass(ITEM_CLASS_AMULET, 'A00A')
call RegisterEquipmentClass(ITEM_CLASS_ARMOR, 'A007')
call RegisterEquipmentClass(ITEM_CLASS_BOOTS, 'A00F')
call RegisterEquipmentClass(ITEM_CLASS_GLOVES, 'A004')
call RegisterEquipmentClass(ITEM_CLASS_RING, 'A00C')
call RegisterEquipmentClass(ITEM_CLASS_HELMET, 'A00L')
call RegisterEquipmentClass(ITEM_CLASS_SPECIAL, 'A00M')
/**
* Item ids can be registered with RegisterEquipmentItemId
*
* itemid | icon | class | twohanded? | animationtag
*/
// Silversword
call RegisterEquipmentItemId('I004', 'A008', ITEM_CLASS_MAINHAND, false, "Alternate")
call ItemIdAddAbility('I004', 'A002', 1) // This is how you add an ability to an itemid.
call EnableItemIdForUnitId('I004','H001', false) // Forbid this item for 'H001'
/**
* In case you use library BonusMod, you can also do:
* call ItemIdAddBonus('I004', BONUS_LIFE, 1000.)
* call ItemIdAddBonus('I004', BONUS_DAMAGE, 200.)
*
* etc...
*/
//* Sacred stone
call RegisterEquipmentItemId('I000', 'A00K', ITEM_CLASS_SPECIAL, false, "")
call ItemIdAddAbility('I000', 'A000', 1)// + 10 Agility.
call ItemIdAddAbility('I000', 'A00Y', 1)
//* Slizer
call RegisterEquipmentItemId('I005' , 'A00H', ITEM_CLASS_MAINHAND, false, "Alternate")
call ItemIdAddAbility('I005', 'A005', 1)
//* Razor
call RegisterEquipmentItemId('I006', 'A00J', ITEM_CLASS_MAINHAND, true, "Channel")
call ItemIdAddAbility('I006', 'A005', 1)// 'A005' adds the SilverRazor modelfile to 'I006'!
//* As an alternative you could also use:
//-->> call AddItemIdSpecialEffect('I006', "war3mapImported\\SilverRazor.mdx", "hand left")
//* Pros and Cons of using the function call can be found in the Equipment Manual.
//* Shield
call RegisterEquipmentItemId('I001', 'A009', ITEM_CLASS_OFFHAND, false, "defend")
call ItemIdAddAbility('I001', 'A006', 1)
//* Amulet of darkness
call RegisterEquipmentItemId('I00A', 'A00B', ITEM_CLASS_AMULET, false, "")
//* Golems Skin
call RegisterEquipmentItemId('I003', 'A00N', ITEM_CLASS_ARMOR, false, "")
call ItemIdAddAbility('I003', 'A00U', 1)
//* Windwalkers
call RegisterEquipmentItemId('I002', 'A00O', ITEM_CLASS_BOOTS, false, "")
call ItemIdAddAbility('I002', 'A00X', 1)
//* Stonefists
call RegisterEquipmentItemId('I007', 'A00P', ITEM_CLASS_GLOVES, false, "")
call ItemIdAddAbility('I007', 'A00W', 1)
//* Arthuriel
call RegisterEquipmentItemId('I008', 'A00Q', ITEM_CLASS_RING, false, "")
call ItemIdAddAbility('I008', 'A00T', 1)
//* Mask of Horror
call RegisterEquipmentItemId('I009', 'A00R', ITEM_CLASS_HELMET, false, "")
call ItemIdAddAbility('I009', 'A00V', 1)
//* Harold's Cleaver Twohand Weapon
call RegisterEquipmentItemId('I00B' , 'A013', ITEM_CLASS_MAINHAND, true, "Alternate")
/**
* This way you attach special effects to weapons without using an ability.
*/
call ItemIdAddSpecialEffect('I00B', "war3mapImported\\SilverRazor.mdx", "hand left")
//** Harold's Ring
call RegisterEquipmentItemId('I00D', 'A014', ITEM_CLASS_RING, false, "")
call ItemIdAddAbility('I00D', 'A016', 1)//+ 10 Strenght
//* Harold's Horn
call RegisterEquipmentItemId('I00C', 'A015', ITEM_CLASS_SPECIAL, false, "")
call ItemIdAddAbility('I00C', 'A00Y', 1)//+ 10% AttackSpeed
endmethod
private static method onInit takes nothing returns nothing
call init()
endmethod
endstruct
////Making the heroes! THE HIVE WORKSHOP PLEASE HELP ME I LOVE YOU SO MUCH
private function Initialize takes nothing returns nothing
local unit demon = CreateUnit(Player(0), 'Edem', -14450, 13612, 0)
local unit test = CreateUnit(Player(0), 'H001', -14450, 13612, 0)
local unit HELP = CreateUnit(Player(0), 'H002', 20509, -31300, 0)
call CreateEquipment(test)
call CreateEquipment(demon)
call CreateEquipment(HELP)
// I pretty much got it from here. Help me ^ ^ ^ <3
//* Except for the village 255 animations model,
//* Animationtags can mess with your models.
//* You can disable this feature for a unit via:
call EquipmentEnableAnimationTags(demon, false)
//* The demo map includes ItemPower and ItemSet,
//* to show what can Equipment do.
call CreateUnitItemPower(demon)
call CreateUnitItemPower(test)
call CreateUnitItemPower(HELP)
call SetHeroLevel(demon, 10, false)
endfunction
endscope
I have edited BPower's documentation at the point I need help. It has to be possible to assign the equip variable in an easier way than creating the unit right? Or maybe not?
Oh and Happy New Year!
Last edited: