Spellcraft Spell's orbs

jarekpl12

TH.net Regular
Reaction score
6
hello Everyone... can somone give me a tip how to add/increase lvl of ability from 3 the same orbs or with 2 the same? I mean how to check it in conditions...thx
 

jarekpl12

TH.net Regular
Reaction score
6
ok I explained not too good. How to check in conditions that hero has 3 items of the same type
For example

PHP:
Flamestrike
Events  Unit - A unit Recives an Item
Conditions  (Item-type of (Item being manipulated)) Equal to |cffFF4500Fire|r
and here i need some condition that checks number of items of type |cffFF4500Fire|r
because an Action needs 3 the same items 
Actions
 

keychup

Active Member
Reaction score
34
a unit receives an item

set INTEGERX = 0
for each integer A from 1 to 6
-if item in slot integer A is equal to orb
-then set INTEGERX = INTEGERX +1
-else do nothing
set level of ability for triggering unit to INTEGERX

INTEGERX is a variable of type "integer"
 

jarekpl12

TH.net Regular
Reaction score
6
a unit receives an item

set INTEGERX = 0
for each integer A from 1 to 6
-if item in slot integer A is equal to orb
-then set INTEGERX = INTEGERX +1
-else do nothing
set level of ability for triggering unit to INTEGERX

INTEGERX is a variable of type "integer"


Something like this? Or it will have some bugs?... Im wondering what gonna happend if 2 heros wear the same item around the same time.. i mean untill the trigger ends

Code:
Flamestrike
  Events  Unit - A unit Recives an item
  Conditions  (Item-type of (Item being manipulated)) equal to |cffFF4500Fire|r
  Actions Set Orb = 0
For each (Integer A) from 1 to 6, do (Actions)
  Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  If - Conditions
  (Item-type of (Item carried by (Triggering unit) in slot (Integer A))) equal to |cffFF4500Fire|r
  Then - Actions Set Orb = (Orb + 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  If - Conditions  (Level of Flamestrike (Neutral Hostile) for (Triggering unit)) equal to 0
  Then - Actions  Unit - Add Flamestrike (Neutral Hostile) to (Triggering unit)
  Else - Actions  Unit - Increase level of Flamestrike (Neutral Hostile) for (Triggering unit)
  Else - Actions
 

denmax

You can change this now in User CP.
Reaction score
155
It works on multiple units, and even if it didn't, the possiblity of two heroes receiving such item in the EXACT SAME MILLISECOND seems too impossible.

What your trigger does right now is actually pretty pointless in adding the for loop. The reason is because you're not using the integer variable Orb.

So you want your hero to receive an ability when he has two Fire Orbs, and another ability if he has three Fire Orbs.

Use that same loop on your actions
Trigger:
  • D
    • For each (Integer A) from 1 to 6, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Item-type of (Item carried by (Triggering unit) in slot (Integer A))) equal to Fire
          • Then - Actions
            • Set Orb = (Orb + 1)
          • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Orb is Greater than or equal to 2
        • Then - Actions
          • Unit - Add Flamestrike to (Triggering unit)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Orb is Greater than or equal to 3
        • Then - Actions
          • Unit - Add Volcano to (Triggering unit)
          • Unit - Increase level of Flamestrike for (Triggering unit)
        • Else - Actions
 

jarekpl12

TH.net Regular
Reaction score
6
nono... i want to add ability (if there is no such an ability yet) or increase lvl of following ability (if there is such an ability). I have 7 kinds of orbs and every combination gives diferent ability. For example 3 Fire Orbs give Flamestrike ability or 2 Fire Orbs and 1 Earth Orb give for example Entanglin Roots

