1
0

37 more lua functions that were missed

This commit is contained in:
Emagi 2025-05-27 09:56:36 -04:00
parent ed754ae752
commit 3230c71c94
37 changed files with 472 additions and 284 deletions

View File

@ -1,22 +1,21 @@
### Function: AddSpellBonus(param1, param2, param3, param4, param5, param6, param7) ### Function: AddSpellBonus(Spawn, type, value)
**Description:** **Description:**
Placeholder description.
Adds a spell bonus of the type specified. The types are defined on https://github.com/emagi/eq2emu/blob/main/docs/data_types/item_stat_types.md
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `spawn` (Spawn) - Spawn object reference `spawn`.
- `param2`: unknown - Unknown type. - `type` (uint16) - Integer value `type`.
- `param3`: unknown - Unknown type. - `value` (float) - Float value `value`.
- `param4`: unknown - Unknown type.
- `param5`: unknown - Unknown type.
- `param6`: int16 - Short integer value.
- `param7`: float - Floating point value.
**Returns:** None. **Returns:** None.
**Example:** **Example:**
```lua ```lua
-- Example usage -- From Spells/AA/AbilityAptitude.lua
AddSpellBonus(..., ..., ..., ..., ..., ..., ...) function cast(Caster, Target, BonusAmt)
AddSpellBonus(Target, 707, BonusAmt)
end
``` ```

View File

@ -1,21 +1,26 @@
### Function: AddSpellBookEntry(param1, param2, param3, param4, param5, param6) ### Function: AddSpellBookEntry(player, spellid, tier, add_silently, add_to_hotbar)
**Description:** **Description:**
Placeholder description.
Adds a spell book entry for the Player with the spellid and tier provided. The add_silently (false by default), add_to_hotbar (true by default)
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `player` (Spawn) - Spawn object representing `player`.
- `param2`: unknown - Unknown type. - `spellid` (uint32) - Integer value `spellid`.
- `param3`: int32 - Integer value. - `tier` (uint16) - Integer value `tier`.
- `param4`: int16 - Short integer value. - `add_silently` (bool) - Boolean flag `add_silently`.
- `param5`: bool - Boolean value (true/false). - `add_to_hotbar` (bool) - Boolean flag `add_to_hotbar`.
- `param6`: bool - Boolean value (true/false).
**Returns:** None. **Returns:** None.
**Example:** **Example:**
```lua ```lua
-- Example usage -- From ItemScripts/ForgeryFreeportCitizenshipPapers.lua
AddSpellBookEntry(..., ..., ..., ..., ..., ...) function Task3(Item,Player)
local Race = GetRace(Player)
if Race == 11 then --Kerra
if HasQuest(Player,LA_F) then
SetStepComplete(Player,LA_F,14)
end
``` ```

View File

@ -1,19 +1,26 @@
### Function: AddStepProgress(param1, param2, param3, param4) ### Function: AddStepProgress(player, quest_id, step, progress)
**Description:** **Description:**
Placeholder description.
Adds progress to the Player's quest based on the quest_id and step. Setting the current progress value.
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `player` (Spawn) - Spawn object representing `player`.
- `param2`: int32 - Integer value. - `quest_id` (uint32) - Integer value `quest_id`.
- `param3`: int32 - Integer value. - `step` (uint32) - Integer value `step`.
- `param4`: int32 - Integer value. - `progress` (uint32) - Integer value `progress`.
**Returns:** None. **Returns:** None.
**Example:** **Example:**
```lua ```lua
-- Example usage -- From ItemScripts/OrcSmugglerRequisition.lua
AddStepProgress(..., ..., ..., ...) function examined(Item, Player)
if not HasQuest(Player, AnOrderOfOrcTongue) and not HasCompletedQuest(Player, AnOrderOfOrcTongue) then
OfferQuest(nil, Player, AnOrderOfOrcTongue)
elseif HasQuest(Player, AnOrderOfOrcTongue) then
AddStepProgress(Player, AnOrderOfOrcTongue, 1, 1)
RemoveItem(Player, 10202)
end
``` ```

View File

@ -1,23 +1,30 @@
### Function: AddTimer(param1, param2, param3, param4, param5, param6, param7, param8) ### Function: AddTimer(spawn, time, function, max_count, player)
**Description:** **Description:**
Placeholder description.
Adds a spawn script timer to call the function when triggering at the elapsed time. The player field can optionally be passed as a field to the function.
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `spawn` (Spawn) - Spawn object representing `spawn`.
- `param2`: unknown - Unknown type. - `time` (uint32) - Integer value `time`.
- `param3`: unknown - Unknown type. - `function` (string) - String `function`.
- `param4`: unknown - Unknown type. - `max_count` (uint32) - Integer value `max_count`.
- `param5`: int32 - Integer value. - `player` (Spawn) - Spawn object representing `player`.
- `param6`: string - String value.
- `param7`: int32 - Integer value.
- `param8`: Spawn - The spawn or entity involved.
**Returns:** None. **Returns:** None.
**Example:** **Example:**
```lua ```lua
-- Example usage -- From ItemScripts/ForgeryFreeportCitizenshipPapers.lua
AddTimer(..., ..., ..., ..., ..., ..., ..., ...) -- removed function AddTimer was in for simplifying example
AddTimer(Player,1000,"TaskDone",1)
function TaskDone(Item,Player)
CloseItemConversation(Item,Player)
if HasItem(Player,1001112) then
RemoveItem(Player,1001112,1)
end
end
``` ```

