~ 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 ~

The Enroth diehard fan community
 
HomeHome  Latest imagesLatest images  SearchSearch  RegisterRegister  Log inLog in  
Latest topics
» Songs of Silence (HoMM like game)
[Script System][Suggestions] GetResourceGeneratorOwner(type, x, y) and more Icon_minitimeby Blake01 Yesterday at 16:52

» Heroes Orchestra's 5th Birthday concerts with Paul Romero
[Script System][Suggestions] GetResourceGeneratorOwner(type, x, y) and more Icon_minitimeby rrravyn 2024-03-23, 22:45

» WARNING - The dreaded moment is here: Heroes 6 servers shutting down
[Script System][Suggestions] GetResourceGeneratorOwner(type, x, y) and more Icon_minitimeby Sir Albe 2024-03-22, 07:15

» fheroes2 General Announcements
[Script System][Suggestions] GetResourceGeneratorOwner(type, x, y) and more Icon_minitimeby sirDranik 2024-03-17, 23:35

» Photo Gallery
[Script System][Suggestions] GetResourceGeneratorOwner(type, x, y) and more Icon_minitimeby Sir Albe 2024-03-07, 06:57

» Polskie powitanie
[Script System][Suggestions] GetResourceGeneratorOwner(type, x, y) and more Icon_minitimeby rrravyn 2024-03-05, 04:02

» Heroes II localisation: how to make no-CD patch.
[Script System][Suggestions] GetResourceGeneratorOwner(type, x, y) and more Icon_minitimeby kiku 2024-02-19, 02:43

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
Introduce yourself
H3SW General Discussion
H3SW Map List: Work in progress
H3SW: Dwelling Development
Forum Admins Feed
The Floody Land
Enrothian Fan Art
Heroes III: The Succession Wars v0.8.1 Beta

 

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

Go down 
AuthorMessage
Unknown_Hero
Mage
Mage
Unknown_Hero


Messages : 778
Quality Points : 78
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
 Similar topics
-
» [Script System][Suggestions] GetLocationSpell(type, x, y) and more
» [Script System][Suggestions] SetLocationState(type, x, y, state)
» [Script System][Suggestions] GetNumTowns(player, type, faction) and more
» [Script System][Suggestions] BattleGetCurrentTurn() and more
» [Script System][Suggestions] CancelShareVision(p1, p2)

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: