Skip to content
nyfrk edited this page Aug 29, 2020 · 1 revision

ISettlers4Api::CastSpell method

Command a priest to cast a spell.

Syntax

BOOL ISettlers4Api::CastSpell(
	DWORD priest, 
	DWORD spell, 
	INT x, 
	INT y, 
	DWORD player
);

Parameters

priest

The index of the priest that casts the spell. The player should own this priest.

spell

The spell type you want the priest to cast. Currently the following values are supported.

Spell
S4_SPELL_DIVINE_PRESENT
0
S4_SPELL_CONVERT_GOOD
1
S4_SPELL_FOOD
2
S4_SPELL_TERRAIN
3
S4_SPELL_DEFENSE
4
S4_SPELL_ATTACK
5
S4_SPELL_SOLDIER
6
S4_SPELL_SPECIAL
7

x

This is the target x coordinate on the map for this spell.

y

This is the target y coordinate on the map for this spell.

player

The player who issues the command. Use 0 (zero) to issue this event as the local player.

Return value

If this method could append the event successfully it will return TRUE. If an error occurred it will return FALSE.

Remarks

The corresponding network event id of the command is ID 5048.

See here for a list of the spell identifiers.

Requirements

Minimum API Level 1
Target Edition Any
Header S4ModApi.h
Library S4ModApi.lib
DLL S4ModApi.dll

See also

ISettlers4Api

Clone this wiki locally