JASS item/ability value shortcut

l-hate_you

New Member
Reaction score
6
In my system where you can purchase abilities as items from a shop, I am trying to make it so that you get a refund if you buy the spell again if it is already at maximum level. I could go through and take the time to find every single value and manually type it into the code, or, I was hoping that there was a certain way to get the value using the shortcut code (ex.<I000:tdex,goldcost> ) for use in a trigger? I know it can be used in tooltips obviously but can you retrieve it in JASS? I tried

call AdjustPlayerStateBJ( <I000:tdex,goldcost>, GetOwningPlayer(GetManipulatingUnit()), PLAYER_STATE_RESOURCE_GOLD )

and of course it doesnt work (error upon saving) soo is there some code that needs to go behind it like GetValue or some crazy thing like that.. or is it just not possible?? thanks :)
 

SFilip

Gone but not forgotten
Reaction score
634
> but can you retrieve it in JASS
Unfortunately you can't. However I've seen a very nifty system that allows you to do it...
You create a dummy buyer and a dummy shop for a neutral player and add that item to it. You set the neutral player's gold to 100000 for example and order the dummy buyer to buy the item. After that the item's cost will be 100000 - (current gold of the neutral player).

And BTW the correct way to get it for a tooltip is <I000,goldcost>, not <I000:tdex,goldcost> since I000 is the actual raw code here..
 

l-hate_you

New Member
Reaction score
6
ok.. ill just enter in all the values, there wouldnt be a map at all with no work :eek: thanks
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top