View File

@ -1,17 +1,21 @@
### Function: AddTransportSpawn(param1, param2) ### Function: AddTransportSpawn(spawn)
**Description:** **Description:**
Placeholder description.
Add's the spawn as a transport spawn in the zone.
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `spawn` (Spawn) - Spawn object representing `spawn`.
- `param2`: unknown - Unknown type.
**Returns:** None. **Returns:** None.
**Example:** **Example:**
```lua ```lua
-- Example usage -- From SpawnScripts/ElddarGrove/TransportTreeLift.lua
AddTransportSpawn(..., ...) function spawn(NPC)
-- AddTransportSpawn(NPC)
-- AddTimer(NPC, 15, "UseLift")
AddMultiFloorLift(NPC)
end
``` ```

View File

@ -1,17 +1,20 @@
### Function: ApplySpellVisual(param1, param2) ### Function: ApplySpellVisual(target, spell_visual)
**Description:** **Description:**
Placeholder description.
Apply a spell visual from the spell visuals in the ReferenceList https://wiki.eq2emu.com/ReferenceLists by client version. Older clients like KoS/DoF translate newer spell visuals to old via the spell_visuals table alternate_spell_visual.
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `target` (Spawn) - Spawn object representing `target`.
- `param2`: int32 - Integer value. - `spell_visual` (uint32) - Integer value `spell_visual`.
**Returns:** None. **Returns:** None.
**Example:** **Example:**
```lua ```lua
-- Example usage -- From ItemScripts/BardCertificationPapers.lua
ApplySpellVisual(..., ...) ApplySpellVisual(Player, 324)
``` ```

View File

@ -1,24 +1,84 @@
### Function: Bind(param1, param2, param3, param4, param5, param6, param7, param8, param9) ### Function: Bind(spawn, zone_id, x, y, z, h)
**Description:** **Description:**
Placeholder description.
Bind the spawn to the zone id, x, y, z and heading specified.
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `spawn` (Spawn) - Spawn object representing `spawn`.
- `param2`: unknown - Unknown type. - `zone_id` (uint32) - Integer value `zone_id`.
- `param3`: unknown - Unknown type. - `x` (float) - Float value `x`.
- `param4`: unknown - Unknown type. - `y` (float) - Float value `y`.
- `param5`: int32 - Integer value. - `z` (float) - Float value `z`.
- `param6`: float - Floating point value. - `h` (float) - Float value `h`.
- `param7`: float - Floating point value.
- `param8`: float - Floating point value.
- `param9`: float - Floating point value.
**Returns:** None. **Returns:** None.
**Example:** **Example:**
```lua ```lua
-- Example usage -- From SpawnScripts/OutpostOverlord/CaptainVarlos.lua
Bind(..., ..., ..., ..., ..., ..., ..., ..., ...) function LeaveIsland(NPC, Spawn)
Race = GetRace(Spawn)
Bind(Spawn, 559, -232.03, -56.06, 172.57, 360.0)
-- Human / Kerra
if Race == 9 or Race == 11 then
AddSpellBookEntry(Spawn, 8057, 1)
ZoneRef = GetZone("Freeport")
Zone(ZoneRef,Spawn)
-- Ratonga / Gnome
elseif Race == 5 or Race == 13 then
AddSpellBookEntry(Spawn, 8057, 1)
ZoneRef = GetZone("Freeport")
Zone(ZoneRef,Spawn)
-- Half Elf
elseif Race == 6 then
AddSpellBookEntry(Spawn, 8057, 1)
ZoneRef = GetZone("Freeport")
Zone(ZoneRef,Spawn)
-- Orge / Troll
elseif Race == 12 or Race == 14 then
AddSpellBookEntry(Spawn, 8057, 1)
ZoneRef = GetZone("Freeport")
Zone(ZoneRef,Spawn)
-- Dark Elf / Iksar
elseif Race == 1 or Race == 10 then
AddSpellBookEntry(Spawn, 8057, 1)
ZoneRef = GetZone("Freeport")
Zone(ZoneRef,Spawn)
-- Erudite / Freeblood
elseif Race == 3 or Race == 19 then
AddSpellBookEntry(Spawn, 8057, 1)
ZoneRef = GetZone("Freeport")
Zone(ZoneRef,Spawn)
-- Barbarian and Aerakyn
elseif Race == 0 or Race == 20 then
AddSpellBookEntry(Spawn, 8057, 1)
ZoneRef = GetZone("Freeport")
Zone(ZoneRef,Spawn)
-- Arasai or Sarnak
elseif Race == 17 or Race == 18 then
AddSpellBookEntry(Spawn, 8057, 1)
ZoneRef = GetZone("Freeport")
Zone(ZoneRef,Spawn)
-- Unknown
else
PlayFlavor(NPC, "", "Sorry, I cannot deal with someone of your race. Try visiting the boat on the other island!", "", 0, 0, Spawn)
ZoneRef = GetZone("Qeynos")
Zone(ZoneRef,Spawn)
end
``` ```

View File

@ -1,19 +1,26 @@
### Function: CanReceiveQuest(param1, param2, param3, param4) ### Function: CanReceiveQuest(spawn, quest_id)
**Description:** **Description:**
Placeholder description.
Return's true if the Spawn can receive the quest by quest_id.
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `spawn` (Spawn) - Spawn object representing `spawn`.
- `param2`: unknown - Unknown type. - `quest_id` (uint32) - Integer value `quest_id`.
- `param3`: unknown - Unknown type.
- `param4`: int32 - Integer value.
**Returns:** None. **Returns:** True if the quest_id can be accepted, otherwise false.
**Example:** **Example:**
```lua ```lua
-- Example usage -- From ItemScripts/abrokenmusicbox.lua
CanReceiveQuest(..., ..., ..., ...) function examined(Item, Player)
if CanReceiveQuest(Player,RewardForAMissingMusicBox) then
Dialog1(Item,Player)
else
conversation = CreateConversation()
AddConversationOption(conversation, "[Keep the musicbox]")
AddConversationOption(conversation, "[Destroy the musicbox]", "QuestFinish")
StartDialogConversation(conversation, 2, Item, Player, "This floral designed music box is broken like one you found before. Perhaps it is the same one? Oh well.")
end
``` ```

View File

@ -1,24 +1,24 @@
### Function: CastSpell(param1, param2, param3, param4, param5, param6, param7, param8, param9) ### Function: CastSpell(target, spell_id, spell_tier, caster, custom_cast_time)
**Description:** **Description:**
Placeholder description.
Casts a spell on the specified target with the spell_id and spell_tier specified.
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `target` (Spawn) - Spawn object representing `target`.
- `param2`: unknown - Unknown type. - `spell_id` (uint32) - Integer value `spell_id`.
- `param3`: unknown - Unknown type. - `spell_tier` (uint8) - Integer value `spell_tier`.
- `param4`: unknown - Unknown type. - `caster` (Spawn) - Spawn object representing `caster`.
- `param5`: unknown - Unknown type. - `custom_cast_time` (uint16) - Integer value `custom_cast_time`.
- `param6`: int32 - Integer value.
- `param7`: int8 - Small integer or boolean flag.
- `param8`: Spawn - The spawn or entity involved.
- `param9`: int16 - Short integer value.
**Returns:** None. **Returns:** None.
**Example:** **Example:**
```lua ```lua
-- Example usage -- From ItemScripts/abasicfirework.lua
CastSpell(..., ..., ..., ..., ..., ..., ..., ..., ...) function used(Item, Player)
CastSpell(Player, 5003, 1)
end
``` ```

View File

@ -1,18 +1,32 @@
### Function: ChangeFaction(param1, param2, param3) ### Function: ChangeFaction(spawn, faction_id, increase_or_decrease)
**Description:** **Description:**
Placeholder description.
Changes the faction on the Spawn for the faction_id by increasing or decreasing the value. Decrease would be a negative value.
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `spawn` (Spawn) - Spawn object representing `spawn`.
- `param2`: int32 - Integer value. - `faction_id` (uint32) - Integer value `faction_id`.
- `param3`: int32 - Integer value. - `increase_or_decrease` (sint32) - Integer value `increase`.
**Returns:** None. **Returns:** True boolean if successful updating the faction value.
**Example:** **Example:**
```lua ```lua
-- Example usage -- From ItemScripts/ForgeryFreeportCitizenshipPapers.lua
ChangeFaction(..., ..., ...) function Faction(Item,Player)
Freeport = GetFactionAmount(Player, 11)
Freeport_Add = (10000-Freeport)
Freeport = GetFactionAmount(Player, 12)
Freeport_Add = (-20000-Freeport)
Neriak = GetFactionAmount(Player, 13)
Kelethin = GetFactionAmount(Player, 14)
Halas = GetFactionAmount(Player, 16)
Gorowyn = GetFactionAmount(Player, 17)
alignment = GetAlignment(Player)
if Freeport <10000 and Freeport >=0 then ChangeFaction(Player, 11, Freeport_Add)
elseif Freeport <0 then ChangeFaction(Player, 11, (Freeport*-1))
Faction(Item,Player)
end
``` ```

