- Joined
- Apr 26, 2008
- Messages
- 830
Hi guys,
Somehow I always get a fatal error when i try to use a normal, ROAR abillity or an item abillity wich gives a new abillity to a unit here is the trigger.
Somehow I always get a fatal error when i try to use a normal, ROAR abillity or an item abillity wich gives a new abillity to a unit here is the trigger.
-
Setup
-

Ereignisse
-


Zeit - Elapsed game time is 1.00 seconds
-
-

Bedingungen
-

Aktionen
-


Set tmItemAbility[tmCount] = Mega Punch
-


Set tmSpell[tmCount] = TM 1 (Gegenstand)
-


Set tmName[tmCount] = Mega Punch
-


Set tmCount = (tmCount + 1)
-


-------- --------
-


Set tmItemAbility[tmCount] = Rage
-


Set tmSpell[tmCount] = TM 2 (Gegenstand)
-


Set tmName[tmCount] = Rage
-


Set tmCount = (tmCount + 1)
-


-------- --------
-


Set tmItemAbility[tmCount] = Water Pulse
-


Set tmSpell[tmCount] = TM 3 (Gegenstand)
-


Set tmName[tmCount] = Water Pulse
-


Set tmCount = (tmCount + 1)
-


-------- --------
-


Set tmItemAbility[tmCount] = Ice Beam
-


Set tmSpell[tmCount] = TM 4 (Gegenstand)
-


Set tmName[tmCount] = Ice Beam
-


Set tmCount = (tmCount + 1)
-


-------- --------
-


Set tmItemAbility[tmCount] = Ice Punch
-


Set tmSpell[tmCount] = TM 5 (Gegenstand)
-


Set tmName[tmCount] = Ice Punch
-


Set tmCount = (tmCount + 1)
-


-------- --------
-


Set tmItemAbility[tmCount] = Fire Punch
-


Set tmSpell[tmCount] = TM 6 (Gegenstand)
-


Set tmName[tmCount] = Fire Punch
-


Set tmCount = (tmCount + 1)
-


-------- --------
-


Set tmItemAbility[tmCount] = Thunder Punch
-


Set tmSpell[tmCount] = TM 7 (Gegenstand)
-


Set tmName[tmCount] = Thunder Punch
-


Set tmCount = (tmCount + 1)
-


-------- --------
-


Set tmItemAbility[tmCount] = Magnitude
-


Set tmSpell[tmCount] = TM 8 (Gegenstand)
-


Set tmName[tmCount] = Magnitude
-


Set tmCount = (tmCount + 1)
-


-------- --------
-


Set tmItemAbility[tmCount] = Solar Beam
-


Set tmSpell[tmCount] = TM 9 (Gegenstand)
-


Set tmName[tmCount] = Solar Beam
-


Set tmCount = (tmCount + 1)
-


-------- --------
-


Set tmItemAbility[tmCount] = Earthquake
-


Set tmSpell[tmCount] = TM 10 (Gegenstand)
-


Set tmName[tmCount] = Earthquake
-


Set tmCount = (tmCount + 1)
-


-------- --------
-


Set tmItemAbility[tmCount] = Thunderbolt
-


Set tmSpell[tmCount] = TM 11 (Gegenstand)
-


Set tmName[tmCount] = Thunderbolt
-


Set tmCount = (tmCount + 1)
-


-------- --------
-


Set tmItemAbility[tmCount] = Psy Beam
-


Set tmSpell[tmCount] = TM 12 (Gegenstand)
-


Set tmName[tmCount] = Psy Beam
-


Set tmCount = (tmCount + 1)
-


-------- --------
-


Set tmItemAbility[tmCount] = Psychic
-


Set tmSpell[tmCount] = TM 13 (Gegenstand)
-


Set tmName[tmCount] = Psychic
-


Set tmCount = (tmCount + 1)
-


-------- --------
-


Set tmItemAbility[tmCount] = Fire Spin
-


Set tmSpell[tmCount] = TM 14 (Gegenstand)
-


Set tmName[tmCount] = Fire Spin
-


Set tmCount = (tmCount + 1)
-


-------- --------
-


Set tmItemAbility[tmCount] = Eruption
-


Set tmSpell[tmCount] = TM 15 (Gegenstand)
-


Set tmName[tmCount] = Eruption
-


Set tmCount = (tmCount + 1)
-


-------- --------
-
-
-
Learn TM
-

Ereignisse
-


Einheit - A unit Startet den Effekt einer Fähigkeit
-
-

Bedingungen
-

Aktionen
-


-------- This doesn't have to be changed --------
-


For each (Integer A) from 0 to tmCount, do (Actions)
-



Schleifen - Aktionen
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





'IF'-Bedingungen
-






(Ability being cast) Gleich tmSpell[(Integer A)]
-
-





'THEN'-Aktionen
-






Set teachAbility = tmItemAbility[(Integer A)]
-






Set teachString = tmName[(Integer A)]
-






Set teachPokemon = (Target unit of ability being cast)
-






Custom script: set bj_forLoopAIndex = udg_tmCount + 1
-






