HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

some abilities not working.

03-21-2005, 08:18 PM#1
AnarkiNet
my problem is this:
ive made a series of abilities based on item abilties (Item Armor Bonus, Item Mana Bonus, etc)

and im having problems with a few of them

Code:
function ItemAquire takes nothing returns nothing
   local unit whichUnit = GetManipulatingUnit()
   local integer whichItem = GetItemTypeId(GetManipulatedItem())
   local integer n = GetPlayerId(GetOwningPlayer(whichUnit))
   local player whichPlayer = GetOwningPlayer(whichUnit)
   local string ProperName = GetHeroProperName(whichUnit)
   local string Name = GetUnitName(whichUnit)
   local string ItemName = GetItemName(GetManipulatedItem())
   local force whichForce = GetPlayersAllies(whichPlayer)
   local integer armor = 'A000' //BonusArmor 1 per #
   local integer damage = 'A001' //BonusDamage 1 per #
   local integer life = 'A002' //BonusLife 25 per #
   local integer mana = 'A003' //BonusMana 25 per #
   local integer str = 'A005' //BonusStrength 1 per #
   local integer move = 'A006' //BonusMoveSpeed 5units/s per #
   local integer dex = 'A007' //BonusDexterity 1 per #
   local integer wis = 'A008' //BonusWisdom 1 per #
   local integer spell = 'A009' //BonusSpellReduction 5% per #
   local integer sight = 'A00A' //BonusSightRange 200 per #
   if ( whichItem == 'I000' ) then //Amulet of Chance
 	if (udg_LeaderType[n] == '1') then
 	  call IncAbilByN(armor,1,whichUnit)
 	  call IncAbilByN(mana,1,whichUnit)
 	  call DisplayTextToForce( whichForce, ProperName + ", the " + Name + " has obtained an " + ItemName + ".")
 	endif
   elseif ( whichItem == 'I001' ) then //Amulet of Control
 	if (udg_LeaderType[n] == '1') then
 	  call IncAbilByN(armor,2,whichUnit)
 	  call IncAbilByN(spell,4,whichUnit)
 	  call DisplayTextToForce( whichForce, ProperName + ", the " + Name + " has obtained an " + ItemName + ".")
 	endif
   elseif ( whichItem == 'I007' ) then //Eyes of the Hawk
 	if (((udg_FaithType[n] == '0') or (udg_FaithType[n] == '5') or (udg_FaithType[n] == '6')) and ((udg_LeaderType[n] == '0') or (udg_LeaderType[n] == '1'))) then
 	  call IncAbilByN(mana,3,whichUnit)
 	  call IncAbilByN(sight,3,whichUnit)
 	  call DisplayTextToForce( whichForce, ProperName + ", the " + Name + " has obtained an " + ItemName + ".")
 	endif
   endif
   call DestroyForce(whichForce)
 endfunction

thats the item pickup trigger that executes when a hero aquires an item.

theres also a trigger that is nearly identical which triggers when a hero loses an item and so it removes the bonuses.

ive tested it ingame and the armor, and the damage bonuses and i think some others work fine, theyre added correctly, and taken away correctly when a hero aquires or drops an item.
however some things like Sight range bonus or Mana bonus arent added or subtracted at all even though they should be functionally identical to the others.

is this just an engine thing? is there another passive ability that adds mana capacity to the hero?

thanks for help,
Anarki

(PS i know theres like 5 million locals there, the trigger needs cleaning up)
03-21-2005, 09:25 PM#2
Guest
I'd also like to know this o.o
03-22-2005, 04:59 AM#3
AnarkiNet
nobody knows?