From 5b276f3a6982d176791dbecfc92c887dccd78b86 Mon Sep 17 00:00:00 2001 From: Emagi Date: Sun, 25 May 2025 21:42:32 -0400 Subject: [PATCH] another 113 lua functions.. --- docs/lua_functions/CastCustomSpell.md | 27 ++++---- docs/lua_functions/CastEntityCommand.md | 25 ++++--- docs/lua_functions/HasCollectionsToHandIn.md | 20 ++++-- docs/lua_functions/HasCompletedQuest.md | 22 +++++-- docs/lua_functions/HasFreeSlot.md | 13 ++-- docs/lua_functions/HasGroup.md | 14 ++-- docs/lua_functions/HasItemEquipped.md | 65 ++++--------------- docs/lua_functions/HasLanguage.md | 20 +++--- docs/lua_functions/HasQuest.md | 19 +++--- docs/lua_functions/HasRecovered.md | 15 ++--- docs/lua_functions/HasSkill.md | 18 +++-- docs/lua_functions/HasSpell.md | 17 ++--- docs/lua_functions/HasSpellEffect.md | 22 +++---- docs/lua_functions/HasSpellImmunity.md | 17 ++--- docs/lua_functions/IncreaseSkillCapsByType.md | 19 ++---- docs/lua_functions/InstructionWindow.md | 38 +++++------ docs/lua_functions/InstructionWindowClose.md | 10 +-- docs/lua_functions/InstructionWindowGoal.md | 18 +++-- docs/lua_functions/IsBehind.md | 21 +++--- docs/lua_functions/IsCasting.md | 15 ++--- docs/lua_functions/IsEntity.md | 21 ++++-- docs/lua_functions/IsFlanking.md | 21 +++--- docs/lua_functions/IsFollowing.md | 18 +++-- docs/lua_functions/IsGroundSpawn.md | 16 +++-- docs/lua_functions/IsHeroic.md | 16 +++-- docs/lua_functions/IsInvulnerable.md | 18 +++-- docs/lua_functions/IsMezzed.md | 15 ++--- docs/lua_functions/IsMezzedOrStunned.md | 15 ++--- docs/lua_functions/IsOnAutoMount.md | 18 ++--- docs/lua_functions/IsRunning.md | 13 ++-- docs/lua_functions/IsStunned.md | 15 ++--- docs/lua_functions/IsZoneLoading.md | 13 ++-- docs/lua_functions/Knockback.md | 24 +++---- docs/lua_functions/LastSpellAttackHit.md | 21 +++--- docs/lua_functions/MakeRandomFloat.md | 17 +++-- docs/lua_functions/ProcDamage.md | 32 +++++---- docs/lua_functions/ProcessMelee.md | 19 ++---- docs/lua_functions/ProcessSpell.md | 21 ++---- docs/lua_functions/RemoveIconValue.md | 14 ++-- docs/lua_functions/RemoveImmunitySpell.md | 17 +++-- docs/lua_functions/RemoveInvis.md | 19 ++++-- docs/lua_functions/RemoveProc.md | 19 +++--- docs/lua_functions/RemoveQuestStep.md | 20 ++---- docs/lua_functions/RemoveSkill.md | 18 ++--- docs/lua_functions/RemoveSpawnAccess.md | 13 ++-- docs/lua_functions/RemoveStealth.md | 19 ++++-- docs/lua_functions/RemoveThreatTransfer.md | 17 ++--- docs/lua_functions/RemoveTriggerFromSpell.md | 16 ++--- docs/lua_functions/RemoveWard.md | 25 +++---- docs/lua_functions/ResetIllusion.md | 14 ++-- docs/lua_functions/ResetQuestStep.md | 20 ++---- docs/lua_functions/Resurrect.md | 32 ++++----- docs/lua_functions/SendOptionWindow.md | 23 ++++--- docs/lua_functions/SendTransporters.md | 16 ++--- docs/lua_functions/SetAAInfo.md | 15 ++--- docs/lua_functions/SetAlignment.md | 18 +++-- docs/lua_functions/SetBrainTick.md | 22 ++++--- docs/lua_functions/SetCharSheetChanged.md | 13 ++-- docs/lua_functions/SetCharacterTitlePrefix.md | 21 +++--- docs/lua_functions/SetCharacterTitleSuffix.md | 16 ++--- docs/lua_functions/SetFailureTimer.md | 16 ++--- docs/lua_functions/SetFollowTarget.md | 38 ++++++++--- docs/lua_functions/SetGridID.md | 17 ++--- docs/lua_functions/SetIllusion.md | 19 +++--- docs/lua_functions/SetInCombat.md | 22 ++++--- docs/lua_functions/SetInfoStructFloat.md | 20 +++--- docs/lua_functions/SetInfoStructSInt.md | 27 +++++--- docs/lua_functions/SetInfoStructString.md | 19 +++--- docs/lua_functions/SetInfoStructUInt.md | 17 ++--- docs/lua_functions/SetItemCount.md | 20 ++---- docs/lua_functions/SetLuaBrain.md | 19 ++++-- docs/lua_functions/SetPlayerHistory.md | 20 +++--- docs/lua_functions/SetQuestFeatherColor.md | 18 +++-- docs/lua_functions/SetQuestFlags.md | 23 +++++-- docs/lua_functions/SetQuestRepeatable.md | 17 +++-- docs/lua_functions/SetQuestTimer.md | 26 +++----- docs/lua_functions/SetQuestTimerComplete.md | 17 ++--- docs/lua_functions/SetRailID.md | 15 ++--- docs/lua_functions/SetServerVariable.md | 17 ++--- docs/lua_functions/SetSkillMaxValue.md | 18 +++-- docs/lua_functions/SetSkillValue.md | 18 +++-- docs/lua_functions/SetSpawnAnimation.md | 19 +++--- docs/lua_functions/SetSpeedMultiplier.md | 16 +++-- docs/lua_functions/SetSpellData.md | 24 ++++--- docs/lua_functions/SetSpellDataIndex.md | 33 +++++----- docs/lua_functions/SetSpellDisplayEffect.md | 30 +++++---- docs/lua_functions/SetSpellList.md | 27 +++++--- docs/lua_functions/SetSpellSnareValue.md | 21 +++--- docs/lua_functions/SetSpellTriggerCount.md | 22 ++++--- docs/lua_functions/SetStepFailed.md | 28 ++++---- docs/lua_functions/SetSuccessTimer.md | 15 ++--- docs/lua_functions/SetTempVariable.md | 26 ++++---- docs/lua_functions/SetTemporaryTransportID.md | 13 ++-- docs/lua_functions/SetTradeskillLevel.md | 20 ++++-- docs/lua_functions/SetTutorialStep.md | 19 ++++-- docs/lua_functions/SetVision.md | 21 +++--- docs/lua_functions/SetWorldTime.md | 17 ++--- docs/lua_functions/SetZoneExpansionFlag.md | 13 ++-- docs/lua_functions/SetZoneHolidayFlag.md | 13 ++-- docs/lua_functions/ShowLootWindow.md | 26 +++++--- docs/lua_functions/ShowWindow.md | 14 ++-- docs/lua_functions/SpawnByLocationID.md | 30 ++++++--- docs/lua_functions/SpawnGroupByID.md | 20 +++--- docs/lua_functions/StartAutoMount.md | 19 +++--- docs/lua_functions/StartHeroicOpportunity.md | 19 +++--- docs/lua_functions/StartTransmute.md | 14 ++-- docs/lua_functions/StopMovement.md | 11 ++-- docs/lua_functions/SummonCosmeticPet.md | 23 +++---- docs/lua_functions/SummonDeityPet.md | 29 +++++---- docs/lua_functions/SummonDumbFirePet.md | 37 ++++++----- docs/lua_functions/SummonPet.md | 29 ++++----- docs/lua_functions/ToggleFollow.md | 34 ++++++++-- docs/lua_functions/UseWidget.md | 13 ++-- 113 files changed, 1175 insertions(+), 1118 deletions(-) diff --git a/docs/lua_functions/CastCustomSpell.md b/docs/lua_functions/CastCustomSpell.md index 6470cb0..9204c1f 100644 --- a/docs/lua_functions/CastCustomSpell.md +++ b/docs/lua_functions/CastCustomSpell.md @@ -1,22 +1,27 @@ -### Function: CastCustomSpell(param1, param2, param3, param4, param5, param6, param7) +### Function: CastCustomSpell(spell, caster, target) **Description:** -Placeholder description. +Casts a custom spell that has been created through a Spell Script. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. -- `param5`: unknown - Unknown type. -- `param6`: Spawn - The spawn or entity involved. -- `param7`: Spawn - The spawn or entity involved. +- `spell` (Spell) - Spell object representing `spell`. +- `caster` (Spawn) - Spawn object representing `caster`. +- `target` (Spawn) - Spawn object representing `target`. **Returns:** None. **Example:** ```lua --- Example usage -CastCustomSpell(..., ..., ..., ..., ..., ..., ...) +-- From ItemScripts/AbbatoirCoffee.lua +function cast(Item, Player) + Spell = GetSpell(5463) + Regenz = 18.0 + newDuration = 180000 + SetSpellData(Spell, "duration1", newDuration) + SetSpellData(Spell, "duration2", newDuration) + SetSpellDataIndex(Spell, 0, Regenz) + SetSpellDisplayEffect(Spell, 0, "description", "Increases Out-of-Combat Power Regeneration of target by " .. Regenz) + CastCustomSpell(Spell, Player, Player) +end ``` diff --git a/docs/lua_functions/CastEntityCommand.md b/docs/lua_functions/CastEntityCommand.md index 7ea3814..5b70f76 100644 --- a/docs/lua_functions/CastEntityCommand.md +++ b/docs/lua_functions/CastEntityCommand.md @@ -1,24 +1,23 @@ -### Function: CastEntityCommand(param1, param2, param3, param4, param5, param6, param7, param8, param9) +### Function: CastEntityCommand(caster, target, id, command) **Description:** -Placeholder description. +Calls an Entity Command through LUA versus the player triggering it themselves. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. -- `param5`: unknown - Unknown type. -- `param6`: unknown - Unknown type. -- `param7`: Spawn - The spawn or entity involved. -- `param8`: int32 - Integer value. -- `param9`: string - String value. +- `caster` (Spawn) - Spawn object representing `caster`. +- `target` (Spawn) - Spawn object representing `target`. +- `id` (uint32) - Integer value `id`. +- `command` (string) - String `command`. **Returns:** None. **Example:** ```lua --- Example usage -CastEntityCommand(..., ..., ..., ..., ..., ..., ..., ..., ...) +-- From ItemScripts/AutomaticBook.lua +function obtained(Item, Spawn) + target = GetTarget(Spawn) + if target ~= nil then +-- CastEntityCommand(Spawn, target, 1, "Scribe") +end ``` diff --git a/docs/lua_functions/HasCollectionsToHandIn.md b/docs/lua_functions/HasCollectionsToHandIn.md index 20acec5..b2cbe76 100644 --- a/docs/lua_functions/HasCollectionsToHandIn.md +++ b/docs/lua_functions/HasCollectionsToHandIn.md @@ -1,16 +1,24 @@ -### Function: HasCollectionsToHandIn(param1) +### Function: HasCollectionsToHandIn(player) **Description:** -Placeholder description. +Return's if the player has collections to turn in. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. +- `player` (Spawn) - Spawn object representing `player`. -**Returns:** None. +**Returns:** Return's true if there is collections complete to turn in, otherwise false. **Example:** ```lua --- Example usage -HasCollectionsToHandIn(...) +-- From SpawnScripts/EastFreeport/RennyParvat.lua +function Dialog1(NPC, Spawn) + FaceTarget(NPC, Spawn) + Dialog.New(NPC, Spawn) + Dialog.AddDialog("This is a decent find, I suppose. I can give you a small reward for it.") + Dialog.AddOption("Thanks a lot.") + Dialog.Start() + if HasCollectionsToHandIn(Spawn) then + HandInCollections(Spawn) + end ``` diff --git a/docs/lua_functions/HasCompletedQuest.md b/docs/lua_functions/HasCompletedQuest.md index ac13405..fe85b09 100644 --- a/docs/lua_functions/HasCompletedQuest.md +++ b/docs/lua_functions/HasCompletedQuest.md @@ -1,17 +1,25 @@ -### Function: HasCompletedQuest(param1, param2) +### Function: HasCompletedQuest(player, quest_id) **Description:** -Placeholder description. +Return's true if the quest_id has been previously completed by the player. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: int32 - Integer value. +- `player` (Spawn) - Spawn object representing `player`. +- `quest_id` (uint32) - Integer value `quest_id`. -**Returns:** None. +**Returns:** If player has completed quest_id then return's true, otherwise false. **Example:** ```lua --- Example usage -HasCompletedQuest(..., ...) +-- From ItemScripts/abixieeye.lua +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 ``` diff --git a/docs/lua_functions/HasFreeSlot.md b/docs/lua_functions/HasFreeSlot.md index fbfa734..cb3492e 100644 --- a/docs/lua_functions/HasFreeSlot.md +++ b/docs/lua_functions/HasFreeSlot.md @@ -1,16 +1,13 @@ -### Function: HasFreeSlot(param1) +### Function: HasFreeSlot(player) **Description:** -Placeholder description. +Return's true if there is a free slot in player's inventory, otherwise false. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. +- `player` (Spawn) - Spawn object representing `player`. -**Returns:** None. +**Returns:** True if there is an open inventory slot for the Player, otherwise false. **Example:** -```lua --- Example usage -HasFreeSlot(...) -``` +Example Required diff --git a/docs/lua_functions/HasGroup.md b/docs/lua_functions/HasGroup.md index fb049e4..becf10e 100644 --- a/docs/lua_functions/HasGroup.md +++ b/docs/lua_functions/HasGroup.md @@ -1,17 +1,13 @@ -### Function: HasGroup(param1, param2) +### Function: HasGroup(spawn) **Description:** -Placeholder description. +Return's if the spawn is in a group. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. +- `spawn` (Spawn) - Spawn object representing `spawn`. -**Returns:** None. +**Returns:** True if the spawn is in a group, otherwise false. **Example:** -```lua --- Example usage -HasGroup(..., ...) -``` +Example Required diff --git a/docs/lua_functions/HasItemEquipped.md b/docs/lua_functions/HasItemEquipped.md index bf1d5f1..6217410 100644 --- a/docs/lua_functions/HasItemEquipped.md +++ b/docs/lua_functions/HasItemEquipped.md @@ -1,64 +1,21 @@ -### Function: HasItemEquipped(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11, param12, param13, param14, param15, param16, param17, param18, param19, param20, param21, param22, param23, param24, param25, param26, param27, param28, param29, param30, param31, param32, param33, param34, param35, param36, param37, param38, param39, param40, param41, param42, param43, param44, param45, param46, param47, param48, param49) +### Function: HasItemEquipped(player, item_id) **Description:** -Placeholder description. +Return's if the player has an item equipped with the item_id. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: Spawn - The spawn or entity involved. -- `param4`: unknown - Unknown type. -- `param5`: unknown - Unknown type. -- `param6`: unknown - Unknown type. -- `param7`: Spawn - The spawn or entity involved. -- `param8`: unknown - Unknown type. -- `param9`: unknown - Unknown type. -- `param10`: unknown - Unknown type. -- `param11`: Spawn - The spawn or entity involved. -- `param12`: unknown - Unknown type. -- `param13`: unknown - Unknown type. -- `param14`: unknown - Unknown type. -- `param15`: Spawn - The spawn or entity involved. -- `param16`: unknown - Unknown type. -- `param17`: unknown - Unknown type. -- `param18`: unknown - Unknown type. -- `param19`: Spawn - The spawn or entity involved. -- `param20`: unknown - Unknown type. -- `param21`: unknown - Unknown type. -- `param22`: unknown - Unknown type. -- `param23`: Spawn - The spawn or entity involved. -- `param24`: unknown - Unknown type. -- `param25`: unknown - Unknown type. -- `param26`: Spawn - The spawn or entity involved. -- `param27`: unknown - Unknown type. -- `param28`: unknown - Unknown type. -- `param29`: unknown - Unknown type. -- `param30`: int32 - Integer value. -- `param31`: int8 - Small integer or boolean flag. -- `param32`: int32 - Integer value. -- `param33`: int8 - Small integer or boolean flag. -- `param34`: int8 - Small integer or boolean flag. -- `param35`: int8 - Small integer or boolean flag. -- `param36`: int8 - Small integer or boolean flag. -- `param37`: int32 - Integer value. -- `param38`: int32 - Integer value. -- `param39`: Item - An item reference. -- `param40`: bool - Boolean value (true/false). -- `param41`: int16 - Short integer value. -- `param42`: int8 - Small integer or boolean flag. -- `param43`: int8 - Small integer or boolean flag. -- `param44`: int8 - Small integer or boolean flag. -- `param45`: int8 - Small integer or boolean flag. -- `param46`: int8 - Small integer or boolean flag. -- `param47`: int8 - Small integer or boolean flag. -- `param48`: int8 - Small integer or boolean flag. -- `param49`: int8 - Small integer or boolean flag. +- `player` (Spawn) - Spawn object representing `player`. +- `item_id` (uint32) - Integer value `item_id`. -**Returns:** None. +**Returns:** Return's true if the item_id is equipped on the player, otherwise false. **Example:** ```lua --- Example usage -HasItemEquipped(..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ...) +-- From ItemScripts/Griz.lua +function GrizChat2_1(Item, Spawn) + if GetQuestStep(Spawn, SometimesKnut) == 2 then + SetStepComplete(Spawn, SometimesKnut, 2) + AddSpawnAccess(GetSpawnByLocationID(Zone, 579551), Spawn) + end ``` diff --git a/docs/lua_functions/HasLanguage.md b/docs/lua_functions/HasLanguage.md index 90377df..c0a8acb 100644 --- a/docs/lua_functions/HasLanguage.md +++ b/docs/lua_functions/HasLanguage.md @@ -1,19 +1,21 @@ -### Function: HasLanguage(param1, param2, param3, param4) +### Function: HasLanguage(player, language_id) **Description:** -Placeholder description. +Return's true if the player has the language_id specified. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: int32 - Integer value. +- `player` (Spawn) - Spawn object representing `player`. +- `language_id` (uint32) - Integer value `language_id`. -**Returns:** None. +**Returns:** True if the language_id has been obtained by the player, otherwise false. **Example:** ```lua --- Example usage -HasLanguage(..., ..., ..., ...) +-- From ItemScripts/acarvedorcaxe.lua +function Dialog1(Item,Player) + conversation = CreateConversation() + if CanReceiveQuest(Player,AnAxesRevenge) then + AddConversationOption(conversation, "[Run your fingers over the markings]", "Dialog2") + end ``` diff --git a/docs/lua_functions/HasQuest.md b/docs/lua_functions/HasQuest.md index 18d7050..34de7c7 100644 --- a/docs/lua_functions/HasQuest.md +++ b/docs/lua_functions/HasQuest.md @@ -1,19 +1,20 @@ -### Function: HasQuest(param1, param2, param3, param4) +### Function: HasQuest(player, quest_id) **Description:** -Placeholder description. +Return's true if the player has the quest_id active in their journal. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: int32 - Integer value. +- `player` (Spawn) - Spawn object representing `player`. +- `quest_id` (uint32) - Integer value `quest_id`. -**Returns:** None. +**Returns:** Return's true if the player has an active quest (not completed/pending). **Example:** ```lua --- Example usage -HasQuest(..., ..., ..., ...) +-- From ItemScripts/abadlypolishedsteelkey.lua +function examined(Item, Player) +if not HasQuest(Player, Polishedsteelkey) then +OfferQuest(nil, Player, Polishedsteelkey) + end ``` diff --git a/docs/lua_functions/HasRecovered.md b/docs/lua_functions/HasRecovered.md index cf3af1d..b6a6ebc 100644 --- a/docs/lua_functions/HasRecovered.md +++ b/docs/lua_functions/HasRecovered.md @@ -1,18 +1,13 @@ -### Function: HasRecovered(param1, param2, param3) +### Function: HasRecovered(spawn) **Description:** -Placeholder description. +If the NPC has recovered from spell casting. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. +- `spawn` (Spawn) - Spawn object representing `spawn`. -**Returns:** None. +**Returns:** True if casting again is possible, otherwise false if inbetween cast recovery. **Example:** -```lua --- Example usage -HasRecovered(..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/HasSkill.md b/docs/lua_functions/HasSkill.md index e582db0..1d23ee3 100644 --- a/docs/lua_functions/HasSkill.md +++ b/docs/lua_functions/HasSkill.md @@ -1,17 +1,21 @@ -### Function: HasSkill(param1, param2) +### Function: HasSkill(player, skill_id) **Description:** -Placeholder description. +Return's true if the player has the skill_id specified **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: int32 - Integer value. +- `player` (Spawn) - Spawn object representing `player`. +- `skill_id` (uint32) - Integer value `skill_id`. -**Returns:** None. +**Returns:** True if the player has the skill_id, otherwise false. **Example:** ```lua --- Example usage -HasSkill(..., ...) +-- From ItemScripts/BardCertificationPapers.lua +function Class(Item, Player) + conversation = CreateConversation() + if CanReceiveQuest(Player,Quest) then + AddConversationOption(conversation, "[Turn in these papers for gear]","QuestStart") + end ``` diff --git a/docs/lua_functions/HasSpell.md b/docs/lua_functions/HasSpell.md index 7c2f205..a0eb845 100644 --- a/docs/lua_functions/HasSpell.md +++ b/docs/lua_functions/HasSpell.md @@ -1,18 +1,15 @@ -### Function: HasSpell(param1, param2, param3) +### Function: HasSpell(player, spellid, tier) **Description:** -Placeholder description. +Return's true if the player has the spellid specified of the tier. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: int32 - Integer value. -- `param3`: int16 - Short integer value. +- `player` (Spawn) - Spawn object representing `player`. +- `spellid` (uint32) - Integer value `spellid`. +- `tier` (uint16) - Integer value `tier`. -**Returns:** None. +**Returns:** Return's true if the player has the spell id with the tier (or higher tier). Otherwise false. **Example:** -```lua --- Example usage -HasSpell(..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/HasSpellEffect.md b/docs/lua_functions/HasSpellEffect.md index 12ec4dc..d5ff3b8 100644 --- a/docs/lua_functions/HasSpellEffect.md +++ b/docs/lua_functions/HasSpellEffect.md @@ -1,21 +1,21 @@ -### Function: HasSpellEffect(param1, param2, param3, param4, param5, param6) +### Function: HasSpellEffect(spawn, spellID, tier) **Description:** -Placeholder description. +Return's true if the spawn has an active spell effect with the spellid and tier specified. If tier is set to 0 all tiers apply. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. -- `param5`: int32 - Integer value. -- `param6`: int8 - Small integer or boolean flag. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `spellID` (uint32) - Integer value `spellID`. +- `tier` (uint8) - Integer value `tier`. -**Returns:** None. +**Returns:** True if spell effect is active on the spawn with spellid and tier (if tier is 0 then all tiers apply). Otherwise false. **Example:** ```lua --- Example usage -HasSpellEffect(..., ..., ..., ..., ..., ...) +-- From ItemScripts/aCourierCostume.lua +function unequipped(Item, Player) + if HasSpellEffect(Player, 5459, 1) then + CastSpell(Player, 5459, 1) +end ``` diff --git a/docs/lua_functions/HasSpellImmunity.md b/docs/lua_functions/HasSpellImmunity.md index 47dea11..483298d 100644 --- a/docs/lua_functions/HasSpellImmunity.md +++ b/docs/lua_functions/HasSpellImmunity.md @@ -1,19 +1,14 @@ -### Function: HasSpellImmunity(param1, param2, param3, param4) +### Function: HasSpellImmunity(spawn, type) **Description:** -Placeholder description. +Return's if the spawn has immunity to the spell type. See available types in https://github.com/emagi/eq2emu/blob/main/docs/data_types/immunity_types.md **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: int8 - Small integer or boolean flag. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `type` (uint8) - Integer value `type`. -**Returns:** None. +**Returns:** True if the spawn has immunity to spell type, otherwise false. **Example:** -```lua --- Example usage -HasSpellImmunity(..., ..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/IncreaseSkillCapsByType.md b/docs/lua_functions/IncreaseSkillCapsByType.md index 774fcde..75d39fa 100644 --- a/docs/lua_functions/IncreaseSkillCapsByType.md +++ b/docs/lua_functions/IncreaseSkillCapsByType.md @@ -1,21 +1,16 @@ -### Function: IncreaseSkillCapsByType(param1, param2, param3, param4, param5, param6) +### Function: IncreaseSkillCapsByType(player_spawn, skill_type, amount, more_to_increase) **Description:** -Placeholder description. +Increases all skill maximums by the skill_type. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: int8 - Small integer or boolean flag. -- `param5`: int8 - Small integer or boolean flag. -- `param6`: bool - Boolean value (true/false). +- `player_spawn` (Spawn) - Spawn object representing `player_spawn`. +- `skill_type` (uint8) - Integer value `skill_type`. +- `amount` (uint8) - Quantity `amount`. +- `more_to_increase` (bool) - Boolean flag `more_to_increase`. **Returns:** None. **Example:** -```lua --- Example usage -IncreaseSkillCapsByType(..., ..., ..., ..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/InstructionWindow.md b/docs/lua_functions/InstructionWindow.md index fa137e8..375720d 100644 --- a/docs/lua_functions/InstructionWindow.md +++ b/docs/lua_functions/InstructionWindow.md @@ -1,30 +1,30 @@ -### Function: InstructionWindow(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11, param12, param13, param14, param15) +### Function: InstructionWindow(player, duration, text, voice, voice_key1, voice_key2, signal, goal1, task1, goal2, task2, goal3, task3, goal4, task4) **Description:** -Placeholder description. +Provides an instruction window for the player. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: float - Floating point value. -- `param3`: string - String value. -- `param4`: string - String value. -- `param5`: int32 - Integer value. -- `param6`: int32 - Integer value. -- `param7`: string - String value. -- `param8`: string - String value. -- `param9`: string - String value. -- `param10`: string - String value. -- `param11`: string - String value. -- `param12`: string - String value. -- `param13`: string - String value. -- `param14`: string - String value. -- `param15`: string - String value. +- `player` (Spawn) - Spawn object representing `player`. +- `duration` (float) - Float value `duration`. +- `text` (string) - String `text`. +- `voice` (string) - String `voice`. +- `voice_key1` (uint32) - Integer value `voice_key1`. +- `voice_key2` (uint32) - Integer value `voice_key2`. +- `signal` (string) - String `signal`. +- `goal1` (string) - String `goal1`. +- `task1` (string) - String `task1`. +- `goal2` (string) - String `goal2`. +- `task2` (string) - String `task2`. +- `goal3` (string) - String `goal3`. +- `task3` (string) - String `task3`. +- `goal4` (string) - String `goal4`. +- `task4` (string) - String `task4`. **Returns:** None. **Example:** ```lua --- Example usage -InstructionWindow(..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ...) +-- From Quests/FarJourneyFreeport/TasksaboardtheFarJourney.lua + InstructionWindow(Player, -1.0, "The items are now in your inventory.", "voiceover/english/narrator/boat_06p_tutorial02/narrator_014_eaa89ef7.mp3", 361706387, 1106127199, "tutorial_stage_18", "", "continue") ``` diff --git a/docs/lua_functions/InstructionWindowClose.md b/docs/lua_functions/InstructionWindowClose.md index 0d8cad8..98895b8 100644 --- a/docs/lua_functions/InstructionWindowClose.md +++ b/docs/lua_functions/InstructionWindowClose.md @@ -1,16 +1,16 @@ -### Function: InstructionWindowClose(param1) +### Function: InstructionWindowClose(player) **Description:** -Placeholder description. +Disables / closes he instruction window previously provided. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. +- `player` (Spawn) - Spawn object representing `player`. **Returns:** None. **Example:** ```lua --- Example usage -InstructionWindowClose(...) +-- From Quests/FarJourneyFreeport/TasksaboardtheFarJourney.lua +InstructionWindowClose(Player) ``` diff --git a/docs/lua_functions/InstructionWindowGoal.md b/docs/lua_functions/InstructionWindowGoal.md index 4fb4001..f20b704 100644 --- a/docs/lua_functions/InstructionWindowGoal.md +++ b/docs/lua_functions/InstructionWindowGoal.md @@ -1,17 +1,23 @@ -### Function: InstructionWindowGoal(param1, param2) +### Function: InstructionWindowGoal(player, goal_num) **Description:** -Placeholder description. +Set's the players instruction window goal number. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: int8 - Small integer or boolean flag. +- `player` (Spawn) - Spawn object representing `player`. +- `goal_num` (uint8) - Quantity `goal_num`. **Returns:** None. **Example:** ```lua --- Example usage -InstructionWindowGoal(..., ...) +-- From SpawnScripts/FarJourneyFreeport/CaptainVarlos.lua +function hailed_instructions(NPC, player) + if needs_selection_help then + InstructionWindowGoal(player,0) + InstructionWindowClose(player) + InstructionWindow(player, -1.0, "To respond to the Captain and other characters you will meet, left click on the response text.", "voiceover/english/narrator/boat_06p_tutorial02/narrator_006_7521b625.mp3", 3936228257, 1877316160, "tutorial_stage_8", "Left click on one of the response options.", "server") + needs_selection_help = false + end ``` diff --git a/docs/lua_functions/IsBehind.md b/docs/lua_functions/IsBehind.md index 17925f7..8347381 100644 --- a/docs/lua_functions/IsBehind.md +++ b/docs/lua_functions/IsBehind.md @@ -1,20 +1,21 @@ -### Function: IsBehind(param1, param2, param3, param4, param5) +### Function: IsBehind(spawn, target) **Description:** -Placeholder description. +Return's true if Spawn is behind Target. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. -- `param5`: Spawn - The spawn or entity involved. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `target` (Spawn) - Spawn object representing `target`. -**Returns:** None. +**Returns:** True if Spawn is behind Target, otherwise False. **Example:** ```lua --- Example usage -IsBehind(..., ..., ..., ..., ...) +-- From Spells/CaskinsRingingSwipe.lua +function precast(Caster,Target) + if not IsFlanking(Caster, Target) and not IsBehind(Caster, Target) then + SendMessage(Caster, "Must be flanking or behind", "yellow") + return false + end ``` diff --git a/docs/lua_functions/IsCasting.md b/docs/lua_functions/IsCasting.md index ebe092e..7f91ede 100644 --- a/docs/lua_functions/IsCasting.md +++ b/docs/lua_functions/IsCasting.md @@ -1,18 +1,13 @@ -### Function: IsCasting(param1, param2, param3) +### Function: IsCasting(spawn) **Description:** -Placeholder description. +Return's true if the Spawn is casting. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. +- `spawn` (Spawn) - Spawn object representing `spawn`. -**Returns:** None. +**Returns:** True if the Spawn is casting, otherwise false. **Example:** -```lua --- Example usage -IsCasting(..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/IsEntity.md b/docs/lua_functions/IsEntity.md index 252cbf1..90964c1 100644 --- a/docs/lua_functions/IsEntity.md +++ b/docs/lua_functions/IsEntity.md @@ -1,17 +1,24 @@ -### Function: IsEntity(param1, param2) +### Function: IsEntity(spawn) **Description:** -Placeholder description. +Return's true if the Spawn is an entity (Player/NPC/Bot). **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. +- `spawn` (Spawn) - Spawn object representing `spawn`. -**Returns:** None. +**Returns:** True if the spawn is an entity, otherwise false. **Example:** ```lua --- Example usage -IsEntity(..., ...) +-- From ItemScripts/LaserGoggles.lua +function used(Item, Player) + local target = GetTarget(Player) + if target ~= nil and IsEntity(target) then + local encounter = GetEncounter(target) + if encounter ~= nil then + doDamage(Player, target, damage) + else + doDamage(Player, target, damage) + end ``` diff --git a/docs/lua_functions/IsFlanking.md b/docs/lua_functions/IsFlanking.md index c87e5a5..5f6c66d 100644 --- a/docs/lua_functions/IsFlanking.md +++ b/docs/lua_functions/IsFlanking.md @@ -1,20 +1,21 @@ -### Function: IsFlanking(param1, param2, param3, param4, param5) +### Function: IsFlanking(spawn, target) **Description:** -Placeholder description. +Return's true if Spawn is flanking Target. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. -- `param5`: Spawn - The spawn or entity involved. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `target` (Spawn) - Spawn object representing `target`. -**Returns:** None. +**Returns:** True if Spawn is flanking Target, otherwise false. **Example:** ```lua --- Example usage -IsFlanking(..., ..., ..., ..., ...) +-- From Spells/CaskinsRingingSwipe.lua +function precast(Caster,Target) + if not IsFlanking(Caster, Target) and not IsBehind(Caster, Target) then + SendMessage(Caster, "Must be flanking or behind", "yellow") + return false + end ``` diff --git a/docs/lua_functions/IsFollowing.md b/docs/lua_functions/IsFollowing.md index 3f1ec1a..2c1563e 100644 --- a/docs/lua_functions/IsFollowing.md +++ b/docs/lua_functions/IsFollowing.md @@ -1,17 +1,21 @@ -### Function: IsFollowing(param1, param2) +### Function: IsFollowing(spawn) **Description:** -Placeholder description. +Return's true if the spawn following is enabled. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. +- `spawn` (Spawn) - Spawn object representing `spawn`. -**Returns:** None. +**Returns:** True if the spawn following is enabled, otherwise false. **Example:** ```lua --- Example usage -IsFollowing(..., ...) +-- From SpawnScripts/BeggarsCourt/Ro.lua +function ResetFollow(NPC) + if IsFollowing(NPC) then + SetTarget(NPC,nil) + ToggleFollow(NPC) + AttackTimer = false +end ``` diff --git a/docs/lua_functions/IsGroundSpawn.md b/docs/lua_functions/IsGroundSpawn.md index 44b6d18..f859f9b 100644 --- a/docs/lua_functions/IsGroundSpawn.md +++ b/docs/lua_functions/IsGroundSpawn.md @@ -1,17 +1,19 @@ -### Function: IsGroundSpawn(param1, param2) +### Function: IsGroundSpawn(spawn) **Description:** -Placeholder description. +Return's true if the spawn is a ground spawn. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. +- `spawn` (Spawn) - Spawn object representing `spawn`. -**Returns:** None. +**Returns:** True if the spawn is the Ground Spawn, otherwise False. **Example:** ```lua --- Example usage -IsGroundSpawn(..., ...) +-- From Spells/Commoner/harvest.lua +function precast(Caster, Target) + if IsGroundSpawn(Target) then + return CanHarvest(Caster, Target) + end ``` diff --git a/docs/lua_functions/IsHeroic.md b/docs/lua_functions/IsHeroic.md index e6cca91..6a1ab58 100644 --- a/docs/lua_functions/IsHeroic.md +++ b/docs/lua_functions/IsHeroic.md @@ -1,17 +1,19 @@ -### Function: IsHeroic(param1, param2) +### Function: IsHeroic(spawn) **Description:** -Placeholder description. +Return's true if Spawn is heroic. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. +- `spawn` (Spawn) - Spawn object representing `spawn`. -**Returns:** None. +**Returns:** True if Spawn is heroic otherwise False. **Example:** ```lua --- Example usage -IsHeroic(..., ...) +-- From SpawnScripts/Antonica/adankfurgnoll.lua +function waypoints(NPC) + if IsHeroic(NPC) == false then + RandomMovement(NPC, Spawn, 8, -8, 2, 8, 15) + end ``` diff --git a/docs/lua_functions/IsInvulnerable.md b/docs/lua_functions/IsInvulnerable.md index 4eb120b..9ed8e68 100644 --- a/docs/lua_functions/IsInvulnerable.md +++ b/docs/lua_functions/IsInvulnerable.md @@ -1,16 +1,22 @@ -### Function: IsInvulnerable(param1) +### Function: IsInvulnerable(spawn) **Description:** -Placeholder description. +Return's true if spawn is set to invulnerable. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. +- `spawn` (Spawn) - Spawn object representing `spawn`. -**Returns:** None. +**Returns:** True if Spawn invulnerable otherwise false. **Example:** ```lua --- Example usage -IsInvulnerable(...) +-- From RegionScripts/exp04_dun_chardok/char_p10_crossbridge_pit01_region.lua +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 ``` diff --git a/docs/lua_functions/IsMezzed.md b/docs/lua_functions/IsMezzed.md index 6cec0bd..667be0f 100644 --- a/docs/lua_functions/IsMezzed.md +++ b/docs/lua_functions/IsMezzed.md @@ -1,18 +1,13 @@ -### Function: IsMezzed(param1, param2, param3) +### Function: IsMezzed(spawn) **Description:** -Placeholder description. +Return's true if Spawn is mesmerized. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. +- `spawn` (Spawn) - Spawn object representing `spawn`. -**Returns:** None. +**Returns:** True if Spawn is mesmerized, otherwise false. **Example:** -```lua --- Example usage -IsMezzed(..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/IsMezzedOrStunned.md b/docs/lua_functions/IsMezzedOrStunned.md index e157f02..2b51fb2 100644 --- a/docs/lua_functions/IsMezzedOrStunned.md +++ b/docs/lua_functions/IsMezzedOrStunned.md @@ -1,18 +1,13 @@ -### Function: IsMezzedOrStunned(param1, param2, param3) +### Function: IsMezzedOrStunned(spawn) **Description:** -Placeholder description. +Return's true if Spawn is mesmerized or stunned. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. +- `spawn` (Spawn) - Spawn object representing `spawn`. -**Returns:** None. +**Returns:** True if Spawn is mesmerized or stunned, otherwise false. **Example:** -```lua --- Example usage -IsMezzedOrStunned(..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/IsOnAutoMount.md b/docs/lua_functions/IsOnAutoMount.md index 5f00217..2ff939f 100644 --- a/docs/lua_functions/IsOnAutoMount.md +++ b/docs/lua_functions/IsOnAutoMount.md @@ -1,19 +1,19 @@ -### Function: IsOnAutoMount(param1, param2, param3, param4) +### Function: IsOnAutoMount(player) **Description:** -Placeholder description. +Return's true if Player is on a auto-mount (like griffon). **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. +- `player` (Spawn) - Spawn object representing `player`. -**Returns:** None. +**Returns:** True if Player is on auto mount, otherwise false. **Example:** ```lua --- Example usage -IsOnAutoMount(..., ..., ..., ...) +-- From ZoneScripts/Antonica.lua +function GriffonTower(Zone, Spawn) + if IsPlayer(Spawn) and IsOnAutoMount(Spawn) then + EndAutoMount(Spawn) + end ``` diff --git a/docs/lua_functions/IsRunning.md b/docs/lua_functions/IsRunning.md index bff1963..c3609dc 100644 --- a/docs/lua_functions/IsRunning.md +++ b/docs/lua_functions/IsRunning.md @@ -1,16 +1,13 @@ -### Function: IsRunning(param1) +### Function: IsRunning(spawn) **Description:** -Placeholder description. +Return's true if spawn is currently running **Parameters:** -- `param1`: Spawn - The spawn or entity involved. +- `spawn` (Spawn) - Spawn object representing `spawn`. -**Returns:** None. +**Returns:** True if Spawn is running, otherwise false. **Example:** -```lua --- Example usage -IsRunning(...) -``` +Example Required diff --git a/docs/lua_functions/IsStunned.md b/docs/lua_functions/IsStunned.md index 171f011..99861d4 100644 --- a/docs/lua_functions/IsStunned.md +++ b/docs/lua_functions/IsStunned.md @@ -1,18 +1,13 @@ -### Function: IsStunned(param1, param2, param3) +### Function: IsStunned(spawn) **Description:** -Placeholder description. +Return's true if spawn is stunned. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. +- `spawn` (Spawn) - Spawn object representing `spawn`. -**Returns:** None. +**Returns:** True if spawn is stunned, otherwise false. **Example:** -```lua --- Example usage -IsStunned(..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/IsZoneLoading.md b/docs/lua_functions/IsZoneLoading.md index caebfaa..dcaa07d 100644 --- a/docs/lua_functions/IsZoneLoading.md +++ b/docs/lua_functions/IsZoneLoading.md @@ -1,16 +1,13 @@ -### Function: IsZoneLoading(param1) +### Function: IsZoneLoading(zone) **Description:** -Placeholder description. +Return's true if zone is currently loading. **Parameters:** -- `param1`: ZoneServer - The zone object. +- `zone` (Zone) - Zone object representing `zone`. -**Returns:** None. +**Returns:** True if zone is loading, otherwise false. **Example:** -```lua --- Example usage -IsZoneLoading(...) -``` +Example Required diff --git a/docs/lua_functions/Knockback.md b/docs/lua_functions/Knockback.md index f651187..1c271e4 100644 --- a/docs/lua_functions/Knockback.md +++ b/docs/lua_functions/Knockback.md @@ -1,23 +1,23 @@ -### Function: Knockback(param1, param2, param3, param4, param5, param6, param7, param8) +### Function: Knockback(target_spawn, spawn, duration, vertical, horizontal, use_heading) **Description:** -Placeholder description. +Triggers a knockback on the target_spawn with spawn being the originator. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: Spawn - The spawn or entity involved. -- `param5`: int32 - Integer value. -- `param6`: float - Floating point value. -- `param7`: float - Floating point value. -- `param8`: int8 - Small integer or boolean flag. +- `target_spawn` (Spawn) - Spawn object representing `target_spawn`. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `duration` (uint32) - Time value `duration` in seconds. +- `vertical` (float) - Float value `vertical`. +- `horizontal` (float) - Float value `horizontal`. +- `use_heading` (uint8) - Integer value `use_heading`. **Returns:** None. **Example:** ```lua --- Example usage -Knockback(..., ..., ..., ..., ..., ..., ..., ...) +-- From SpawnScripts/houseofroachie/GnomishKnockbackDevice.lua +function examined(NPC, Spawn) + Knockback(NPC, Spawn, 10) +end ``` diff --git a/docs/lua_functions/LastSpellAttackHit.md b/docs/lua_functions/LastSpellAttackHit.md index 939f629..c2607e8 100644 --- a/docs/lua_functions/LastSpellAttackHit.md +++ b/docs/lua_functions/LastSpellAttackHit.md @@ -1,17 +1,22 @@ -### Function: LastSpellAttackHit(param1, param2) +### Function: LastSpellAttackHit() **Description:** -Placeholder description. +Return's true if the last spell attack was a successful hit. -**Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: unknown - Unknown type. +**Parameters:** None. -**Returns:** None. +**Returns:** True if the last hit was successful otherwise false. **Example:** ```lua --- Example usage -LastSpellAttackHit(..., ...) +-- From Spells/AA/NullifyingStaff.lua +function cast(Caster, Target, DmgType, MinVal, MaxVal, CombatMit, Arcane) + SpellDamage(Target, DmgType, MinVal, MaxVal) +--if LastSpellAttackHit() then +--AddSpellBonus(Target, 0, CombatMit) +--end + if LastSpellAttackHit() then + AddSpellBonus(Target, 203, Arcane) + end ``` diff --git a/docs/lua_functions/MakeRandomFloat.md b/docs/lua_functions/MakeRandomFloat.md index 3f77e60..9903f9e 100644 --- a/docs/lua_functions/MakeRandomFloat.md +++ b/docs/lua_functions/MakeRandomFloat.md @@ -1,17 +1,20 @@ -### Function: MakeRandomFloat(param1, param2) +### Function: MakeRandomFloat(min, max) **Description:** -Placeholder description. +Make a random float between min and max. **Parameters:** -- `param1`: float - Floating point value. -- `param2`: float - Floating point value. +- `min` (float) - Float value `min`. +- `max` (float) - Float value `max`. -**Returns:** None. +**Returns:** Float value between min and max. **Example:** ```lua --- Example usage -MakeRandomFloat(..., ...) +-- From Spells/Commoner/VerdantTrinity.lua +function cast(Caster, Target, Val1, Val2) + Percentage = MakeRandomFloat(Val1, Val2) + SpellHealPct("Heal", Percentage, false, false, Target, 2) +end ``` diff --git a/docs/lua_functions/ProcDamage.md b/docs/lua_functions/ProcDamage.md index bf58c48..f3ae71e 100644 --- a/docs/lua_functions/ProcDamage.md +++ b/docs/lua_functions/ProcDamage.md @@ -1,28 +1,26 @@ -### Function: ProcDamage(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11, param12, param13) +### Function: ProcDamage(caster, target, name, dmg_type, low_damage, high_damage, success_msg, effect_msg) **Description:** -Placeholder description. +Conduct proc damage against the target. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. -- `param5`: unknown - Unknown type. -- `param6`: unknown - Unknown type. -- `param7`: Spawn - The spawn or entity involved. -- `param8`: string - String value. -- `param9`: int8 - Small integer or boolean flag. -- `param10`: int32 - Integer value. -- `param11`: int32 - Integer value. -- `param12`: string - String value. -- `param13`: string - String value. +- `caster` (Spawn) - Spawn object representing `caster`. +- `target` (Spawn) - Spawn object representing `target`. +- `name` (string) - String `name`. +- `dmg_type` (uint8) - Integer value `dmg_type`. +- `low_damage` (uint32) - Integer value `low_damage`. +- `high_damage` (uint32) - Integer value `high_damage`. +- `success_msg` (string) - String `success_msg`. +- `effect_msg` (string) - String `effect_msg`. **Returns:** None. **Example:** ```lua --- Example usage -ProcDamage(..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ...) +-- From ItemScripts/LaserGoggles.lua +function doDamage(Player, Target, damage) + local damage = math.floor(((GetHP(Target) / 100) * 50) + GetHP(Target)) + ProcDamage(Player, Target, " Dev AE Slay", 4, damage) +end ``` diff --git a/docs/lua_functions/ProcessMelee.md b/docs/lua_functions/ProcessMelee.md index d4142bb..719143e 100644 --- a/docs/lua_functions/ProcessMelee.md +++ b/docs/lua_functions/ProcessMelee.md @@ -1,22 +1,15 @@ -### Function: ProcessMelee(param1, param2, param3, param4, param5, param6, param7) +### Function: ProcessMelee(spawn, target, distance) **Description:** -Placeholder description. +Send a LUA Brain process melee call for the Spawn against the Target based on the distance provided. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. -- `param5`: unknown - Unknown type. -- `param6`: Spawn - The spawn or entity involved. -- `param7`: float - Floating point value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `target` (Spawn) - Spawn object representing `target`. +- `distance` (float) - Float value `distance`. **Returns:** None. **Example:** -```lua --- Example usage -ProcessMelee(..., ..., ..., ..., ..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/ProcessSpell.md b/docs/lua_functions/ProcessSpell.md index 9a4c775..48b9624 100644 --- a/docs/lua_functions/ProcessSpell.md +++ b/docs/lua_functions/ProcessSpell.md @@ -1,22 +1,15 @@ -### Function: ProcessSpell(param1, param2, param3, param4, param5, param6, param7) +### Function: ProcessSpell(spawn, target, distance) **Description:** -Placeholder description. +Send a LUA Brain process spell call for the Spawn against the Target based on the distance provided. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. -- `param5`: unknown - Unknown type. -- `param6`: Spawn - The spawn or entity involved. -- `param7`: float - Floating point value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `target` (Spawn) - Spawn object representing `target`. +- `distance` (float) - Float value `distance`. -**Returns:** None. +**Returns:** True if successful, otherwise false. **Example:** -```lua --- Example usage -ProcessSpell(..., ..., ..., ..., ..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/RemoveIconValue.md b/docs/lua_functions/RemoveIconValue.md index d68929a..746e8f5 100644 --- a/docs/lua_functions/RemoveIconValue.md +++ b/docs/lua_functions/RemoveIconValue.md @@ -1,18 +1,14 @@ -### Function: RemoveIconValue(param1, param2, param3) +### Function: RemoveIconValue(spawn, value) **Description:** -Placeholder description. +Remove a visual icon value from the Spawn. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: int32 - Integer value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `value` (uint32) - Integer value `value`. **Returns:** None. **Example:** -```lua --- Example usage -RemoveIconValue(..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/RemoveImmunitySpell.md b/docs/lua_functions/RemoveImmunitySpell.md index f4223f6..56fc774 100644 --- a/docs/lua_functions/RemoveImmunitySpell.md +++ b/docs/lua_functions/RemoveImmunitySpell.md @@ -1,20 +1,19 @@ -### Function: RemoveImmunitySpell(param1, param2, param3, param4, param5) +### Function: RemoveImmunitySpell(type, spawn) **Description:** -Placeholder description. +Remove an immunity spell from the Spawn. See immunity types https://github.com/emagi/eq2emu/blob/main/docs/data_types/immunity_types.md **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: int8 - Small integer or boolean flag. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. -- `param5`: Spawn - The spawn or entity involved. +- `type` (uint8) - UInt8 value `type`. +- `spawn` (Spawn) - Spawn object representing `spawn`. **Returns:** None. **Example:** ```lua --- Example usage -RemoveImmunitySpell(..., ..., ..., ..., ...) +-- From Spells/AA/AdvanceWarning.lua +function remove(Caster, Target) + RemoveImmunitySpell(7, Target) +end ``` diff --git a/docs/lua_functions/RemoveInvis.md b/docs/lua_functions/RemoveInvis.md index 340fe69..1de3a23 100644 --- a/docs/lua_functions/RemoveInvis.md +++ b/docs/lua_functions/RemoveInvis.md @@ -1,18 +1,23 @@ -### Function: RemoveInvis(param1, param2, param3) +### Function: RemoveInvis(spawn) **Description:** -Placeholder description. +Remove invisible from the spawn. Spawn is optional, otherwise in a spell script applies to all spell targets. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. +- `spawn` (Spawn) - Spawn object representing `spawn`. **Returns:** None. **Example:** ```lua --- Example usage -RemoveInvis(..., ..., ...) +-- From SpawnScripts/Caves/acuriousrock.lua +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 ``` diff --git a/docs/lua_functions/RemoveProc.md b/docs/lua_functions/RemoveProc.md index eb05484..5717ada 100644 --- a/docs/lua_functions/RemoveProc.md +++ b/docs/lua_functions/RemoveProc.md @@ -1,21 +1,20 @@ -### Function: RemoveProc(param1, param2, param3, param4, param5, param6) +### Function: RemoveProc(spawn, item) **Description:** -Placeholder description. +Remove proc that was applied in a spell script or item script. Will apply to spawn unless item is not specified, then all spell targets are applicable. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. -- `param5`: unknown - Unknown type. -- `param6`: Item - An item reference. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `item` (Item) - Item object representing `item`. **Returns:** None. **Example:** ```lua --- Example usage -RemoveProc(..., ..., ..., ..., ..., ...) +-- From Spells/BastensRunesofSurety.lua +function remove(Caster, Target) + RemoveSpellBonus() + RemoveProc() +end ``` diff --git a/docs/lua_functions/RemoveQuestStep.md b/docs/lua_functions/RemoveQuestStep.md index ff16e90..8162039 100644 --- a/docs/lua_functions/RemoveQuestStep.md +++ b/docs/lua_functions/RemoveQuestStep.md @@ -1,23 +1,15 @@ -### Function: RemoveQuestStep(param1, param2, param3, param4, param5, param6, param7, param8) +### Function: RemoveQuestStep(player, quest, step) **Description:** -Placeholder description. +Remove a quest step from the Player's quest journal. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. -- `param5`: unknown - Unknown type. -- `param6`: unknown - Unknown type. -- `param7`: unknown - Unknown type. -- `param8`: int32 - Integer value. +- `player` (Spawn) - Spawn object representing `player`. +- `quest` (Quest) - Quest object representing `quest`. +- `step` (uint32) - Integer value `step`. **Returns:** None. **Example:** -```lua --- Example usage -RemoveQuestStep(..., ..., ..., ..., ..., ..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/RemoveSkill.md b/docs/lua_functions/RemoveSkill.md index 279f9dc..eb889cf 100644 --- a/docs/lua_functions/RemoveSkill.md +++ b/docs/lua_functions/RemoveSkill.md @@ -1,20 +1,20 @@ -### Function: RemoveSkill(param1, param2, param3, param4, param5) +### Function: RemoveSkill(player_spawn, skill_id, more_to_remove) **Description:** -Placeholder description. +Remove's the skill from the player's skill list. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: int32 - Integer value. -- `param5`: bool - Boolean value (true/false). +- `player_spawn` (Spawn) - Spawn object representing `player_spawn`. +- `skill_id` (uint32) - Integer value `skill_id`. +- `more_to_remove` (bool) - Boolean flag `more_to_remove`. **Returns:** None. **Example:** ```lua --- Example usage -RemoveSkill(..., ..., ..., ..., ...) +-- From ItemScripts/BardCertificationPapers.lua +if HasSkill(Player, 1408356869) then -- Martial/Fighter + RemoveSkill(Player, 1408356869) +end ``` diff --git a/docs/lua_functions/RemoveSpawnAccess.md b/docs/lua_functions/RemoveSpawnAccess.md index fd99502..70ecc06 100644 --- a/docs/lua_functions/RemoveSpawnAccess.md +++ b/docs/lua_functions/RemoveSpawnAccess.md @@ -1,19 +1,16 @@ -### Function: RemoveSpawnAccess(param1, param2, param3, param4) +### Function: RemoveSpawnAccess(Spawn, Player) **Description:** -Placeholder description. +Removes the Player from accessing the Spawn. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: Spawn - The spawn or entity involved. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `player` (Spawn) - Spawn object representing `player`. **Returns:** None. **Example:** ```lua --- Example usage -RemoveSpawnAccess(..., ..., ..., ...) +RemoveSpawnAccess(Spawn, Player) ``` diff --git a/docs/lua_functions/RemoveStealth.md b/docs/lua_functions/RemoveStealth.md index e327f72..d1c38b5 100644 --- a/docs/lua_functions/RemoveStealth.md +++ b/docs/lua_functions/RemoveStealth.md @@ -1,18 +1,23 @@ -### Function: RemoveStealth(param1, param2, param3) +### Function: RemoveStealth(spawn) **Description:** -Placeholder description. +Remove stealth from the spawn. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. +- `spawn` (Spawn) - Spawn object representing `spawn`. **Returns:** None. **Example:** ```lua --- Example usage -RemoveStealth(..., ..., ...) +-- From SpawnScripts/Caves/acuriousrock.lua +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 ``` diff --git a/docs/lua_functions/RemoveThreatTransfer.md b/docs/lua_functions/RemoveThreatTransfer.md index fd32c1e..95a1c91 100644 --- a/docs/lua_functions/RemoveThreatTransfer.md +++ b/docs/lua_functions/RemoveThreatTransfer.md @@ -1,21 +1,18 @@ -### Function: RemoveThreatTransfer(param1, param2, param3, param4, param5, param6) +### Function: RemoveThreatTransfer(spawn) **Description:** -Placeholder description. +Remove a threat transfer currently assigned to the Spawn, only inside a Spell Script. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. -- `param5`: unknown - Unknown type. -- `param6`: unknown - Unknown type. +- `spawn` (Spawn) - Spawn object representing `spawn`. **Returns:** None. **Example:** ```lua --- Example usage -RemoveThreatTransfer(..., ..., ..., ..., ..., ...) +-- From Spells/Fighter/Crusader/Paladin/Amends.lua +function remove(Caster, Target) + RemoveThreatTransfer(Caster) +end ``` diff --git a/docs/lua_functions/RemoveTriggerFromSpell.md b/docs/lua_functions/RemoveTriggerFromSpell.md index 99e1af1..7a63d0e 100644 --- a/docs/lua_functions/RemoveTriggerFromSpell.md +++ b/docs/lua_functions/RemoveTriggerFromSpell.md @@ -1,19 +1,19 @@ -### Function: RemoveTriggerFromSpell(param1, param2, param3, param4) +### Function: RemoveTriggerFromSpell(remove_count) **Description:** -Placeholder description. +Remove a spell trigger from the spell, must be ran inside Spell Script. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: int16 - Short integer value. +- `remove_count` (uint16) - Quantity `remove_count`. **Returns:** None. **Example:** ```lua --- Example usage -RemoveTriggerFromSpell(..., ..., ..., ...) +-- From Spells/Commoner/ArcaneEnlightenment.lua +function proc(Caster, Target, Type, Power, Triggers) + CastSpell(Caster, 2550391, 1) + RemoveTriggerFromSpell() +end ``` diff --git a/docs/lua_functions/RemoveWard.md b/docs/lua_functions/RemoveWard.md index 40885a2..6db35f7 100644 --- a/docs/lua_functions/RemoveWard.md +++ b/docs/lua_functions/RemoveWard.md @@ -1,25 +1,20 @@ -### Function: RemoveWard(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10) +### Function: RemoveWard() **Description:** -Placeholder description. +Remove Ward from spell targets, must be used in spell script. -**Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: Spawn - The spawn or entity involved. -- `param5`: unknown - Unknown type. -- `param6`: unknown - Unknown type. -- `param7`: unknown - Unknown type. -- `param8`: unknown - Unknown type. -- `param9`: unknown - Unknown type. -- `param10`: Spawn - The spawn or entity involved. +**Parameters:** None. **Returns:** None. **Example:** ```lua --- Example usage -RemoveWard(..., ..., ..., ..., ..., ..., ..., ..., ..., ...) +-- From Spells/Commoner/CarpetDjinnMaster.lua +function remove(Caster, Target) + RemoveSpellBonus(Caster) +RemoveWard() +SetMount(Caster, 0) + RemoveControlEffect(Caster, 12) +end ``` diff --git a/docs/lua_functions/ResetIllusion.md b/docs/lua_functions/ResetIllusion.md index 596890f..b357ac2 100644 --- a/docs/lua_functions/ResetIllusion.md +++ b/docs/lua_functions/ResetIllusion.md @@ -1,18 +1,18 @@ -### Function: ResetIllusion(param1, param2, param3) +### Function: ResetIllusion(spawn) **Description:** -Placeholder description. +Remove the current illusion from a spawn, the spawn parameter is optional, inside spell script resets all spell targets illusion. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. +- `spawn` (Spawn) - Spawn object representing `spawn`. **Returns:** None. **Example:** ```lua --- Example usage -ResetIllusion(..., ..., ...) +-- From Spells/Commoner/GenericGenderDisguise.lua +function remove(Caster, Target) + ResetIllusion(Target) +end ``` diff --git a/docs/lua_functions/ResetQuestStep.md b/docs/lua_functions/ResetQuestStep.md index 528da92..9e3a897 100644 --- a/docs/lua_functions/ResetQuestStep.md +++ b/docs/lua_functions/ResetQuestStep.md @@ -1,22 +1,16 @@ -### Function: ResetQuestStep(param1, param2, param3, param4, param5, param6, param7) +### Function: ResetQuestStep(quest, step, desc, task_group) **Description:** -Placeholder description. +Resets the progress on the quest step for the quest object. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. -- `param5`: int32 - Integer value. -- `param6`: string - String value. -- `param7`: string - String value. +- `quest` (Quest) - Quest object representing `quest`. +- `step` (uint32) - Integer value `step`. +- `desc` (string) - String `desc`. +- `task_group` (string) - String `task_group`. **Returns:** None. **Example:** -```lua --- Example usage -ResetQuestStep(..., ..., ..., ..., ..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/Resurrect.md b/docs/lua_functions/Resurrect.md index 798f258..7c5c0fd 100644 --- a/docs/lua_functions/Resurrect.md +++ b/docs/lua_functions/Resurrect.md @@ -1,27 +1,27 @@ -### Function: Resurrect(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11, param12) +### Function: Resurrect(hp_perc, power_perc, send_window, target, heal_name, crit_mod, no_calcs, revive_spell_id, revive_spell_tier) **Description:** -Placeholder description. +Resurrect the spell targets. **Parameters:** -- `param1`: float - Floating point value. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. -- `param5`: float - Floating point value. -- `param6`: int32 - Integer value. -- `param7`: Spawn - The spawn or entity involved. -- `param8`: string - String value. -- `param9`: int32 - Integer value. -- `param10`: int32 - Integer value. -- `param11`: int32 - Integer value. -- `param12`: int32 - Integer value. +- `hp_perc` (float) - Float value `hp_perc`. +- `power_perc` (float) - Float value `power_perc`. +- `send_window` (uint32) - Integer value `send_window`. +- `target` (Spawn) - Spawn object representing `target`. +- `heal_name` (string) - String `heal_name`. +- `crit_mod` (uint32) - Integer value `crit_mod`. +- `no_calcs` (uint32) - Integer value `no_calcs`. +- `revive_spell_id` (uint32) - Integer value `revive_spell_id`. +- `revive_spell_tier` (uint32) - Integer value `revive_spell_tier`. **Returns:** None. **Example:** ```lua --- Example usage -Resurrect(..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ...) +-- From Spells/Commoner/FavorofthePhoenix.lua +function cast(Caster, Target) +Resurrect(15, 15, 1) + Say(Caster, "Summoning Sickness not implemented.") +end ``` diff --git a/docs/lua_functions/SendOptionWindow.md b/docs/lua_functions/SendOptionWindow.md index dd4fc84..860eddd 100644 --- a/docs/lua_functions/SendOptionWindow.md +++ b/docs/lua_functions/SendOptionWindow.md @@ -1,20 +1,25 @@ -### Function: SendOptionWindow(param1, param2, param3, param4, param5) +### Function: SendOptionWindow(option_window, player, window_title, cancel_command) **Description:** -Placeholder description. +Send a option window with the previous option window arguments. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: unknown - Unknown type. -- `param3`: Spawn - The spawn or entity involved. -- `param4`: string - String value. -- `param5`: string - String value. +- `option_window` (OptionWindow) - OptionWindow object representing `option_window`. +- `player` (Spawn) - Spawn object representing `player`. +- `window_title` (string) - String `window_title`. +- `cancel_command` (string) - String `cancel_command`. **Returns:** None. **Example:** ```lua --- Example usage -SendOptionWindow(..., ..., ..., ..., ...) +-- From SpawnScripts/Generic/GenericCraftingTrainer.lua +function SendSecondaryChoice(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 ``` diff --git a/docs/lua_functions/SendTransporters.md b/docs/lua_functions/SendTransporters.md index 25d6fd9..7ede78b 100644 --- a/docs/lua_functions/SendTransporters.md +++ b/docs/lua_functions/SendTransporters.md @@ -1,19 +1,15 @@ -### Function: SendTransporters(param1, param2, param3, param4) +### Function: SendTransporters(spawn, player, transport_id) **Description:** -Placeholder description. +Send the transporters list to the Player from the Spawn with the transport_id. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: Spawn - The spawn or entity involved. -- `param3`: Spawn - The spawn or entity involved. -- `param4`: int32 - Integer value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `player` (Spawn) - Spawn object representing `player`. +- `transport_id` (uint32) - Integer value `transport_id`. **Returns:** None. **Example:** -```lua --- Example usage -SendTransporters(..., ..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/SetAAInfo.md b/docs/lua_functions/SetAAInfo.md index bfba6e5..4bae7e1 100644 --- a/docs/lua_functions/SetAAInfo.md +++ b/docs/lua_functions/SetAAInfo.md @@ -1,18 +1,15 @@ -### Function: SetAAInfo(param1, param2, param3) +### Function: SetAAInfo(spawn, type, value) **Description:** -Placeholder description. +Set's the AA Info type to the value. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: string - String value. -- `param3`: unknown - Unknown type. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `type` (string) - String `type`. +- `value` (int32) - Integer value `value`. **Returns:** None. **Example:** -```lua --- Example usage -SetAAInfo(..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/SetAlignment.md b/docs/lua_functions/SetAlignment.md index f6672e2..9cfdbe1 100644 --- a/docs/lua_functions/SetAlignment.md +++ b/docs/lua_functions/SetAlignment.md @@ -1,21 +1,19 @@ -### Function: SetAlignment(param1, param2, param3, param4, param5, param6) +### Function: SetAlignment(spawn, alignment) **Description:** -Placeholder description. +Sets the alignment of the Spawn to the value. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. -- `param5`: unknown - Unknown type. -- `param6`: unknown - Unknown type. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `alignment` (int32) - Integer value `alignment`. **Returns:** None. **Example:** ```lua --- Example usage -SetAlignment(..., ..., ..., ..., ..., ...) +-- From ItemScripts/ForgeryFreeportCitizenshipPapers.lua +if GetRace(Player) == 0 or GetRace(Player) == 3 or GetRace(Player) == 5 or GetRace(Player) == 6 or GetRace(Player) == 9 or GetRace(Player) == 11 or GetRace(Player) == 20 then +SetAlignment(Player, 2) +end ``` diff --git a/docs/lua_functions/SetBrainTick.md b/docs/lua_functions/SetBrainTick.md index 62f6660..402505e 100644 --- a/docs/lua_functions/SetBrainTick.md +++ b/docs/lua_functions/SetBrainTick.md @@ -1,20 +1,24 @@ -### Function: SetBrainTick(param1, param2, param3, param4, param5) +### Function: SetBrainTick(spawn, tick) **Description:** -Placeholder description. +Sets the Spawn's brain tick rate in milliseconds. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. -- `param5`: int16 - Short integer value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `tick` (uint16) - Integer value `tick`. **Returns:** None. **Example:** ```lua --- Example usage -SetBrainTick(..., ..., ..., ..., ...) +-- From SpawnScripts/GMHall/TrainingDummy.lua +function spawn(NPC) + -- set the calls to the ai to 10 mins as there is no ai + SetBrainTick(NPC, 600000) + SetLuaBrain(NPC) + + -- give the spawn a crap load of hp so we can't one hit kill + SetHP(NPC, 1000000) +end ``` diff --git a/docs/lua_functions/SetCharSheetChanged.md b/docs/lua_functions/SetCharSheetChanged.md index ea14513..500e182 100644 --- a/docs/lua_functions/SetCharSheetChanged.md +++ b/docs/lua_functions/SetCharSheetChanged.md @@ -1,18 +1,17 @@ -### Function: SetCharSheetChanged(param1, param2, param3) +### Function: SetCharSheetChanged(spawn, value) **Description:** -Placeholder description. +Set's that the character sheet was changed (usually set to true to update the client). **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: bool - Boolean value (true/false). +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `value` (bool) - Boolean flag `value`. **Returns:** None. **Example:** ```lua --- Example usage -SetCharSheetChanged(..., ..., ...) +-- From SpawnScripts/Generic/SpiritShard.lua +SetCharSheetChanged(Spawn, true) ``` diff --git a/docs/lua_functions/SetCharacterTitlePrefix.md b/docs/lua_functions/SetCharacterTitlePrefix.md index 9f834de..846e4ad 100644 --- a/docs/lua_functions/SetCharacterTitlePrefix.md +++ b/docs/lua_functions/SetCharacterTitlePrefix.md @@ -1,20 +1,23 @@ -### Function: SetCharacterTitlePrefix(param1, param2, param3, param4, param5) +### Function: SetCharacterTitlePrefix(spawn, titleName) **Description:** -Placeholder description. +Set's the character title prefix of the Spawn to the title name. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. -- `param5`: string - String value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `titleName` (string) - String `titleName`. **Returns:** None. **Example:** ```lua --- Example usage -SetCharacterTitlePrefix(..., ..., ..., ..., ...) +-- From SpawnScripts/IsleRefuge1/TitleBot.lua +function hailed(NPC, Spawn) + FaceTarget(NPC, Spawn) + AddMasterTitle("Lord", 1) -- create new title for all players, is prefix + AddCharacterTitle(Spawn, "Lord") -- add title to the current player + SetCharacterTitlePrefix(Spawn, "Lord") -- set the characters current prefix to the newly created title + +end ``` diff --git a/docs/lua_functions/SetCharacterTitleSuffix.md b/docs/lua_functions/SetCharacterTitleSuffix.md index 3af841e..dca337a 100644 --- a/docs/lua_functions/SetCharacterTitleSuffix.md +++ b/docs/lua_functions/SetCharacterTitleSuffix.md @@ -1,20 +1,14 @@ -### Function: SetCharacterTitleSuffix(param1, param2, param3, param4, param5) +### Function: SetCharacterTitleSuffix(spawn, titleName) **Description:** -Placeholder description. +Set's the character title suffix of the Spawn to the title name. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. -- `param5`: string - String value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `titleName` (string) - String `titleName`. **Returns:** None. **Example:** -```lua --- Example usage -SetCharacterTitleSuffix(..., ..., ..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/SetFailureTimer.md b/docs/lua_functions/SetFailureTimer.md index fa48c96..51bb0db 100644 --- a/docs/lua_functions/SetFailureTimer.md +++ b/docs/lua_functions/SetFailureTimer.md @@ -1,20 +1,18 @@ -### Function: SetFailureTimer(param1, param2, param3, param4, param5) +### Function: SetFailureTimer(spawn) **Description:** -Placeholder description. +Sets the failure timer on the Spawn for the current zone. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. -- `param5`: unknown - Unknown type. +- `spawn` (Spawn) - Spawn object representing `spawn`. **Returns:** None. **Example:** ```lua --- Example usage -SetFailureTimer(..., ..., ..., ..., ...) +-- From ZoneScripts/BloodSkullValleyExcavationSite.lua +function player_entry(zone, player) + SetFailureTimer(player) +end ``` diff --git a/docs/lua_functions/SetFollowTarget.md b/docs/lua_functions/SetFollowTarget.md index 41b857a..0455134 100644 --- a/docs/lua_functions/SetFollowTarget.md +++ b/docs/lua_functions/SetFollowTarget.md @@ -1,19 +1,41 @@ -### Function: SetFollowTarget(param1, param2, param3, param4) +### Function: SetFollowTarget(spawn, target, follow_distance) **Description:** -Placeholder description. +Set's the spawns follow target and the optional follow_distance. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: Spawn - The spawn or entity involved. -- `param4`: int32 - Integer value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `target` (Spawn) - Spawn object representing `target`. +- `follow_distance` (uint32) - Distance `follow_distance`. **Returns:** None. **Example:** ```lua --- Example usage -SetFollowTarget(..., ..., ..., ...) +-- From SpawnScripts/BeggarsCourt/arat.lua +function CatCheck(NPC,Spawn) + if IsAlive(NPC) then + AddTimer(NPC,MakeRandomInt(2000,4000),"CatCheck") + + local zone = GetZone(NPC) + local Cat = GetSpawnByLocationID(zone,402996) + if not IsInCombat(NPC) and Cat~= nil and not IsInCombat(Cat)then + local Distance = GetDistance(NPC,Cat,1) + if Distance <=5 then + Attack(Cat,NPC) + Attack(NPC,Cat) + local x = GetX(Cat) + local y = GetY(Cat) + local z = GetZ(Cat) + SetFollowTarget(Cat,NPC) + SetFollowTarget(NPC,Cat) + ToggleFollow(Cat) + ToggleFollow(NPC) + SetTarget(Cat,NPC) + FaceTarget(Cat,NPC) + FaceTarget(NPC,Cat) + PlayFlavor(NPC,"","","attack",0,0) + AddTimer(NPC,MakeRandomInt(2500,4500),"kill",1,Spawn) + end ``` diff --git a/docs/lua_functions/SetGridID.md b/docs/lua_functions/SetGridID.md index 4db2b62..9b3f80e 100644 --- a/docs/lua_functions/SetGridID.md +++ b/docs/lua_functions/SetGridID.md @@ -1,19 +1,20 @@ -### Function: SetGridID(param1, param2, param3, param4) +### Function: SetGridID(spawn, grid) **Description:** -Placeholder description. +Set's the grid id of the spawn. See /grid for more information on the grid id. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: int32 - Integer value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `grid` (uint32) - Integer value `grid`. **Returns:** None. **Example:** ```lua --- Example usage -SetGridID(..., ..., ..., ...) +-- From SpawnScripts/FallenGate/atormentedbattlemage_A.lua +function Change_Grid_A(NPC) + Say(NPC, "This is the Change_Grid_A function") + SetGridID(NPC, 3104458931) +end ``` diff --git a/docs/lua_functions/SetIllusion.md b/docs/lua_functions/SetIllusion.md index f524c7a..0835179 100644 --- a/docs/lua_functions/SetIllusion.md +++ b/docs/lua_functions/SetIllusion.md @@ -1,19 +1,22 @@ -### Function: SetIllusion(param1, param2, param3, param4) +### Function: SetIllusion(spawn, model) **Description:** -Placeholder description. +Sets the illusion of the Spawn to the model provided. See model ids by version on https://wiki.eq2emu.com/ReferenceLists **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: int16 - Short integer value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `model` (uint16) - Integer value `model`. **Returns:** None. **Example:** ```lua --- Example usage -SetIllusion(..., ..., ..., ...) +-- From Spells/Commoner/GenericGenderDisguise.lua +function cast(Caster, Target, Male, Female) + if GetGender(Spawn) == 1 then + SetIllusion(Target, Male) + else + SetIllusion(Target, Female) + end ``` diff --git a/docs/lua_functions/SetInCombat.md b/docs/lua_functions/SetInCombat.md index a8f3d5c..e255efa 100644 --- a/docs/lua_functions/SetInCombat.md +++ b/docs/lua_functions/SetInCombat.md @@ -1,19 +1,25 @@ -### Function: SetInCombat(param1, param2, param3, param4) +### Function: SetInCombat(spawn, val) **Description:** -Placeholder description. +Set's if the Spawn is in combat. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: bool - Boolean value (true/false). +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `val` (bool) - Boolean flag `val`. **Returns:** None. **Example:** ```lua --- Example usage -SetInCombat(..., ..., ..., ...) +-- From SpawnScripts/BrawlersDojo/afirstcircleadept.lua +function aggro(NPC,Spawn) + if GetTempVariable(NPC,"Reset")== nil then + else + ClearHate(NPC, Spawn) + SetInCombat(Spawn, false) + SetInCombat(NPC, false) + ClearEncounter(NPC) + SetTarget(Spawn,nil) + end ``` diff --git a/docs/lua_functions/SetInfoStructFloat.md b/docs/lua_functions/SetInfoStructFloat.md index a66b1a4..4fdd65a 100644 --- a/docs/lua_functions/SetInfoStructFloat.md +++ b/docs/lua_functions/SetInfoStructFloat.md @@ -1,19 +1,23 @@ -### Function: SetInfoStructFloat(param1, param2, param3, param4) +### Function: SetInfoStructFloat(spawn, field, value) **Description:** -Placeholder description. +Sets the float field to the value provided. See https://github.com/emagi/eq2emu/blob/main/docs/data_types/info_struct.md for field types. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: string - String value. -- `param4`: float - Floating point value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `field` (string) - String `field`. +- `value` (float) - Float value `value`. **Returns:** None. **Example:** ```lua --- Example usage -SetInfoStructFloat(..., ..., ..., ...) +-- From SpawnScripts/Generic/CombatModule.lua +function attributes(NPC, Spawn) + -- Calculate attributes + if level <= 4 then + baseStat = 19 else + baseStat = level + 15 + end ``` diff --git a/docs/lua_functions/SetInfoStructSInt.md b/docs/lua_functions/SetInfoStructSInt.md index e9d6014..1459219 100644 --- a/docs/lua_functions/SetInfoStructSInt.md +++ b/docs/lua_functions/SetInfoStructSInt.md @@ -1,19 +1,30 @@ -### Function: SetInfoStructSInt(param1, param2, param3, param4) +### Function: SetInfoStructSInt(spawn, field, value) **Description:** -Placeholder description. +Sets the signed integer field to the value provided. See https://github.com/emagi/eq2emu/blob/main/docs/data_types/info_struct.md for field types. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: string - String value. -- `param4`: sint64 - Large integer value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `field` (string) - String `field`. +- `value` (int64) - Integer value `value`. **Returns:** None. **Example:** ```lua --- Example usage -SetInfoStructSInt(..., ..., ..., ...) +-- From SpawnScripts/Antonica/Anguis.lua +function spawn(NPC) + dmgMod = math.floor(GetStr(NPC)/10) + HPRegenMod = math.floor(GetSta(NPC)/10) + PwRegenMod = math.floor(GetStr(NPC)/10) + SetInfoStructUInt(NPC, "override_primary_weapon", 1) + SetInfoStructUInt(NPC, "primary_weapon_damage_low", math.floor(205 + dmgMod)) + SetInfoStructUInt(NPC, "primary_weapon_damage_high", math.floor(355 + dmgMod)) + SetInfoStructUInt(NPC, "hp_regen_override", 1) + SetInfoStructSInt(NPC, "hp_regen", 125 + HPRegenMod) + SetInfoStructUInt(NPC, "pw_regen_override", 1) + SetInfoStructSInt(NPC, "pw_regen", 75 + PwRegenMod) + +end ``` diff --git a/docs/lua_functions/SetInfoStructString.md b/docs/lua_functions/SetInfoStructString.md index 27c1cbb..d7ea895 100644 --- a/docs/lua_functions/SetInfoStructString.md +++ b/docs/lua_functions/SetInfoStructString.md @@ -1,19 +1,22 @@ -### Function: SetInfoStructString(param1, param2, param3, param4) +### Function: SetInfoStructString(spawn, field, value) **Description:** -Placeholder description. +Sets the string field to the value provided. See https://github.com/emagi/eq2emu/blob/main/docs/data_types/info_struct.md for field types. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: string - String value. -- `param4`: string - String value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `field` (string) - String `field`. +- `value` (string) - String `value`. **Returns:** None. **Example:** ```lua --- Example usage -SetInfoStructString(..., ..., ..., ...) +-- From SpawnScripts/Antonica/anoverlandminer.lua +function spawn(NPC, Spawn) + NPCModule(NPC, Spawn) + dwarf(NPC) + SetInfoStructString(NPC, "action_state", "mining_digging") +end ``` diff --git a/docs/lua_functions/SetInfoStructUInt.md b/docs/lua_functions/SetInfoStructUInt.md index 4863cf8..7b3b963 100644 --- a/docs/lua_functions/SetInfoStructUInt.md +++ b/docs/lua_functions/SetInfoStructUInt.md @@ -1,19 +1,20 @@ -### Function: SetInfoStructUInt(param1, param2, param3, param4) +### Function: SetInfoStructUInt(spawn, field, value) **Description:** -Placeholder description. +Sets the unsigned integer field to the value provided. See https://github.com/emagi/eq2emu/blob/main/docs/data_types/info_struct.md for field types. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: string - String value. -- `param4`: unknown - Unknown type. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `field` (string) - String `field`. +- `value` (uint64) - Integer value `value`. **Returns:** None. **Example:** ```lua --- Example usage -SetInfoStructUInt(..., ..., ..., ...) +-- From ItemScripts/discordimbuedroughspunhexdoll.lua +function examined(Item, Player) +SetInfoStructUInt(Player, "status_points", 20000) +end ``` diff --git a/docs/lua_functions/SetItemCount.md b/docs/lua_functions/SetItemCount.md index 800edf3..f9f1774 100644 --- a/docs/lua_functions/SetItemCount.md +++ b/docs/lua_functions/SetItemCount.md @@ -1,23 +1,15 @@ -### Function: SetItemCount(param1, param2, param3, param4, param5, param6, param7, param8) +### Function: SetItemCount(item, owner, new_count) **Description:** -Placeholder description. +Set's the item count of the Item object. Only applicable to Player's. **Parameters:** -- `param1`: Item - An item reference. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. -- `param5`: unknown - Unknown type. -- `param6`: unknown - Unknown type. -- `param7`: Spawn - The spawn or entity involved. -- `param8`: int32 - Integer value. +- `item` (Item) - Item object representing `item`. +- `owner` (Spawn) - Spawn object representing `owner`. +- `new_count` (uint32) - Quantity `new_count`. **Returns:** None. **Example:** -```lua --- Example usage -SetItemCount(..., ..., ..., ..., ..., ..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/SetLuaBrain.md b/docs/lua_functions/SetLuaBrain.md index c9e8b5a..485599e 100644 --- a/docs/lua_functions/SetLuaBrain.md +++ b/docs/lua_functions/SetLuaBrain.md @@ -1,18 +1,23 @@ -### Function: SetLuaBrain(param1, param2, param3) +### Function: SetLuaBrain(spawn) **Description:** -Placeholder description. +Creates a new LUA Brain for the Spawn. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. +- `spawn` (Spawn) - Spawn object representing `spawn`. **Returns:** None. **Example:** ```lua --- Example usage -SetLuaBrain(..., ..., ...) +-- From SpawnScripts/GMHall/TrainingDummy.lua +function spawn(NPC) + -- set the calls to the ai to 10 mins as there is no ai + SetBrainTick(NPC, 600000) + SetLuaBrain(NPC) + + -- give the spawn a crap load of hp so we can't one hit kill + SetHP(NPC, 1000000) +end ``` diff --git a/docs/lua_functions/SetPlayerHistory.md b/docs/lua_functions/SetPlayerHistory.md index 2440d24..2d968c9 100644 --- a/docs/lua_functions/SetPlayerHistory.md +++ b/docs/lua_functions/SetPlayerHistory.md @@ -1,21 +1,21 @@ -### Function: SetPlayerHistory(param1, param2, param3, param4, param5, param6) +### Function: SetPlayerHistory(player, event_id, value, value2) **Description:** -Placeholder description. +Set's the players history to the value provided. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: int32 - Integer value. -- `param5`: int32 - Integer value. -- `param6`: int32 - Integer value. +- `player` (Spawn) - Spawn object representing `player`. +- `event_id` (uint32) - Integer value `event_id`. +- `value` (uint32) - Integer value `value`. +- `value2` (uint32) - Integer value `value2`. **Returns:** None. **Example:** ```lua --- Example usage -SetPlayerHistory(..., ..., ..., ..., ..., ...) +-- From Quests/Antonica/hunters_manifest.lua +function Accepted(Quest, QuestGiver, Player) +SetPlayerHistory(Player, 8, 1) +end ``` diff --git a/docs/lua_functions/SetQuestFeatherColor.md b/docs/lua_functions/SetQuestFeatherColor.md index 2c39238..638f85a 100644 --- a/docs/lua_functions/SetQuestFeatherColor.md +++ b/docs/lua_functions/SetQuestFeatherColor.md @@ -1,18 +1,22 @@ -### Function: SetQuestFeatherColor(param1, param2, param3) +### Function: SetQuestFeatherColor(quest, feather_color) **Description:** -Placeholder description. +Set's the feather color of the quest. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: unknown - Unknown type. -- `param3`: int8 - Small integer or boolean flag. +- `quest` (Quest) - Quest object representing `quest`. +- `feather_color` (uint8) - Integer value `feather_color`. **Returns:** None. **Example:** ```lua --- Example usage -SetQuestFeatherColor(..., ..., ...) +-- From Quests/Antonica/a_brass_key.lua +function Init(Quest) + SetQuestFeatherColor(Quest, 3) + SetQuestRepeatable(Quest) + AddQuestStep(Quest, 1, "From the looks of the key and the tag, it would be safe to assume that this key can be used at a lighthouse of sorts.", 1, 100, "I need to find out what lighthouse this key goes to. The trek maybe dangerous, so I should take other hearty adventurers with me. From the looks of the key and the tag, it would be safe to assume that this key can be used at a lighthouse of sorts.", 2176) + AddQuestStepCompleteAction(Quest, 1, "QuestComplete") +end ``` diff --git a/docs/lua_functions/SetQuestFlags.md b/docs/lua_functions/SetQuestFlags.md index a3c1762..77f821b 100644 --- a/docs/lua_functions/SetQuestFlags.md +++ b/docs/lua_functions/SetQuestFlags.md @@ -1,18 +1,27 @@ -### Function: SetQuestFlags(param1, param2, param3) +### Function: SetQuestFlags(quest, flags) **Description:** -Placeholder description. +Sets the quest flags for the quest object. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: unknown - Unknown type. -- `param3`: int32 - Integer value. +- `quest` (Quest) - Quest object representing `quest`. +- `flags` (uint32) - Integer value `flags`. **Returns:** None. **Example:** ```lua --- Example usage -SetQuestFlags(..., ..., ...) +-- From Quests/EnchantedLands/HelpingSarmaSingebellows.lua +function Accepted(Quest, QuestGiver, Player) + + if GetTempVariable(Player, "HelpingSarmaSingebellows") == "true" then + PlayFlavor(NPC, "voiceover/english/sarma_singebellows/enchanted/sarma_singebellows002.mp3", "", "", 2943069626, 2445316031, Spawn) + AddConversationOption(conversation, "I shall return when they are destroyed.") + StartConversation(conversation, NPC, Spawn, "Excellent! You worked hard to kill all of those goblins, but we need to make sure they don't regain their foothold.") + else + PlayFlavor(NPC, "voiceover/english/sarma_singebellows/enchanted/sarma_singebellows002.mp3", "", "", 2943069626, 2445316031, Spawn) + AddConversationOption(conversation, "As you wish.") + StartConversation(conversation, NPC, Spawn, "Excellent! Goblins are tainting the water and withering the trees at a watermill by a nearby lake. I want you to destroy as many of them as you can!") + end ``` diff --git a/docs/lua_functions/SetQuestRepeatable.md b/docs/lua_functions/SetQuestRepeatable.md index f84e1f5..c407a7c 100644 --- a/docs/lua_functions/SetQuestRepeatable.md +++ b/docs/lua_functions/SetQuestRepeatable.md @@ -1,17 +1,22 @@ -### Function: SetQuestRepeatable(param1, param2) +### Function: SetQuestRepeatable(quest) **Description:** -Placeholder description. +Set's if the quest is repeatable. + **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: unknown - Unknown type. +- `quest` (Quest) - Quest object representing `quest`. **Returns:** None. **Example:** ```lua --- Example usage -SetQuestRepeatable(..., ...) +-- From Quests/Antonica/a_brass_key.lua +function Init(Quest) + SetQuestFeatherColor(Quest, 3) + SetQuestRepeatable(Quest) + AddQuestStep(Quest, 1, "From the looks of the key and the tag, it would be safe to assume that this key can be used at a lighthouse of sorts.", 1, 100, "I need to find out what lighthouse this key goes to. The trek maybe dangerous, so I should take other hearty adventurers with me. From the looks of the key and the tag, it would be safe to assume that this key can be used at a lighthouse of sorts.", 2176) + AddQuestStepCompleteAction(Quest, 1, "QuestComplete") +end ``` diff --git a/docs/lua_functions/SetQuestTimer.md b/docs/lua_functions/SetQuestTimer.md index 6736e98..fa483d6 100644 --- a/docs/lua_functions/SetQuestTimer.md +++ b/docs/lua_functions/SetQuestTimer.md @@ -1,27 +1,17 @@ -### Function: SetQuestTimer(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11, param12) +### Function: SetQuestTimer(quest, player, step, duration, action) **Description:** -Placeholder description. +Set's the player's quest timer and result action function. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. -- `param5`: unknown - Unknown type. -- `param6`: unknown - Unknown type. -- `param7`: unknown - Unknown type. -- `param8`: unknown - Unknown type. -- `param9`: Spawn - The spawn or entity involved. -- `param10`: int32 - Integer value. -- `param11`: int32 - Integer value. -- `param12`: string - String value. +- `quest` (Quest) - Quest object representing `quest`. +- `player` (Spawn) - Spawn object representing `player`. +- `step` (uint32) - Integer value `step`. +- `duration` (uint32) - Time value `duration` in seconds. +- `action` (string) - String `action`. **Returns:** None. **Example:** -```lua --- Example usage -SetQuestTimer(..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/SetQuestTimerComplete.md b/docs/lua_functions/SetQuestTimerComplete.md index c5e30fb..54f9bf2 100644 --- a/docs/lua_functions/SetQuestTimerComplete.md +++ b/docs/lua_functions/SetQuestTimerComplete.md @@ -1,21 +1,14 @@ -### Function: SetQuestTimerComplete(param1, param2, param3, param4, param5, param6) +### Function: SetQuestTimerComplete(quest, player) **Description:** -Placeholder description. +Set's the quest timer as complete for the player. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. -- `param5`: unknown - Unknown type. -- `param6`: Spawn - The spawn or entity involved. +- `quest` (Quest) - Quest object representing `quest`. +- `player` (Spawn) - Spawn object representing `player`. **Returns:** None. **Example:** -```lua --- Example usage -SetQuestTimerComplete(..., ..., ..., ..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/SetRailID.md b/docs/lua_functions/SetRailID.md index 5d26340..3a9b64f 100644 --- a/docs/lua_functions/SetRailID.md +++ b/docs/lua_functions/SetRailID.md @@ -1,19 +1,14 @@ -### Function: SetRailID(param1, param2, param3, param4) +### Function: SetRailID(spawn, rail_id) **Description:** -Placeholder description. +Set's the rail id of the spawn. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: sint64 - Large integer value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `rail_id` (int64) - Integer value `rail_id`. **Returns:** None. **Example:** -```lua --- Example usage -SetRailID(..., ..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/SetServerVariable.md b/docs/lua_functions/SetServerVariable.md index 57a6b78..1bd89eb 100644 --- a/docs/lua_functions/SetServerVariable.md +++ b/docs/lua_functions/SetServerVariable.md @@ -1,20 +1,15 @@ -### Function: SetServerVariable(param1, param2, param3, param4, param5) +### Function: SetServerVariable(name, value, comment) **Description:** -Placeholder description. +Set's the server variable to the value provided. **Parameters:** -- `param1`: string - String value. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: string - String value. -- `param5`: string - String value. +- `name` (string) - String `name`. +- `value` (string) - String `value`. +- `comment` (string) - String `comment`. **Returns:** None. **Example:** -```lua --- Example usage -SetServerVariable(..., ..., ..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/SetSkillMaxValue.md b/docs/lua_functions/SetSkillMaxValue.md index d1799c7..a2a0dad 100644 --- a/docs/lua_functions/SetSkillMaxValue.md +++ b/docs/lua_functions/SetSkillMaxValue.md @@ -1,18 +1,22 @@ -### Function: SetSkillMaxValue(param1, param2, param3) +### Function: SetSkillMaxValue(skill, value) **Description:** -Placeholder description. +Set's the maximum skill value for the skill object. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: unknown - Unknown type. -- `param3`: int16 - Short integer value. +- `skill` (int32) - Integer value `skill`. +- `value` (uint16) - Integer value `value`. **Returns:** None. **Example:** ```lua --- Example usage -SetSkillMaxValue(..., ..., ...) +-- From SpawnScripts/DarkBargainers/SasitSoroth.lua +function MaxGathering(NPC, Spawn) + local skill = GetSkill(Spawn, "Gathering") + if skill ~= nil then + SetSkillMaxValue(skill, 300) + SetSkillValue(skill, 300) + end ``` diff --git a/docs/lua_functions/SetSkillValue.md b/docs/lua_functions/SetSkillValue.md index d83b78f..2023355 100644 --- a/docs/lua_functions/SetSkillValue.md +++ b/docs/lua_functions/SetSkillValue.md @@ -1,18 +1,22 @@ -### Function: SetSkillValue(param1, param2, param3) +### Function: SetSkillValue(skill, value) **Description:** -Placeholder description. +Set's the current skill value for the skill object. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: unknown - Unknown type. -- `param3`: int16 - Short integer value. +- `skill` (int32) - Integer value `skill`. +- `value` (uint16) - Integer value `value`. **Returns:** None. **Example:** ```lua --- Example usage -SetSkillValue(..., ..., ...) +-- From SpawnScripts/DarkBargainers/SasitSoroth.lua +function MaxGathering(NPC, Spawn) + local skill = GetSkill(Spawn, "Gathering") + if skill ~= nil then + SetSkillMaxValue(skill, 300) + SetSkillValue(skill, 300) + end ``` diff --git a/docs/lua_functions/SetSpawnAnimation.md b/docs/lua_functions/SetSpawnAnimation.md index 4eb51a1..b61e91c 100644 --- a/docs/lua_functions/SetSpawnAnimation.md +++ b/docs/lua_functions/SetSpawnAnimation.md @@ -1,20 +1,21 @@ -### Function: SetSpawnAnimation(param1, param2, param3, param4, param5) +### Function: SetSpawnAnimation(spawn, anim_id, leeway) **Description:** -Placeholder description. +Set's the spawn animation of the spawn, leeway adds a delay in milliseconds. See appearance id's at https://wiki.eq2emu.com/ReferenceLists for animation ids. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: int32 - Integer value. -- `param5`: int16 - Short integer value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `anim_id` (uint32) - Integer value `anim_id`. +- `leeway` (uint16) - Integer value `leeway`. **Returns:** None. **Example:** ```lua --- Example usage -SetSpawnAnimation(..., ..., ..., ..., ...) +-- From SpawnScripts/Antonica/anearthcrawler.lua +function spawn(NPC, Spawn) + NPCModule(NPC, Spawn) + SetSpawnAnimation(NPC, 13016) +end ``` diff --git a/docs/lua_functions/SetSpeedMultiplier.md b/docs/lua_functions/SetSpeedMultiplier.md index 6d6455b..51f1b5b 100644 --- a/docs/lua_functions/SetSpeedMultiplier.md +++ b/docs/lua_functions/SetSpeedMultiplier.md @@ -1,18 +1,20 @@ -### Function: SetSpeedMultiplier(param1, param2, param3) +### Function: SetSpeedMultiplier(spawn, val) **Description:** -Placeholder description. +Set's the speed multiplier of the spell. Must be in a spell script. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: float - Floating point value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `val` (float) - Float value `val`. **Returns:** None. **Example:** ```lua --- Example usage -SetSpeedMultiplier(..., ..., ...) +-- From SpawnScripts/Nektropos1/ArchfiendIzzoroth.lua +function spawn(NPC) + SetSpeedMultiplier(NPC, 0) + AddTimer(NPC, 6000, "MakeAttackable") +end ``` diff --git a/docs/lua_functions/SetSpellData.md b/docs/lua_functions/SetSpellData.md index db35503..883ca59 100644 --- a/docs/lua_functions/SetSpellData.md +++ b/docs/lua_functions/SetSpellData.md @@ -1,19 +1,27 @@ -### Function: SetSpellData(param1, param2, param3, param4) +### Function: SetSpellData(spell, field, fieldvalue) **Description:** -Placeholder description. +Set's the spell data value **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: string - String value. +- `spell` (Spell) - Spell object representing `spell`. +- `field` (string) - String `field`. +- `fieldvalue` (value) - `fieldvalue`. **Returns:** None. **Example:** ```lua --- Example usage -SetSpellData(..., ..., ..., ...) +-- From ItemScripts/AbbatoirCoffee.lua +function cast(Item, Player) + Spell = GetSpell(5463) + Regenz = 18.0 + newDuration = 180000 + SetSpellData(Spell, "duration1", newDuration) + SetSpellData(Spell, "duration2", newDuration) + SetSpellDataIndex(Spell, 0, Regenz) + SetSpellDisplayEffect(Spell, 0, "description", "Increases Out-of-Combat Power Regeneration of target by " .. Regenz) + CastCustomSpell(Spell, Player, Player) +end ``` diff --git a/docs/lua_functions/SetSpellDataIndex.md b/docs/lua_functions/SetSpellDataIndex.md index c9731bd..26854f7 100644 --- a/docs/lua_functions/SetSpellDataIndex.md +++ b/docs/lua_functions/SetSpellDataIndex.md @@ -1,27 +1,28 @@ -### Function: SetSpellDataIndex(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11, param12) +### Function: SetSpellDataIndex(spell, idx, value, value2) **Description:** -Placeholder description. +Set's the spell data index value **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. -- `param5`: int32 - Integer value. -- `param6`: unknown - Unknown type. -- `param7`: float - Floating point value. -- `param8`: bool - Boolean value (true/false). -- `param9`: string - String value. -- `param10`: unknown - Unknown type. -- `param11`: float - Floating point value. -- `param12`: string - String value. +- `spell` (Spell) - Spell object representing `spell`. +- `idx` (uint32) - Integer value `idx`. +- `value` (int32) - Integer value `value`. +- `value2` (int32) - Integer value `value2`. **Returns:** None. **Example:** ```lua --- Example usage -SetSpellDataIndex(..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ...) +-- From ItemScripts/AbbatoirCoffee.lua +function cast(Item, Player) + Spell = GetSpell(5463) + Regenz = 18.0 + newDuration = 180000 + SetSpellData(Spell, "duration1", newDuration) + SetSpellData(Spell, "duration2", newDuration) + SetSpellDataIndex(Spell, 0, Regenz) + SetSpellDisplayEffect(Spell, 0, "description", "Increases Out-of-Combat Power Regeneration of target by " .. Regenz) + CastCustomSpell(Spell, Player, Player) +end ``` diff --git a/docs/lua_functions/SetSpellDisplayEffect.md b/docs/lua_functions/SetSpellDisplayEffect.md index 0b25819..f490316 100644 --- a/docs/lua_functions/SetSpellDisplayEffect.md +++ b/docs/lua_functions/SetSpellDisplayEffect.md @@ -1,24 +1,28 @@ -### Function: SetSpellDisplayEffect(param1, param2, param3, param4, param5, param6, param7, param8, param9) +### Function: SetSpellDisplayEffect(spell, idx, field, percentage) **Description:** -Placeholder description. +Set's the spell display effect value. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. -- `param5`: int32 - Integer value. -- `param6`: string - String value. -- `param7`: string - String value. -- `param8`: int8 - Small integer or boolean flag. -- `param9`: int8 - Small integer or boolean flag. +- `spell` (Spell) - Spell object representing `spell`. +- `idx` (uint32) - Integer value `idx`. +- `field` (string) - String `field`. +- `percentage` (uint8) - Integer value `percentage`. **Returns:** None. **Example:** ```lua --- Example usage -SetSpellDisplayEffect(..., ..., ..., ..., ..., ..., ..., ..., ...) +-- From ItemScripts/AbbatoirCoffee.lua +function cast(Item, Player) + Spell = GetSpell(5463) + Regenz = 18.0 + newDuration = 180000 + SetSpellData(Spell, "duration1", newDuration) + SetSpellData(Spell, "duration2", newDuration) + SetSpellDataIndex(Spell, 0, Regenz) + SetSpellDisplayEffect(Spell, 0, "description", "Increases Out-of-Combat Power Regeneration of target by " .. Regenz) + CastCustomSpell(Spell, Player, Player) +end ``` diff --git a/docs/lua_functions/SetSpellList.md b/docs/lua_functions/SetSpellList.md index 8f57dd1..a282894 100644 --- a/docs/lua_functions/SetSpellList.md +++ b/docs/lua_functions/SetSpellList.md @@ -1,19 +1,30 @@ -### Function: SetSpellList(param1, param2, param3, param4) +### Function: SetSpellList(spawn, primary_list, secondary_list) **Description:** -Placeholder description. +Set the spell list of the Spawn for primary and secondary list. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: int32 - Integer value. -- `param4`: int32 - Integer value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `primary_list` (uint32) - Integer value `primary_list`. +- `secondary_list` (uint32) - Integer value `secondary_list`. **Returns:** None. **Example:** ```lua --- Example usage -SetSpellList(..., ..., ..., ...) +-- From SpawnScripts/Antonica/abloodsaberseditionist.lua +function ChooseClass(NPC) + SetClass = MakeRandomInt(1,2) + if SetClass == 1 then + SpawnSet(NPC,"class", 2) + SetSpellList(NPC, 451) + IdleAggressive(NPC) + DervishChain(NPC) + elseif SetClass == 2 then + SpawnSet(NPC, "class", 32) + SetSpellList(NPC, 469) + IdleAlert(NPC) + DervishLeather(NPC) + end ``` diff --git a/docs/lua_functions/SetSpellSnareValue.md b/docs/lua_functions/SetSpellSnareValue.md index 7bdd663..865851f 100644 --- a/docs/lua_functions/SetSpellSnareValue.md +++ b/docs/lua_functions/SetSpellSnareValue.md @@ -1,19 +1,24 @@ -### Function: SetSpellSnareValue(param1, param2, param3, param4) +### Function: SetSpellSnareValue(snare, spawn) **Description:** -Placeholder description. +Set's the spell snare value of the current spell script. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: float - Floating point value. -- `param3`: unknown - Unknown type. -- `param4`: Spawn - The spawn or entity involved. +- `snare` (float) - Float value `snare`. +- `spawn` (Spawn) - Spawn object representing `spawn`. **Returns:** None. **Example:** ```lua --- Example usage -SetSpellSnareValue(..., ..., ..., ...) +-- From Spells/Commoner/Blind.lua +function cast(Caster, Target, Snare) + if not IsEpic(Target) then + --Dazes the target + AddControlEffect(Target, 3) + BlurVision(Target, 1.0) + SetSpellSnareValue(Target, Snare) + AddControlEffect(Target, 11) + end ``` diff --git a/docs/lua_functions/SetSpellTriggerCount.md b/docs/lua_functions/SetSpellTriggerCount.md index 9fa86d6..547c2c4 100644 --- a/docs/lua_functions/SetSpellTriggerCount.md +++ b/docs/lua_functions/SetSpellTriggerCount.md @@ -1,20 +1,24 @@ -### Function: SetSpellTriggerCount(param1, param2, param3, param4, param5) +### Function: SetSpellTriggerCount(trigger_count, cancel_after_triggers) **Description:** -Placeholder description. +Set's the spell trigger count in a spell script, cancel_after_triggers set to 1 will remove spell after. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: unknown - Unknown type. -- `param3`: int16 - Short integer value. -- `param4`: unknown - Unknown type. -- `param5`: int8 - Small integer or boolean flag. +- `trigger_count` (uint16) - uint16 value `trigger_count`. +- `cancel_after_triggers` (uint8) - uint8 value `cancel_after_triggers`. **Returns:** None. **Example:** ```lua --- Example usage -SetSpellTriggerCount(..., ..., ..., ..., ...) +-- From Spells/Commoner/ArcaneEnlightenment.lua +function cast(Caster, Target, Power, Triggers) + MaxPow = GetMaxPower(Caster) + PowHeal = math.floor(MaxPow * 0.2) + SpellHeal("Power", PowHeal, PowHeal, Caster) + + AddProc(Caster, 15, 50) + SetSpellTriggerCount(Triggers, 1) +end ``` diff --git a/docs/lua_functions/SetStepFailed.md b/docs/lua_functions/SetStepFailed.md index 0f32dfb..5adaf06 100644 --- a/docs/lua_functions/SetStepFailed.md +++ b/docs/lua_functions/SetStepFailed.md @@ -1,22 +1,28 @@ -### Function: SetStepFailed(param1, param2, param3, param4, param5, param6, param7) +### Function: SetStepFailed(player, quest_id, step) **Description:** -Placeholder description. +Set the player's quest step as failed. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. -- `param5`: unknown - Unknown type. -- `param6`: int32 - Integer value. -- `param7`: int32 - Integer value. +- `player` (Spawn) - Spawn object representing `player`. +- `quest_id` (uint32) - Integer value `quest_id`. +- `step` (uint32) - Integer value `step`. **Returns:** None. **Example:** ```lua --- Example usage -SetStepFailed(..., ..., ..., ..., ..., ..., ...) +-- From Quests/Hallmark/freeport_to_qeynos__part_2.lua +function Declined(Quest, QuestGiver, Player) + FaceTarget(QuestGiver, Player) + Dialog.New(QuestGiver, Player) + Dialog.AddDialog("I thought I smelled a coward. I want nothing to do with you until you come to your senses.") + Dialog.AddVoiceover("voiceover/english/watcher_kenjedeau/fprt_sewer02/watcher_kenjedeau005.mp3", 1178065540, 4141402431) + PlayFlavor(QuestGiver, "", "", "glare", 0, 0, Player) + Dialog.AddOption("Fine.") + Dialog.Start() + if HasQuest(Player,5889) and GetQuestStep(Player,5889) ==1 then + SetStepFailed(Player,5889,1) + end ``` diff --git a/docs/lua_functions/SetSuccessTimer.md b/docs/lua_functions/SetSuccessTimer.md index 99a51db..46d7f1e 100644 --- a/docs/lua_functions/SetSuccessTimer.md +++ b/docs/lua_functions/SetSuccessTimer.md @@ -1,20 +1,13 @@ -### Function: SetSuccessTimer(param1, param2, param3, param4, param5) +### Function: SetSuccessTimer(spawn) **Description:** -Placeholder description. +Set the success timer for the spawn in the instance. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. -- `param5`: unknown - Unknown type. +- `spawn` (Spawn) - Spawn object representing `spawn`. **Returns:** None. **Example:** -```lua --- Example usage -SetSuccessTimer(..., ..., ..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/SetTempVariable.md b/docs/lua_functions/SetTempVariable.md index b87c731..2575a8b 100644 --- a/docs/lua_functions/SetTempVariable.md +++ b/docs/lua_functions/SetTempVariable.md @@ -1,22 +1,26 @@ -### Function: SetTempVariable(param1, param2, param3, param4, param5, param6, param7) +### Function: SetTempVariable(spawn, var, val) **Description:** -Placeholder description. +Set's a temporary variable on the Spawn. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. -- `param5`: unknown - Unknown type. -- `param6`: string - String value. -- `param7`: string - String value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `var` (string) - String `var`. +- `val` (string) - String `val`. **Returns:** None. **Example:** ```lua --- Example usage -SetTempVariable(..., ..., ..., ..., ..., ..., ...) +-- From ItemScripts/BowlOfTerratrodderChuck.lua +function used(Item, Player) + if HasQuest(Player, AMindOfMyOwn) then + if GetZoneID(GetZone(Player)) == 108 then + + RemoveItem(Player, TerratrodderChuck) + local bucket = SpawnMob(GetZone(Player), 1081002, 1, GetX(Player), GetY(Player), GetZ(Player), GetHeading(Player)) + AddSpawnAccess(bucket, Player) + SetTempVariable(bucket, "PlayerPointer", Player) + end ``` diff --git a/docs/lua_functions/SetTemporaryTransportID.md b/docs/lua_functions/SetTemporaryTransportID.md index 827c203..0d0a209 100644 --- a/docs/lua_functions/SetTemporaryTransportID.md +++ b/docs/lua_functions/SetTemporaryTransportID.md @@ -1,17 +1,14 @@ -### Function: SetTemporaryTransportID(param1, param2) +### Function: SetTemporaryTransportID(player, transport_id) **Description:** -Placeholder description. +Set's the Spawn (Player)'s temporary transport id. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: int32 - Integer value. +- `player` (Spawn) - Spawn object representing `player`. +- `transport_id` (uint32) - Integer value `transport_id`. **Returns:** None. **Example:** -```lua --- Example usage -SetTemporaryTransportID(..., ...) -``` +Example Required diff --git a/docs/lua_functions/SetTradeskillLevel.md b/docs/lua_functions/SetTradeskillLevel.md index 9a045c0..349d99c 100644 --- a/docs/lua_functions/SetTradeskillLevel.md +++ b/docs/lua_functions/SetTradeskillLevel.md @@ -1,18 +1,24 @@ -### Function: SetTradeskillLevel(param1, param2, param3) +### Function: SetTradeskillLevel(spawn, level) **Description:** -Placeholder description. +Sets the tradeskill level on the Spawn. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: int8 - Small integer or boolean flag. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `level` (uint8) - Integer value `level`. **Returns:** None. **Example:** ```lua --- Example usage -SetTradeskillLevel(..., ..., ...) +-- From Quests/Hallmark/cellar_cleanup.lua +function Step8Complete(Quest, QuestGiver, Player) + UpdateQuestStepDescription(Quest, 8, "I spoke with Assistant Dreak.") + UpdateQuestTaskGroupDescription(Quest, 2, "I told Assistant Dreak that the cellar is clean.") + UpdateQuestZone(Quest,"Mizan's Cellar") + if not HasItem(Player,20708,1) and GetTradeskillLevel(Player) <2 then + SummonItem(Player,1030001,1) + GiveQuestItem(Quest, Player, "", 20708,1001034,1001034,1001034,7391,7391,7391) + end ``` diff --git a/docs/lua_functions/SetTutorialStep.md b/docs/lua_functions/SetTutorialStep.md index 8e7c6ee..f539b62 100644 --- a/docs/lua_functions/SetTutorialStep.md +++ b/docs/lua_functions/SetTutorialStep.md @@ -1,17 +1,24 @@ -### Function: SetTutorialStep(param1, param2) +### Function: SetTutorialStep(player, step) **Description:** -Placeholder description. +Sets the current tutorial step for the Player. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: int8 - Small integer or boolean flag. +- `player` (Spawn) - Spawn object representing `player`. +- `step` (uint8) - Integer value `step`. **Returns:** None. **Example:** ```lua --- Example usage -SetTutorialStep(..., ...) +-- From Quests/FarJourneyFreeport/TasksaboardtheFarJourney.lua +function Step3Init(Quest, QuestGiver, Player) + SetTutorialStep(Player, 17) + UpdateQuestStepDescription(Quest, 2, "I found Waulon's hat.") + UpdateQuestTaskGroupDescription(Quest, 2, "I found Waulon's hat in one of the boxes.") + + AddQuestStepChat(Quest, 3, "I should speak to Waulon.", 1, "Now that I found Waulon's hat, I should return it.", 258, Waulon) + AddQuestStepCompleteAction(Quest, 3, "Step3Complete") +end ``` diff --git a/docs/lua_functions/SetVision.md b/docs/lua_functions/SetVision.md index b285195..df5c070 100644 --- a/docs/lua_functions/SetVision.md +++ b/docs/lua_functions/SetVision.md @@ -1,20 +1,23 @@ -### Function: SetVision(param1, param2, param3, param4, param5) +### Function: SetVision(spawn, vision) **Description:** -Placeholder description. +Set's the vision mode for the Player. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. -- `param5`: int32 - Integer value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `vision` (uint32) - Integer value `vision`. **Returns:** None. **Example:** ```lua --- Example usage -SetVision(..., ..., ..., ..., ...) +-- From Spells/Commoner/TotenoftheEnduringSpirit.lua +function cast(Caster, Target) + if (GetLevel(Caster) >= 80) + then + AddControlEffect(Caster, 7) + BreatheUnderwater(Caster, true) + SetVision(Caster, 4) + end ``` diff --git a/docs/lua_functions/SetWorldTime.md b/docs/lua_functions/SetWorldTime.md index 813906b..79ef478 100644 --- a/docs/lua_functions/SetWorldTime.md +++ b/docs/lua_functions/SetWorldTime.md @@ -1,19 +1,16 @@ -### Function: SetWorldTime(param1, param2, param3, param4) +### Function: SetWorldTime(newYear, newMonth, newHour, newMinute) **Description:** -Placeholder description. +Set's the world time on the world server. **Parameters:** -- `param1`: int16 - Short integer value. -- `param2`: int16 - Short integer value. -- `param3`: int16 - Short integer value. -- `param4`: int16 - Short integer value. +- `newYear` (uint16) - Integer value `newYear`. +- `newMonth` (uint16) - Integer value `newMonth`. +- `newHour` (uint16) - Integer value `newHour`. +- `newMinute` (uint16) - Integer value `newMinute`. **Returns:** None. **Example:** -```lua --- Example usage -SetWorldTime(..., ..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/SetZoneExpansionFlag.md b/docs/lua_functions/SetZoneExpansionFlag.md index 4f09c7c..d7ed6b8 100644 --- a/docs/lua_functions/SetZoneExpansionFlag.md +++ b/docs/lua_functions/SetZoneExpansionFlag.md @@ -1,17 +1,14 @@ -### Function: SetZoneExpansionFlag(param1, param2) +### Function: SetZoneExpansionFlag(zone, xpackFlag) **Description:** -Placeholder description. +Set's the current zone expansion flag. **Parameters:** -- `param1`: ZoneServer - The zone object. -- `param2`: int32 - Integer value. +- `zone` (Zone) - Zone object representing `zone`. +- `xpackFlag` (uint32) - Integer value `xpackFlag`. **Returns:** None. **Example:** -```lua --- Example usage -SetZoneExpansionFlag(..., ...) -``` +Example Required diff --git a/docs/lua_functions/SetZoneHolidayFlag.md b/docs/lua_functions/SetZoneHolidayFlag.md index 850a5d2..674954a 100644 --- a/docs/lua_functions/SetZoneHolidayFlag.md +++ b/docs/lua_functions/SetZoneHolidayFlag.md @@ -1,17 +1,14 @@ -### Function: SetZoneHolidayFlag(param1, param2) +### Function: SetZoneHolidayFlag(zone, holidayFlag) **Description:** -Placeholder description. +Set's the current zone's holiday flag. **Parameters:** -- `param1`: ZoneServer - The zone object. -- `param2`: int32 - Integer value. +- `zone` (Zone) - Zone object representing `zone`. +- `holidayFlag` (uint32) - Integer value `holidayFlag`. **Returns:** None. **Example:** -```lua --- Example usage -SetZoneHolidayFlag(..., ...) -``` +Example Required diff --git a/docs/lua_functions/ShowLootWindow.md b/docs/lua_functions/ShowLootWindow.md index 011c8fa..c8a43ec 100644 --- a/docs/lua_functions/ShowLootWindow.md +++ b/docs/lua_functions/ShowLootWindow.md @@ -1,19 +1,29 @@ -### Function: ShowLootWindow(param1, param2, param3, param4) +### Function: ShowLootWindow(player, spawn) **Description:** -Placeholder description. +Shows the Player the Spawn's loot window. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: Spawn - The spawn or entity involved. +- `player` (Spawn) - Spawn object representing `player`. +- `spawn` (Spawn) - Spawn object representing `spawn`. **Returns:** None. **Example:** ```lua --- Example usage -ShowLootWindow(..., ..., ..., ...) +-- From SpawnScripts/FarJourneyFreeport/atreasurechest.lua +function open(NPC, Player) + SendStateCommand(NPC, 399) + AddTimer(NPC, 2000, "finished_open_animation") + if HasPendingLoot(NPC, Player) then + ShowLootWindow(Player, NPC) + DisplayText(Player, 12, "There appears to be something inside this box.") + InstructionWindow(Player, -1.0, "This screen shows the contents of the box you just opened. Left click on the loot all button to take the items from the box.", "voiceover/english/narrator/boat_06p_tutorial02/narrator_013_f0780e49.mp3", 1581263773, 1569244108, "tutorial_stage_17", "Left click on the loot all button.", "server") + SetTutorialStep(player, 16) + else + DisplayText(Player, 12, "This box is empty.") + ChangeHandIcon(NPC, 0) + SpawnSet(NPC, "targetable", 0) + end ``` diff --git a/docs/lua_functions/ShowWindow.md b/docs/lua_functions/ShowWindow.md index a59dc00..a63f801 100644 --- a/docs/lua_functions/ShowWindow.md +++ b/docs/lua_functions/ShowWindow.md @@ -1,18 +1,18 @@ -### Function: ShowWindow(param1, param2, param3) +### Function: ShowWindow(player, window, show) **Description:** -Placeholder description. +Shows a UI window, window represents the ui/default directory eq2ui_x_y.xml, in other words eq2ui_inventory_inventory.xml will be Inventory.Inventory. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: string - String value. -- `param3`: int8 - Small integer or boolean flag. +- `player` (Spawn) - Spawn object representing `player`. +- `window` (string) - String `window`. +- `show` (uint8) - Integer value `show`. **Returns:** None. **Example:** ```lua --- Example usage -ShowWindow(..., ..., ...) +-- From Quests/FarJourneyFreeport/TasksaboardtheFarJourney.lua + ShowWindow(Player, "Inventory.Inventory", 0) ``` diff --git a/docs/lua_functions/SpawnByLocationID.md b/docs/lua_functions/SpawnByLocationID.md index 70cf338..101ea93 100644 --- a/docs/lua_functions/SpawnByLocationID.md +++ b/docs/lua_functions/SpawnByLocationID.md @@ -1,20 +1,32 @@ -### Function: SpawnByLocationID(param1, param2, param3, param4, param5) +### Function: SpawnByLocationID(zone, location_id) **Description:** -Placeholder description. +Spawn by location_id in the current Zone. **Parameters:** -- `param1`: ZoneServer - The zone object. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. -- `param5`: int32 - Integer value. +- `zone` (Zone) - Zone object representing `zone`. +- `location_id` (uint32) - Integer value `location_id`. **Returns:** None. **Example:** ```lua --- Example usage -SpawnByLocationID(..., ..., ..., ..., ...) +-- From ItemScripts/RyGorrExplosiveMiningBarrel.lua +function used(Item, Player) + if GetQuestStep(Player, RyGorrOperations) == 1 then + if GetZoneID(GetZone(Player)) == 470 then + local X = GetX(Player) + local Y = GetY(Player) + local Z = GetZ(Player) + if X > -20.27 and X < -10.27 then + if Y < -60 then + if Z > 150.07 and Z < 160.07 then + local barrel = SpawnByLocationID(GetZone(Player), 33980) + AddSpawnAccess(barrel, Player) + SetTempVariable(barrel, "player", Player) + RemoveItem(Player, 47881) + else + SendMessage(Player, "You cannot place the Ry'Gorr Explosive Mining Barrel here.", "yellow") + end ``` diff --git a/docs/lua_functions/SpawnGroupByID.md b/docs/lua_functions/SpawnGroupByID.md index 49d3288..77ce4c9 100644 --- a/docs/lua_functions/SpawnGroupByID.md +++ b/docs/lua_functions/SpawnGroupByID.md @@ -1,21 +1,21 @@ -### Function: SpawnGroupByID(param1, param2, param3, param4, param5, param6) +### Function: SpawnGroupByID(zone, group_id, custom_level) **Description:** -Placeholder description. +Spawn by group_id in the current zone, custom_level can be provided to hard set all spawns to the same level. **Parameters:** -- `param1`: ZoneServer - The zone object. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. -- `param5`: int32 - Integer value. -- `param6`: int32 - Integer value. +- `zone` (Zone) - Zone object representing `zone`. +- `group_id` (uint32) - Integer value `group_id`. +- `custom_level` (uint32) - Integer value `custom_level`. **Returns:** None. **Example:** ```lua --- Example usage -SpawnGroupByID(..., ..., ..., ..., ..., ...) +-- From SpawnScripts/IsleRefuge1/GoblinSaboteurFirepit.lua +function InRange(NPC,Spawn) + if GetQuestStep(Spawn,saboteur)==1 then + SetStepComplete(Spawn,saboteur,1) + end ``` diff --git a/docs/lua_functions/StartAutoMount.md b/docs/lua_functions/StartAutoMount.md index 5f15ccb..6102019 100644 --- a/docs/lua_functions/StartAutoMount.md +++ b/docs/lua_functions/StartAutoMount.md @@ -1,21 +1,20 @@ -### Function: StartAutoMount(param1, param2, param3, param4, param5, param6) +### Function: StartAutoMount(player, path) **Description:** -Placeholder description. +Start the auto mount for the Player on a path id. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. -- `param5`: unknown - Unknown type. -- `param6`: int32 - Integer value. +- `player` (Spawn) - Spawn object representing `player`. +- `path` (uint32) - Integer value `path`. **Returns:** None. **Example:** ```lua --- Example usage -StartAutoMount(..., ..., ..., ..., ..., ...) +-- From SpawnScripts/Antonica/AGriffonTamer.lua +function QeynosToSteppes(NPC, Spawn) + StartAutoMount(Spawn, 84) + SetMount(Spawn, 225) +end ``` diff --git a/docs/lua_functions/StartHeroicOpportunity.md b/docs/lua_functions/StartHeroicOpportunity.md index e5bb5b7..f3e89d7 100644 --- a/docs/lua_functions/StartHeroicOpportunity.md +++ b/docs/lua_functions/StartHeroicOpportunity.md @@ -1,21 +1,20 @@ -### Function: StartHeroicOpportunity(param1, param2, param3, param4, param5, param6) +### Function: StartHeroicOpportunity(caster, class_id) **Description:** -Placeholder description. +Start a heroic opportunity with the caster based on the class_id. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. -- `param5`: unknown - Unknown type. -- `param6`: int8 - Small integer or boolean flag. +- `caster` (Spawn) - Spawn object representing `caster`. +- `class_id` (uint8) - Integer value `class_id`. **Returns:** None. **Example:** ```lua --- Example usage -StartHeroicOpportunity(..., ..., ..., ..., ..., ...) +-- From Spells/Fighter/FightingChance.lua +function cast(Caster, Target) + -- Begins a Heroic Opportunity +StartHeroicOpportunity(Caster, 1) +end ``` diff --git a/docs/lua_functions/StartTransmute.md b/docs/lua_functions/StartTransmute.md index 07dd65d..0f26f71 100644 --- a/docs/lua_functions/StartTransmute.md +++ b/docs/lua_functions/StartTransmute.md @@ -1,18 +1,18 @@ -### Function: StartTransmute(param1, param2, param3) +### Function: StartTransmute(spawn) **Description:** -Placeholder description. +Start a transmute process with the Spawn. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. +- `spawn` (Spawn) - Spawn object representing `spawn`. **Returns:** None. **Example:** ```lua --- Example usage -StartTransmute(..., ..., ...) +-- From Spells/Commoner/Transmute.lua +function cast(Caster) + StartTransmute(Caster) +end ``` diff --git a/docs/lua_functions/StopMovement.md b/docs/lua_functions/StopMovement.md index 65f2f9f..0b94723 100644 --- a/docs/lua_functions/StopMovement.md +++ b/docs/lua_functions/StopMovement.md @@ -1,16 +1,13 @@ -### Function: StopMovement(param1) +### Function: StopMovement(spawn) **Description:** -Placeholder description. +Stop the Spawn (usually NPC) from movement, interrupt its pathing. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. +- `spawn` (Spawn) - Spawn object representing `spawn`. **Returns:** None. **Example:** -```lua --- Example usage -StopMovement(...) -``` +Example Required diff --git a/docs/lua_functions/SummonCosmeticPet.md b/docs/lua_functions/SummonCosmeticPet.md index 2b732c0..e7d71db 100644 --- a/docs/lua_functions/SummonCosmeticPet.md +++ b/docs/lua_functions/SummonCosmeticPet.md @@ -1,25 +1,20 @@ -### Function: SummonCosmeticPet(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10) +### Function: SummonCosmeticPet(spawn, pet_id) **Description:** -Placeholder description. +Summon a cosmetic pet with the pet_id (spawn database id). **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. -- `param5`: unknown - Unknown type. -- `param6`: unknown - Unknown type. -- `param7`: unknown - Unknown type. -- `param8`: unknown - Unknown type. -- `param9`: unknown - Unknown type. -- `param10`: int32 - Integer value. +- `spawn` (Spawn) - Spawn object reference `spawn`. +- `pet_id` (uint32) - Integer value `pet_id`. **Returns:** None. **Example:** ```lua --- Example usage -SummonCosmeticPet(..., ..., ..., ..., ..., ..., ..., ..., ..., ...) +-- From Spells/AA/SummonAnimatedTome.lua +function cast(Caster, Target, CritChance) + AddSpellBonus(Target, 656, CritChance) + SummonCosmeticPet(Caster, 150084) +end ``` diff --git a/docs/lua_functions/SummonDeityPet.md b/docs/lua_functions/SummonDeityPet.md index 8e17aa8..63bbc45 100644 --- a/docs/lua_functions/SummonDeityPet.md +++ b/docs/lua_functions/SummonDeityPet.md @@ -1,25 +1,26 @@ -### Function: SummonDeityPet(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10) +### Function: SummonDeityPet(spawn, pet_id) **Description:** -Placeholder description. +Summon a deity pet with the pet_id (spawn database id). **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. -- `param5`: unknown - Unknown type. -- `param6`: unknown - Unknown type. -- `param7`: unknown - Unknown type. -- `param8`: unknown - Unknown type. -- `param9`: unknown - Unknown type. -- `param10`: int32 - Integer value. +- `spawn` (Spawn) - Spawn object reference `spawn`. +- `pet_id` (uint32) - Integer value `pet_id`. **Returns:** None. **Example:** ```lua --- Example usage -SummonDeityPet(..., ..., ..., ..., ..., ..., ..., ..., ..., ...) +-- From Spells/Commoner/PeacefulVisage.lua +function cast(Caster, Target, PetID, Stats) + Adjusted = GetLevel(Caster) / Stats + SummonDeityPet(Caster, PetID, Stats) + Say(Caster, "deity checks needed and formula need to be fine tuned") + AddSpellBonus(Target, 0, Adjusted) + AddSpellBonus(Target, 1, Adjusted) + AddSpellBonus(Target, 2, Adjusted) + AddSpellBonus(Target, 3, Adjusted) + AddSpellBonus(Target, 4, Adjusted) +end ``` diff --git a/docs/lua_functions/SummonDumbFirePet.md b/docs/lua_functions/SummonDumbFirePet.md index d270587..12883fa 100644 --- a/docs/lua_functions/SummonDumbFirePet.md +++ b/docs/lua_functions/SummonDumbFirePet.md @@ -1,28 +1,31 @@ -### Function: SummonDumbFirePet(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11, param12, param13) +### Function: SummonDumbFirePet(spawn, target, pet_id, x, y, z) **Description:** -Placeholder description. +Summon a dumbfire pet with the pet_id (spawn database id). **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. -- `param5`: unknown - Unknown type. -- `param6`: unknown - Unknown type. -- `param7`: unknown - Unknown type. -- `param8`: unknown - Unknown type. -- `param9`: Spawn - The spawn or entity involved. -- `param10`: int32 - Integer value. -- `param11`: float - Floating point value. -- `param12`: float - Floating point value. -- `param13`: float - Floating point value. +- `spawn` (Spawn) - Spawn object reference `spawn`. +- `target` (Spawn) - Spawn object representing `target`. +- `pet_id` (uint32) - Integer value `pet_id`. +- `x` (float) - Float value `x`. +- `y` (float) - Float value `y`. +- `z` (float) - Float value `z`. **Returns:** None. **Example:** ```lua --- Example usage -SummonDumbFirePet(..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ...) +-- From Spells/Mage/Enchanter/Coercer/Puppetmaster.lua +function cast(Caster, Target, PetID) + local x = GetX(Caster) + local y = GetY(Caster) + local z = GetZ(Caster) +local count = 0; +while (count < 4) do + local pet = SummonDumbFirePet(Caster, Target, PetID, x, y, z) + if pet ~= nil then + CopySpawnAppearance(pet, Target) + SpawnSet(pet, "size", "6") + end ``` diff --git a/docs/lua_functions/SummonPet.md b/docs/lua_functions/SummonPet.md index c753b35..f8b6900 100644 --- a/docs/lua_functions/SummonPet.md +++ b/docs/lua_functions/SummonPet.md @@ -1,26 +1,25 @@ -### Function: SummonPet(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11) +### Function: SummonPet(spawn, pet_id, max_level) **Description:** -Placeholder description. +Summon a pet with the pet_id (spawn database id). **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. -- `param5`: unknown - Unknown type. -- `param6`: unknown - Unknown type. -- `param7`: unknown - Unknown type. -- `param8`: unknown - Unknown type. -- `param9`: unknown - Unknown type. -- `param10`: int32 - Integer value. -- `param11`: int8 - Small integer or boolean flag. +- `spawn` (Spawn) - Spawn object reference `spawn`. +- `pet_id` (uint32) - Integer value `pet_id`. +- `max_level` (uint8) - Integer value `max_level`. **Returns:** None. **Example:** ```lua --- Example usage -SummonPet(..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ...) +-- From Spells/Commoner/MoleratTest.lua +function cast(Caster, Target) + SummonPet(Caster, 2780089) +CallCliffdiverHawk(NPC, Spawn) + local CliffdiverHawk = GetSpawn(NPC, 2780089) + + if CliffdiverHawk ~= nil then + AddTimer(CliffdiverHawk, 5000, "FlyToMoleRat", 1, Spawn) + end ``` diff --git a/docs/lua_functions/ToggleFollow.md b/docs/lua_functions/ToggleFollow.md index 123d5de..c0ec1f9 100644 --- a/docs/lua_functions/ToggleFollow.md +++ b/docs/lua_functions/ToggleFollow.md @@ -1,17 +1,39 @@ -### Function: ToggleFollow(param1, param2) +### Function: ToggleFollow(spawn) **Description:** -Placeholder description. +Toggle's the follow flag on or off depending on the Spawn's current setting. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. +- `spawn` (Spawn) - Spawn object representing `spawn`. **Returns:** None. **Example:** ```lua --- Example usage -ToggleFollow(..., ...) +-- From SpawnScripts/BeggarsCourt/arat.lua +function CatCheck(NPC,Spawn) + if IsAlive(NPC) then + AddTimer(NPC,MakeRandomInt(2000,4000),"CatCheck") + + local zone = GetZone(NPC) + local Cat = GetSpawnByLocationID(zone,402996) + if not IsInCombat(NPC) and Cat~= nil and not IsInCombat(Cat)then + local Distance = GetDistance(NPC,Cat,1) + if Distance <=5 then + Attack(Cat,NPC) + Attack(NPC,Cat) + local x = GetX(Cat) + local y = GetY(Cat) + local z = GetZ(Cat) + SetFollowTarget(Cat,NPC) + SetFollowTarget(NPC,Cat) + ToggleFollow(Cat) + ToggleFollow(NPC) + SetTarget(Cat,NPC) + FaceTarget(Cat,NPC) + FaceTarget(NPC,Cat) + PlayFlavor(NPC,"","","attack",0,0) + AddTimer(NPC,MakeRandomInt(2500,4500),"kill",1,Spawn) + end ``` diff --git a/docs/lua_functions/UseWidget.md b/docs/lua_functions/UseWidget.md index 01dcb69..548def9 100644 --- a/docs/lua_functions/UseWidget.md +++ b/docs/lua_functions/UseWidget.md @@ -1,16 +1,19 @@ -### Function: UseWidget(param1) +### Function: UseWidget(widget) **Description:** -Placeholder description. +Use or Trigger a widget/object, such as in the context of opening or closing a door. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. +- `widget` (Spawn) - Spawn object representing `widget`. **Returns:** None. **Example:** ```lua --- Example usage -UseWidget(...) +-- From SpawnScripts/Baubbleshire/BinkOakshire.lua +function Door1(NPC,Spawn) + local door = GetSpawn(NPC, 2380074) + UseWidget(door) +end ```