2902 Posts in 433 Topics - by 2150 Members - Latest Member: wtvr

Warcraft III: MapsModelsSkinsIconsSpellsToolsTutorials
WC3 JASS: Code SnippetsJASS and vJASS Spells and SystemsJass Tutorials
Chat @Discord

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


WC3 Spells - radamantus

Pages: [1]
1
Warcraft III Spells and Systems / Custom Ability Source Cost v1.1
« on: June 27, 2013, 02:48:58 PM »
Categories: System, GUI
Rating: 4
Image/screenshot:
Warcraft III spell resource
« Created: June 10, 2017, 06:30:02 AM by moyack »
Allows you to use custom ability source cost.

To Import:
Copy the triggers and variables

Setup:
Trigger: Test 1741522898
   
           
  • CASC Setup
  • Events
  • Map initialization
  • Conditions
  • Actions
  • Custom script: set udg_CASC_Hash = InitHashtable()
  • -------- --------------------------- --------
  • -------- Determines the abilities and its required resource --------
  • -------- --------------------------- --------
  • Set CASC_Abil = Example 1
  • Set CASC_Gold = 100
  • Set CASC_Lumber = 75
  • Set CASC_Life = 0.00
  • Set CASC_Mana = 0.00
  • -------- --------------------------- --------
  • -------- Save --------
  • -------- --------------------------- --------
  • Trigger - Run CASC Save <gen> (ignoring conditions)
  • Set CASC_Abil = Example 2
  • Set CASC_Gold = 0
  • Set CASC_Lumber = 0
  • Set CASC_Life = 100.00
  • Set CASC_Mana = 75.00
  • -------- --------------------------- --------
  • -------- Save --------
  • -------- --------------------------- --------
  • Trigger - Run CASC Save <gen> (ignoring conditions)
           

Save
Trigger: Test 1566429989
   
           
  • CASC Save
  • Events
  • Conditions
  • Actions
  • Custom script: call SaveInteger(udg_CASC_Hash,udg_CASC_Abil,1,udg_CASC_Gold)
  • Custom script: call SaveInteger(udg_CASC_Hash,udg_CASC_Abil,2,udg_CASC_Lumber)
  • Custom script: call SaveReal(udg_CASC_Hash,udg_CASC_Abil,3,udg_CASC_Life)
  • Custom script: call SaveReal(udg_CASC_Hash,udg_CASC_Abil,4,udg_CASC_Mana)
           

Cast
Trigger: Test 392380074
   
           
  • CASC Cast
  • Events
  • Unit - A unit Begins casting an ability
  • Conditions
  • Actions
  • Custom script: set udg_CASC_TempAbil = GetSpellAbilityId()
  • Set CASC_Caster = (Triggering unit)
  • Set CASC_Player = (Triggering player)
  • -------- --------------------------- --------
  • -------- Load --------
  • -------- --------------------------- --------
  • Set CASC_LoadGold = (Load 1 of CASC_TempAbil from CASC_Hash)
  • Set CASC_LoadLumber = (Load 2 of CASC_TempAbil from CASC_Hash)
  • Set CASC_LoadLife = (Load 3 of CASC_TempAbil from CASC_Hash)
  • Set CASC_LoadMana = (Load 4 of CASC_TempAbil from CASC_Hash)
  • -------- --------------------------- --------
  • -------- Variables --------
  • -------- --------------------------- --------
  • Set CASC_CurrentGold = (CASC_Player Current gold)
  • Set CASC_CurrentLumber = (CASC_Player Current lumber)
  • Set CASC_CurrentLife = (Life of CASC_Caster)
  • Set CASC_CurrentMana = (Mana of CASC_Caster)
  • -------- --------------------------- --------
  • -------- Checking --------
  • -------- --------------------------- --------
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • And - All (Conditions) are true
  • Conditions
  • CASC_CurrentGold Greater than CASC_LoadGold
  • CASC_CurrentLumber Greater than CASC_LoadLumber
  • CASC_CurrentLife Greater than CASC_LoadLife
  • CASC_CurrentMana Greater than CASC_LoadMana
  • Then - Actions
  • Unit - Set life of CASC_Caster to (CASC_CurrentLife - CASC_LoadLife)
  • Unit - Set mana of CASC_Caster to (CASC_CurrentMana - CASC_LoadMana)
  • Player - Set CASC_Player Current gold to (CASC_CurrentGold - CASC_LoadGold)
  • Player - Set CASC_Player Current lumber to (CASC_CurrentLumber - CASC_LoadLumber)
  • Else - Actions
  • Unit - Order CASC_Caster to Stop
  • Set CASC_TempPlayer = (Player group(CASC_Player))
  • Game - Display to CASC_TempPlayer the text: |cffffcc00Not enoug...
  • Custom script: call DestroyForce(udg_CASC_TempPlayer)
           


Quote
Changelog
v1.1
-Changed event(due to quick casting)
-Removed ability remove and add.(if matched with my new event,the caster will be stuck up)

Pages: [1]
Blizzard Modding Information Center Starcraft II Modding Information Center Wacraft III Modding Information Center WC3JASS.com - The JASS Vault Chronicles of Darkness - A Warcraft III mod Jetcraft - A Starcraft II mod Troll Smash - A Warcraft III Arena
  Mod DB - Change the Game Power of Corruption - A Warcraft III altered melee map Chaos Realm - The world of Game modders and wc3 addicts Follow us on Facebook!!