• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Problem with item trigger

Status
Not open for further replies.
Level 12
Joined
Apr 26, 2008
Messages
830
Somehow when i play it in multiplayer the empty pokeball and full pokeball, clones himself into the inventory and everytime i use it somehow it gets, to the other player it's just a mess, so after 4-5 uses i would have a full inventory of cloned items just spamming... So the backpack system itself works i think, or it just works for just 1 player, so i think it's the backpack system but it might also be the catch/create pokeball system well i will post them both so maybe one of you can check it, have been working alot on this so i would be realy gratefull if someone could check it...

  • Inventory Init
    • Ereignisse
      • Map initialization
    • Bedingungen
    • Aktionen
      • Hashtabelle - Create a hashtable
      • Set Inv_Hash = (Last created hashtable)
  • Inventory Pick
    • Ereignisse
      • Einheit - A unit Erwirbt einen Gegenstand
    • Bedingungen
      • Inv_Active Gleich True
      • ((Triggering unit) is Ein Urtum) Gleich False
    • Aktionen
      • -------- Find hero index --------
      • Set j = ((Player number of (Owner of (Triggering unit))) x (6 x Inv_Pages))
      • -------- Now j contains the first slot of the hero's inventory. --------
      • -------- lZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZl --------
      • -------- Item is pokeball - Slots 0-5 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (Item-class of (Item being manipulated)) Gleich Dauerhaft
        • 'THEN'-Aktionen
          • For each (Integer tmpSlot) from j to (j + 5), do (Actions)
            • Schleifen - Aktionen
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • 'IF'-Bedingungen
                  • Inv_Used[tmpSlot] Gleich False
                • 'THEN'-Aktionen
                  • Set Inv_Items[tmpSlot] = (Item-type of (Item being manipulated))
                  • Set Inv_Used[tmpSlot] = True
                  • Set Inv_Charges[tmpSlot] = (Charges remaining in (Item being manipulated))
                  • Set Inv_Temp_Item = (Item being manipulated)
                  • Set Inv_Temp_Page = 1
                  • Set Inv_Temp_Slot = tmpSlot
                  • Countdown-Timer - Start Inv_PickTimer as a Einmalig timer that will expire in 0.00 seconds
                  • Skip remaining actions
                • 'ELSE'-Aktionen
          • Set Inv_Temp_Hero = (Triggering unit)
          • Set Inv_Temp_Item = (Item being manipulated)
          • Countdown-Timer - Start Inv_DropTimer as a Einmalig timer that will expire in 0.00 seconds
        • 'ELSE'-Aktionen
      • -------- Item goes to backpack - Slots 6-11 --------
      • Set j = (j + 6)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (Item-class of (Item being manipulated)) Gleich Käuflich
        • 'THEN'-Aktionen
          • For each (Integer tmpSlot) from j to (j + 5), do (Actions)
            • Schleifen - Aktionen
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • 'IF'-Bedingungen
                  • Inv_Used[tmpSlot] Gleich False
                • 'THEN'-Aktionen
                  • Set Inv_Items[tmpSlot] = (Item-type of (Item being manipulated))
                  • Set Inv_Used[tmpSlot] = True
                  • Set Inv_Charges[tmpSlot] = (Charges remaining in (Item being manipulated))
                  • Set Inv_Temp_Item = (Item being manipulated)
                  • Set Inv_Temp_Page = 2
                  • Set Inv_Temp_Slot = tmpSlot
                  • Countdown-Timer - Start Inv_PickTimer as a Einmalig timer that will expire in 0.00 seconds
                  • Skip remaining actions
                • 'ELSE'-Aktionen
          • Set Inv_Temp_Hero = (Triggering unit)
          • Set Inv_Temp_Item = (Item being manipulated)
          • Countdown-Timer - Start Inv_DropTimer as a Einmalig timer that will expire in 0.00 seconds
        • 'ELSE'-Aktionen
      • -------- Item is badge - Slots 12-18 --------
      • Set j = (j + 6)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (Item-class of (Item being manipulated)) Gleich Artefakt
        • 'THEN'-Aktionen
          • For each (Integer tmpSlot) from j to (j + 5), do (Actions)
            • Schleifen - Aktionen
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • 'IF'-Bedingungen
                  • Inv_Used[tmpSlot] Gleich False
                • 'THEN'-Aktionen
                  • Set Inv_Items[tmpSlot] = (Item-type of (Item being manipulated))
                  • Set Inv_Used[tmpSlot] = True
                  • Set Inv_Charges[tmpSlot] = (Charges remaining in (Item being manipulated))
                  • Set Inv_Temp_Item = (Item being manipulated)
                  • Set Inv_Temp_Page = 3
                  • Set Inv_Temp_Slot = tmpSlot
                  • Countdown-Timer - Start Inv_PickTimer as a Einmalig timer that will expire in 0.00 seconds
                  • Skip remaining actions
                • 'ELSE'-Aktionen
          • Set Inv_Temp_Hero = (Triggering unit)
          • Set Inv_Temp_Item = (Item being manipulated)
          • Countdown-Timer - Start Inv_DropTimer as a Einmalig timer that will expire in 0.00 seconds
        • 'ELSE'-Aktionen
  • Inventory Remove Item
    • Ereignisse
      • Zeit - Inv_PickTimer expires
    • Bedingungen
    • Aktionen
      • Set Inv_Data[Inv_Temp_Slot] = (Custom value of Inv_Temp_Item)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • Inv_Current[(Player number of (Owner of (Triggering unit)))] Ungleich Inv_Temp_Page
        • 'THEN'-Aktionen
          • Set Inv_Active = False
          • Gegenstand - Remove Inv_Temp_Item
          • Countdown-Timer - Start Inv_ReactivateTimer as a Einmalig timer that will expire in 0.00 seconds
        • 'ELSE'-Aktionen
  • Inventory Remove Item
    • Ereignisse
      • Zeit - Inv_PickTimer expires
    • Bedingungen
    • Aktionen
      • Set Inv_Data[Inv_Temp_Slot] = (Custom value of Inv_Temp_Item)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • Inv_Current[(Player number of (Owner of (Triggering unit)))] Ungleich Inv_Temp_Page
        • 'THEN'-Aktionen
          • Set Inv_Active = False
          • Gegenstand - Remove Inv_Temp_Item
          • Countdown-Timer - Start Inv_ReactivateTimer as a Einmalig timer that will expire in 0.00 seconds
        • 'ELSE'-Aktionen
  • Inventory Drop Item
    • Ereignisse
      • Zeit - Inv_DropTimer expires
    • Bedingungen
    • Aktionen
      • Set Inv_Active = False
      • Held - Drop Inv_Temp_Item from Inv_Temp_Hero
      • Countdown-Timer - Start Inv_ReactivateTimer as a Einmalig timer that will expire in 0.00 seconds
  • Inventory Update Charges
    • Ereignisse
      • Einheit - A unit Benutzt einen Gegenstand
    • Bedingungen
      • Inv_Active Gleich True
      • ((Triggering unit) is Ein Urtum) Gleich False
    • Aktionen
      • -------- Find hero index --------
      • Set j = ((Player number of (Owner of (Triggering unit))) x (6 x Inv_Pages))
      • -------- Now j contains the first slot of the hero's inventory. --------
      • -------- lZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZl --------
      • -------- Item is pokeball - Slots 0-5 --------
      • -------- Item is in backpack - Slots 6-11 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (Item-class of (Item being manipulated)) Gleich Käuflich
        • 'THEN'-Aktionen
          • Set j = (j + 6)
        • 'ELSE'-Aktionen
      • -------- Item is badge - Slots 12-18 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (Item-class of (Item being manipulated)) Gleich Kampagne
        • 'THEN'-Aktionen
          • Set j = (j + 12)
        • 'ELSE'-Aktionen
      • -------- Unregister item --------
      • For each (Integer tmpSlot) from 1 to 6, do (Actions)
        • Schleifen - Aktionen
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • (Item carried by tmpTrainer in slot tmpSlot) Gleich (Item being manipulated)
            • 'THEN'-Aktionen
              • Set Inv_Charges[((tmpSlot + j) - 1)] = (Charges remaining in (Item being manipulated))
            • 'ELSE'-Aktionen
  • Inventory Move Item
    • Ereignisse
      • Einheit - A unit Erhält einen auf ein Objekt zielenden Befehl
    • Bedingungen
      • Inv_Active Gleich True
    • Aktionen
      • -------- This will get the target inventory slot to tmpOtherSlot (believe me) --------
      • Custom script: set udg_tmpOtherSlot = GetIssuedOrderId() - 852002
      • Custom script: if udg_tmpOtherSlot < 0 or udg_tmpOtherSlot > 5 then
      • Custom script: return
      • Custom script: endif
      • -------- Find moving item slot to tmpSlot --------
      • For each (Integer j) from 1 to 6, do (Actions)
        • Schleifen - Aktionen
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • (Item carried by (Triggering unit) in slot j) Gleich (Target item of issued order)
            • 'THEN'-Aktionen
              • Set tmpSlot = (j - 1)
              • Set j = 7
            • 'ELSE'-Aktionen
      • -------- Find hero index --------
      • Set j = ((Player number of (Owner of (Triggering unit))) x (6 x Inv_Pages))
      • -------- Now j contains the first slot of the hero's inventory. --------
      • -------- lZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZl --------
      • -------- Item is in backpack - Slots 6-11 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (Item-class of (Target item of issued order)) Gleich Käuflich
        • 'THEN'-Aktionen
          • Set j = (j + 6)
        • 'ELSE'-Aktionen
      • -------- Item is badge - Slots 12-18 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (Item-class of (Target item of issued order)) Gleich Kampagne
        • 'THEN'-Aktionen
          • Set j = (j + 12)
        • 'ELSE'-Aktionen
      • -------- Now swap items in tmpSlot and tmpOtherSlot --------
      • Set tmpOtherSlot = (tmpOtherSlot + j)
      • Set tmpSlot = (tmpSlot + j)
      • Set Inv_Items[tmpOtherSlot] = Inv_Items[tmpSlot]
      • Set Inv_Charges[tmpOtherSlot] = Inv_Charges[tmpSlot]
      • Set Inv_Data[tmpOtherSlot] = Inv_Data[tmpSlot]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • Inv_Used[tmpOtherSlot] Gleich True
        • 'THEN'-Aktionen
          • Set tmpOtherSlot = ((tmpOtherSlot - j) + 1)
          • Set Inv_Temp_Item = (Item carried by (Triggering unit) in slot tmpOtherSlot)
          • Set Inv_Items[tmpSlot] = (Item-type of Inv_Temp_Item)
          • Set Inv_Charges[tmpSlot] = (Charges remaining in Inv_Temp_Item)
          • Set Inv_Data[tmpSlot] = (Custom value of Inv_Temp_Item)
        • 'ELSE'-Aktionen
          • Set Inv_Used[tmpOtherSlot] = True
          • Set Inv_Used[tmpSlot] = False
  • Inventory Move Item
    • Ereignisse
      • Einheit - A unit Erhält einen auf ein Objekt zielenden Befehl
    • Bedingungen
      • Inv_Active Gleich True
    • Aktionen
      • -------- This will get the target inventory slot to tmpOtherSlot (believe me) --------
      • Custom script: set udg_tmpOtherSlot = GetIssuedOrderId() - 852002
      • Custom script: if udg_tmpOtherSlot < 0 or udg_tmpOtherSlot > 5 then
      • Custom script: return
      • Custom script: endif
      • -------- Find moving item slot to tmpSlot --------
      • For each (Integer j) from 1 to 6, do (Actions)
        • Schleifen - Aktionen
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • (Item carried by (Triggering unit) in slot j) Gleich (Target item of issued order)
            • 'THEN'-Aktionen
              • Set tmpSlot = (j - 1)
              • Set j = 7
            • 'ELSE'-Aktionen
      • -------- Find hero index --------
      • Set j = ((Player number of (Owner of (Triggering unit))) x (6 x Inv_Pages))
      • -------- Now j contains the first slot of the hero's inventory. --------
      • -------- lZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZl --------
      • -------- Item is in backpack - Slots 6-11 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (Item-class of (Target item of issued order)) Gleich Käuflich
        • 'THEN'-Aktionen
          • Set j = (j + 6)
        • 'ELSE'-Aktionen
      • -------- Item is badge - Slots 12-18 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (Item-class of (Target item of issued order)) Gleich Kampagne
        • 'THEN'-Aktionen
          • Set j = (j + 12)
        • 'ELSE'-Aktionen
      • -------- Now swap items in tmpSlot and tmpOtherSlot --------
      • Set tmpOtherSlot = (tmpOtherSlot + j)
      • Set tmpSlot = (tmpSlot + j)
      • Set Inv_Items[tmpOtherSlot] = Inv_Items[tmpSlot]
      • Set Inv_Charges[tmpOtherSlot] = Inv_Charges[tmpSlot]
      • Set Inv_Data[tmpOtherSlot] = Inv_Data[tmpSlot]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • Inv_Used[tmpOtherSlot] Gleich True
        • 'THEN'-Aktionen
          • Set tmpOtherSlot = ((tmpOtherSlot - j) + 1)
          • Set Inv_Temp_Item = (Item carried by (Triggering unit) in slot tmpOtherSlot)
          • Set Inv_Items[tmpSlot] = (Item-type of Inv_Temp_Item)
          • Set Inv_Charges[tmpSlot] = (Charges remaining in Inv_Temp_Item)
          • Set Inv_Data[tmpSlot] = (Custom value of Inv_Temp_Item)
        • 'ELSE'-Aktionen
          • Set Inv_Used[tmpOtherSlot] = True
          • Set Inv_Used[tmpSlot] = False
  • Inventory Lose
    • Ereignisse
      • Einheit - A unit Verliert einen Gegenstand
    • Bedingungen
      • Inv_Active Gleich True
      • ((Triggering unit) is Ein Urtum) Gleich False
    • Aktionen
      • -------- Find hero index --------
      • Set j = ((Player number of (Owner of (Triggering unit))) x (6 x Inv_Pages))
      • -------- Now j contains the first slot of the hero's inventory. --------
      • -------- lZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZl --------
      • -------- Item is pokeball - Slots 0-5 --------
      • -------- Item is in backpack - Slots 6-11 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (Item-class of (Item being manipulated)) Gleich Käuflich
        • 'THEN'-Aktionen
          • Set j = (j + 6)
        • 'ELSE'-Aktionen
      • -------- Item is badge - Slots 12-18 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (Item-class of (Item being manipulated)) Gleich Kampagne
        • 'THEN'-Aktionen
          • Set j = (j + 12)
        • 'ELSE'-Aktionen
      • -------- Unregister item --------
      • For each (Integer tmpSlot) from 1 to 6, do (Actions)
        • Schleifen - Aktionen
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • (Item carried by tmpTrainer in slot tmpSlot) Gleich (Item being manipulated)
            • 'THEN'-Aktionen
              • Set Inv_Used[((tmpSlot + j) - 1)] = False
            • 'ELSE'-Aktionen
  • Inventory See Pokeballs
    • Ereignisse
      • Einheit - A unit Startet den Effekt einer Fähigkeit
    • Bedingungen
      • (Ability being cast) Gleich Pokeballs
    • Aktionen
      • Set tmpTrainer = (Triggering unit)
      • -------- Find hero index --------
      • Set j = ((Player number of (Owner of (Triggering unit))) x (6 x Inv_Pages))
      • -------- Now j contains the first slot of the hero's inventory. --------
      • -------- lZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZl --------
      • Set Inv_Active = False
      • Set Inv_Current[(Player number of (Owner of tmpTrainer))] = 1
      • For each (Integer tmpSlot) from j to (j + 5), do (Actions)
        • Schleifen - Aktionen
          • Gegenstand - Remove (Item carried by tmpTrainer in slot ((tmpSlot - j) + 1))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • Inv_Used[tmpSlot] Gleich True
            • 'THEN'-Aktionen
              • Held - Create Inv_Items[tmpSlot] and give it to tmpTrainer
              • Einheit - Order tmpTrainer to move (Last created item) to inventory slot ((tmpSlot - j) + 1)
              • Gegenstand - Set the custom value of (Last created item) to Inv_Data[tmpSlot]
            • 'ELSE'-Aktionen
      • Countdown-Timer - Start Inv_ReactivateTimer as a Einmalig timer that will expire in 0.00 seconds
  • Inventory See Backpack
    • Ereignisse
      • Einheit - A unit Startet den Effekt einer Fähigkeit
    • Bedingungen
      • (Ability being cast) Gleich Backpack
    • Aktionen
      • Set tmpTrainer = (Triggering unit)
      • -------- Find hero index --------
      • Set j = ((Player number of (Owner of (Triggering unit))) x (6 x Inv_Pages))
      • Set j = (j + 6)
      • -------- Now j contains the first slot of the hero's inventory. --------
      • -------- lZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZl --------
      • Set Inv_Active = False
      • Set Inv_Current[(Player number of (Owner of tmpTrainer))] = 2
      • For each (Integer tmpSlot) from j to (j + 5), do (Actions)
        • Schleifen - Aktionen
          • Gegenstand - Remove (Item carried by tmpTrainer in slot ((tmpSlot - j) + 1))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • Inv_Used[tmpSlot] Gleich True
            • 'THEN'-Aktionen
              • Held - Create Inv_Items[tmpSlot] and give it to tmpTrainer
              • Einheit - Order tmpTrainer to move (Last created item) to inventory slot ((tmpSlot - j) + 1)
              • Gegenstand - Set the custom value of (Last created item) to Inv_Data[tmpSlot]
              • Gegenstand - Set charges remaining in (Last created item) to Inv_Charges[tmpSlot]
            • 'ELSE'-Aktionen
      • Countdown-Timer - Start Inv_ReactivateTimer as a Einmalig timer that will expire in 0.00 seconds
  • Inventory Reactivate
    • Ereignisse
      • Zeit - Inv_ReactivateTimer expires
    • Bedingungen
    • Aktionen
      • Set Inv_Active = True





  • Initialize Catch System
    • Ereignisse
      • Map initialization
    • Bedingungen
    • Aktionen
      • -------- Objects and regions --------
      • Set Ability_Catch[0] = Pokeball 0
      • Set Ability_Catch[1] = Pokeball 1
      • Set Ability_Catch[2] = Pokeball 2
      • Set Ability_Catch[3] = Pokeball 3
      • Set Ability_Catch[4] = Pokeball 4
      • Set ItemClass_Pokeball = Dauerhaft
      • Set Item_EmptyPokeball = Empty Pokeball
      • Set Item_FullPokeball = Full Pokeball
      • Set Rect_PokemonArea = Pokemon Restricted Area <gen>
      • Set Real_Period = 0.10
      • Set Buff_Capturing = Capturing
      • Set Buff_PokeballHit = Pokeball Hit
      • -------- Base chance of catching a pokemon for each health level --------
      • Set Chances[0] = 1.00
      • Set Chances[1] = 1.00
      • Set Chances[2] = 1.00
      • Set Chances[3] = 2.50
      • Set Chances[4] = 5.00
      • Set Chances[5] = 10.00
      • Set Chances[6] = 20.00
      • Set Chances[7] = 40.00
      • Set Chances[8] = 60.00
      • Set Chances[9] = 80.00
      • -------- Chance bonus of catching a pokemon for each pokeball type --------
      • Set PokeballBonus[0] = 0.00
      • Set PokeballBonus[1] = 20.00
      • Set PokeballBonus[2] = 30.00
      • Set PokeballBonus[3] = 40.00
      • Set PokeballBonus[4] = 100.00
      • -------- THESE ARE TESTING STUFF --------
      • -------- Saves each player trainer --------
  • Catch Cast
    • Ereignisse
      • Einheit - A unit Startet den Effekt einer Fähigkeit
    • Bedingungen
      • ((Triggering unit) is Ein Urtum) Gleich False
      • Or - Any (Conditions) are true
        • Bedingungen
          • (Ability being cast) Gleich Ability_Catch[0]
          • (Ability being cast) Gleich Ability_Catch[1]
          • (Ability being cast) Gleich Ability_Catch[2]
          • (Ability being cast) Gleich Ability_Catch[3]
          • (Ability being cast) Gleich Ability_Catch[4]
    • Aktionen
      • -------- Uses locals to make it MUI --------
      • -------- Think of it as variables that won't change by GUI actions --------
      • Custom script: local unit TargetPokemon = GetSpellTargetUnit()
      • Custom script: local integer CastAbility = GetSpellAbilityId()
      • -------- Wait until pokeball reaches target --------
      • Custom script: loop
      • Custom script: exitwhen GetUnitAbilityLevel( TargetPokemon, udg_Buff_PokeballHit ) > 0
      • Wait 0.10 seconds
      • Custom script: endloop
      • -------- Restores the local variables to global variables --------
      • -------- So that we can use them in GUI now --------
      • Custom script: set udg_tmpPokemon = TargetPokemon
      • Custom script: set udg_tmpAbility = CastAbility
      • Custom script: set TargetPokemon = null
      • Einheit - Remove Buff_PokeballHit buff from tmpPokemon
      • -------- Get pokeball level --------
      • For each (Integer i) from 0 to 4, do (Actions)
        • Schleifen - Aktionen
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • tmpAbility Gleich Ability_Catch[i]
            • 'THEN'-Aktionen
              • Set tmpPokeballLevel = i
              • Set i = 5
            • 'ELSE'-Aktionen
      • -------- Get pokemon and trainer --------
      • Set tmpTrainer = (Triggering unit)
      • -------- Execute catch! --------
      • Auslöser - Run Catch Run <gen> (checking conditions)
  • Catch Run
    • Ereignisse
    • Bedingungen
    • Aktionen
      • -------- Trigger is called from "Catch Cast" --------
      • -------- Parameters: tmpPokemon, tmpTrainer, tmpPokeballLevel --------
      • -------- lZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZl --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (Owner of tmpPokemon) Ungleich Spieler 12 (Braun)
          • (Owner of tmpPokemon) Ungleich Neutral feindlich
          • (Owner of tmpPokemon) Ungleich Neutral passiv
        • 'THEN'-Aktionen
          • Spiel - Display to (Player group(Pokemon_Owner[Pokemon_Max])) for 5.00 seconds the text: That pokemon is alr...
          • Skip remaining actions
        • 'ELSE'-Aktionen
      • -------- Get missing data --------
      • Set tmpHealthLevel = (Integer(((Percentage life of tmpPokemon) / 20.00)))
      • Set tmpPokemonLevel = ((Hero level of tmpPokemon) / 10)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • tmpPokemonLevel Größer als 4
        • 'THEN'-Aktionen
          • Set tmpPokemonLevel = 4
        • 'ELSE'-Aktionen
      • -------- Get new index for instance --------
      • Set Catch_Max = (Catch_Max + 1)
      • Auslöser - Turn on Catch Execute <gen>
      • -------- Calculate and save --------
      • Set Catch_Chance[Catch_Max] = (Chances[((9 - tmpHealthLevel) - tmpPokemonLevel)] + PokeballBonus[tmpPokeballLevel])
      • Set Catch_Pokemon[Catch_Max] = tmpPokemon
      • Set Catch_Trainer[Catch_Max] = tmpTrainer
      • Set Catch_Time[Catch_Max] = 4.00
      • -------- Make pokemon invulnerable while capturing --------
      • Einheit - Make tmpPokemon Unverwundbar
      • Einheit - Pause ein tmpPokemon
      • -------- Do animation --------
      • Set point = (Position of tmpPokemon)
      • Einheit - Create 1 Dummy Catch System for (Owner of tmpTrainer) at point facing Vorgabe für Gebäude-Ausrichtung degrees
      • Custom script: call RemoveLocation(udg_point)
      • Einheit - Order (Last created unit) to Orc-Schattenjäger - 'Hexerei' tmpPokemon
      • Einheit - Add a 1.00 second Standard expiration timer to (Last created unit)
  • Catch Execute
    • Ereignisse
      • Zeit - Every 0.10 seconds of game time
    • Bedingungen
    • Aktionen
      • For each (Integer i) from 1 to Catch_Max, do (Actions)
        • Schleifen - Aktionen
          • Set Catch_Time[i] = (Catch_Time[i] - Real_Period)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • (Catch_Time[i] mod 2.00) Gleich 1.00
            • 'THEN'-Aktionen
              • Animation - Play Catch_Pokemon[i]'s channel animation
            • 'ELSE'-Aktionen
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • Catch_Time[i] Gleich 0.00
            • 'THEN'-Aktionen
              • -------- Run capturing -- Cross your fingers --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • 'IF'-Bedingungen
                  • (Random real number between 1.00 and 100.00) Kleiner als Catch_Chance[i]
                • 'THEN'-Aktionen
                  • -------- Gotcha! Get a new pokemon index --------
                  • Set Pokemon_Max = (Pokemon_Max + 1)
                  • -------- Create full pokeball and link it to the pokemon --------
                  • Held - Create Item_FullPokeball and give it to Catch_Trainer[i]
                  • Gegenstand - Set the custom value of (Last created item) to Pokemon_Max
                  • Einheit - Set the custom value of Catch_Pokemon[i] to Pokemon_Max
                  • Set Pokemon_List[Pokemon_Max] = Catch_Pokemon[i]
                  • Set Pokemon_Ball[Pokemon_Max] = (Last created item)
                  • Set Pokemon_Owner[Pokemon_Max] = (Owner of Catch_Trainer[i])
                  • -------- Move pokemon to the uber-secret area --------
                  • Set point = (Position of Catch_Pokemon[i])
                  • Spezialeffekt - Create a special effect at point using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
                  • Custom script: call RemoveLocation(udg_point)
                  • Einheit - Change ownership of Pokemon_List[Pokemon_Max] to Pokemon_Owner[Pokemon_Max] and Farbe wechseln
                  • Set point = (Random point in Rect_PokemonArea)
                  • Einheit - Move Catch_Pokemon[i] instantly to point
                  • Custom script: call RemoveLocation(udg_point)
                  • Spiel - Display to (Player group(Pokemon_Owner[Pokemon_Max])) for 5.00 seconds the text: (Congratulations! You have catched a + (Proper name of Pokemon_List[Pokemon_Max]))
                • 'ELSE'-Aktionen
                  • -------- Missed it... --------
                  • Einheit - Make Catch_Pokemon[i] Verwundbar
                  • Einheit - Pause aus Catch_Pokemon[i]
              • -------- Free index --------
              • Einheit - Remove Buff_Capturing buff from Catch_Pokemon[i]
              • Auslöser - Run Catch Free <gen> (checking conditions)
              • Set i = (i - 1)
            • 'ELSE'-Aktionen
  • Catch Free
    • Ereignisse
    • Bedingungen
    • Aktionen
      • -------- Func - trigger used to free index < i > --------
      • -------- Transfers last instance to the free position --------
      • -------- lZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZl --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • Catch_Max Gleich 1
        • 'THEN'-Aktionen
          • Auslöser - Turn off Catch Execute <gen>
        • 'ELSE'-Aktionen
          • Set Catch_Chance[i] = Catch_Chance[Catch_Max]
          • Set Catch_Pokemon[i] = Catch_Pokemon[Catch_Max]
          • Set Catch_Time[i] = Catch_Time[Catch_Max]
          • Set Catch_Trainer[i] = Catch_Trainer[Catch_Max]
      • Set Catch_Max = (Catch_Max - 1)
  • Summon Pokemon
    • Ereignisse
      • Einheit - A unit Benutzt einen Gegenstand
    • Bedingungen
      • (Item-type of (Item being manipulated)) Gleich Item_FullPokeball
    • Aktionen
      • -------- Get indexes --------
      • Set tmpTrainer = (Triggering unit)
      • Set tmpPokeball = (Item being manipulated)
      • Set i = (Custom value of tmpPokeball)
      • Set tmpPlayerId = (Player number of (Owner of tmpTrainer))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • Pokemon_Out[tmpPlayerId] Gleich Keine Einheit
        • 'THEN'-Aktionen
          • -------- Summon pokemon --------
          • Set Pokemon_Out[tmpPlayerId] = Pokemon_List[i]
          • -------- Prepare it for player --------
          • Einheit - Pause aus Pokemon_List[i]
          • Einheit - Make Pokemon_List[i] Verwundbar
          • -------- Move it --------
          • Set point = (Position of (Triggering unit))
          • Einheit - Move Pokemon_List[i] instantly to point
          • Custom script: call RemoveLocation(udg_point)
          • -------- Do animation --------
          • Set point = (Position of Pokemon_List[i])
          • Spezialeffekt - Create a special effect at point using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
          • Spezialeffekt - Destroy (Last created special effect)
          • Custom script: call RemoveLocation(udg_point)
          • Spiel - Display to (Player group(Pokemon_Owner[Pokemon_Max])) for 5.00 seconds the text: (Come out + ((Proper name of Pokemon_List[i]) + (! + I choose you...)))
          • -------- Replace pokeball --------
          • For each (Integer tmpSlot) from 1 to 6, do (Actions)
            • Schleifen - Aktionen
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • 'IF'-Bedingungen
                  • (Item carried by tmpTrainer in slot tmpSlot) Gleich tmpPokeball
                • 'THEN'-Aktionen
                  • Gegenstand - Remove tmpPokeball
                  • Held - Create Item_EmptyPokeball and give it to tmpTrainer
                  • Gegenstand - Set the custom value of (Last created item) to i
                  • Einheit - Order tmpTrainer to move (Last created item) to inventory slot tmpSlot
                  • Set Pokemon_Ball[i] = (Last created item)
                • 'ELSE'-Aktionen
        • 'ELSE'-Aktionen
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • Pokemon_Out[tmpPlayerId] Ungleich Pokemon_List[i]
            • 'THEN'-Aktionen
              • -------- Attempt to release another pokemon --------
              • Spiel - Display to (All players) the text: You cannot have two...
            • 'ELSE'-Aktionen
  • Return Pokemon
    • Ereignisse
      • Einheit - A unit Benutzt einen Gegenstand
    • Bedingungen
      • (Item-type of (Item being manipulated)) Gleich Item_EmptyPokeball
    • Aktionen
      • -------- Get indexes --------
      • Set tmpTrainer = (Triggering unit)
      • Set tmpPokeball = (Item being manipulated)
      • Set i = (Custom value of tmpPokeball)
      • Set tmpPlayerId = (Player number of (Owner of tmpTrainer))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • Pokemon_Out[tmpPlayerId] Gleich Pokemon_List[i]
        • 'THEN'-Aktionen
          • -------- Return pokemon --------
          • Set Pokemon_Out[tmpPlayerId] = Keine Einheit
          • -------- Prepare it for player --------
          • Einheit - Pause ein Pokemon_List[i]
          • Einheit - Make Pokemon_List[i] Unverwundbar
          • -------- Do animation --------
          • Set point = (Position of Pokemon_List[i])
          • Spezialeffekt - Create a special effect at point using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
          • Custom script: call RemoveLocation(udg_point)
          • -------- Move it --------
          • Set point = (Random point in Rect_PokemonArea)
          • Einheit - Move Pokemon_List[i] instantly to point
          • Custom script: call RemoveLocation(udg_point)
          • Spiel - Display to (Player group(Pokemon_Owner[Pokemon_Max])) for 5.00 seconds the text: (Come back + ((Proper name of Pokemon_List[i]) + (! + Get some rest..)))
          • -------- Replace pokeball --------
          • For each (Integer tmpSlot) from 1 to 6, do (Actions)
            • Schleifen - Aktionen
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • 'IF'-Bedingungen
                  • (Item carried by tmpTrainer in slot tmpSlot) Gleich tmpPokeball
                • 'THEN'-Aktionen
                  • Gegenstand - Remove tmpPokeball
                  • Held - Create Item_FullPokeball and give it to tmpTrainer
                  • Gegenstand - Set the custom value of (Last created item) to i
                  • Einheit - Order tmpTrainer to move (Last created item) to inventory slot tmpSlot
                • 'ELSE'-Aktionen
        • 'ELSE'-Aktionen
  • Release Pokemon
    • Ereignisse
      • Spieler - Spieler 1 (Rot) types a chat message containing -release as Exakte Ãœbereinstimmung
      • Spieler - Spieler 2 (Blau) types a chat message containing -release as Exakte Ãœbereinstimmung
      • Spieler - Spieler 3 (Blaugrau) types a chat message containing -release as Exakte Ãœbereinstimmung
      • Spieler - Spieler 4 (Lila) types a chat message containing -release as Exakte Ãœbereinstimmung
      • Spieler - Spieler 5 (Gelb) types a chat message containing -release as Exakte Ãœbereinstimmung
      • Spieler - Spieler 6 (Orange) types a chat message containing -release as Exakte Ãœbereinstimmung
      • Spieler - Spieler 7 (Grün) types a chat message containing -release as Exakte Ãœbereinstimmung
      • Spieler - Spieler 8 (Rosa) types a chat message containing -release as Exakte Ãœbereinstimmung
      • Spieler - Spieler 9 (Grau) types a chat message containing -release as Exakte Ãœbereinstimmung
      • Spieler - Spieler 10 (Hellblau) types a chat message containing -release as Exakte Ãœbereinstimmung
    • Bedingungen
    • Aktionen
      • -------- Func - trigger used to remove pokemon < i > --------
      • -------- Transfers last instance to the free position --------
      • -------- lZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZl --------
      • Einheit - Remove Pokemon_List[i] from the game
      • Set Pokemon_Ball[i] = Pokemon_Ball[Pokemon_Max]
      • Set Pokemon_List[i] = Pokemon_List[Pokemon_Max]
      • Set Pokemon_Owner[i] = Pokemon_Owner[Pokemon_Max]
      • Gegenstand - Set the custom value of Pokemon_Ball[i] to i
      • Set Pokemon_Max = (Pokemon_Max - 1)
  • My Pokemon
    • Ereignisse
      • Spieler - Spieler 1 (Rot) types a chat message containing -mypokemon as Exakte Ãœbereinstimmung
      • Spieler - Spieler 2 (Blau) types a chat message containing -mypokemon as Exakte Ãœbereinstimmung
      • Spieler - Spieler 3 (Blaugrau) types a chat message containing -mypokemon as Exakte Ãœbereinstimmung
      • Spieler - Spieler 4 (Lila) types a chat message containing -mypokemon as Exakte Ãœbereinstimmung
      • Spieler - Spieler 5 (Gelb) types a chat message containing -mypokemon as Exakte Ãœbereinstimmung
      • Spieler - Spieler 6 (Orange) types a chat message containing -mypokemon as Exakte Ãœbereinstimmung
      • Spieler - Spieler 7 (Grün) types a chat message containing -mypokemon as Exakte Ãœbereinstimmung
      • Spieler - Spieler 8 (Rosa) types a chat message containing -mypokemon as Exakte Ãœbereinstimmung
      • Spieler - Spieler 9 (Grau) types a chat message containing -mypokemon as Exakte Ãœbereinstimmung
      • Spieler - Spieler 10 (Hellblau) types a chat message containing -mypokemon as Exakte Ãœbereinstimmung
    • Bedingungen
    • Aktionen
      • Set tmpTrainer = PlayerTrainer[(Player number of (Triggering player))]
      • For each (Integer i) from 1 to 6, do (Actions)
        • Schleifen - Aktionen
          • Set tmpPokeball = (Item carried by tmpTrainer in slot i)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • tmpPokeball Ungleich Kein Gegenstand
            • 'THEN'-Aktionen
              • Set tmpPokemon = Pokemon_List[(Custom value of tmpPokeball)]
              • Spiel - Display to (Player group((Triggering player))) the text: (((|cff00ff00Slot # + (String(i))) + : |r) + (((Proper name of tmpPokemon) + |cff00ff00HP: |r) + ((String((Percentage life of tmpPokemon), 0, 0)) + ( |cff00ff00LVL:|r + (String((Hero level of tmpPokemon)))))))
            • 'ELSE'-Aktionen
  • Give Pokemon
    • Ereignisse
    • Bedingungen
    • Aktionen
      • -------- Func - trigger used to give a pokemon to a player --------
      • -------- Parameters: Give_Type, Give_Player --------
      • -------- lZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZl --------
      • Set tmpPlayerId = (Player number of Give_Player)
      • Set tmpTrainer = PlayerTrainer[tmpPlayerId]
      • -------- Create pokemon --------
      • Set point = (Random point in Rect_PokemonArea)
      • Einheit - Create 1 Give_Type for Give_Player at point facing Vorgabe für Gebäude-Ausrichtung degrees
      • Held - Set (Last created unit) Hero-level to Give_Level, Verbergen level-up graphics
      • Custom script: call RemoveLocation( udg_point )
      • Set tmpPokemon = (Last created unit)
      • Spiel - Display to (Player group(Give_Player)) for 5.00 seconds the text: (Congratulations! You have been given + ((Proper name of (Last created unit)) + ! Be sure to train him well =)))
      • -------- Gotcha! Get a new pokemon index --------
      • Set Pokemon_Max = (Pokemon_Max + 1)
      • -------- Create full pokeball and link it to the pokemon --------
      • Held - Create Item_FullPokeball and give it to tmpTrainer
      • Gegenstand - Set the custom value of (Last created item) to Pokemon_Max
      • Einheit - Set the custom value of tmpPokemon to Pokemon_Max
      • Set Pokemon_List[Pokemon_Max] = tmpPokemon
      • Set Pokemon_Ball[Pokemon_Max] = (Last created item)
      • Set Pokemon_Owner[Pokemon_Max] = Give_Player
  • You lose
    • Ereignisse
      • Einheit - A unit Stirbt
    • Bedingungen
      • ((Triggering unit) is Ein Urtum) Gleich True
      • (Owner of (Triggering unit)) Ungleich Neutral feindlich
      • (Owner of (Triggering unit)) Ungleich Spieler 12 (Braun)
      • (Owner of (Triggering unit)) Ungleich Neutral passiv
    • Aktionen
      • Set tmpTrainer = PlayerTrainer[(Player number of Pokemon_Owner[(Custom value of (Triggering unit))])]
      • Set HasLivingPokemon = False
      • -------- Check all items in inventory --------
      • For each (Integer tmpSlot) from 1 to 6, do (Actions)
        • Schleifen - Aktionen
          • Set tmpPokeball = (Item carried by tmpTrainer in slot tmpSlot)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • Or - Any (Conditions) are true
                • Bedingungen
                  • (Item-type of tmpPokeball) Gleich Full Pokeball
                  • (Item-type of tmpPokeball) Gleich Empty Pokeball
            • 'THEN'-Aktionen
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • 'IF'-Bedingungen
                  • (Pokemon_List[(Custom value of tmpPokeball)] is alive) Gleich True
                • 'THEN'-Aktionen
                  • Set HasLivingPokemon = True
                  • Set tmpSlot = 10
                • 'ELSE'-Aktionen
            • 'ELSE'-Aktionen
      • -------- Has lost? --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • HasLivingPokemon Gleich False
        • 'THEN'-Aktionen
          • -------- Yes he lost --------
          • Set point = (Center of CheckPoint[(Player number of (Owner of (Triggering unit)))])
          • Einheit - Move tmpTrainer instantly to point
          • Spiel - Display to (Player group((Owner of (Triggering unit)))) for 5.00 seconds the text: ((Name of (Owner of (Triggering unit))) + has no more pokemon left, you whited out...)
          • Custom script: call RemoveLocation( udg_point)
          • Held - Order tmpTrainer to use (Item carried by tmpTrainer of type Full Pokeball)
        • 'ELSE'-Aktionen

I think you should look into the summon/release pokemon trigger and the give pokemon trigger


I think you should look into the summon/release pokemon trigger and the give pokemon trigger
 
Last edited:
Level 28
Joined
Jan 26, 2007
Messages
4,789
You should probably upload the map, that are indeed a lot of triggers :p
It's not about reading, it's about debugging. WAY easier when you can actually edit the triggers.

Also, there's a new fancy BB-code that could be useful when dealing with this many triggers: tabs.

Trigger 1

Trigger 2

  • Huar huar
    • Events
      • Nothing Happens
    • Conditions
    • Actions
      • Do Nothing
  • Kill All
    • Events
      • Something Happens
    • Conditions
    • Actions
      • Unit Group - Kill all units
It goes like this:

[tabs]
[tab=Title 1"] (Fill in text here)
[/tab]
[tab=Title 2"] (Other text here)
[/tab]
[/tabs]

Hidden-tags also work inside/around tabs (though not always required).
 
Level 11
Joined
Jun 15, 2011
Messages
447
I faced this problem months ago while trying to make an Empty/Full bottle trigger... And the one which causes the problem is actually the replacing the item and then moving it to another slot, like replacing your empty ball with a full ball item and moving it to another slot... I fixed the problem months ago but the map I made was deleted... Sorry if I don't have time calculating again... If you're using if then else action, then try adding "skip remaining actions".
 
Level 12
Joined
Apr 26, 2008
Messages
830
I faced this problem months ago while trying to make an Empty/Full bottle trigger... And the one which causes the problem is actually the replacing the item and then moving it to another slot, like replacing your empty ball with a full ball item and moving it to another slot... I fixed the problem months ago but the map I made was deleted... Sorry if I don't have time calculating again... If you're using if then else action, then try adding "skip remaining actions".

Uhh would be nice if you could show me how it's done because i'm actually not so good with triggers, this was made by my triggerer which left wc3..
 
Status
Not open for further replies.
Top