1
0

Some of the LUA functions doc completed

This commit is contained in:
Emagi 2025-05-06 12:21:14 -04:00
parent cf4c16333e
commit aad24ca1e4
20 changed files with 275 additions and 207 deletions

View File

@ -1,20 +1,17 @@
### Function: AddCharacterTitle(param1, param2, param3, param4, param5) ### Function: AddCharacterTitle(Spawn, TitleName)
**Description:** **Description:**
Placeholder description. Provides the Spawn (Player Character) a new title they can apply from their Profile.
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `Player`: Spawn - The Spawn (Player only) to provide the new title.
- `param2`: unknown - Unknown type. - `TitleName`: String - Title to set to the Spawn.
- `param3`: unknown - Unknown type.
- `param4`: unknown - Unknown type.
- `param5`: string - String value.
**Returns:** None. **Returns:** SInt32 -1 if invalid, otherwise provides Title database ID.
**Example:** **Example:**
```lua ```lua
-- Example usage -- Example usage
AddCharacterTitle(..., ..., ..., ..., ...) AddCharacterTitle(Player, "My New Title!")
``` ```

View File

@ -1,20 +1,17 @@
### Function: AddCoin(param1, param2, param3, param4, param5) ### Function: AddCoin(Player, Amount)
**Description:** **Description:**
Placeholder description. Provide the Amount of coin provided in copper which will translate the value into copper, silver, gold, platinum respectively to the Player.
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `Player`: Spawn - The Spawn (Player) to provide the coin.
- `param2`: unknown - Unknown type. - `Amount`: UInt32 - Amount in copper to provide Player.
- `param3`: unknown - Unknown type.
- `param4`: unknown - Unknown type.
- `param5`: int32 - Integer value.
**Returns:** None. **Returns:** None.
**Example:** **Example:**
```lua ```lua
-- Example usage -- Example usage, provide 5 copper to Player. 50 copper = 5 silver, 500 copper = 5 gold, 5000 copper = 5 platinum.
AddCoin(..., ..., ..., ..., ...) AddCoin(Player, 5)
``` ```

View File

@ -1,23 +1,21 @@
### Function: AddControlEffect(param1, param2, param3, param4, param5, param6, param7, param8) ### Function: AddControlEffect(Spawn, Type, OnlyAddSpawn)
**Description:** **Description:**
Placeholder description. Apply a Control Effect to a Spawn, this includes Mesmerize, Stun, Root, so on.
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `Spawn`: Spawn - The spawn or entity involved.
- `param2`: unknown - Unknown type. - `Type`: UInt8 - Control Effect Type
- `param3`: unknown - Unknown type. - `OnlyAddSpawn`: Boolean (Optional) - False by default, set to True will only apply Control Effect to Spawn. Otherwise if Spell all Spawn Targets will apply control effect.
- `param4`: unknown - Unknown type.
- `param5`: unknown - Unknown type.
- `param6`: unknown - Unknown type.
- `param7`: int32 - Integer value.
- `param8`: int8 - Small integer or boolean flag.
**Returns:** None. **Returns:** None.
**Notes:**
- See CONTROL_EFFECT_TYPE defines for more details.
**Example:** **Example:**
```lua ```lua
-- Example usage -- Example usage: Will apply Control Effect to Spawn, or if in a Spell Script all Spell Targets, Type 1 is Mesmerize.
AddControlEffect(..., ..., ..., ..., ..., ..., ..., ...) AddControlEffect(Spawn, 1)
``` ```

View File