Here is my trigger to add (increase lvl of) spell with 3 DIFERENT orbs... This is easy, my problem is to do the same thing with checking if Triggering Unit has 3 the same orbs or 2 the same orbs and 1 diferent orb:
Code:
Flamestrike
    Events
        Unit - A unit Recives an item
    Conditions
        Or - Any (Conditions) are true
            Conditions
                (Item-type of (Item being manipulated)) equal to |cffFF4500Fire|r
                (Item-type of (Item being manipulated)) equal to |cffFFFF66Light|r
                (Item-type of (Item being manipulated)) equal to |cff0000FFWater|r
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Triggering unit) has an item of type |cffFF4500Fire|r) equal to True
                ((Triggering unit) has an item of type |cffFFFF66Light|r) equal to True
                ((Triggering unit) has an item of type |cff0000FFWater|r) equal to True
            Then - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Level of Flamestrike (Neutral Hostile) for (Triggering unit)) equal to 0
                    Then - Actions
                        Unit - Add Flamestrike (Neutral Hostile) to (Triggering unit)
                        Item - Remove (Item carried by (Triggering unit) of type |cffFF4500Fire|r)
                        Item - Remove (Item carried by (Triggering unit) of type |cffFFFF66Light|r)
                        Item - Remove (Item carried by (Triggering unit) of type |cff0000FFWater|r)
                    Else - Actions
                        Unit - Increase level of Flamestrike (Neutral Hostile) for (Triggering unit)
                        Item - Remove (Item carried by (Triggering unit) of type |cffFF4500Fire|r)
                        Item - Remove (Item carried by (Triggering unit) of type |cffFFFF66Light|r)
                        Item - Remove (Item carried by (Triggering unit) of type |cff0000FFWater|r)
            Else - Actions
 

keychup

Active Member
Reaction score
34
interesting. should have said so earlier.
it's definitely doable.
write down each and every orb, and spells with their corresponding orb combination.
please note that you can have only 2 abilities max if you choose to use the inventory as a reference.
 

denmax

You can change this now in User CP.
Reaction score
155

I think you just said that without actually understanding what my code did, because technically it would have potentially solved your problem already :/

Copy my code, and remove the first If-Then-Else (the one with the condition - Orbs is Greater than or equal to 2), change Volcano to Flame Strike, and remove the Increase level.
 

jarekpl12

TH.net Regular
Reaction score
6
I think you just said that without actually understanding what my code did, because technically it would have potentially solved your problem already :/

Copy my code, and remove the first If-Then-Else (the one with the condition - Orbs is Greater than or equal to 2), change Volcano to Flame Strike, and remove the Increase level.

y u right... I can't understeand this function: For each (Integer A) from 1 to 6, do (Actions)

ok I'll try... thx
 

jarekpl12

TH.net Regular
Reaction score
6
now the trigger adds ability after i pick up 2 orbs and after i pick 3rd orb level of ability is increased to 5

interesting. should have said so earlier.
it's definitely doable.
write down each and every orb, and spells with their corresponding orb combination.
please note that you can have only 2 abilities max if you choose to use the inventory as a reference.
Fire, Water, Earth, Storm, Energy, Light, Dark
 

Attachments

  • Spells.txt
    2.7 KB · Views: 293

vypur85

Hibernate
Reaction score
803
Understand denmax's trigger. The idea is there. That is how you detect multiple items. From post#7, you seemed to be quite well verse with triggers (unless, of course, the trigger was not made by you).

The idea is to calculate how many similar items you have in the hero inventory. And then decide if the unit has multiple items or not. Hence the 1 to 6 integer loop. Understand the trigger given and apply it to your map. And if there's any trigger problem, please post your most current trigger when you ask your next question (as how you did in post#7).
 

keychup

Active Member
Reaction score
34
Sorry I haven't come online for a while. I'll look into your spells when I get home from school. It looks like an invoke-type set of triggers can take care of this. I'll let you know as soon as I get something done.
 

jarekpl12