View File

@ -1,17 +1,28 @@
### Function: ChangeHandIcon(param1, param2) ### Function: ChangeHandIcon(spawn, displayHandIcon)
**Description:** **Description:**
Placeholder description.
Changes the hand icon of the Spawn when Player's hover over the Spawn in 3d space.
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `spawn` (Spawn) - Spawn object representing `spawn`.
- `param2`: int8 - Small integer or boolean flag. - `displayHandIcon` (uint8) - Integer value `displayHandIcon`.
**Returns:** None. **Returns:** None.
**Example:** **Example:**
```lua ```lua
-- Example usage -- From Quests/FarJourneyFreeport/TasksaboardtheFarJourney.lua
ChangeHandIcon(..., ...) function CurrentStep(Quest, QuestGiver, Player)
if GetQuestStepProgress(Player, 524,2) == 0 and GetQuestStep(Player, 524) == 2 then
i = 1
spawns = GetSpawnListBySpawnID(Player, 270010)
repeat
spawn = GetSpawnFromList(spawns, i-1)
if spawn then
ChangeHandIcon(spawn, 1)
AddPrimaryEntityCommand(nil, spawn)
SpawnSet(NPC, "targetable", 1, true, true)
end
``` ```

View File

@ -1,19 +1,22 @@
### Function: ClearChoice(param1, param2, param3, param4) ### Function: ClearChoice(spawn, commandToClear, clearDecline)
**Description:** **Description:**
Placeholder description.
Clear's a choice previously set on the Player with a command.
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `spawn` (Spawn) - Spawn object representing `spawn`.
- `param2`: unknown - Unknown type. - `commandToClear` (string) - String `commandToClear`.
- `param3`: string - String value. - `clearDecline` (uint8) - Integer value `clearDecline`.
- `param4`: int8 - Small integer or boolean flag.
**Returns:** None. **Returns:** None.
**Example:** **Example:**
```lua ```lua
-- Example usage -- From SpawnScripts/DoF_design_path_script/AnimationSpeedScroll.lua
ClearChoice(..., ..., ..., ...) function DoSpellVisual(NPC,Spawn)
ClearChoice(Spawn, "select")
CreateChoiceWindow(NPC, Spawn, "Display Visual ID X, Visual ID Range X-Y, Visual ID String Wildcard, eg. heal", "OK", "select", "Cancel", "", 0, 1, 1, 14)
end
``` ```

View File

@ -1,16 +1,20 @@
### Function: ClearRunningLocations(param1) ### Function: ClearRunningLocations(spawn)
**Description:** **Description:**
Placeholder description.
Removes all the running locations on the Spawn.
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `spawn` (Spawn) - Spawn object representing `spawn`.
**Returns:** None. **Returns:** None.
**Example:** **Example:**
```lua ```lua
-- Example usage -- From SpawnScripts/FarJourneyFreeport/agoblin.lua
ClearRunningLocations(...) function run_around_loop_init_pause(NPC)
ClearRunningLocations(NPC)
AddTimer(NPC, 700, "run_around_loop_init_continue")
end
``` ```

View File

@ -1,17 +1,21 @@
### Function: CloseConversation(param1, param2) ### Function: CloseConversation(npc, player)
**Description:** **Description:**
Placeholder description.
Closes a Player's active conversation with the NPC.
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `npc` (Spawn) - Spawn object representing `npc`.
- `param2`: Spawn - The spawn or entity involved. - `player` (Spawn) - Spawn object representing `player`.
**Returns:** None. **Returns:** None.
**Example:** **Example:**
```lua ```lua
-- Example usage -- From Quests/CastleviewHamlet/the_lost_book_of_arbos.lua
CloseConversation(..., ...) function Accepted(Quest, QuestGiver, Player)
PlayFlavor(QuestGiver, "", "", "thanks", 0,0 , Player)
CloseConversation(QuestGiver,Player)
end
``` ```

View File

@ -1,17 +1,23 @@
### Function: CloseItemConversation(param1, param2) ### Function: CloseItemConversation(item, player)
**Description:** **Description:**
Placeholder description.
Closes a conversation of the Player with an Item script.
**Parameters:** **Parameters:**
- `param1`: Item - An item reference. - `item` (Item) - Item object representing `item`.
- `param2`: Spawn - The spawn or entity involved. - `player` (Spawn) - Spawn object representing `player`.
**Returns:** None. **Returns:** None.
**Example:** **Example:**
```lua ```lua
-- Example usage -- From ItemScripts/abixieeye.lua
CloseItemConversation(..., ...) function Step_Complete(Item, Player)
if HasItem(Player,1219,1) then
SetStepComplete(Player, LoreAndLegendBixie, 4)
CloseItemConversation(Item, Player)
RemoveItem(Player, 1219)
end
``` ```