Auslöser - Run Teach Pokemon 2 <gen> (ignoring conditions)
-
-





'ELSE'-Aktionen
-
-
-
-
-
-
Teach
-

Ereignisse
-

Bedingungen
-

Aktionen
-


-------- Func - trigger used to teach an ability to a pokemon --------
-


-------- ================ --------
-


-------- Get data --------
-


Set tempForce = (Player group((Triggering player)))
-


Set playerNumber = (Player number of (Triggering player))
-


Custom script: set udg_handleID = GetHandleId(udg_teachPokemon)
-


Custom script: set udg_tempInt = LoadInteger(udg_skillTable, udg_handleID, StringHash("spells"))
-


-------- Don't learn what it already knows --------
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



'IF'-Bedingungen
-




(Level of teachAbility for teachPokemon) Größer als 0
-
-



'THEN'-Aktionen
-




Spiel - Display to tempForce for 15.00 seconds the text: The pokemon already...
-




Custom script: call DestroyForce(udg_tempForce)
-




Skip remaining actions
-
-



'ELSE'-Aktionen
-
-


-------- Check number of current abilities --------
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



'IF'-Bedingungen
-




tempInt Größer gleich 4
-
-



'THEN'-Aktionen
-




-------- Oh noes, gotta forget something --------
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





'IF'-Bedingungen
-






Or - Any (Conditions) are true
-







Bedingungen
-








(Owner of teachPokemon) Gleich Neutral feindlich
-








(Owner of teachPokemon) Gleich Neutral passiv
-








teachSilent Gleich True
-
-
-
-





'THEN'-Aktionen
-






-------- Neutral pokemons have no owner to decide for them --------
-






-------- ...And ownerless pokemon don't like forgetting things --------
-






Custom script: call DestroyForce(udg_tempForce)
-






Skip remaining actions
-






-------- (also, if Teach_Silent is true, let's not bother the player) --------
-
-





'ELSE'-Aktionen
-
-




-------- But if it's an owned pokemon.... --------
-




Set teachWaitingAbility[playerNumber] = teachAbility
-




Custom script: set udg_teachWaitingString[udg_playerNumber] = GetObjectName(udg_teachAbility)
-




Set teachWaitingPokemon[playerNumber] = teachPokemon
-




Set teachForget[playerNumber] = True
-




-------- Pause and invul pokemon and trainer --------
-




Einheit - Pause ein pokemonTrainer[playerNumber]
-




Einheit - Make pokemonTrainer[playerNumber] Unverwundbar
-




Einheit - Pause ein teachPokemon
-




Einheit - Make teachPokemon Unverwundbar
-




-------- Show his current skills --------
-




Spiel - Display to tempForce for 15.00 seconds the text: ((|cff00ff00 + ((Name of teachPokemon) + |r wants to learn |cff00ff00)) + ((Name of teachAbility) + |r!))
-




Spiel - Display to tempForce for 15.00 seconds the text: |cffffff00Your poke...
-




Custom script: call DisplayTimedTextToPlayer(GetTriggerPlayer(), 0., 0., 15., "1 - " +LoadStr(udg_skillTable, udg_handleID, StringHash("name1")))
-




Custom script: call DisplayTimedTextToPlayer(GetTriggerPlayer(), 0., 0., 15., "2 - " +LoadStr(udg_skillTable, udg_handleID, StringHash("name2")))
-




Custom script: call DisplayTimedTextToPlayer(GetTriggerPlayer(), 0., 0., 15., "3 - " +LoadStr(udg_skillTable, udg_handleID, StringHash("name3")))
-




Custom script: call DisplayTimedTextToPlayer(GetTriggerPlayer(), 0., 0., 15., "4 - " +LoadStr(udg_skillTable, udg_handleID, StringHash("name4")))
-




Spiel - Display to tempForce for 15.00 seconds the text: (|cffffff80skip - Don't learn + ((Name of teachAbility) + |r))
-




Spiel - Display to tempForce for 15.00 seconds the text: |cffffff00Type -sho...
-
-



'ELSE'-Aktionen
-




-------- Oh yeah, I can learn it! --------
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





'IF'-Bedingungen
-






teachSilent Gleich False
-
-





'THEN'-Aktionen
-






Spiel - Display to tempForce for 15.00 seconds the text: ((|cff00ff00 + ((Name of teachPokemon) + |r just learned |cff00ff00)) + ((Name of teachAbility) + |r!))
-
-





'ELSE'-Aktionen
-
-




Set tempInt = (tempInt + 1)
-




Hashtabelle - Save tempInt as (Key spells) of handleID in skillTable
-




Custom script: call SaveInteger(udg_skillTable, udg_handleID, StringHash("abil"+I2S(udg_tempInt)), udg_teachAbility)
-




Custom script: call SaveStr(udg_skillTable, udg_handleID, StringHash("name"+I2S(udg_tempInt)), udg_teachString)
-




Einheit - Add teachAbility to teachPokemon
-
-
-


Custom script: call DestroyForce(udg_tempForce)
-
-