TH.net Regular
Reaction score
6
this is my last progress: when i buy 1st Fire orb - Flamestrike lvl 1, then i buy 2nd Fire orb - Flamestrike lvl 5 :(



Code:
Flamestrike
    Events
        Unit - A unit Recives an item
    Conditions
        (Item-type of (Item being manipulated)) equal to |cffFF4500Fire|r
    Actions
        For each (Integer A) from 1 to 6, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Item-type of (Item carried by (Triggering unit) in slot (Integer A))) equal to |cffFF4500Fire|r
                    Then - Actions
                        Set Orb = (Orb + 1)
                    Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Orb equal to 3
                    Then - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Level of Flamestrike (Neutral Hostile) for (Triggering unit)) equa; to                  Then - Actions
                                Unit - Add Flamestrike (Neutral Hostile) to (Triggering unit)
                            Else - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Codnitions
                                        (Level of Flamestrike (Neutral Hostile) for (Triggering unit)) less than 5
                                    Then - Actions
                                        Unit - Increase level of Flamestrike (Neutral Hostile) for (Triggering unit)
                                Else - Actions
 

vypur85

Hibernate
Reaction score
803
The pasted trigger seems a bit off. But remove the second if then else out of the integer loop. And set the integer value to 0 at the beginning of the trigger.

Code:
Set Orb = 0
For each (Integer A) from 1 to 6, do (Actions)
  Loop - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
          (Item-type of (Item carried by (Triggering unit) in slot (Integer A))) equal to |cffFF4500Fire|r
      Then - Actions
          Set Orb = (Orb + 1)
      Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
        Orb equal to 3
    Then - Actions
        ......
 

keychup

Active Member
Reaction score
34
hold on, so the idea is to pick up 1 fire orb to get 1 ability and pick up a second orb to upgrade it? i thought you had to combine 3 orbs to get a spell.

Please wait for my trigger. I can handle all the abilities.
 

vypur85

Hibernate
Reaction score
803
> so the idea is to pick up 1 fire orb to get 1 ability and pick up a second orb to upgrade it?
Refer to the trigger in post#7. Combined orbs give either the ability or level up. If you 5 different kind of orbs, there are about 12 different combinations, if I'm correct.
 

keychup

Active Member
Reaction score
34
Unfortunately you will not be able to use my trigger to upgrade your spells. You cannot obtain, for example, Flamestrike without 3 flame orbs. If you do have Flamestrike, picking up another orb will only determine the second ability, not upgrade the first. If you want an ability to be upgraded, however, you can implement the Upgrades in the object editor and research the ability directly.
These are the variables you'll be needing:

HASHTABLE: Hashtable Type, No Arrays
ABILITY []: Ability Type, 82 Arrays
ORB1: Integer Type, No Arrays
ORB2: Integer Type No Arrays

First you need to create a hashtable then you need to store all the abilities in ABILITY []

Trigger 1:
Event
Elapsed Game Time is 0 seconds
Conditions
None
Actions
Create a Hashtable
Set HASHTABLE = Last Created Hashtable
Set ABILITY [3] = Flamestrike
Set ABILITY [12] = Rain of Fire
Set ABILITY [102] = Endurance Aura
Set ABILITY [1002] = Shockwave
Set ABILITY [10002] = Fire Bolt
...

Refer to this table for the complete list of spell codes:

COMBINATION ---------- Ability ------------- Code

FIRE FIRE FIRE ------- Flamestrike --------- 3
FIRE FIRE WATER ------ Rain of Fire -------- 12
FIRE FIRE EARTH ------ Endurance Aura ------ 102
FIRE FIRE STORM ------ Shockwave ----------- 1002
FIRE FIRE ENERGY ----- Fire Bolt ----------- 10002
FIRE FIRE LIGHT ------ Breath of Fire ------ 100002
FIRE FIRE DARK ------- Immolation ---------- 1000002

WATER WATER WATER ---- Crushing Wave ------- 30
WATER WATER FIRE ----- Water Elemental ----- 21
WATER WATER EARTH ---- Brilliance Aura ----- 120
WATER WATER STORM ---- Blizzard ------------ 1020
WATER WATER ENERGY --- Frost Bolt ---------- 10020
WATER WATER LIGHT ---- Breath of Frost ----- 100020
WATER WATER DARK ----- Frost Nova ---------- 1000020