View File

@ -1,28 +1,30 @@
### Function: CreateChoiceWindow(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11, param12, param13) ### Function: CreateChoiceWindow(npc, spawn, windowTextPrompt, acceptText, acceptCommand, declineText, declineCommand, time, textBox, textBoxRequired, maxLength)
**Description:** **Description:**
Placeholder description.
Create's a choice display window for the client to provide a accept/decline prompt window and input box support (for text field).
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `npc` (Spawn) - Spawn object representing `npc`.
- `param2`: unknown - Unknown type. - `spawn` (Spawn) - Spawn object representing `spawn`.
- `param3`: unknown - Unknown type. - `windowTextPrompt` (string) - String `windowTextPrompt`.
- `param4`: Spawn - The spawn or entity involved. - `acceptText` (string) - String `acceptText`.
- `param5`: string - String value. - `acceptCommand` (string) - String `acceptCommand`.
- `param6`: string - String value. - `declineText` (string) - String `declineText`.
- `param7`: string - String value. - `declineCommand` (string) - String `declineCommand`.
- `param8`: string - String value. - `time` (uint32) - Integer value `time`.
- `param9`: string - String value. - `textBox` (uint8) - Integer value `textBox`.
- `param10`: int32 - Integer value. - `textBoxRequired` (uint8) - Integer value `textBoxRequired`.
- `param11`: int8 - Small integer or boolean flag. - `maxLength` (uint32) - Integer value `maxLength`.
- `param12`: int8 - Small integer or boolean flag.
- `param13`: int32 - Integer value.
**Returns:** None. **Returns:** None.
**Example:** **Example:**
```lua ```lua
-- Example usage -- From SpawnScripts/DoF_design_path_script/AnimationSpeedScroll.lua
CreateChoiceWindow(..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ...) function DoSpellVisual(NPC,Spawn)
ClearChoice(Spawn, "select")
CreateChoiceWindow(NPC, Spawn, "Display Visual ID X, Visual ID Range X-Y, Visual ID String Wildcard, eg. heal", "OK", "select", "Cancel", "", 0, 1, 1, 14)
end
``` ```

View File

@ -1,16 +1,25 @@
### Function: CreateConversation(param1) ### Function: CreateConversation(conversation)
**Description:** **Description:**
Placeholder description.
Create a new conversation option for the Spawn to use in AddConversationOption.
**Parameters:** **Parameters:**
- `param1`: ConversationOption[] - List of conversation options. - `conversation` (Conversation) - Conversation object representing `conversation`.
**Returns:** None. **Returns:** None.
**Example:** **Example:**
```lua ```lua
-- Example usage -- From ItemScripts/abixieeye.lua
CreateConversation(...) function examined(Item, Player)
local LnLAccept = GetRuleFlagFloat("R_World", "LoreAndLegendAccept")
if LnLAccept > 0 and not HasQuest(Player, LoreAndLegendBixie) and not HasCompletedQuest(Player, LoreAndLegendBixie) then
OfferQuest(nil, Player, LoreAndLegendBixie)
else
conversation = CreateConversation()
if HasQuest(Player, LoreAndLegendBixie) and GetQuestStepProgress(Player, LoreAndLegendBixie, 4)==0 then
AddConversationOption(conversation, "Begin to study...", "Step_Complete")
end
``` ```

View File

@ -1,12 +1,13 @@
### Function: HasCollectionsToHandIn(player) ### Function: HasCollectionsToHandIn(player)
**Description:** **Description:**
Return's if the player has collections to turn in. Return's if the player has collections to turn in.
**Parameters:** **Parameters:**
- `player` (Spawn) - Spawn object representing `player`. - `player` (Spawn) - Spawn object representing `player`.
**Returns:** Return's true if there is collections complete to turn in, otherwise false. **Returns:** True if the player has active collections to turn in.
**Example:** **Example:**

View File

@ -1,13 +1,14 @@
### Function: HasCompletedQuest(player, quest_id) ### Function: HasCompletedQuest(player, quest_id)
**Description:** **Description:**
Return's true if the quest_id has been previously completed by the player.
Return's true if the player has completed the quest with quest_id.
**Parameters:** **Parameters:**
- `player` (Spawn) - Spawn object representing `player`. - `player` (Spawn) - Spawn object representing `player`.
- `quest_id` (uint32) - Integer value `quest_id`. - `quest_id` (uint32) - Integer value `quest_id`.
**Returns:** If player has completed quest_id then return's true, otherwise false. **Returns:** True if the quest_id matches a completed quest for the Player, otherwise false.
**Example:** **Example:**

View File

@ -1,12 +1,13 @@
### Function: HasFreeSlot(player) ### Function: HasFreeSlot(player)
**Description:** **Description:**
Return's true if there is a free slot in player's inventory, otherwise false.
Return's true if the player has a free slot in their inventory.
**Parameters:** **Parameters:**
- `player` (Spawn) - Spawn object representing `player`. - `player` (Spawn) - Spawn object representing `player`.
**Returns:** True if there is an open inventory slot for the Player, otherwise false. **Returns:** True if the player has an open inventory slot.
**Example:** **Example:**

View File

@ -1,12 +1,13 @@
### Function: HasGroup(spawn) ### Function: HasGroup(spawn)
**Description:** **Description:**
Return's if the spawn is in a group.
Return's true if the Spawn is in a group (If Player) otherwise checks if NPC/Object/Widget is in a Spawn Group.
**Parameters:** **Parameters:**
- `spawn` (Spawn) - Spawn object representing `spawn`. - `spawn` (Spawn) - Spawn object representing `spawn`.
**Returns:** True if the spawn is in a group, otherwise false. **Returns:** True if criteria is met for Player in a group or NPC/Object/Widget/Sign is in a Spawn Group.
**Example:** **Example:**

View File

@ -1,16 +1,21 @@
### Function: HasMoved(param1) ### Function: HasMoved(spawn)
**Description:** **Description:**
Placeholder description.
Return's true if the position has moved (X/Y/Z) heading is not included since the last time HasMoved was called on the Spawn.
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `spawn` (Spawn) - Spawn object representing `spawn`.
**Returns:** True if the HasMoved function was previously called on the Spawn and the x/y/z positions have changed since last being called. Otherwise false.
**Returns:** None.
**Example:** **Example:**
```lua ```lua
-- Example usage -- From SpawnScripts/Cache/abanditcook.lua
HasMoved(...) function Checking(NPC,Spawn)
if GetDistance(NPC,Spawn) <=8 and HasMoved(Spawn) then
Attack(NPC,Spawn)
end
``` ```

View File

@ -1,19 +1,24 @@
### Function: HasRecipeBook(param1, param2, param3, param4) ### Function: HasRecipeBook(player, recipe_id)
**Description:** **Description:**
Placeholder description.
Return's true if the player has a recipe book that matches the recipe_id.
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `player` (Spawn) - Spawn object representing `player`.
- `param2`: unknown - Unknown type. - `recipe_id` (uint32) - Integer value `recipe_id`.
- `param3`: unknown - Unknown type.
- `param4`: int32 - Integer value.
**Returns:** None. **Returns:** True if the player has a recipe book with the recipe of recipe_id included. Otherwise false.
**Example:** **Example:**
```lua ```lua
-- Example usage -- From SpawnScripts/Generic/GenericCraftingTrainer.lua
HasRecipeBook(..., ..., ..., ...) function HasBooks(Spawn)
local has_books = true
--check if the player has certain recipe books
if not HasRecipeBook(Spawn, artisan_ess_1) and not HasItem(Spawn, artisan_ess_1, 1) then
has_books = false
end
``` ```

View File

@ -1,19 +1,15 @@
### Function: InFront(param1, param2, param3, param4) ### Function: InFront(spawn, target)
**Description:** **Description:**
Placeholder description.
Return's true if Spawn is in front of target.
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `spawn` (Spawn) - Spawn object representing `spawn`.
- `param2`: unknown - Unknown type. - `target` (Spawn) - Spawn object representing `target`.
- `param3`: unknown - Unknown type.
- `param4`: Spawn - The spawn or entity involved.
**Returns:** None. **Returns:** Return's true if Spawn is in front of target. Otherwise false.
**Example:** **Example:**
```lua Example Required
-- Example usage
InFront(..., ..., ..., ...)
```

View File

@ -1,16 +1,27 @@
### Function: IsAlive(param1) ### Function: IsAlive(spawn)
**Description:** **Description:**
Placeholder description.
Return's true if the Spawn is alive, otherwise false.
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `spawn` (Spawn) - Spawn object representing `spawn`.
**Returns:** None. **Returns:** Return's true if the Spawn is alive, otherwise false.
**Example:** **Example:**
```lua ```lua
-- Example usage -- From Quests/FarJourneyFreeport/TasksaboardtheFarJourney.lua
IsAlive(...) function CurrentStep(Quest, QuestGiver, Player)
if GetQuestStepProgress(Player, 524,2) == 0 and GetQuestStep(Player, 524) == 2 then
i = 1
spawns = GetSpawnListBySpawnID(Player, 270010)
repeat
spawn = GetSpawnFromList(spawns, i-1)
if spawn then
ChangeHandIcon(spawn, 1)
AddPrimaryEntityCommand(nil, spawn)
SpawnSet(NPC, "targetable", 1, true, true)
end
``` ```

View File