@ -4,15 +4,33 @@
Placeholder description. Placeholder description.
**Parameters:** **Parameters:**
- `param1`: ConversationOption[] - List of conversation options. - `param1`: ConversationOption - Conversation Option object to apply the new text and function call.
- `param2`: string - String value. - `Message`: string - String value option to display the player when StartConversation is called.
- `param3`: string - String value. - `FunctionName`: string - Function name that will be called if Player selects the option.
**Returns:** None. **Returns:** None.
**Notes:**
- Must call CreateConversation() to instantiate the ConversationOption object before AddConversationOption can be used.
**Example:** **Example:**
```lua ```lua
-- Example usage -- Example usage
AddConversationOption(..., ..., ...)
function hailed(NPC, Spawn)
FaceTarget(NPC, Spawn)
conversation = CreateConversation()
AddConversationOption(conversation, "Yes!", "yes_cookie")
AddConversationOption(conversation, "No!", "no_cookie")
StartConversation(conversation, NPC, Spawn, "Greetings traveler, would you like a cookie today?")
end
function yes_cookie(NPC, Spawn)
-- do whatever you like to give the player a cookie!
end
function no_cookie(NPC, Spawn)
-- do whatever you like to scorn them for rejecting your cookie!
end
``` ```

View File

@ -1,20 +1,19 @@
### Function: AddHate(param1, param2, param3, param4, param5) ### Function: AddHate(Spawn, NPC, Amount, SendPacket)
**Description:** **Description:**
Placeholder description. Add or Remove hate from a Spawn or Spell Targets if in a LUA Spell.
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `Spawn`: Spawn - The target involved for the hate to be added.
- `param2`: unknown - Unknown type. - `NPC`: Spawn - NPC related to the hate list we want to update.
- `param3`: Spawn - The spawn or entity involved. - `Amount`: SInt32 - The amount of hate to add or subtract (negative to remove hate).
- `param4`: unknown - Unknown type. - `SendPacket`: UInt8 - Default is false, if set to 1 then we will send the threat packet to the client if in a lua spell.
- `param5`: int8 - Small integer or boolean flag.
**Returns:** None. **Returns:** None.
**Example:** **Example:**
```lua ```lua
-- Example usage -- Example usage: Adds 100 hate to the Spawn on the NPC's hate list.
AddHate(..., ..., ..., ..., ...) AddHate(Spawn, NPC, 100)
``` ```

View File

@ -1,18 +1,17 @@
### Function: AddIconValue(param1, param2, param3) ### Function: AddIconValue(Spawn, Value)
**Description:** **Description:**
Placeholder description. Add an icon value to the Spawn.
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `Spawn`: Spawn - The spawn or entity involved.
- `param2`: unknown - Unknown type. - `Value`: UInt32 - icon value to be added.
- `param3`: int32 - Integer value.
**Returns:** None. **Returns:** Boolean: True if successful, otherwise False..
**Example:** **Example:**
```lua ```lua
-- Example usage -- Example usage
AddIconValue(..., ..., ...) AddIconValue(Spawn, Value)
``` ```

View File

@ -1,20 +1,21 @@
### Function: AddImmunitySpell(param1, param2, param3, param4, param5) ### Function: AddImmunitySpell(ImmunityType, Spawn)
**Description:** **Description:**
Placeholder description. Add an Immunity to the Spawn by the Immunity Type.
**Parameters:** **Parameters:**
- `param1`: unknown - Unknown type. - `ImmunityType`: UInt8 - Immunity Type to add.
- `param2`: int8 - Small integer or boolean flag. - `Spawn`: Spawn - Spawn to apply immunity.
- `param3`: unknown - Unknown type.
- `param4`: unknown - Unknown type.
- `param5`: Spawn - The spawn or entity involved.
**Returns:** None. **Returns:** None.
**Notes:**
- See IMMUNITY_TYPE defines for more details.
- If Spawn is specified only the Spawn receives the Immunity, otherwise if it is in a Spell Script we will apply to all Spell Targets.
**Example:** **Example:**
```lua ```lua
-- Example usage -- Example usage: Immunity Type 7 makes NPC immune to AOE spells.
AddImmunitySpell(..., ..., ..., ..., ...) AddImmunitySpell(7, NPC)
``` ```

View File