EARTH EARTH EARTH ---- Entangling Roots ---- 300
EARTH EARTH FIRE ----- Faerie Fire --------- 201
EARTH EARTH WATER ---- Force of Nature ----- 210
EARTH EARTH STORM ---- Fan of Knives ------- 1200
EARTH EARTH ENERGY --- Thorns Aura --------- 10200
EARTH EARTH LIGHT ---- Abolish Magic ------- 100200
EARTH EARTH DARK ----- Shadow Strike ------- 1000200

STORM STORM STORM ---- Chain Lightning ----- 3000
STORM STORM FIRE ----- Thunder Clap -------- 2001
STORM STORM WATER ---- Forked Lightning ---- 2010
STORM STORM EARTH ---- Lightning Shield ---- 2100
STORM STORM ENERGY --- Statis Trap --------- 12000
STORM STORM LIGHT ---- Storm Bolt ---------- 10200
STORM STORM DARK ----- Serpent Ward -------- 1002000

ENERGY ENERGY ENERGY - Polymorph ----------- 30000
ENERGY ENERGY FIRE --- Searing Arrows ------ 20001
ENERGY ENERGY WATER -- Cold Arrows --------- 20010
ENERGY ENERGY EARTH -- Slow Poison --------- 20100
ENERGY ENERGY STORM -- Bear ---------------- 21000
ENERGY ENERGY LIGHT -- Evasion ------------- 120000
ENERGY ENERGY DARK --- Curse --------------- 1020000

LIGHT LIGHT LIGHT ---- Holy Light ---------- 300000
LIGHT LIGHT FIRE ----- Inner Fire ---------- 200001
LIGHT LIGHT WATER ---- Heal ---------------- 200010
LIGHT LIGHT EARTH ---- Rejuvenation -------- 200100
LIGHT LIGHT STORM ---- Hardend Skin -------- 201000
LIGHT LIGHT ENERGY --- Healing Ward -------- 210000
LIGHT LIGHT DARK ----- Banish -------------- 1200000

DARK DARK DARK ------- Death Coil ---------- 3000000
DARK DARK FIRE ------- Unholy Aura --------- 2000001
DARK DARK WATER ------ Sleep --------------- 2000010
DARK DARK EARTH ------ Raise Death --------- 2000100
DARK DARK STORM ------ Unholy Frenzy ------- 2001000
DARK DARK ENERGY ----- Impale -------------- 2010000
DARK DARK LIGHT ------ Cripple ------------- 2100000

FIRE WATER EARTH ----- Cyclone ------------- 111
FIRE WATER STORM ----- Slow ---------------- 1011
FIRE WATER ENERGY ---- Spell Steal --------- 10011
FIRE WATER LIGHT ----- Healing Wave -------- 100011
FIRE WATER DARK ------ Mana Burn ----------- 1000011

FIRE EARTH STORM ----- Feral Spirit -------- 1101
FIRE EARTH ENERGY ---- Critical Strike ----- 10101
FIRE EARTH LIGHT ----- Trueshot Aura ------- 100101
FIRE EARTH DARK ------ Envenomed Weapons --- 1000101

FIRE STORM ENERGY ---- Pulverize ----------- 11001
FIRE STORM LIGHT ----- Command Aura -------- 101001
FIRE STORM DARK ------ Bloodlust ----------- 1001001

FIRE ENERGY LIGHT ---- Shackless ----------- 110001
FIRE ENERGY DARK ----- Spiked Carapace ----- 1010001

FIRE LIGHT DARK ------ Feedback ------------ 1100001

WATER EARTH STORM ---- Mana Shield --------- 1110
WATER EARTH ENERGY --- Mirror Image -------- 10110
WATER EARTH LIGHT ---- Life Drain ---------- 100110
WATER EARTH DARK ----- Cleaving Attack ----- 1000110

WATER STORM ENERGY --- Parasite ------------ 11010
WATER STORM LIGHT ---- Devotion Aura ------- 101010
WATER STORM DARK ----- Acid Bomb ----------- 1001010

WATER ENERGY LIGHT --- Bash ---------------- 110010
WATER ENERGY DARK ---- Mana Drain ---------- 1010010

WATER LIGHT DARK ----- Frost Armor --------- 1100010