@ -1,16 +1,14 @@
### Function: IsBindAllowed(param1) ### Function: IsBindAllowed(spawn)
**Description:** **Description:**
Placeholder description.
Return's true if bind is allowed in the zone for the spawn, otherwise false.
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `spawn` (Spawn) - Spawn object representing `spawn`.
**Returns:** None. **Returns:** Return's true if bind is allowed in the zone for the spawn, otherwise false.
**Example:** **Example:**
```lua Example Required
-- Example usage
IsBindAllowed(...)
```

View File

@ -1,18 +1,15 @@
### Function: IsCastOnAggroComplete(param1, param2, param3) ### Function: IsCastOnAggroComplete(spawn)
**Description:** **Description:**
Placeholder description.
Return's true if the cast on aggro trigger has completed for the Spawn (NPC).
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `spawn` (Spawn) - Spawn object representing `spawn`.
- `param2`: unknown - Unknown type.
- `param3`: unknown - Unknown type.
**Returns:** None.
**Returns:** Return's true if the cast on aggro trigger has completed for the Spawn (NPC). Otherwise false.
**Example:** **Example:**
```lua Example Required
-- Example usage
IsCastOnAggroComplete(..., ..., ...)
```

View File

@ -1,17 +1,14 @@
### Function: IsGateAllowed(param1, param2) ### Function: IsGateAllowed(spawn)
**Description:** **Description:**
Placeholder description.
Return's true if gate is allowed in the zone for the Spawn otherwise false.
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `spawn` (Spawn) - Spawn object representing `spawn`.
- `param2`: ZoneServer - The zone object.
**Returns:** None. **Returns:** Return's true if gate is allowed in the zone for the Spawn otherwise false.
**Example:** **Example:**
```lua Example Required
-- Example usage
IsGateAllowed(..., ...)
```

View File

@ -1,16 +1,22 @@
### Function: IsInCombat(param1) ### Function: IsInCombat(spawn)
**Description:** **Description:**
Placeholder description.
Return's true if the spawn is currently in combat.
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `spawn` (Spawn) - Spawn object representing `spawn`.
**Returns:** None. **Returns:** Return's true if the spawn is currently in combat.
**Example:** **Example:**
```lua ```lua
-- Example usage -- From ItemScripts/awellspringcubleash.lua
IsInCombat(...) function used(Item, Player)
target = GetTarget(Player)
if GetName(target) == 'a wellspring cub' and GetTempVariable(Player, "cub") == nil then
if not IsInCombat(target) then
CastEntityCommand(Player, target, 1278, "Leash")
end
``` ```

View File

@ -1,18 +1,20 @@
### Function: IsInvis(param1, param2, param3) ### Function: IsInvis(spawn)
**Description:** **Description:**
Placeholder description.
Return's true if the spawn is invisible, otherwise false.
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `spawn` (Spawn) - Spawn object representing `spawn`.
- `param2`: unknown - Unknown type.
- `param3`: unknown - Unknown type.
**Returns:** None. **Returns:** Return's true if the spawn is invisible, otherwise false.
**Example:** **Example:**
```lua ```lua
-- Example usage -- made up example
IsInvis(..., ..., ...) function casted_on(NPC, Spawn, Message)
if IsInvis(Spawn) then
-- RemoveInvis(NPC,Spawn)
end
``` ```

View File

@ -1,17 +1,25 @@
### Function: IsSpawnGroupAlive(param1, param2) ### Function: IsSpawnGroupAlive(zone, group_id)
**Description:** **Description:**
Placeholder description.
Return's true if there is an alive spawn within the spawn group_id specified in the Zone.
**Parameters:** **Parameters:**
- `param1`: ZoneServer - The zone object. - `zone` (Zone) - Zone object representing `zone`.
- `param2`: int32 - Integer value. - `group_id` (uint32) - Integer value `group_id`.
**Returns:** None. **Returns:** Return's true if there is an alive spawn within the spawn group_id specified in the Zone. Otherwise false.
**Example:** **Example:**
```lua ```lua
-- Example usage -- From SpawnScripts/ThunderingSteppes/AntelopeHerd1.lua
IsSpawnGroupAlive(..., ...) function SpawnCheck(NPC)
local zone = GetZone(NPC)
if IsSpawnGroupAlive(zone, GroupID) == true then
AddTimer(NPC, 6000, "SpawnCheck")
else
Despawn(GetSpawnByLocationID(zone, 133793500))
end
``` ```

View File