@ -1,18 +1,18 @@
### Function: AddItem(param1, param2, param3) ### Function: AddItem(Spawn, ItemID, Quantity)
**Description:** **Description:**
Placeholder description. Add an Item to a Spawn/Player with the defined Item ID and Quantity.
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `Spawn`: Spawn - The spawn or entity involved.
- `param2`: int32 - Integer value. - `ItemID`: UInt32 - Item id to assign to Spawn.
- `param3`: int32 - Integer value. - `Quantity`: UInt32 - Quantity of item to assign to Spawn (default 1).
**Returns:** None. **Returns:** Boolean: True if successfully assigned the item, otherwise return's False.
**Example:** **Example:**
```lua ```lua
-- Example usage -- Example usage: Assigns Spawn the ItemID 1696 (a fishman scale amulet) with Quantity of 1.
AddItem(..., ..., ...) AddItem(Spawn, 1696)
``` ```

View File

@ -1,19 +1,20 @@
### Function: AddLanguage(param1, param2, param3, param4) ### Function: AddLanguage(Player, LanguageID)
**Description:** **Description:**
Placeholder description. Add a Language to a Player by the Language ID in the Database (within the languages table).
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `Player`: Spawn - The spawn or entity involved.
- `param2`: unknown - Unknown type. - `LanguageID`: int32 - Integer value.
- `param3`: unknown - Unknown type.
- `param4`: int32 - Integer value.
**Returns:** None. **Returns:** None.
**Notes:**
- See the languages table for the LanguageID.
**Example:** **Example:**
```lua ```lua
-- Example usage -- Example usage: Adds Halasian Language (1) to Player.
AddLanguage(..., ..., ..., ...) AddLanguage(Player, 1)
``` ```

View File

@ -1,17 +1,17 @@
### Function: AddLootCoin(param1, param2) ### Function: AddLootCoin(Spawn, Amount)
**Description:** **Description:**
Placeholder description. Adds coin to the Spawn's loot table for the current instance when they die.
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `Spawn`: Spawn - The spawn or entity to add loot coin.
- `param2`: int32 - Integer value. - `Amount`: int32 - Amount in copper.
**Returns:** None. **Returns:** None.
**Example:** **Example:**
```lua ```lua
-- Example usage -- Example usage: Add 50 copper to Spawn's loot table for when it dies.
AddLootCoin(..., ...) AddLootCoin(Spawn, 50)
``` ```

View File

@ -1,18 +1,18 @@
### Function: AddLootItem(param1, param2, param3) ### Function: AddLootItem(Spawn, ItemID, Charges)
**Description:** **Description:**
Placeholder description. Add an item and its charges (quantity) to a Spawn's loot table for this instance.
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `Spawn`: Spawn - The spawn or entity to add the loot item.
- `param2`: int32 - Integer value. - `ItemID`: int32 - ItemID from the items table.
- `param3`: int16 - Short integer value. - `Charges`: int16 - Amount of charges for the item (or quantity), default is 1.
**Returns:** None. **Returns:** None.
**Example:** **Example:**
```lua ```lua
-- Example usage -- Example usage: Add to Spawn ItemID 1696 (a fishman scale amulet) with Quantity of 1.
AddLootItem(..., ..., ...) AddLootItem(Spawn, 1696)
``` ```

View File

@ -1,17 +1,17 @@
### Function: AddMasterTitle(param1, param2) ### Function: AddMasterTitle(TitleName, IsPrefix)
**Description:** **Description:**
Placeholder description. Creates a new Title to be used for Characters/Players with AddCharacterTitle
**Parameters:** **Parameters:**
- `param1`: string - String value. - `TitleName`: string - String value of the new master title to be used for characters/players.
- `param2`: int8 - Small integer or boolean flag. - `IsPrefix`: int8 - If this title is a prefix or not, default is 0.
**Returns:** None. **Returns:** The Database ID of the new Title that is created.
**Example:** **Example:**
```lua ```lua
-- Example usage -- Example usage: Create a new title called "My New Title!" the dbID retrieved can be used to assign to a character with AddCharacterTitle
AddMasterTitle(..., ...) local dbID = AddMasterTitle("My New Title!")
``` ```

View File