EARTH STORM ENERGY --- War Stomp ----------- 11100
EARTH STORM LIGHT ---- Barrage ------------- 101100
EARTH STORM DARK ----- Hex ----------------- 1001100

EARTH ENERGY LIGHT --- Drunken Haze -------- 110100
EARTH ENERGY DARK ---- Carrion Beetles ----- 1010100

EARTH LIGHT DARK ----- Roar ---------------- 1100100

STORM ENERGY LIGHT --- Wind Walk ----------- 111000
STORM ENERGY DARK ---- Orb of Annihilation - 1011000

STORM LIGHT DARK ----- Vampiric Aura ------- 1101000

ENERGY LIGHT DARK ---- Essence of Blight --- 1110000

Now this next trigger is what you will use to change the abilities

Trigger 2:
Event
A unit acquires an item
Conditions
None
Actions
-----FIRST ABILITY-----
Set ORB1 = (Load (Get String ID Key ORB1) of (Key (Triggering unit)) from (HASHTABLE))
Remove ABILITY [ORB1] from (Triggering unit)
Set ORB1 = 0
For Each Integer from 1 to 3
If Item-type of (Item carried by (Triggering unit) in slot (Integer A))) equal to FIRE Then Set ORB1 = (ORB1 + 1) Else Do Nothing
If Item-type of (Item carried by (Triggering unit) in slot (Integer A))) equal to WATER Then Set ORB1 = (ORB1 + 10) Else Do Nothing
If Item-type of (Item carried by (Triggering unit) in slot (Integer A))) equal to EARTH Then Set ORB1 = (ORB1 + 100) Else Do Nothing
If Item-type of (Item carried by (Triggering unit) in slot (Integer A))) equal to STORM Then Set ORB1 = (ORB1 + 1000) Else Do Nothing
If Item-type of (Item carried by (Triggering unit) in slot (Integer A))) equal to ENERGY Then Set ORB1 = (ORB1 + 10000) Else Do Nothing
If Item-type of (Item carried by (Triggering unit) in slot (Integer A))) equal to LIGHT Then Set ORB1 = (ORB1 + 100000) Else Do Nothing
If Item-type of (Item carried by (Triggering unit) in slot (Integer A))) equal to DARK Then Set ORB1 = (ORB1 + 1000000) Else Do Nothing
Add ABILITY [ORB1] to (Triggering unit)
Hashtable - Save ORB1 as ( Get String ID Key ORB1) of (Key (Triggering unit)) in HASHTABLE
-----SECOND ABILITY-----
Set ORB2 = (Load (Get String ID Key ORB2) of (Key (Triggering unit)) from (HASHTABLE))
Remove ABILITY [ORB2] from (Triggering unit)
Set ORB2 = 0
For Each Integer from 4 to 6
If Item-type of (Item carried by (Triggering unit) in slot (Integer A))) equal to FIRE Then Set ORB2 = (ORB2 + 1) Else Do Nothing
If Item-type of (Item carried by (Triggering unit) in slot (Integer A))) equal to WATER Then Set ORB2 = (ORB2 + 10) Else Do Nothing
If Item-type of (Item carried by (Triggering unit) in slot (Integer A))) equal to EARTH Then Set ORB2 = (ORB2 + 100) Else Do Nothing
If Item-type of (Item carried by (Triggering unit) in slot (Integer A))) equal to STORM Then Set ORB2 = (ORB2 + 1000) Else Do Nothing
If Item-type of (Item carried by (Triggering unit) in slot (Integer A))) equal to ENERGY Then Set ORB2 = (ORB2 + 10000) Else Do Nothing
If Item-type of (Item carried by (Triggering unit) in slot (Integer A))) equal to LIGHT Then Set ORB2 = (ORB2 + 100000) Else Do Nothing
If Item-type of (Item carried by (Triggering unit) in slot (Integer A))) equal to DARK Then Set ORB2 = (ORB2 + 1000000) Else Do Nothing
Add ABILITY [ORB2] to (Triggering unit)
Hashtable - Save ORB2 as ( Get String ID Key ORB2) of (Key (Triggering unit)) in HASHTABLE
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      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