2967 Posts in 476 Topics - by 2187 Members - Latest Member: Suwranna

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

Author Topic: Custom Ability Source Cost v1.1  (Read 7448 times)

Rating
Average Score
« Created: June 10, 2017, 06:30:16 AM by moyack »

  • Newbie - level 2
  • **
  • Posts: 17
  • WC3 Models: 0
  • WC3 Tutorials: 0
  • WC3 Tools: 0
  • WC3 Maps: 0
  • WC3 Skins: 0
  • WC3 Icons: 0
  • WC3 Spells: 0
  • Reputation: 0
  • Damn Spell Coder
    • View Profile
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 2015679645
   
           
  • 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 360158307
   
           
  • 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 654129819
   
           
  • 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)
« Last Edit: June 10, 2017, 06:30:02 AM by moyack »

  • Site Owner
  • Administrator
  • Starter - level 4
  • *
  • Posts: 988
  • WC3 Models: 32
  • WC3 Tutorials: 13
  • WC3 Tools: 10
  • WC3 Maps: 11
  • WC3 Skins: 6
  • WC3 Icons: 2
  • WC3 Spells: 5
  • Reputation: 1153
  • Site Admin - I love fix things
    • View Profile
    • Blizzard Modding Information Center
Custom Ability Source Cost v1.1
« Reply #1 on: June 27, 2013, 02:49:26 PM »
Please add the code to the first post.

We can give you full hosting for your projects, a complete page!!

A custom altered melee map where you can play Naga and Demons. Check it out!!
Use Dropbox...

  • Newbie - level 2
  • **
  • Posts: 21
  • WC3 Models: 0
  • WC3 Tutorials: 0
  • WC3 Tools: 0
  • WC3 Maps: 0
  • WC3 Skins: 0
  • WC3 Icons: 0
  • WC3 Spells: 0
  • Reputation: 1
    • View Profile
Re: Custom Ability Source Cost v1.1
« Reply #2 on: August 13, 2015, 11:32:19 AM »
Or even a map? I see an attachment icon but no attachment.

  • Site Owner
  • Administrator
  • Starter - level 4
  • *
  • Posts: 988
  • WC3 Models: 32
  • WC3 Tutorials: 13
  • WC3 Tools: 10
  • WC3 Maps: 11
  • WC3 Skins: 6
  • WC3 Icons: 2
  • WC3 Spells: 5
  • Reputation: 1153
  • Site Admin - I love fix things
    • View Profile
    • Blizzard Modding Information Center
Re: Custom Ability Source Cost v1.1
« Reply #3 on: August 16, 2015, 10:01:55 PM »
Or even a map? I see an attachment icon but no attachment.
Ok, added the file map. Thanks for reporting this issue.

We can give you full hosting for your projects, a complete page!!

A custom altered melee map where you can play Naga and Demons. Check it out!!
Use Dropbox...

 

Patch 1.28.1, now live and fixing a dangerous thing for custom maps

Started by moyackBoard Warcraft III News

Replies: 0
Views: 437
Last post April 27, 2017, 08:50:54 PM
by moyack
My custom made spell damage function

Started by rvonsonsnadtzBoard Coding Help

Replies: 10
Views: 16247
Last post October 13, 2012, 06:20:48 AM
by rvonsonsnadtz
Custom TESH Highlighting

Started by Magtheridon96Board Jass Tutorials

Replies: 3
Views: 7697
Last post April 14, 2012, 09:05:27 PM
by moyack
What people want in a Custom XP System?

Started by Naoto ShiroganeBoard Triggers & Scripting

Replies: 3
Views: 4063
Last post April 02, 2015, 06:36:41 PM
by moyack
How to import custom UI

Started by SonofJayBoard Tutorial Zone

Replies: 3
Views: 8254
Last post September 22, 2013, 06:31:25 AM
by moyack
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!!