@ -1,18 +1,16 @@
### Function: AddMultiFloorLift(param1, param2, param3) ### Function: AddMultiFloorLift(Spawn)
**Description:** **Description:**
Placeholder description. Makes the Spawn (Required to be Widget) a multi-floor widget like an elevator.
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `Spawn`: Spawn - The Spawn (Widget) to be set to multi-floor.
- `param2`: unknown - Unknown type.
- `param3`: unknown - Unknown type.
**Returns:** None. **Returns:** None.
**Example:** **Example:**
```lua ```lua
-- Example usage -- Example usage: Spawn becomes a multi-floor lift
AddMultiFloorLift(..., ..., ...) AddMultiFloorLift(Spawn)
``` ```

View File

@ -1,22 +1,47 @@
### Function: AddOptionWindowOption(param1, param2, param3, param4, param5, param6, param7) ### Function: AddOptionWindowOption(OptionWindow, OptionName, OptionDescription, OptionIconSheet, OptionIconID, OptionCommand, OptionConfirmTitle)
**Description:** **Description:**
Placeholder description. Adds a new option to the option window screen.
**Parameters:** **Parameters:**
- `param1`: unknown - Unknown type. - `OptionWindow`: OptionWindow - OptionWindow object made with CreateOptionWindow().
- `param2`: string - String value. - `OptionName`: string - String value.
- `param3`: string - String value. - `OptionDescription`: string - String value.
- `param4`: int32 - Integer value. - `OptionIconSheet`: int32 - Integer value.
- `param5`: int16 - Short integer value. - `OptionIconID`: int16 - Short integer value.
- `param6`: string - String value. - `OptionCommand`: string - String value.
- `param7`: string - String value. - `OptionConfirmTitle`: string - String value.
**Returns:** None. **Returns:** None.
**Notes:**
- Must call CreateOptionWindow to instantiate the OptionWindow before AddOptionWindowOption can be used.
**Example:** **Example:**
```lua ```lua
-- Example usage -- Example usage: Create an option window to select a profession, Craftsman, Outfitter or Scholar, function outputs are select_*professionname*.
AddOptionWindowOption(..., ..., ..., ..., ..., ..., ...) function SendOptionWindow(NPC, Spawn)
window = CreateOptionWindow()
AddOptionWindowOption(window, "Craftsman", "Craftsmen become carpenters, provisioners, or woodworkers. They make furniture and strong boxes, food, drink, bows, arrows, totems, wooden weapons, and wooden shields.", 1, 420, "select_craftsman")
AddOptionWindowOption(window, "Outfitter", "Outfitters become armorers, tailors, or weaponsmiths. They make plate and chainmail armor, heavy shields, cloth and leather armor, casual clothing, backpacks, hex dolls, and metal weapons.", 1, 411, "select_outfitter")
AddOptionWindowOption(window, "Scholar", "Scholars become alchemists, jewelers, and sages. They make spell and combat art upgrades for adventurers, potions, poisons, and jewelry.", 1, 396, "select_scholar")
SendOptionWindow(window, Spawn, "Select A Profession")
end
function select_craftsman(NPC, Spawn)
SetTradeskillClass(Spawn, CRAFTSMAN)
SetTradeskillLevel(Spawn, 10)
end
function select_outfitter(NPC, Spawn)
SetTradeskillClass(Spawn, OUTFITTER)
SetTradeskillLevel(Spawn, 10)
end
function select_scholar(NPC, Spawn)
SetTradeskillClass(Spawn, SCHOLAR)
SetTradeskillLevel(Spawn, 10)
end
``` ```

View File

