- Joined
- Dec 3, 2012
- Messages
- 117
So, in my RPG the players' heroes ahve to be able to change jobs, now I thinhk I have a pretty decent trigger to do this:
I was thinking of saving the abilities in a variable array when learned, but then idk how I'd save the level of the ability
-
Swordsman Job Change
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Interact (Basic Skills)
- (Unit-type of (Target unit of ability being cast)) Equal to Swordsman Job Changer
-
Actions
- Set TEMPInteger = (Player number of (Owner of (Casting unit)))
- Set TEMPPlayerGroup = (Player group((Triggering player)))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- JOBLevel[TEMPInteger] Equal to 10
- HEROClassNr[TEMPInteger] Equal to 0
-
Then - Actions
- -------- Setting Availabe SP to job lvl. In case of novice to basic job, ignore this. --------
- Set SkillPointsAvailable[TEMPInteger] = JOBLevel[TEMPInteger]
- -------- Saving the heroes stats in integer variables. --------
- Set JOBChangeStats[TEMPInteger] = (Strength of HEROPlayerHero[TEMPInteger] (Exclude bonuses))
- Set JOBChangeStats[(TEMPInteger + 6)] = (Agility of HEROPlayerHero[TEMPInteger] (Exclude bonuses))
- Set JOBChangeStats[(TEMPInteger + 12)] = (Intelligence of HEROPlayerHero[TEMPInteger] (Exclude bonuses))
- -------- Saving the heroes unspent attribute points in integer variables. --------
- Set JOBChangeUnspentAP[TEMPInteger] = (Unspent skill points of HEROPlayerHero[TEMPInteger])
- -------- Saving the heroes items in item variables. --------
- Set JOBChangeItems[TEMPInteger] = (Item carried by HEROPlayerHero[TEMPInteger] in slot 1)
- Set JOBChangeItems[(TEMPInteger + 6)] = (Item carried by HEROPlayerHero[TEMPInteger] in slot 2)
- Set JOBChangeItems[(TEMPInteger + 12)] = (Item carried by HEROPlayerHero[TEMPInteger] in slot 3)
- Set JOBChangeItems[(TEMPInteger + 18)] = (Item carried by HEROPlayerHero[TEMPInteger] in slot 4)
- Set JOBChangeItems[(TEMPInteger + 24)] = (Item carried by HEROPlayerHero[TEMPInteger] in slot 5)
- Set JOBChangeItems[(TEMPInteger + 30)] = (Item carried by HEROPlayerHero[TEMPInteger] in slot 6)
- -------- Saving Abilities --------
- Set JOBLearnedAbilities[TEMPInteger] = (Ability being cast)
- -------- Creating new job level hero --------
- Set TEMPPoint = (Position of HEROPlayerHero[TEMPInteger])
- Unit - Remove HEROPlayerHero[TEMPInteger] from the game
- Unit - Create 1 Swordsman (Basic Job) for Player 1 (Red) at TEMPPoint facing Default building facing degrees
- Set HEROPlayerHero[TEMPInteger] = (Last created unit)
- Set HEROClassNr[TEMPInteger] = 1
- Custom script: call RemoveLocation (udg_TEMPPoint)
- -------- Adding saved Attributes, Unspent AP and items --------
- -------- Stats --------
- Hero - Modify Strength of HEROPlayerHero[TEMPInteger]: Set to JOBChangeStats[TEMPInteger]
- Hero - Modify Agility of HEROPlayerHero[TEMPInteger]: Set to JOBChangeStats[(TEMPInteger + 6)]
- Hero - Modify Intelligence of HEROPlayerHero[TEMPInteger]: Set to JOBChangeStats[(TEMPInteger + 12)]
- -------- Unspent AP --------
- Hero - Modify unspent skill points of HEROPlayerHero[TEMPInteger]: Set to JOBChangeUnspentAP[TEMPInteger] points
- -------- Items --------
- Hero - Create (Item-type of JOBChangeItems[TEMPInteger]) and give it to HEROPlayerHero[TEMPInteger]
- Hero - Create (Item-type of JOBChangeItems[(TEMPInteger + 6)]) and give it to HEROPlayerHero[TEMPInteger]
- Hero - Create (Item-type of JOBChangeItems[(TEMPInteger + 12)]) and give it to HEROPlayerHero[TEMPInteger]
- Hero - Create (Item-type of JOBChangeItems[(TEMPInteger + 18)]) and give it to HEROPlayerHero[TEMPInteger]
- Hero - Create (Item-type of JOBChangeItems[(TEMPInteger + 24)]) and give it to HEROPlayerHero[TEMPInteger]
- Hero - Create (Item-type of JOBChangeItems[(TEMPInteger + 30)]) and give it to HEROPlayerHero[TEMPInteger]
- -------- Resetting job level, SP and adding previous job skills (BETA, NOVICE ONLY FOR NOW) --------
- Set JOBLevel[TEMPInteger] = 1
- Set SkillPointsAvailable[TEMPInteger] = 1
- Unit - Add Swordsman Skills (Spellbook) to HEROPlayerHero[TEMPInteger]
- Unit - Add Novice Skills (Spellbook) to HEROPlayerHero[TEMPInteger]
- Unit - Add Basic Skills (Container Play Dead) to HEROPlayerHero[TEMPInteger]
- Unit - Add Basic Skills (Container First Aid) to HEROPlayerHero[TEMPInteger]
- Unit - Set level of First Aid (Basic Skills) for HEROPlayerHero[TEMPInteger] to 3
- Selection - Select HEROPlayerHero[TEMPInteger] for (Owner of (Casting unit))
- Game - Display to TEMPPlayerGroup the text: (|cff9acd32You have changed your job to |r|cffffcc00 + ((Name of HEROPlayerHero[TEMPInteger]) + !|r))
-
Else - Actions
- Game - Display to TEMPPlayerGroup the text: |cff008000Your job ...
-
If - Conditions
-
Events
I was thinking of saving the abilities in a variable array when learned, but then idk how I'd save the level of the ability
Last edited: