|
|
Moonlith
Bad-mannered
Supreme Hero
If all else fails, use Fiyah!
|
posted July 08, 2007 02:32 PM |
|
Edited by Moonlith at 14:33, 08 Jul 2007.
|
The script
I'm not sure if this section is the right place to ask, but I figured I could try.
It's regarding the map editor script. Would someone be able to provide me with a script giving any new hero hired by a specific player a number of experience, skills, spells, artifects or the like, as a starting boost?
I'm mostly unsure how the triggering-and-effects work.
I'm trying to get into the script but it's hard to learn I feel, the manual is very lousy and may state all commands (Or just about all), but doesn't state in what order you need to list it and all.
Any chance someone with too much time on their hands could make a better manual?
Thanks in advance.
|
|
Daystar
Honorable
Legendary Hero
Back from the Dead
|
posted July 08, 2007 02:49 PM |
|
Edited by Daystar at 15:31, 08 Jul 2007.
|
This isn't much help, but someone on celestial heavens already has. Go to their forum and search "Script" or "Heroes V Script" or something like that, there's a link somewhere.
EDIT: Here it is!
____________
How exactly is luck a skill?
|
|
sfidanza
Promising
Supreme Hero
|
posted July 15, 2007 07:10 PM |
|
|
I also suggest you have a look at the scripts in the H5 maps. Look for lua files in the maps folder, you should get an idea how they work in practice.
What you want to do seems pretty feasible. You need to use the PLAYER_ADD_HERO_TRIGGER. The handler function will receive the hero name, allowing you to add exp, spells, skills...
It would go something like:
function boost_hero(heroname)
ChangeHeroStat(heroname, STAT_EXPERIENCE, 5000); -- add 5000 exp
GiveHeroSkill(heroname, SKILL_DEFENCE); -- give basic defense
...
end;
Trigger(PLAYER_ADD_HERO_TRIGGER, PLAYER_1, "boost_hero");
Note that requirements have to be met when adding skills or it won't work.
|
|
|
|