@ -1,29 +1,28 @@
### Function: AddPlayerMail(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11, param12, param13, param14) ### Function: AddPlayerMail(Spawn, FromName, SubjectName, MailBody, MailType, Copper, Silver, Gold, Platinum, ItemID, StackSize, ExpireTime, SentTime)
**Description:** **Description:**
Placeholder description. Sends a mail message to the Spawn.
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `Spawn`: Spawn - The Spawn (Player) to send the mail.
- `param2`: unknown - Unknown type. - `FromName`: string - From header name.
- `param3`: string - String value. - `SubjectName`: string - Subject header name.
- `param4`: string - String value. - `MailBody`: string - Body value.
- `param5`: string - String value. - `MailType`: UInt8 - Type of mail, 0 = Regular, 1 = Spam, 2 = GM.
- `param6`: int8 - Small integer or boolean flag. - `Copper`: UInt32 - Amount of copper included in the mail.
- `param7`: int32 - Integer value. - `Silver`: UInt32 - Amount of silver included in the mail.
- `param8`: int32 - Integer value. - `Gold`: UInt32 - Amount of gold included in the mail.
- `param9`: int32 - Integer value. - `Platinum`: UInt32 - Amount of platinum included in the mail.
- `param10`: int32 - Integer value. - `ItemID`: UInt32 - ItemID to provide to the Spawn in the mail.
- `param11`: int32 - Integer value. - `StackSize`: UInt16 - StackSize (Quantity) of the item.
- `param12`: int32 - Integer value. - `ExpireTime`: UInt32 - Unix Timestamp Expiration (defaults to 30 days after the sent time). Not active?
- `param13`: int32 - Integer value. - `SentTime`: UInt32 - Unix Timestamp of when the mail was sent (optional defaults to current time).
- `param14`: int32 - Integer value.
**Returns:** None. **Returns:** Boolean: True if successful adding mail, otherwise False.
**Example:** **Example:**
```lua ```lua
-- Example usage -- Example usage: Sends Spawn a message from "Bob" with 1 Platinum and ItemID 1696 (a fishman scale amulet)
AddPlayerMail(..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ...) AddPlayerMail(Spawn, "Bob", "Mail for you", "What do you need, but some amulet?", 0, 0, 0, 0, 1, 1696)
``` ```

View File

@ -1,28 +1,28 @@
### Function: AddPlayerMailByCharID(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11, param12, param13) ### Function: AddPlayerMailByCharID(CharacterID, FromName, SubjectName, MailBody, MailType, Copper, Silver, Gold, Platinum, ItemID, StackSize, ExpireTime, SentTime)
**Description:** **Description:**
Placeholder description. Sends a mail message to the Player represented by the CharacterID.
**Parameters:** **Parameters:**
- `param1`: int32 - Integer value. - `CharacterID`: int32 - Integer value.
- `param2`: string - String value. - `FromName`: string - From header name.
- `param3`: string - String value. - `SubjectName`: string - Subject header name.
- `param4`: string - String value. - `MailBody`: string - Body value.
- `param5`: int8 - Small integer or boolean flag. - `MailType`: UInt8 - Type of mail, 0 = Regular, 1 = Spam, 2 = GM.
- `param6`: int32 - Integer value. - `Copper`: UInt32 - Amount of copper included in the mail.
- `param7`: int32 - Integer value. - `Silver`: UInt32 - Amount of silver included in the mail.
- `param8`: int32 - Integer value. - `Gold`: UInt32 - Amount of gold included in the mail.
- `param9`: int32 - Integer value. - `Platinum`: UInt32 - Amount of platinum included in the mail.
- `param10`: int32 - Integer value. - `ItemID`: UInt32 - ItemID to provide to the Spawn in the mail.
- `param11`: int32 - Integer value. - `StackSize`: UInt16 - StackSize (Quantity) of the item.
- `param12`: int32 - Integer value. - `ExpireTime`: UInt32 - Unix Timestamp Expiration (defaults to 30 days after the sent time). Not active?
- `param13`: int32 - Integer value. - `SentTime`: UInt32 - Unix Timestamp of when the mail was sent (optional defaults to current time).
**Returns:** None. **Returns:** Boolean: True is always returned.
**Example:** **Example:**
```lua ```lua
-- Example usage -- Example usage: Sends character id 123 (if it exists) a message from "Bob" with 1 Platinum and ItemID 1696 (a fishman scale amulet)
AddPlayerMailByCharID(..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ...) AddPlayerMail(123, "Bob", "Mail for you", "What do you need, but some amulet?", 0, 0, 0, 0, 1, 1696)
``` ```

View File

@ -1,24 +1,33 @@
### Function: AddPrimaryEntityCommand(param1, param2, param3, param4, param5, param6, param7, param8, param9) ### Function: AddPrimaryEntityCommand(Player, Spawn, Name, Distance, Command, ErrorText, CastTime, SpellVisual, DenyListDefault)
**Description:** **Description:**
Placeholder description. Puts a context menu (right click) entity command on the Spawn for the Player (or all to access if Player is nil).
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `Player`: Spawn - The Player that can access the entity command. Optionally set to nil to allow all access.
- `param2`: Spawn - The spawn or entity involved. - `Spawn`: Spawn - The spawn to add the entity command.
- `param3`: string - String value. - `Name`: string - Text display of the entity command.
- `param4`: float - Floating point value. - `Distance`: float - Distance the player can access the command otherwise it is gray.
- `param5`: string - String value. - `Command`: string - Command function to call when used by Player.
- `param6`: string - String value. - `ErrorText`: string - Error text displayed when cannot use.
- `param7`: int16 - Short integer value. - `CastTime`: UInt16 - Time in /10 of a second to complete the command after clicking it.
- `param8`: int32 - Integer value. - `SpellVisual`: UInt32 - Optional spell visual when using the entity command.
- `param9`: int8 - Small integer or boolean flag. - `DenyListDefault`: UInt8 - Default is 0, add to allow, set to 1 to put on deny list.
**Returns:** None. **Returns:** None.
**Example:** **Example:**
```lua ```lua
-- Example usage -- Example usage: On Hail add Destroy command to Spawn.
AddPrimaryEntityCommand(..., ..., ..., ..., ..., ..., ..., ..., ...)
function hail(NPC, Spawn)
AddPrimaryEntityCommand(Spawn, NPC, "Destroy", 5)
end
function casted_on(NPC, Spawn, SpellName)
if SpellName == 'Destroy' then
-- perform action
end
end
``` ```

View File

@ -1,24 +1,33 @@
### Function: AddPrimaryEntityCommandAllSpawns(param1, param2, param3, param4, param5, param6, param7, param8, param9) ### Function: AddPrimaryEntityCommandAllSpawns(Player, SpawnID, Name, Distance, Command, ErrorText, CastTime, SpellVisual, DenyListDefault)
**Description:** **Description:**
Placeholder description. Puts a context menu (right click) entity command on all the Spawn's by the Spawn ID in the zone for the Player.
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `Player`: Spawn - The Player that can access the entity command. Optionally set to nil to allow all access.
- `param2`: unknown - Unknown type. - `SpawnID`: UInt32 - The spawn id of all related Spawns to add the entity command.
- `param3`: int32 - Integer value. - `Name`: string - Text display of the entity command.
- `param4`: string - String value. - `Distance`: float - Distance the player can access the command otherwise it is gray.
- `param5`: float - Floating point value. - `Command`: string - Command function to call when used by Player.
- `param6`: string - String value. - `ErrorText`: string - Error text displayed when cannot use.
- `param7`: string - String value. - `CastTime`: UInt16 - Time in /10 of a second to complete the command after clicking it.
- `param8`: int16 - Short integer value. - `SpellVisual`: UInt32 - Optional spell visual when using the entity command.
- `param9`: int32 - Integer value. - `DenyListDefault`: UInt8 - Default is 0, add to allow, set to 1 to put on deny list.
**Returns:** None. **Returns:** None.
**Example:** **Example:**
```lua ```lua
-- Example usage -- Example usage: On Hail add context command to Spawn's with Spawn ID 123.
AddPrimaryEntityCommandAllSpawns(..., ..., ..., ..., ..., ..., ..., ..., ...)
function hail(NPC, Spawn)
AddPrimaryEntityCommandAllSpawns(Spawn, 123, "Destroy", 5)
end
function casted_on(NPC, Spawn, SpellName)
if SpellName == 'Destroy' then
-- perform action
end
end
``` ```

View File

