~ Forums of Enroth ~
Would you like to react to this message? Create an account in a few clicks or log in to continue.

~ Forums of Enroth ~

An Enroth diehard fan community
 
HomeHome  SearchSearch  RegisterRegister  Log inLog in  
Latest topics
» Immortal Realms: Vampire Wars (HoMM like game)
[Script System][Suggestions] GetResourceGeneratorOwner(type, x, y) and more Icon_minitimeby Unknown_Hero 2020-09-18, 23:10

» They talked about fheroes2!
[Script System][Suggestions] GetResourceGeneratorOwner(type, x, y) and more Icon_minitimeby sirDranik 2020-09-13, 02:51

» GoG Homm2 vs fheroes2 comparison review
[Script System][Suggestions] GetResourceGeneratorOwner(type, x, y) and more Icon_minitimeby sirDranik 2020-09-11, 01:19

» Resurrection of fheroes2 with 0.8 version
[Script System][Suggestions] GetResourceGeneratorOwner(type, x, y) and more Icon_minitimeby Tibor0803 2020-09-08, 06:32

» [Enhancement] Enhancement for the information displayed when the player right clicks on an object
[Script System][Suggestions] GetResourceGeneratorOwner(type, x, y) and more Icon_minitimeby sirDranik 2020-09-07, 20:45

» Free Heroes of Might and Magic II (fheroes2) General Announcements
[Script System][Suggestions] GetResourceGeneratorOwner(type, x, y) and more Icon_minitimeby ihhub 2020-09-05, 02:34

» [Enhancement] Enhancement for Scouting secondary skill
[Script System][Suggestions] GetResourceGeneratorOwner(type, x, y) and more Icon_minitimeby Unknown_Hero 2020-09-03, 21:26

Poll
Global announcements should be:
Everlasting, 1 for each project.
[Script System][Suggestions] GetResourceGeneratorOwner(type, x, y) and more Redbar110%[Script System][Suggestions] GetResourceGeneratorOwner(type, x, y) and more Redbar12
 0% [ 0 ]
Temporary, when there is something new to announce.
[Script System][Suggestions] GetResourceGeneratorOwner(type, x, y) and more Redbar11100%[Script System][Suggestions] GetResourceGeneratorOwner(type, x, y) and more Redbar12
 100% [ 6 ]
Holalala... No idea where the Ultimate artifact is.
[Script System][Suggestions] GetResourceGeneratorOwner(type, x, y) and more Redbar110%[Script System][Suggestions] GetResourceGeneratorOwner(type, x, y) and more Redbar12
 0% [ 0 ]
Total Votes : 6
Most Viewed Topics
H3SW: General Graphics discussion
Ragoon's Graphics For HoMM3SW
H3SW General Discussion
H3SW Map List: Work in progress
H3SW: Dwelling Development
Heroes III: The Succession Wars v0.8.1 Beta
Heroes of Might and Magic 3: The Succession Wars - General info & Announcements
Project Ironfist announcements
Introduce yourself
Welcome fellow Enrothians!

 

 [Script System][Suggestions] GetResourceGeneratorOwner(type, x, y) and more

Go down 
AuthorMessage
Unknown_Hero
Mage
Mage
Unknown_Hero

Messages : 724
Quality Points : 74
Registration Date : 2015-09-06

[Script System][Suggestions] GetResourceGeneratorOwner(type, x, y) and more Empty
PostSubject: [Script System][Suggestions] GetResourceGeneratorOwner(type, x, y) and more   [Script System][Suggestions] GetResourceGeneratorOwner(type, x, y) and more Icon_minitime2017-03-18, 06:55

GetResourceGeneratorOwner(type, x, y)
type: the ID of the location (see section "Locations").
x: X coordinate on the world map.
y: Y coordinate on the world map.

Returns the owner of the specified resource generator as an integer (0-5), or returns "-1" if the resource generator is not owned by any player.

SetResourceGeneratorOwner(type, x, y, player)
type: the ID of the location (see section "Locations").
x: X coordinate on the world map.
y: Y coordinate on the world map.
player: the player you wish to select.

Sets the specified player (0-5) to become the owner of the specified resource generator.

Using value of "-1" for player, the resource generator is not owned by any player.

Using values of "-1" for x and y, all the resource generators of the same type on the map are affected at the same time.

*

CastSpellOnResourceGenerator(type, x, y, spell, power, player, control)
type: the ID of the location (see section "Locations").
x: X coordinate on the world map.
y: Y coordinate on the world map.
spell: the spell ID you want to cast on the resource generator (see section "Spells"). Currently, it can be the "Haunt" spell and the four "Set Elemental Guardian" spells.
power: the Spell Power to which the spell will be cast.
player: affects the resource generator only if the specified player (0-5) is the owner of the resource generator. Using value of "-1" for player, only the resource generator not owned by a player is affected. Can also be left empty, all the resource generators of the specified type will be affected regardless of who controls the resource generator.
control: can be set to "0" or "1".
- "0" if the resource generator is controlled by a player, he loses control of the resource generator.
- "1" if the resource generator is controlled by a player, he keeps control of the resource generator.

Casts the specified spell at the specified Spell Power on the specified resource generator if the specfied player is the owner of the resource generator. The player can keep control of the resource generator or not (player flag).

Examples of use:

CastSpellOnResourceGenerator(LOCATION_MINE, 10, 25, SPELL_HAUNT, 10, 3, 1);

If the resource generator is owned by the player "3", 40 Ghosts (10 * 4) are generated on the mine located at (10, 25). The player keeps control of the mine (the mine continues to give resources to the player every day).

*

Using values of "-1" for x and y, all the resource generators of the same type on the map are affected at the same time.

CastSpellOnResourceGenerator(LOCATION_MINE_CRYSTAL, -1, -1, SPELL_SET_FIRE_GUARDIAN, 10, 3, 0);

For all the resource generators of the specified type and owned by the player "3", 40 Fire Elementals (10 * 4) are generated. The player loses control of the resource generators.

*

Leaving the value for player empty, all the resource generators of the same type on the map are affected regardless of who controls the resource generators.

CastSpellOnResourceGenerator(LOCATION_MINE_CRYSTAL, -1, -1, SPELL_SET_FIRE_GUARDIAN, 10, , 0);

For all the resource generators of the specified type, 40 Fire Elementals (10 * 4) are generated. All the players lose control of the resource generators.
Back to top Go down
 
[Script System][Suggestions] GetResourceGeneratorOwner(type, x, y) and more
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
~ Forums of Enroth ~ :: Modding Guild :: Heroes of Might and Magic II: Project Ironfist :: Modding and Mapmaking-
Jump to: