@@ -394,7 +394,9 @@ public ILconstBool IsHeroUnitId(ILconstInt unitId) {
394394 String rawcode = ObjectHelper .objectIdIntToString (unitId .getVal ());
395395 return ILconstBool .instance (!rawcode .isEmpty () && Character .isUpperCase (rawcode .charAt (0 )));
396396 }
397- public ILconstBool IsUnitIdType (ILconstInt unitId , IlConstHandle unitType ) { return ILconstBool .FALSE ; }
397+ public ILconstBool IsUnitIdType (ILconstInt unitId , IlConstHandle unitType ) {
398+ return IsHeroUnitId (unitId );
399+ }
398400
399401 public ILconstBool UnitAddType (IlConstHandle unit , IlConstHandle unitType ) {
400402 UnitMock unitMock = unitOrNull (unit );
@@ -594,7 +596,13 @@ public ILconstBool UnitStripHeroLevel(IlConstHandle unit, ILconstInt levels) {
594596 public ILconstString GetHeroProperName (IlConstHandle unit ) { return GetUnitName (unit ); }
595597 public void SuspendHeroXP (IlConstHandle unit , ILconstBool flag ) { UnitMock m = unitOrNull (unit ); if (m != null ) m .suspendedXp = flag .getVal (); }
596598 public ILconstBool IsSuspendedXP (IlConstHandle unit ) { UnitMock m = unitOrNull (unit ); return ILconstBool .instance (m != null && m .suspendedXp ); }
597- public void SelectHeroSkill (IlConstHandle unit , ILconstInt abilityId ) { UnitAddAbility (unit , abilityId ); }
599+ public void SelectHeroSkill (IlConstHandle unit , ILconstInt abilityId ) {
600+ UnitMock m = unitOrNull (unit );
601+ if (m == null || m .skillPoints .getVal () <= 0 ) return ;
602+ int level = m .abilityLevels .getOrDefault (abilityId .getVal (), ILconstInt .create (0 )).getVal ();
603+ m .abilityLevels .put (abilityId .getVal (), ILconstInt .create (level + 1 ));
604+ m .skillPoints = ILconstInt .create (m .skillPoints .getVal () - 1 );
605+ }
598606
599607 public ILconstBool ReviveHero (IlConstHandle unit , ILconstReal x , ILconstReal y , ILconstBool doEyeCandy ) {
600608 UnitMock m = unitOrNull (unit );
0 commit comments