Unknown_Hero Mage
Messages : 780 Quality Points : 78 Registration Date : 2015-09-06
| Subject: [Script System][Suggestions] GetResourceGeneratorOwner(type, x, y) and more 2017-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. | |
|