@ -1,24 +1,31 @@
### Function: AddProc(param1, param2, param3, param4, param5, param6, param7, param8, param9) ### Function: AddProc(Spawn, Type, Chance, Item, UseAllSpellTargets)
**Description:** **Description:**
Placeholder description. Add's a proc for a Spell and calls function proc when proc succeeds.
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `Spawn`: Spawn - The spawn or entity involved.
- `param2`: unknown - Unknown type. - `Type`: int8 - See PROC_TYPE defines.
- `param3`: unknown - Unknown type. - `Chance`: float - Chance of proc 1-100.
- `param4`: unknown - Unknown type. - `Item`: Item - An item reference.
- `param5`: unknown - Unknown type. - `UseAllSpellTargets`: int8 - Default is 0, when set to 1 all spell targets will apply the proc not the Spawn
- `param6`: int8 - Small integer or boolean flag.
- `param7`: float - Floating point value.
- `param8`: Item - An item reference.
- `param9`: int8 - Small integer or boolean flag.
**Returns:** None. **Returns:** None.
**Example:** **Example:**
```lua ```lua
-- Example usage -- Example usage: Example Spell Script, when casted Target has 10% chance to trigger proc on type 15 (PROC_TYPE_DAMAGED) when damaged.
AddProc(..., ..., ..., ..., ..., ..., ..., ..., ...)
function cast(Caster, Target)
-- 10% chance to dispel when target takes damage
AddProc(Target, 15, 10.0)
end
function proc(Caster, Target, Type)
if Type == 15 then
CancelSpell()
end
end
``` ```

View File

@ -1,28 +1,39 @@
### Function: AddProcExt(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11, param12, param13) ### Function: AddProcExt(Spawn, ProcType, DamageType, Chance, HPRatio, BelowHealth, TargetHealth, Item, UseAllSpellTargets)
**Description:** **Description:**
Placeholder description. Add's a proc for a Spell and calls function proc_ext when proc succeeds.
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `Spawn`: Spawn - The spawn or entity involved.
- `param2`: unknown - Unknown type. - `ProcType`: int8 - See ProcType options
- `param3`: unknown - Unknown type. - `DamageType`: int8 - See DamageType options
- `param4`: unknown - Unknown type. - `Chance`: float - Floating point value.
- `param5`: unknown - Unknown type. - `HPRatio`: int8 - Small integer or boolean flag.
- `param6`: int8 - Small integer or boolean flag. - `BelowHealth`: bool - Use HPRatio against health lower than if false (default). Otherwise if health is higher when true.
- `param7`: int8 - Small integer or boolean flag. - `TargetHealth`: bool - Use Target's Health for formula, default is false (use self Spawn health). Otherwise when true use Target's health.
- `param8`: float - Floating point value. - `Item`: Item - An item reference.
- `param9`: int8 - Small integer or boolean flag. - `UseAllSpellTargets`: int8 - By default 0 (false) use just Spawn, otherwise use all Spell Targets.
- `param10`: bool - Boolean value (true/false).
- `param11`: bool - Boolean value (true/false).
- `param12`: Item - An item reference.
- `param13`: int8 - Small integer or boolean flag.
**Returns:** None. **Returns:** None.
**Example:** **Example:**
```lua ```lua
-- Example usage -- Example usage: Spell Script when on cast there is a AddProcExt called for when player is going to die Type 13 PROC_TYPE_DEATH
AddProcExt(..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ...) - then proc_ext is called, which in turn casts the RedemptionReactiveSpell and the RemoveProc(Target) is called to remove spell from Target.
local RedemptionReactiveSpell = 2550537
function cast(Caster, Target, HealAmt, MaxHealthAmt)
AddProcExt(Target, 13, 255, 100.0)
end
function proc_ext(Caster, Target, Type, DamageType, InitialCaster, HealAmt, MaxHealthAmt)
CastSpell(Caster, RedemptionReactiveSpell, GetSpellTier(), InitialCaster)
SetSpellTriggerCount(1, 1)
RemoveProc(Target)
end
function remove(Caster, Target)
RemoveProc(Target)
end
``` ```