@ -1,18 +1,24 @@
### Function: IsStealthed(param1, param2, param3) ### Function: IsStealthed(spawn)
**Description:** **Description:**
Placeholder description.
Return's true if the spawn is stealthed, otherwise false.
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `spawn` (Spawn) - Spawn object representing `spawn`.
- `param2`: unknown - Unknown type.
- `param3`: unknown - Unknown type.
**Returns:** None. **Returns:** Return's true if the spawn is stealthed, otherwise false.
**Example:** **Example:**
```lua ```lua
-- Example usage -- From SpawnScripts/Caves/acuriousrock.lua
IsStealthed(..., ..., ...) function casted_on(NPC, Spawn, Message)
if Message == "smash" then
SetAccessToEntityCommand(Spawn,NPC,"smash", 0)
SpawnSet(NPC, "show_command_icon", 0)
SpawnSet(NPC, "display_hand_icon", 0)
if IsStealthed(Spawn) then
-- RemoveStealth(NPC,Spawn)
end
``` ```

View File

@ -1,17 +1,14 @@
### Function: IsTransportSpawn(param1, param2) ### Function: IsTransportSpawn(spawn)
**Description:** **Description:**
Placeholder description.
Return's true if the Spawn is flagged as a transport spawn, otherwise false.
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `spawn` (Spawn) - Spawn object representing `spawn`.
- `param2`: unknown - Unknown type.
**Returns:** None. **Returns:** Return's true if the Spawn is flagged as a transport spawn, otherwise false.
**Example:** **Example:**
```lua Example Required
-- Example usage
IsTransportSpawn(..., ...)
```

View File

@ -1,18 +1,30 @@
### Function: KillSpawn(param1, param2, param3) ### Function: KillSpawn(dead, killer)
**Description:** **Description:**
Placeholder description.
Trigger's the dead spawn to be killed. The killer field is optional, but updates that the killer targetted the dead spawn.
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `dead` (Spawn) - Spawn object representing `dead`.
- `param2`: Spawn - The spawn or entity involved. - `killer` (Spawn) - Spawn object representing `killer`.
- `param3`: int8 - Small integer or boolean flag.
**Returns:** None. **Returns:** None.
**Example:** **Example:**
```lua ```lua
-- Example usage -- From RegionScripts/exp04_dun_chardok/char_p10_crossbridge_pit01_region.lua
KillSpawn(..., ..., ...) function EnterRegion(Zone, Spawn, RegionType)
-- RegionType 2 is 'lava' or 'death' regions, RegionType 1 is water
local invul = IsInvulnerable(Spawn)
if invul == true then
return 0
end
if RegionType == 2 then
KillSpawn(Spawn, null, 1)
end
end
``` ```

View File

@ -1,19 +1,22 @@
### Function: KillSpawnByDistance(param1, param2, param3, param4) ### Function: KillSpawnByDistance(spawn, max_distance, include_players, send_packet)
**Description:** **Description:**
Placeholder description.
Kill's spawns in the distance radius around the Spawn (Entity based, NPC, Player, Bot). The include_players is false by default, as-is send_packet.
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `spawn` (Spawn) - Spawn object representing `spawn`.
- `param2`: float - Floating point value. - `max_distance` (float) - Float value `max_distance`.
- `param3`: int8 - Small integer or boolean flag. - `include_players` (uint8) - Integer value `include_players`.
- `param4`: int8 - Small integer or boolean flag. - `send_packet` (uint8) - Integer value `send_packet`.
**Returns:** None. **Returns:** None.
**Example:** **Example:**
```lua ```lua
-- Example usage -- From SpawnScripts/FrostfangSea/qst_scourgeson_x2_rygorr_tent.lua
KillSpawnByDistance(..., ..., ..., ...) function KillArea(NPC)
KillSpawnByDistance(NPC, 20, 0, 0)
end
``` ```

View File

@ -1,17 +1,15 @@
### Function: SetCurrentHP(param1, param2) ### Function: SetCurrentHP(spawn, value)
**Description:** **Description:**
Placeholder description.
Set's the current spawn hp value if the hp value + current hp is less than total hp. Otherwise it will override the total hp. This function is an alias of SetHP(spawn, value)
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `spawn` (Spawn) - Spawn object representing `spawn`.
- `param2`: unknown - Unknown type. - `value` (int32) - Integer value `value`.
**Returns:** None. **Returns:** None.
**Example:** **Example:**
```lua Example Required
-- Example usage
SetCurrentHP(..., ...)
```

View File

@ -1,17 +1,15 @@
### Function: SetCurrentPower(param1, param2) ### Function: SetCurrentPower(spawn, value)
**Description:** **Description:**
Placeholder description.
Set's the current spawn power value if the power value + current power is less than total power. Otherwise it will override the total power. This function is an alias of SetPower(spawn, value)
**Parameters:** **Parameters:**
- `param1`: Spawn - The spawn or entity involved. - `spawn` (Spawn) - Spawn object representing `spawn`.
- `param2`: unknown - Unknown type. - `value` (int32) - Integer value `value`.
**Returns:** None. **Returns:** None.
**Example:** **Example:**
```lua Example Required
-- Example usage
SetCurrentPower(..., ...)
```