From ab41124e73f338841ea016998b85c73ef6d69c05 Mon Sep 17 00:00:00 2001 From: Emagi Date: Fri, 23 May 2025 11:50:05 -0400 Subject: [PATCH] A lot of lua functions documented, most have examples, not all. --- docs/lua_functions/AddQuestPrereqFaction.md | 18 ++--- docs/lua_functions/AddQuestPrereqItem.md | 16 +++-- docs/lua_functions/AddQuestPrereqModelType.md | 14 ++-- docs/lua_functions/AddQuestPrereqQuest.md | 17 +++-- docs/lua_functions/AddQuestPrereqRace.md | 14 ++-- .../AddQuestPrereqTradeskillClass.md | 15 ++-- .../AddQuestPrereqTradeskillLevel.md | 15 ++-- docs/lua_functions/AddQuestRewardCoin.md | 28 +++++--- docs/lua_functions/AddQuestRewardFaction.md | 15 ++-- docs/lua_functions/AddQuestRewardItem.md | 33 +++++++-- .../AddQuestSelectableRewardItem.md | 24 +++++-- docs/lua_functions/AddQuestStep.md | 35 +++++----- docs/lua_functions/AddQuestStepChat.md | 29 +++++--- .../AddQuestStepCompleteAction.md | 28 ++++++-- docs/lua_functions/AddQuestStepCraft.md | 29 +++++--- docs/lua_functions/AddQuestStepHarvest.md | 28 +++++--- docs/lua_functions/AddQuestStepLocation.md | 27 +++++--- docs/lua_functions/AddQuestStepObtainItem.md | 31 ++++++--- .../AddQuestStepProgressAction.md | 15 ++-- docs/lua_functions/AddQuestStepSpell.md | 28 +++++--- docs/lua_functions/AddQuestStepZoneLoc.md | 28 +++++--- docs/lua_functions/AddQuestUsableItem.md | 24 +++---- docs/lua_functions/AddRecipeBookToPlayer.md | 11 ++- docs/lua_functions/AddRespawn.md | 15 ++-- docs/lua_functions/AddSkillBonus.md | 20 +++--- docs/lua_functions/AddSpawnAccess.md | 20 ++++-- docs/lua_functions/AddSpawnIDAccess.md | 17 ++--- docs/lua_functions/AddSpawnToGroup.md | 24 +++++-- docs/lua_functions/GetSpellCaster.md | 24 ++++--- docs/lua_functions/GetSpellInitialTarget.md | 15 ++-- docs/lua_functions/GetSpellName.md | 24 +++++-- docs/lua_functions/GetSpellRequiredLevel.md | 20 +++--- docs/lua_functions/GetSpellTargets.md | 18 ++--- docs/lua_functions/GiveLoot.md | 25 +++++-- docs/lua_functions/GiveQuestReward.md | 18 +++-- docs/lua_functions/Harvest.md | 20 +++--- docs/lua_functions/HasCoin.md | 19 +++--- docs/lua_functions/HasControlEffect.md | 18 ++--- docs/lua_functions/HasItem.md | 24 +++---- docs/lua_functions/HasLootItem.md | 18 +++-- docs/lua_functions/HasPendingLoot.md | 24 +++++-- docs/lua_functions/HasPendingLootItem.md | 15 ++-- docs/lua_functions/HasPendingQuest.md | 45 +++++++++--- docs/lua_functions/HasQuestRewardItem.md | 15 ++-- docs/lua_functions/InLava.md | 18 ++--- docs/lua_functions/InWater.md | 18 ++--- docs/lua_functions/IsEpic.md | 17 ++--- docs/lua_functions/ModifyHP.md | 19 ++++-- docs/lua_functions/ModifyMaxHP.md | 11 ++- docs/lua_functions/ModifyMaxPower.md | 11 ++- docs/lua_functions/ModifyPower.md | 26 +++++-- docs/lua_functions/MoveToLocation.md | 28 ++++---- docs/lua_functions/MovementLoopAdd.md | 53 +++++++++++---- docs/lua_functions/OfferQuest.md | 23 +++---- docs/lua_functions/PlayAnimation.md | 21 +++--- docs/lua_functions/PlayAnimationString.md | 27 ++++---- docs/lua_functions/PlayFlavor.md | 43 ++++++++---- docs/lua_functions/PlayFlavorID.md | 27 +++++--- docs/lua_functions/PlaySound.md | 20 +++--- docs/lua_functions/PlayVoice.md | 27 +++++--- docs/lua_functions/ProvidesQuest.md | 14 ++-- docs/lua_functions/QuestIsComplete.md | 17 +++-- docs/lua_functions/QuestReturnNPC.md | 16 +++-- docs/lua_functions/QuestStepIsComplete.md | 22 ++++-- docs/lua_functions/RegisterQuest.md | 27 +++----- docs/lua_functions/RemoveControlEffect.md | 19 +++--- docs/lua_functions/RemoveItem.md | 66 +++++++++++++++--- docs/lua_functions/RemoveLootItem.md | 18 +++-- .../RemovePrimaryEntityCommand.md | 21 +++--- docs/lua_functions/RemoveRecipeFromPlayer.md | 15 ++-- docs/lua_functions/RemoveRegion.md | 16 ++--- docs/lua_functions/RemoveSkillBonus.md | 13 ++-- docs/lua_functions/RemoveSpawnIDAccess.md | 17 ++--- docs/lua_functions/RemoveSpellBonus.md | 13 ++-- docs/lua_functions/RemoveSpellBookEntry.md | 16 +++-- .../lua_functions/RemoveWidgetFromSpawnMap.md | 13 ++-- docs/lua_functions/RemoveWidgetFromZoneMap.md | 18 +++-- docs/lua_functions/ReplaceWidgetFromClient.md | 22 +++--- docs/lua_functions/Say.md | 33 ++++++--- docs/lua_functions/SayOOC.md | 19 +++--- docs/lua_functions/SendHearCast.md | 20 +++--- docs/lua_functions/SendMessage.md | 64 +++++++++++++++-- docs/lua_functions/SendNewAdventureSpells.md | 11 ++- docs/lua_functions/SendNewTradeskillSpells.md | 11 ++- docs/lua_functions/SendPopUpMessage.md | 25 ++++--- docs/lua_functions/SendStateCommand.md | 21 ++++-- .../lua_functions/SendUpdateDefaultCommand.md | 27 ++++---- .../lua_functions/SetAccessToEntityCommand.md | 27 ++++---- .../SetAccessToEntityCommandByCharID.md | 27 ++++---- docs/lua_functions/SetAdventureClass.md | 14 ++-- docs/lua_functions/SetAggroRadius.md | 20 +++--- docs/lua_functions/SetAgi.md | 14 ++-- docs/lua_functions/SetAgiBase.md | 17 +++-- docs/lua_functions/SetAttackable.md | 22 ++++-- docs/lua_functions/SetCanBind.md | 14 ++-- docs/lua_functions/SetCanEvac.md | 14 ++-- docs/lua_functions/SetCanGate.md | 14 ++-- docs/lua_functions/SetCastOnAggroComplete.md | 15 ++-- docs/lua_functions/SetCoinTmpReward.md | 13 ++-- docs/lua_functions/SetCompleteFlag.md | 14 ++-- docs/lua_functions/SetCompletedDescription.md | 13 ++-- docs/lua_functions/SetDeity.md | 13 ++-- docs/lua_functions/SetFactionID.md | 13 ++-- docs/lua_functions/SetHeading.md | 14 ++-- docs/lua_functions/SetInfoFlag.md | 16 +++-- docs/lua_functions/SetInt.md | 14 ++-- docs/lua_functions/SetIntBase.md | 17 +++-- .../SetLocationProximityFunction.md | 68 ++++++++++++++++--- docs/lua_functions/SetLootCoin.md | 33 +++++++-- docs/lua_functions/SetLootDropType.md | 13 ++-- docs/lua_functions/SetLootTier.md | 13 ++-- docs/lua_functions/SetMaxHP.md | 15 ++-- docs/lua_functions/SetMaxHPBase.md | 13 ++-- docs/lua_functions/SetMaxPower.md | 26 +++++-- docs/lua_functions/SetMaxPowerBase.md | 13 ++-- docs/lua_functions/SetModelType.md | 20 ++++-- docs/lua_functions/SetMount.md | 15 ++-- docs/lua_functions/SetMountColor.md | 28 +++++--- docs/lua_functions/SetPlayerPOVGhost.md | 13 ++-- .../SetPlayerProximityFunction.md | 18 ++--- docs/lua_functions/SetPosition.md | 22 +++--- docs/lua_functions/SetQuestCompleteAction.md | 13 ++-- docs/lua_functions/SetQuestPrereqLevel.md | 13 ++-- docs/lua_functions/SetQuestRewardComment.md | 13 ++-- docs/lua_functions/SetQuestRewardExp.md | 13 ++-- docs/lua_functions/SetQuestRewardStatus.md | 23 ++++--- docs/lua_functions/SetQuestYellow.md | 12 ++-- docs/lua_functions/SetRequiredHistory.md | 22 +++--- docs/lua_functions/SetRequiredQuest.md | 21 +++--- docs/lua_functions/SetServerControlFlag.md | 21 +++--- docs/lua_functions/SetSpawnGroupID.md | 13 ++-- docs/lua_functions/SetSpeed.md | 22 ++++-- docs/lua_functions/SetSta.md | 14 ++-- docs/lua_functions/SetStaBase.md | 17 +++-- docs/lua_functions/SetStatusTmpReward.md | 13 ++-- docs/lua_functions/SetStepComplete.md | 23 ++++--- docs/lua_functions/SetStr.md | 14 ++-- docs/lua_functions/SetStrBase.md | 17 +++-- docs/lua_functions/SetTradeskillClass.md | 23 +++++-- docs/lua_functions/SetVisualFlag.md | 16 +++-- docs/lua_functions/SetWis.md | 14 ++-- docs/lua_functions/SetWisBase.md | 22 ++++-- docs/lua_functions/Shout.md | 20 +++--- docs/lua_functions/Spawn.md | 31 +++++---- docs/lua_functions/SpawnMove.md | 20 ++---- docs/lua_functions/SpawnSet.md | 49 ++++++++++--- docs/lua_functions/SpawnSetByDistance.md | 30 +++++--- docs/lua_functions/SpellDamage.md | 26 +++---- docs/lua_functions/SpellDamageExt.md | 37 ++++++---- docs/lua_functions/SpellHeal.md | 25 +++---- docs/lua_functions/SpellHealPct.md | 27 ++++---- docs/lua_functions/StartConversation.md | 32 +++++---- docs/lua_functions/StartDialogConversation.md | 38 ++++++----- docs/lua_functions/Stealth.md | 18 +++-- docs/lua_functions/StopTimer.md | 23 ++++--- docs/lua_functions/SummonItem.md | 67 +++++++++++++++--- docs/lua_functions/ToggleCharacterFlag.md | 15 ++-- docs/lua_functions/ToggleTracking.md | 12 ++-- docs/lua_functions/UpdateQuestDescription.md | 17 +++-- .../UpdateQuestStepDescription.md | 22 ++++-- .../UpdateQuestTaskGroupDescription.md | 20 +++--- docs/lua_functions/UpdateQuestZone.md | 18 +++-- docs/lua_functions/Zone.md | 23 ++++--- 163 files changed, 2075 insertions(+), 1432 deletions(-) diff --git a/docs/lua_functions/AddQuestPrereqFaction.md b/docs/lua_functions/AddQuestPrereqFaction.md index 3da6fa5..8612d3a 100644 --- a/docs/lua_functions/AddQuestPrereqFaction.md +++ b/docs/lua_functions/AddQuestPrereqFaction.md @@ -1,19 +1,21 @@ -### Function: AddQuestPrereqFaction(param1, param2, param3, param4) +### Function: AddQuestPrereqFaction(quest, faction_id, min, max) **Description:** -Placeholder description. +CanReceiveQuest will fail if the Player does not have the faction_id within the min or max values. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: int32 - Integer value. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. +- `quest` (Quest) - Quest object representing `quest`. +- `faction_id` (uint32) - Integer value `faction_id`. +- `min` (int32) - Integer value `min`. +- `max` (int32) - Integer value `max`. **Returns:** None. **Example:** ```lua --- Example usage -AddQuestPrereqFaction(..., ..., ..., ...) +-- Require faction id 123 with 50 - 100000 faction to allow the quest. +function Init(Quest) + AddQuestPrereqFaction(Quest, 123, 50, 100000) +end ``` diff --git a/docs/lua_functions/AddQuestPrereqItem.md b/docs/lua_functions/AddQuestPrereqItem.md index e13c4ca..6016c22 100644 --- a/docs/lua_functions/AddQuestPrereqItem.md +++ b/docs/lua_functions/AddQuestPrereqItem.md @@ -1,18 +1,20 @@ -### Function: AddQuestPrereqItem(param1, param2, param3) +### Function: AddQuestPrereqItem(quest, item_id, quantity) **Description:** -Placeholder description. +Not implemented. CanReceiveQuest should require an item of item_id and quantity to be allowed to receive the quest. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: int32 - Integer value. -- `param3`: int32 - Integer value. +- `quest` (Quest) - Quest object representing `quest`. +- `item_id` (uint32) - Integer value `item_id`. +- `quantity` (int32) - Integer value `quantity`. **Returns:** None. **Example:** ```lua --- Example usage -AddQuestPrereqItem(..., ..., ...) +-- Require the item with item_id 123 and a quantity of 2 be required to receive the quest. +function Init(Quest) + AddQuestPrereqItem(Quest, 123, 2) +end ``` diff --git a/docs/lua_functions/AddQuestPrereqModelType.md b/docs/lua_functions/AddQuestPrereqModelType.md index d7285aa..ba70ba0 100644 --- a/docs/lua_functions/AddQuestPrereqModelType.md +++ b/docs/lua_functions/AddQuestPrereqModelType.md @@ -1,17 +1,19 @@ -### Function: AddQuestPrereqModelType(param1, param2) +### Function: AddQuestPrereqModelType(quest, model_type) **Description:** -Placeholder description. +CanReceiveQuest checks if the Player is the model_type defined. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: int16 - Short integer value. +- `quest` (Quest) - Quest object representing `quest`. +- `model_type` (int32) - Integer value `model_type`. **Returns:** None. **Example:** ```lua --- Example usage -AddQuestPrereqModelType(..., ...) +-- Require the Player to have a model_type of 123 for the Quest +function Init(Quest) + AddQuestPrereqModelType(Quest, 123) +end ``` diff --git a/docs/lua_functions/AddQuestPrereqQuest.md b/docs/lua_functions/AddQuestPrereqQuest.md index 0703f4e..3c841cb 100644 --- a/docs/lua_functions/AddQuestPrereqQuest.md +++ b/docs/lua_functions/AddQuestPrereqQuest.md @@ -1,17 +1,22 @@ -### Function: AddQuestPrereqQuest(param1, param2) +### Function: AddQuestPrereqQuest(quest, quest_id) **Description:** -Placeholder description. +CanReceiveQuest checks if the Player has previously completed the quest_id defined. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: int32 - Integer value. +- `quest` (Quest) - Quest object representing `quest`. +- `quest_id` (uint32) - Integer value `quest_id`. **Returns:** None. **Example:** ```lua --- Example usage -AddQuestPrereqQuest(..., ...) +-- From Quests/FrostfangSea/the_absent_effigy.lua +function Init(Quest) + AddQuestRewardCoin(Quest, math.random(10,80), math.random(6,15), 0, 0) + AddQuestPrereqQuest(Quest, LostFroglok) -- change quest step to obtain item 'an Effigy of Mithaniel' drop from frigid whirlstorms/ The Deadly Icewind + AddQuestStepKill(Quest, 1, "I must kill frigid whirlstorms to find Splorpy's Effigy of Mithaniel.", 1, 75, "I should kill frigid whirlstorms around Gwenevyn's Cove to find Splorpy's Effigy of Mithaniel.", 1059, 4700054, 4700069) + AddQuestStepCompleteAction(Quest, 1, "GotEffigy") +end ``` diff --git a/docs/lua_functions/AddQuestPrereqRace.md b/docs/lua_functions/AddQuestPrereqRace.md index edbf9f1..cccfcfe 100644 --- a/docs/lua_functions/AddQuestPrereqRace.md +++ b/docs/lua_functions/AddQuestPrereqRace.md @@ -1,17 +1,19 @@ -### Function: AddQuestPrereqRace(param1, param2) +### Function: AddQuestPrereqRace(quest, race) **Description:** -Placeholder description. +CanReceiveQuest requires the Player to be of a specific race ID. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: int8 - Small integer or boolean flag. +- `quest` (Quest) - Quest object representing `quest`. +- `race` (int32) - Integer value `race`. **Returns:** None. **Example:** ```lua --- Example usage -AddQuestPrereqRace(..., ...) +-- Require the Player to have a race of 1 (Dark Elf) for the Quest +function Init(Quest) + AddQuestPrereqRace(Quest, 1) +end ``` diff --git a/docs/lua_functions/AddQuestPrereqTradeskillClass.md b/docs/lua_functions/AddQuestPrereqTradeskillClass.md index a144aa3..b68e8b8 100644 --- a/docs/lua_functions/AddQuestPrereqTradeskillClass.md +++ b/docs/lua_functions/AddQuestPrereqTradeskillClass.md @@ -1,18 +1,19 @@ -### Function: AddQuestPrereqTradeskillClass(param1, param2, param3) +### Function: AddQuestPrereqTradeskillClass(quest, class_id) **Description:** -Placeholder description. +CanReceiveQuest requires the Player to be of the tradeskill class with class_id. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: unknown - Unknown type. -- `param3`: int8 - Small integer or boolean flag. +- `quest` (Quest) - Quest object representing `quest`. +- `class_id` (uint32) - Integer value `class_id`. **Returns:** None. **Example:** ```lua --- Example usage -AddQuestPrereqTradeskillClass(..., ..., ...) +-- Require the Player to have a tradeskill class of 46 (Craftsman) +function Init(Quest) + AddQuestPrereqTradeskillClass(Quest, 46) +end ``` diff --git a/docs/lua_functions/AddQuestPrereqTradeskillLevel.md b/docs/lua_functions/AddQuestPrereqTradeskillLevel.md index fcd96b9..760a5fd 100644 --- a/docs/lua_functions/AddQuestPrereqTradeskillLevel.md +++ b/docs/lua_functions/AddQuestPrereqTradeskillLevel.md @@ -1,18 +1,19 @@ -### Function: AddQuestPrereqTradeskillLevel(param1, param2, param3) +### Function: AddQuestPrereqTradeskillLevel(quest, level) **Description:** -Placeholder description. +CanReceiveQuest requires the Player to be of the tradeskill level defined. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: unknown - Unknown type. -- `param3`: int8 - Small integer or boolean flag. +- `quest` (Quest) - Quest object representing `quest`. +- `level` (int32) - Integer value `level`. **Returns:** None. **Example:** ```lua --- Example usage -AddQuestPrereqTradeskillLevel(..., ..., ...) +-- Require the Player to have a tradeskill level of 25 +function Init(Quest) + AddQuestPrereqTradeskillLevel(Quest, 25) +end ``` diff --git a/docs/lua_functions/AddQuestRewardCoin.md b/docs/lua_functions/AddQuestRewardCoin.md index 69c86cb..0ef27c8 100644 --- a/docs/lua_functions/AddQuestRewardCoin.md +++ b/docs/lua_functions/AddQuestRewardCoin.md @@ -1,20 +1,30 @@ -### Function: AddQuestRewardCoin(param1, param2, param3, param4, param5) +### Function: AddQuestRewardCoin(quest, copper, silver, gold, plat) **Description:** -Placeholder description. +Upon completion of the quest the Player will receive the copper, silver, gold, platinum described. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: int32 - Integer value. -- `param3`: int32 - Integer value. -- `param4`: int32 - Integer value. -- `param5`: int32 - Integer value. +- `quest` (Quest) - Quest object representing `quest`. +- `copper` (int32) - Integer value `copper`. +- `silver` (int32) - Integer value `silver`. +- `gold` (int32) - Integer value `gold`. +- `plat` (int32) - Integer value `plat`. **Returns:** None. **Example:** ```lua --- Example usage -AddQuestRewardCoin(..., ..., ..., ..., ...) +-- From Quests/EnchantedLands/Drodo'sGoodies.lua +function Init(Quest) + AddQuestRewardCoin(Quest, math.random(10,95), math.random(39,49), math.random(1,1), 0) + AddQuestStepKill(Quest, 1, "I must hunt grove badgers.", 1, 40, "I must hunt the critters near the granary in Enchanted Lands. They should have Drodo's goodies.", 2299, 390041) + AddQuestStepKill(Quest, 2, "I must hunt lancer wasps.", 1, 40, "I must hunt the critters near the granary in Enchanted Lands. They should have Drodo's goodies.", 1229, 390092) + AddQuestStepKill(Quest, 3, "I must hunt klakrok drones.", 1, 40, "I must hunt the critters near the granary in Enchanted Lands. They should have Drodo's goodies.", 1225, 390069) + AddQuestStepKill(Quest, 4, "I must hunt briarpaw cubs.", 1, 40, "I must hunt the critters near the granary in Enchanted Lands. They should have Drodo's goodies.", 928, 390104) + AddQuestStepCompleteAction(Quest, 1, "deck") + AddQuestStepCompleteAction(Quest, 2, "comb") + AddQuestStepCompleteAction(Quest, 3, "dice") + AddQuestStepCompleteAction(Quest, 4, "box") +end ``` diff --git a/docs/lua_functions/AddQuestRewardFaction.md b/docs/lua_functions/AddQuestRewardFaction.md index 5b35750..cce70b9 100644 --- a/docs/lua_functions/AddQuestRewardFaction.md +++ b/docs/lua_functions/AddQuestRewardFaction.md @@ -1,18 +1,15 @@ -### Function: AddQuestRewardFaction(param1, param2, param3) +### Function: AddQuestRewardFaction(quest, faction_id, amount) **Description:** -Placeholder description. +CanReceiveQuest requires the minimum faction amount with the faction_id specified. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: int32 - Integer value. -- `param3`: unknown - Unknown type. +- `quest` (Quest) - Quest object representing `quest`. +- `faction_id` (uint32) - Integer value `faction_id`. +- `amount` (int32) - Quantity `amount`. **Returns:** None. **Example:** -```lua --- Example usage -AddQuestRewardFaction(..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/AddQuestRewardItem.md b/docs/lua_functions/AddQuestRewardItem.md index b8cc096..4551e26 100644 --- a/docs/lua_functions/AddQuestRewardItem.md +++ b/docs/lua_functions/AddQuestRewardItem.md @@ -1,18 +1,37 @@ -### Function: AddQuestRewardItem(param1, param2, param3) +### Function: AddQuestRewardItem(quest, item_id, quantity) **Description:** -Placeholder description. +Adds a rewarded item for completion of the current Quest. Triggered by calling the LUA Function `GiveQuestReward` on completion of the Quest. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: int32 - Integer value. -- `param3`: int32 - Integer value. +- `quest` (Quest) - Quest object representing `quest`. +- `item_id` (uint32) - Integer value `item_id`. +- `quantity` (int32) - Integer value `quantity`. **Returns:** None. **Example:** ```lua --- Example usage -AddQuestRewardItem(..., ..., ...) +-- From Quests/Peatbog/FarSeasDirectRequisitionPBG0162.lua + +local MARINER_STITCHED_BRACERS_ID = 164053 +local MARINER_STITCHED_SHAWL_ID = 164058 +local MARINER_STITCHED_SLIPPERS_ID = 164059 + +function Init(Quest) + local chance = math.random(1, 3) + if chance == 1 then + AddQuestRewardItem(Quest, MARINER_STITCHED_BRACERS_ID) + elseif chance == 2 then + AddQuestRewardItem(Quest, MARINER_STITCHED_SHAWL_ID) + elseif chance == 3 then + AddQuestRewardItem(Quest, MARINER_STITCHED_SLIPPERS_ID) + end + + SetQuestFeatherColor(Quest, 3) + SetQuestRepeatable(Quest) + AddQuestStepKill(Quest, 1, "I must kill some bog slugs", 10, 100, "I must hunt down the creatures in the Peat Bog to fill the requisition.", 289, BOG_SLUG_ID) + AddQuestStepCompleteAction(Quest, 1, "Step1Complete") +end ``` diff --git a/docs/lua_functions/AddQuestSelectableRewardItem.md b/docs/lua_functions/AddQuestSelectableRewardItem.md index 2992948..900c4a7 100644 --- a/docs/lua_functions/AddQuestSelectableRewardItem.md +++ b/docs/lua_functions/AddQuestSelectableRewardItem.md @@ -1,18 +1,28 @@ -### Function: AddQuestSelectableRewardItem(param1, param2, param3) +### Function: AddQuestSelectableRewardItem(quest, item_id, quantity) **Description:** -Placeholder description. +Adds a selectable reward item for completion of the current Quest. Triggered by calling the LUA Function `GiveQuestReward` on completion of the Quest. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: int32 - Integer value. -- `param3`: int8 - Small integer or boolean flag. +- `quest` (Quest) - Quest object representing `quest`. +- `item_id` (uint32) - Integer value `item_id`. +- `quantity` (int32) - Integer value `quantity`. **Returns:** None. **Example:** ```lua --- Example usage -AddQuestSelectableRewardItem(..., ..., ...) +-- Made up example + +local MARINER_STITCHED_BRACERS_ID = 164053 +local MARINER_STITCHED_SHAWL_ID = 164058 +local MARINER_STITCHED_SLIPPERS_ID = 164059 + +function Init(Quest) + -- allows one item to be selected as an end reward of the quest + AddQuestSelectableRewardItem(Quest, MARINER_STITCHED_BRACERS_ID) + AddQuestSelectableRewardItem(Quest, MARINER_STITCHED_SHAWL_ID) + AddQuestSelectableRewardItem(Quest, MARINER_STITCHED_SLIPPERS_ID) +end ``` diff --git a/docs/lua_functions/AddQuestStep.md b/docs/lua_functions/AddQuestStep.md index 40e65c1..5549cf8 100644 --- a/docs/lua_functions/AddQuestStep.md +++ b/docs/lua_functions/AddQuestStep.md @@ -1,30 +1,27 @@ -### Function: AddQuestStep(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11, param12, param13, param14, param15) +### Function: AddQuestStep(quest, step, description, quantity, percentage, str_taskgroup, icon, usableitemid) **Description:** -Placeholder description. +Adds a displayable step in the players quest journal to help them determine their next action to Complete the step. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: unknown - Unknown type. -- `param3`: int32 - Integer value. -- `param4`: int32 - Integer value. -- `param5`: string - String value. -- `param6`: string - String value. -- `param7`: int32 - Integer value. -- `param8`: int32 - Integer value. -- `param9`: float - Floating point value. -- `param10`: float - Floating point value. -- `param11`: string - String value. -- `param12`: string - String value. -- `param13`: int16 - Short integer value. -- `param14`: int16 - Short integer value. -- `param15`: int32 - Integer value. +- `quest` (Quest) - Quest object representing `quest`. +- `step` (int32) - Integer value `step`. +- `description` (int32) - Integer value `description`. +- `quantity` (int32) - Integer value `quantity`. +- `percentage` (int32) - Integer value `percentage`. +- `str_taskgroup` (string) - String `str_taskgroup`. +- `icon` (int32) - Integer value `icon`. +- `usableitemid` (uint32) - Integer value `usableitemid`. **Returns:** None. **Example:** ```lua --- Example usage -AddQuestStep(..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ...) +-- From Quests/Antonica/ancient_kite_shield.lua +function Step1Complete(Quest, QuestGiver, Player) + UpdateQuestStepDescription(Quest, 1, "I've rinsed a lot of dirt from the shield.") + AddQuestStep(Quest,2,"I should inspect the shield again.",1, 100,"If I'm going to clean this shield and return to working condition, I'll need to put some effort into it.", 2268) + AddQuestStepCompleteAction(Quest, 2, "Step2Complete") +end ``` diff --git a/docs/lua_functions/AddQuestStepChat.md b/docs/lua_functions/AddQuestStepChat.md index d4bd142..3f3bf9c 100644 --- a/docs/lua_functions/AddQuestStepChat.md +++ b/docs/lua_functions/AddQuestStepChat.md @@ -1,21 +1,30 @@ -### Function: AddQuestStepChat(param1, param2, param3, param4, param5, param6) +### Function: AddQuestStepChat(quest, step, description, quantity, str_taskgroup, icon, npc_id) **Description:** -Placeholder description. +Adds a displayable chat step in the players quest journal to point them towards an NPC their next action to Complete the step. The npc_id will need to match the destination NPC's spawn id if you select them and do /spawn details or refer to the spawn table in the database. This supports multiple npc_id's where only one must match. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: int32 - Integer value. -- `param3`: string - String value. -- `param4`: int32 - Integer value. -- `param5`: string - String value. -- `param6`: int16 - Short integer value. +- `quest` (Quest) - Quest object representing `quest`. +- `step` (int32) - Integer value `step`. +- `description` (int32) - Integer value `description`. +- `quantity` (int32) - Integer value `quantity`. +- `str_taskgroup` (string) - String `str_taskgroup`. +- `icon` (int32) - Integer value `icon`. +- `npc_id` (int32) - Integer value `npc_id`. **Returns:** None. **Example:** ```lua --- Example usage -AddQuestStepChat(..., ..., ..., ..., ..., ...) +-- From Quests/AlphaTest/stowaway_antonica.lua +function Step1Complete(Quest) + UpdateQuestStepDescription(Quest, 1, "I have arrived in Antonica mostly intact.") + AddQuestStepChat(Quest, 2, "I need to meet up with the Shady Swashbuckler near the lighthouse in Antonica.", 1, "The Shady Swashbuckler provided me passage to Antonica. He will have the paperwork I need when I get there.", 11, 121874) + AddQuestStepObtainItem(Quest, 3, "I must fill out Qeynos Citizenship papers.", 1,100, "The Shady Swashbuckler provided me passage to Antonica. He will have the paperwork I need when I get there.", 75, 1001095) + AddQuestStepObtainItem(Quest, 4, "I must fill out Class Certification paperwork.", 1,100, "The Shady Swashbuckler provided me passage to Antonica. He will have the paperwork I need when I get there.", 2183, 1001096,1001097,1001098,1001099,1001100,1001101,1001102,1001103,1001104,1001105,1001106,1001107) + AddQuestStepCompleteAction(Quest, 2, "Step2Complete") + AddQuestStepCompleteAction(Quest, 3, "Step3Complete") + AddQuestStepCompleteAction(Quest, 4, "Step4Complete") +end ``` diff --git a/docs/lua_functions/AddQuestStepCompleteAction.md b/docs/lua_functions/AddQuestStepCompleteAction.md index 8c860b4..3e6e619 100644 --- a/docs/lua_functions/AddQuestStepCompleteAction.md +++ b/docs/lua_functions/AddQuestStepCompleteAction.md @@ -1,18 +1,32 @@ -### Function: AddQuestStepCompleteAction(param1, param2, param3) +### Function: AddQuestStepCompleteAction(quest, step, action) **Description:** -Placeholder description. +Sets the function to call when the quest step is completed. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: int32 - Integer value. -- `param3`: string - String value. +- `quest` (Quest) - Quest object representing `quest`. +- `step` (int32) - Integer value `step`. +- `action` (int32) - Integer value `action`. **Returns:** None. **Example:** ```lua --- Example usage -AddQuestStepCompleteAction(..., ..., ...) +-- From Quests/AlphaTest/stowaway_antonica.lua +function Init(Quest) + AddQuestStepZoneLoc(Quest, 1, "I must ride to Antonica...", 12, "The Shady Swashbuckler provided me passage to Antonica. He will have the paperwork I need when I get there.", 2285, 395.79, -38.56, 809.38,12) + AddQuestStepCompleteAction(Quest, 1, "Step1Complete") +end + +function Step1Complete(Quest) + UpdateQuestStepDescription(Quest, 1, "I have arrived in Antonica mostly intact.") + AddQuestStepChat(Quest, 2, "I need to meet up with the Shady Swashbuckler near the lighthouse in Antonica.", 1, "The Shady Swashbuckler provided me passage to Antonica. He will have the paperwork I need when I get there.", 11, 121874) + AddQuestStepObtainItem(Quest, 3, "I must fill out Qeynos Citizenship papers.", 1,100, "The Shady Swashbuckler provided me passage to Antonica. He will have the paperwork I need when I get there.", 75, 1001095) + AddQuestStepObtainItem(Quest, 4, "I must fill out Class Certification paperwork.", 1,100, "The Shady Swashbuckler provided me passage to Antonica. He will have the paperwork I need when I get there.", 2183, 1001096,1001097,1001098,1001099,1001100,1001101,1001102,1001103,1001104,1001105,1001106,1001107) + AddQuestStepCompleteAction(Quest, 2, "Step2Complete") + AddQuestStepCompleteAction(Quest, 3, "Step3Complete") + AddQuestStepCompleteAction(Quest, 4, "Step4Complete") +end + ``` diff --git a/docs/lua_functions/AddQuestStepCraft.md b/docs/lua_functions/AddQuestStepCraft.md index c8625ca..cb59675 100644 --- a/docs/lua_functions/AddQuestStepCraft.md +++ b/docs/lua_functions/AddQuestStepCraft.md @@ -1,22 +1,29 @@ -### Function: AddQuestStepCraft(param1, param2, param3, param4, param5, param6, param7) +### Function: AddQuestStepCraft(quest, step, description, quantity, percentage, str_taskgroup, icon, crafted_item_id) **Description:** -Placeholder description. +Adds a quest step to the player's journal requiring a craft related action be performed. The result expected item can be specified as a number of last arguments crafted_item_id. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: int32 - Integer value. -- `param3`: string - String value. -- `param4`: int32 - Integer value. -- `param5`: float - Floating point value. -- `param6`: string - String value. -- `param7`: int16 - Short integer value. +- `quest` (Quest) - Quest object representing `quest`. +- `step` (int32) - Integer value `step`. +- `description` (int32) - Integer value `description`. +- `quantity` (int32) - Integer value `quantity`. +- `percentage` (int32) - Integer value `percentage`. +- `str_taskgroup` (string) - String `str_taskgroup`. +- `icon` (int32) - Integer value `icon`. +- `crafted_item_id` (int32) - Integer value `crafted_item_id`. **Returns:** None. **Example:** ```lua --- Example usage -AddQuestStepCraft(..., ..., ..., ..., ..., ..., ...) +-- From Quests/CityofFreeport/the_stein_of_moggok_it_can_be_rebuilt.lua +function Step7Complete(Quest, QuestGiver, Player) + UpdateQuestStepDescription(Quest, 7, "I spoke with Rumdum.") + UpdateQuestTaskGroupDescription(Quest, 4, "I spoke with Rumdum.") + GiveQuestItem(Quest, Player, "I spoke with Rumdum." , 13961, 14072, 31562) + AddQuestStepCraft(Quest, 8, "I need to remake the Stein of Moggok.", 1, 100, "I need to remake the Stein of Moggok using Rumdum's family Recipe.", 11, 54775) + AddQuestStepCompleteAction(Quest, 8, "QuestComplete") +end ``` diff --git a/docs/lua_functions/AddQuestStepHarvest.md b/docs/lua_functions/AddQuestStepHarvest.md index 4b1bd18..8ab4a67 100644 --- a/docs/lua_functions/AddQuestStepHarvest.md +++ b/docs/lua_functions/AddQuestStepHarvest.md @@ -1,22 +1,28 @@ -### Function: AddQuestStepHarvest(param1, param2, param3, param4, param5, param6, param7) +### Function: AddQuestStepHarvest(quest, step, description, quantity, percentage, str_taskgroup, icon, harvested_item_id) **Description:** -Placeholder description. +Adds a quest step to the player's journal requiring a harvest related action be performed. The result expected item can be specified as a number of last arguments crafted_item_id of the item to harvest. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: int32 - Integer value. -- `param3`: string - String value. -- `param4`: int32 - Integer value. -- `param5`: float - Floating point value. -- `param6`: string - String value. -- `param7`: int16 - Short integer value. +- `quest` (Quest) - Quest object representing `quest`. +- `step` (int32) - Integer value `step`. +- `description` (int32) - Integer value `description`. +- `quantity` (int32) - Integer value `quantity`. +- `percentage` (int32) - Integer value `percentage`. +- `str_taskgroup` (string) - String `str_taskgroup`. +- `icon` (int32) - Integer value `icon`. +- `harvested_item_id` (int32) - Integer value `harvested_item_id`. **Returns:** None. **Example:** ```lua --- Example usage -AddQuestStepHarvest(..., ..., ..., ..., ..., ..., ...) +-- From Quests/Antonica/meteoric_hoop.lua +function Step2Complete(Quest, QuestGiver, Player) + UpdateQuestStepDescription(Quest, 2, "I've applied the ink and made the chunk a lot darker.") + + AddQuestStepHarvest(Quest, 3, "I need to harvest some Sandwashed Rock to make a hoop.", 1, 100, "I need to harvest a lot of Sandwashed Rock to make a hoop.", 1186, 121172) + AddQuestStepCompleteAction(Quest, 3, "Step3Complete") +end ``` diff --git a/docs/lua_functions/AddQuestStepLocation.md b/docs/lua_functions/AddQuestStepLocation.md index 46c3ed4..3e8e04b 100644 --- a/docs/lua_functions/AddQuestStepLocation.md +++ b/docs/lua_functions/AddQuestStepLocation.md @@ -1,22 +1,27 @@ -### Function: AddQuestStepLocation(param1, param2, param3, param4, param5, param6, param7) +### Function: AddQuestStepLocation(quest, step, description, max_variation, str_taskgroup, icon, dest_x, dest_y, dest_z) **Description:** -Placeholder description. +Adds a quest step to the player's journal requiring a location be reached for the complete action to be performed. The dest_x, dest_y, dest_z can be repeated in sequence to add multiple potential locations to reach. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: unknown - Unknown type. -- `param3`: int32 - Integer value. -- `param4`: string - String value. -- `param5`: float - Floating point value. -- `param6`: string - String value. -- `param7`: int16 - Short integer value. +- `quest` (Quest) - Quest object representing `quest`. +- `step` (int32) - Integer value `step`. +- `description` (int32) - Integer value `description`. +- `max_variation` (int32) - Integer value `max_variation`. +- `str_taskgroup` (string) - String `str_taskgroup`. +- `icon` (int32) - Integer value `icon`. +- `dest_x` (float) - Float value `dest_x`. +- `dest_y` (float) - Float value `dest_y`. +- `dest_z` (float) - Float value `dest_z`. **Returns:** None. **Example:** ```lua --- Example usage -AddQuestStepLocation(..., ..., ..., ..., ..., ..., ...) +-- From Quests/Antonica/history_of_the_ayrdal_part_i.lua +function Init(Quest) + AddQuestStepLocation(Quest, 1, "I need to visit Glade of the Coven.", 10, "I would like to visit the Glade of the Coven in Antonica.", 11, 160, -24, 441) + AddQuestStepCompleteAction(Quest, 1, "Step1Complete") +end ``` diff --git a/docs/lua_functions/AddQuestStepObtainItem.md b/docs/lua_functions/AddQuestStepObtainItem.md index 80040eb..bd9f89b 100644 --- a/docs/lua_functions/AddQuestStepObtainItem.md +++ b/docs/lua_functions/AddQuestStepObtainItem.md @@ -1,22 +1,31 @@ -### Function: AddQuestStepObtainItem(param1, param2, param3, param4, param5, param6, param7) +### Function: AddQuestStepObtainItem(quest, step, description, quantity, percentage, str_taskgroup, icon, obtain_item_id) **Description:** -Placeholder description. +Adds a quest step to the player's journal requiring an item be obtained for the complete action to be performed. Multiple obtain_item_id's can be passed with only one requiring to match. The player must obtain the item either by looting, item purchase (such as merchant, broker), summon item. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: int32 - Integer value. -- `param3`: string - String value. -- `param4`: int32 - Integer value. -- `param5`: float - Floating point value. -- `param6`: string - String value. -- `param7`: int16 - Short integer value. +- `quest` (Quest) - Quest object representing `quest`. +- `step` (int32) - Integer value `step`. +- `description` (int32) - Integer value `description`. +- `quantity` (int32) - Integer value `quantity`. +- `percentage` (int32) - Integer value `percentage`. +- `str_taskgroup` (string) - String `str_taskgroup`. +- `icon` (int32) - Integer value `icon`. +- `obtain_item_id` (int32) - Integer value `obtain_item_id`. **Returns:** None. **Example:** ```lua --- Example usage -AddQuestStepObtainItem(..., ..., ..., ..., ..., ..., ...) +-- From Quests/AlphaTest/stowaway_antonica.lua +function Step1Complete(Quest) + UpdateQuestStepDescription(Quest, 1, "I have arrived in Antonica mostly intact.") + AddQuestStepChat(Quest, 2, "I need to meet up with the Shady Swashbuckler near the lighthouse in Antonica.", 1, "The Shady Swashbuckler provided me passage to Antonica. He will have the paperwork I need when I get there.", 11, 121874) + AddQuestStepObtainItem(Quest, 3, "I must fill out Qeynos Citizenship papers.", 1,100, "The Shady Swashbuckler provided me passage to Antonica. He will have the paperwork I need when I get there.", 75, 1001095) + AddQuestStepObtainItem(Quest, 4, "I must fill out Class Certification paperwork.", 1,100, "The Shady Swashbuckler provided me passage to Antonica. He will have the paperwork I need when I get there.", 2183, 1001096,1001097,1001098,1001099,1001100,1001101,1001102,1001103,1001104,1001105,1001106,1001107) + AddQuestStepCompleteAction(Quest, 2, "Step2Complete") + AddQuestStepCompleteAction(Quest, 3, "Step3Complete") + AddQuestStepCompleteAction(Quest, 4, "Step4Complete") +end ``` diff --git a/docs/lua_functions/AddQuestStepProgressAction.md b/docs/lua_functions/AddQuestStepProgressAction.md index 680ebe0..866fd46 100644 --- a/docs/lua_functions/AddQuestStepProgressAction.md +++ b/docs/lua_functions/AddQuestStepProgressAction.md @@ -1,18 +1,15 @@ -### Function: AddQuestStepProgressAction(param1, param2, param3) +### Function: AddQuestStepProgressAction(quest, step, action) **Description:** -Placeholder description. +This can be used to call a LUA function when a quest step progresses successfully (such as a kill 1/10 or item 1/10). **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: int32 - Integer value. -- `param3`: string - String value. +- `quest` (Quest) - Quest object representing `quest`. +- `step` (int32) - Integer value `step`. +- `action` (int32) - Integer value `action`. **Returns:** None. **Example:** -```lua --- Example usage -AddQuestStepProgressAction(..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/AddQuestStepSpell.md b/docs/lua_functions/AddQuestStepSpell.md index b2d6fce..784f83f 100644 --- a/docs/lua_functions/AddQuestStepSpell.md +++ b/docs/lua_functions/AddQuestStepSpell.md @@ -1,22 +1,28 @@ -### Function: AddQuestStepSpell(param1, param2, param3, param4, param5, param6, param7) +### Function: AddQuestStepSpell(quest, step, description, quantity, percentage, str_taskgroup, icon, cast_spell_id) **Description:** -Placeholder description. +Adds a quest step to the Player's journal requiring that they use a spell id supplied by cast_spell_id. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: int32 - Integer value. -- `param3`: string - String value. -- `param4`: int32 - Integer value. -- `param5`: float - Floating point value. -- `param6`: string - String value. -- `param7`: int16 - Short integer value. +- `quest` (Quest) - Quest object representing `quest`. +- `step` (int32) - Integer value `step`. +- `description` (int32) - Integer value `description`. +- `quantity` (int32) - Integer value `quantity`. +- `percentage` (int32) - Integer value `percentage`. +- `str_taskgroup` (string) - String `str_taskgroup`. +- `icon` (int32) - Integer value `icon`. **Returns:** None. **Example:** ```lua --- Example usage -AddQuestStepSpell(..., ..., ..., ..., ..., ..., ...) +-- From Quests/BeggarsCourt/dirty_work.lua +function Step2_Complete_Listened(Quest, QuestGiver, Player) + UpdateQuestStepDescription(Quest, 2, "I have learned the location that the meeting will take place in.") + UpdateQuestTaskGroupDescription(Quest, 2, "I have learned the location that the meeting will take place in.") + + AddQuestStepSpell(Quest, 3, "I must poison the cups in the room in the southeastern area of the Beggar's Court, east of the inn.", 1, 100, "I need to poison the cups at the meeting place.", 0, A_MUG_TO_POISON) + AddQuestStepCompleteAction(Quest, 3, "Step3_Complete_CupsPoisoned") +end ``` diff --git a/docs/lua_functions/AddQuestStepZoneLoc.md b/docs/lua_functions/AddQuestStepZoneLoc.md index 3ff9cb5..91d2a62 100644 --- a/docs/lua_functions/AddQuestStepZoneLoc.md +++ b/docs/lua_functions/AddQuestStepZoneLoc.md @@ -1,22 +1,28 @@ -### Function: AddQuestStepZoneLoc(param1, param2, param3, param4, param5, param6, param7) +### Function: AddQuestStepZoneLoc(quest, step, description, max_variation, str_taskgroup, icon, dest_x, dest_y, dest_z, dest_zone_id) **Description:** -Placeholder description. +Adds a quest step to the Player's journal requiring a new destination location be reached and can also supply a different zone id. The dest parameters can be repeated for multiple possible locations. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: unknown - Unknown type. -- `param3`: int32 - Integer value. -- `param4`: string - String value. -- `param5`: float - Floating point value. -- `param6`: string - String value. -- `param7`: int16 - Short integer value. +- `quest` (Quest) - Quest object representing `quest`. +- `step` (int32) - Integer value `step`. +- `description` (int32) - Integer value `description`. +- `max_variation` (int32) - Integer value `max_variation`. +- `str_taskgroup` (string) - String `str_taskgroup`. +- `icon` (int32) - Integer value `icon`. +- `dest_x` (float) - Float value `dest_x`. +- `dest_y` (float) - Float value `dest_y`. +- `dest_z` (float) - Float value `dest_z`. +- `dest_zone_id` (int32) - Integer value `dest_zone_id`. **Returns:** None. **Example:** ```lua --- Example usage -AddQuestStepZoneLoc(..., ..., ..., ..., ..., ..., ...) +-- From Quests/AlphaTest/stowaway_antonica.lua +function Init(Quest) + AddQuestStepZoneLoc(Quest, 1, "I must ride to Antonica...", 12, "The Shady Swashbuckler provided me passage to Antonica. He will have the paperwork I need when I get there.", 2285, 395.79, -38.56, 809.38,12) + AddQuestStepCompleteAction(Quest, 1, "Step1Complete") +end ``` diff --git a/docs/lua_functions/AddQuestUsableItem.md b/docs/lua_functions/AddQuestUsableItem.md index 33cd418..cf1612a 100644 --- a/docs/lua_functions/AddQuestUsableItem.md +++ b/docs/lua_functions/AddQuestUsableItem.md @@ -1,21 +1,21 @@ -### Function: AddQuestUsableItem(param1, param2, param3, param4, param5, param6) +### Function: AddQuestUsableItem(quest, step, description, max_variation, str_taskgroup, icon, dest_x, dest_y, dest_z) **Description:** -Placeholder description. +Adds a quest step to the Player's journal requiring a new destination location be reached and can also supply a different zone id. The dest parameters can be repeated for multiple possible locations. This acts just like a location marker, nothing points to checking item id's. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: int32 - Integer value. -- `param3`: string - String value. -- `param4`: float - Floating point value. -- `param5`: string - String value. -- `param6`: int16 - Short integer value. +- `quest` (Quest) - Quest object representing `quest`. +- `step` (int32) - Integer value `step`. +- `description` (int32) - Integer value `description`. +- `max_variation` (int32) - Integer value `max_variation`. +- `str_taskgroup` (string) - String `str_taskgroup`. +- `icon` (int32) - Integer value `icon`. +- `dest_x` (float) - Float value `dest_x`. +- `dest_y` (float) - Float value `dest_y`. +- `dest_z` (float) - Float value `dest_z`. **Returns:** None. **Example:** -```lua --- Example usage -AddQuestUsableItem(..., ..., ..., ..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/AddRecipeBookToPlayer.md b/docs/lua_functions/AddRecipeBookToPlayer.md index b12e9c0..dcc6e48 100644 --- a/docs/lua_functions/AddRecipeBookToPlayer.md +++ b/docs/lua_functions/AddRecipeBookToPlayer.md @@ -1,17 +1,16 @@ -### Function: AddRecipeBookToPlayer(param1, param2) +### Function: AddRecipeBookToPlayer(player, recipe_book_id) **Description:** -Placeholder description. +Adds a recipe book to the Player's. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: int32 - Integer value. +- `player` (Spawn) - Spawn object representing `player`. +- `recipe_book_id` (uint32) - Integer value `recipe_book_id`. **Returns:** None. **Example:** ```lua --- Example usage -AddRecipeBookToPlayer(..., ...) +AddRecipeBook(Player, 1) ``` diff --git a/docs/lua_functions/AddRespawn.md b/docs/lua_functions/AddRespawn.md index beece8e..7fcd0d0 100644 --- a/docs/lua_functions/AddRespawn.md +++ b/docs/lua_functions/AddRespawn.md @@ -1,18 +1,15 @@ -### Function: AddRespawn(param1, param2, param3) +### Function: AddRespawn(zone, location_id, respawn_time) **Description:** -Placeholder description. +Creates a new respawn using the location_id for the Zone and sets the respawn_time provided. **Parameters:** -- `param1`: ZoneServer - The zone object. -- `param2`: int32 - Integer value. -- `param3`: int32 - Integer value. +- `zone` (Zone) - Zone object representing `zone`. +- `location_id` (uint32) - Integer value `location_id`. +- `respawn_time` (int32) - Time value `respawn_time` in seconds. **Returns:** None. **Example:** -```lua --- Example usage -AddRespawn(..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/AddSkillBonus.md b/docs/lua_functions/AddSkillBonus.md index a4d063c..597503f 100644 --- a/docs/lua_functions/AddSkillBonus.md +++ b/docs/lua_functions/AddSkillBonus.md @@ -1,20 +1,24 @@ -### Function: AddSkillBonus(param1, param2, param3, param4, param5) +### Function: AddSkillBonus(spawn, skill_id, value) **Description:** Placeholder description. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: int32 - Integer value. -- `param5`: float - Floating point value. +- `luaspell` (int32) - Integer value `luaspell`. +- `skill_id` (uint32) - Integer value `skill_id`. +- `value` (int32) - Integer value `value`. **Returns:** None. **Example:** ```lua --- Example usage -AddSkillBonus(..., ..., ..., ..., ...) +-- From Spells/AA/BattlemagesFervor.lua +function cast(Caster, Target, SkillAmt) + AddSkillBonus(Target, GetSkillIDByName("Focus"), SkillAmt) + AddSkillBonus(Target, GetSkillIDByName("Disruption"), SkillAmt) + AddSkillBonus(Target, GetSkillIDByName("Subjugation"), SkillAmt) + AddSkillBonus(Target, GetSkillIDByName("Ordination"), SkillAmt) + Say(Caster, "need formula") +end ``` diff --git a/docs/lua_functions/AddSpawnAccess.md b/docs/lua_functions/AddSpawnAccess.md index f26623c..b4f08f2 100644 --- a/docs/lua_functions/AddSpawnAccess.md +++ b/docs/lua_functions/AddSpawnAccess.md @@ -1,17 +1,25 @@ -### Function: AddSpawnAccess(param1, param2) +### Function: AddSpawnAccess(Spawn, Player) **Description:** -Placeholder description. +Allows `Player` access to `Spawn` visually and such as for restricting to Quest only Player's. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: Spawn - The spawn or entity involved. +- `Spawn` (Spawn) - Spawn object representing `Spawn`. +- `Player` (Spawn) - Spawn object value `Player`. **Returns:** None. **Example:** ```lua --- Example usage -AddSpawnAccess(..., ...) +-- 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/AddSpawnIDAccess.md b/docs/lua_functions/AddSpawnIDAccess.md index ba6e3fe..97c9964 100644 --- a/docs/lua_functions/AddSpawnIDAccess.md +++ b/docs/lua_functions/AddSpawnIDAccess.md @@ -1,20 +1,15 @@ -### Function: AddSpawnIDAccess(param1, param2, param3, param4, param5) +### Function: AddSpawnIDAccess(Player, spawn_id, zone) **Description:** -Placeholder description. +Adds Player to the access list of the spawn_id provided. Zone is optional, it will use Player's zone to determine any Spawn's in zone based on the spawn_id provided. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: int32 - Integer value. -- `param5`: ZoneServer - The zone object. +- `Player` (Spawn) - Spawn object representing `Player`. +- `spawn_id` (uint32) - Integer value `spawn_id`. +- `zone` (Zone) - Zone object representing `zone`. **Returns:** None. **Example:** -```lua --- Example usage -AddSpawnIDAccess(..., ..., ..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/AddSpawnToGroup.md b/docs/lua_functions/AddSpawnToGroup.md index a4d0257..a65f859 100644 --- a/docs/lua_functions/AddSpawnToGroup.md +++ b/docs/lua_functions/AddSpawnToGroup.md @@ -1,17 +1,29 @@ -### Function: AddSpawnToGroup(param1, param2) +### Function: AddSpawnToGroup(spawn, new_group_id) **Description:** -Placeholder description. +Combines Spawn into the specified new_group_id which will link the Spawn's together in an encounter and they will engage and assist each other as a group. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: int32 - Integer value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `new_group_id` (uint32) - Integer value `new_group_id`. **Returns:** None. **Example:** ```lua --- Example usage -AddSpawnToGroup(..., ...) +-- From SpawnScripts/IsleRefuge1/GoblinSaboteurFirepit.lua +function Grouping(NPC,Spawn) + local zone = GetZone(NPC) + Gob1 = GetSpawnByLocationID(zone,133776460) + Gob2 = GetSpawnByLocationID(zone,133776463) + Gob3 = GetSpawnByLocationID(zone,133776464) + Gob4 = GetSpawnByLocationID(zone,133776458) + Gob5 = GetSpawnByLocationID(zone,133776459) + AddSpawnToGroup(Gob1,1051222) + AddSpawnToGroup(Gob2,1051222) + AddSpawnToGroup(Gob3,"1051222") + AddSpawnToGroup(Gob4,"1051222") + AddSpawnToGroup(Gob5,"1051222") +end ``` diff --git a/docs/lua_functions/GetSpellCaster.md b/docs/lua_functions/GetSpellCaster.md index 4765bf8..c38f5fc 100644 --- a/docs/lua_functions/GetSpellCaster.md +++ b/docs/lua_functions/GetSpellCaster.md @@ -1,19 +1,27 @@ -### Function: GetSpellCaster(param1, param2, param3, param4) +### Function: GetSpellCaster(spell) **Description:** -Placeholder description. +Obtain the Spawn 'Caster' of the Spell. The `spell` field is optional, it will otherwise be in a Spell Script which defaults to getting the current spell caster. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. +- `spell` (Spell) - Spell object representing `spell`. **Returns:** None. **Example:** ```lua --- Example usage -GetSpellCaster(..., ..., ..., ...) +-- From Spells/Priest/Cleric/Inquisitor/ContriteGrace.lua +function proc(Caster, Target, Type, MinValHeal, MaxValHeal, MinValDamage, MaxValDamage) + local initial_caster = GetSpellCaster() + if initial_caster ~= nil and Type == 15 then + MinValHeal = CalculateRateValue(initial_caster, Target, GetSpellRequiredLevel(initial_caster), GetCasterSpellLevel(), 3.75, MinValHeal) + MaxValHeal = CalculateRateValue(initial_caster, Target, GetSpellRequiredLevel(initial_caster), GetCasterSpellLevel(), 3.75, MaxValHeal) + MinValDamage = CalculateRateValue(initial_caster, Target, GetSpellRequiredLevel(initial_caster), GetCasterSpellLevel(), 1.25, MinValDamage) + MaxValDamage = CalculateRateValue(initial_caster, Target, GetSpellRequiredLevel(initial_caster), GetCasterSpellLevel(), 1.25, MaxValDamage) + + SpellHeal("heal", MinValHeal, MaxValHeal, Caster, 0, 0, "Atoning Faith") + ProcDamage(initial_caster, Target, "Atoning Faith", 7, MinValDamage, MaxValDamage) + RemoveTriggerFromSpell(1) + end ``` diff --git a/docs/lua_functions/GetSpellInitialTarget.md b/docs/lua_functions/GetSpellInitialTarget.md index 5b5fd70..43b9653 100644 --- a/docs/lua_functions/GetSpellInitialTarget.md +++ b/docs/lua_functions/GetSpellInitialTarget.md @@ -1,20 +1,13 @@ -### Function: GetSpellInitialTarget(param1, param2, param3, param4, param5) +### Function: GetSpellInitialTarget(spell) **Description:** -Placeholder description. +Obtain the Initial Target of the Spell. The `spell` field is optional, it will otherwise be in a Spell Script which defaults to the current spell's initial target. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. -- `param5`: unknown - Unknown type. +- `spell` (Spell) - Spell object representing `spell`. **Returns:** None. **Example:** -```lua --- Example usage -GetSpellInitialTarget(..., ..., ..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/GetSpellName.md b/docs/lua_functions/GetSpellName.md index bf5cecb..564014c 100644 --- a/docs/lua_functions/GetSpellName.md +++ b/docs/lua_functions/GetSpellName.md @@ -1,17 +1,29 @@ -### Function: GetSpellName(param1, param2) +### Function: GetSpellName(spell) **Description:** -Placeholder description. +Obtain the Spell Name of the Spell. Must be used in a Spell Script. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: unknown - Unknown type. +- None **Returns:** None. **Example:** ```lua --- Example usage -GetSpellName(..., ...) +-- From Spells/Priest/Cleric/Inquisitor/HereticsDemise.lua +function remove(Caster, Target, Reason, DoTType, MinVal, MaxVal) + MinVal = CalculateRateValue(Caster, Target, GetSpellRequiredLevel(Caster), GetLevel(Caster), 1.25, MinVal) + MaxVal = CalculateRateValue(Caster, Target, GetSpellRequiredLevel(Caster), GetLevel(Caster), 1.25, MaxVal) + + if Reason == "target_dead" then + local Zone = GetZone(Target) + local encounterSpawn = GetSpawnByGroupID(Zone, GetSpawnGroupID(Target)) + if encounterSpawn ~= nil then + local targets = GetGroup(encounterSpawn) + for k,v in ipairs(targets) do + SpawnSet(v,"visual_state",0) + if IsAlive(v) then + DamageSpawn(Caster, v, 193, 3, MinVal, MaxVal, GetSpellName()) + end ``` diff --git a/docs/lua_functions/GetSpellRequiredLevel.md b/docs/lua_functions/GetSpellRequiredLevel.md index 69f3862..6b99b66 100644 --- a/docs/lua_functions/GetSpellRequiredLevel.md +++ b/docs/lua_functions/GetSpellRequiredLevel.md @@ -1,19 +1,23 @@ -### Function: GetSpellRequiredLevel(param1, param2, param3, param4) +### Function: GetSpellRequiredLevel(spell) **Description:** -Placeholder description. +Obtain the Required Level of the Spell, must be used inside a Spell Script. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: Spawn - The spawn or entity involved. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. +- None **Returns:** None. **Example:** ```lua --- Example usage -GetSpellRequiredLevel(..., ..., ..., ...) +-- From Spells/Dregs.lua +function cast(Caster, Target, BonusAmt) + -- Allows target to breathe under water + BreatheUnderwater(Target, true) + + BonusAmt = CalculateRateValue(Caster, Target, GetSpellRequiredLevel(Caster), GetLevel(Caster), 1.0, BonusAmt) + + AddSpellBonus(Target, 201, BonusAmt) +end ``` diff --git a/docs/lua_functions/GetSpellTargets.md b/docs/lua_functions/GetSpellTargets.md index f9187c5..d04d425 100644 --- a/docs/lua_functions/GetSpellTargets.md +++ b/docs/lua_functions/GetSpellTargets.md @@ -1,19 +1,21 @@ -### Function: GetSpellTargets(param1, param2, param3, param4) +### Function: GetSpellTargets(spell) **Description:** -Placeholder description. +Obtain all the Spell Targets of the Spell. The `spell` field is optional, it will otherwise be in a Spell Script which defaults to the current spell's initial target. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. +- `spell` (Spell) - Spell object representing `spell`. **Returns:** None. **Example:** ```lua --- Example usage -GetSpellTargets(..., ..., ..., ...) +-- From Spells/Commoner/UnholyFear.lua +function cast(Caster, Target) + local targets = GetSpellTargets() + for k,v in ipairs(targets) do + if GetLevel(v) < GetLevel(Caster) then + PlayAnimationString(v, "cringe", nil, true) + end ``` diff --git a/docs/lua_functions/GiveLoot.md b/docs/lua_functions/GiveLoot.md index 952f449..0183cdf 100644 --- a/docs/lua_functions/GiveLoot.md +++ b/docs/lua_functions/GiveLoot.md @@ -1,18 +1,29 @@ -### Function: GiveLoot(param1, param2, param3) +### Function: GiveLoot(entity, player, coins, item_id) **Description:** -Placeholder description. +Give the specified Player coin and item_id (multiple can be provided comma delimited) as pending loot for their inventory. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: Spawn - The spawn or entity involved. -- `param3`: int32 - Integer value. +- `entity` (int32) - Integer value `entity`. +- `player` (Spawn) - Spawn object representing `player`. +- `coins` (int32) - Integer value `coins`. +- `item_id` (int32) - Integer value `item_id`. **Returns:** None. **Example:** ```lua --- Example usage -GiveLoot(..., ..., ...) +-- From Quests/FarJourneyFreeport/TasksaboardtheFarJourney.lua +function CurrentStep(Quest, QuestGiver, Player) + if GetQuestStepProgress(Player, 524,2) == 0 and GetQuestStep(Player, 524) == 2 then + i = 1 + spawns = GetSpawnListBySpawnID(Player, 270010) + repeat + spawn = GetSpawnFromList(spawns, i-1) + if spawn then + ChangeHandIcon(spawn, 1) + AddPrimaryEntityCommand(nil, spawn) + SpawnSet(NPC, "targetable", 1, true, true) + end ``` diff --git a/docs/lua_functions/GiveQuestReward.md b/docs/lua_functions/GiveQuestReward.md index b153362..4de16e3 100644 --- a/docs/lua_functions/GiveQuestReward.md +++ b/docs/lua_functions/GiveQuestReward.md @@ -1,17 +1,23 @@ -### Function: GiveQuestReward(param1, param2) +### Function: GiveQuestReward(quest, spawn) **Description:** -Placeholder description. +Provides the quest rewards previously specified with AddQuestRewardCoin, AddQuestRewardFaction, AddQuestRewardItem and AddQuestSelectableRewardItem or in the database. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: Spawn - The spawn or entity involved. +- `quest` (Quest) - Quest object representing `quest`. +- `spawn` (Spawn) - Spawn object representing `spawn`. **Returns:** None. **Example:** ```lua --- Example usage -GiveQuestReward(..., ...) +-- From Quests/AlphaTest/stowaway_antonica.lua +function QuestCheck1(Quest, QuestGiver, Player) + if QuestStepIsComplete(Player,5858,2) and QuestStepIsComplete(Player,5858,3)and QuestStepIsComplete(Player,5858,4) then + UpdateQuestTaskGroupDescription(Quest, 1, "I have found all I need to Fast-Track to Qeynos.") + UpdateQuestDescription(Quest, "I have all the necessary parts for the Fast-Track passage to Qeynos. The ride was a bit cramped...") + GiveQuestReward(Quest, Player) +end +end ``` diff --git a/docs/lua_functions/Harvest.md b/docs/lua_functions/Harvest.md index 023d98a..01d7499 100644 --- a/docs/lua_functions/Harvest.md +++ b/docs/lua_functions/Harvest.md @@ -1,15 +1,17 @@ -Function: Harvest(Player, GroundSpawn) +### Function: Harvest(Player, GroundSpawn) -Description: Forces a harvest action on the specified harvestable object or resource node. When called on a harvestable spawn (like a resource node), it attempts to collect from it as if a player harvested it. +**Description:** +Forces a harvest action on the specified harvestable object or resource node. When called on a harvestable spawn (like a resource node), it attempts to collect from it as if a player harvested it. -Parameters: +**Parameters:** +- `Player`: Spawn – The Player to harvest the node. +- `GroundSpawn`: Spawn - The Spawn that represents the GroundSpawn. - Player: Spawn – The Player to harvest the node. - GroundSpawn: Spawn - The Spawn that represents the GroundSpawn. +**Returns:** None (the harvesting results — items or updates — are handled by the system). -Returns: None (the harvesting results — items or updates — are handled by the system). - -Example: +**Example:** +```lua -- Example usage (not commonly used in scripts; simulated harvest of a node) -Harvest(Player, Node) \ No newline at end of file +Harvest(Player, Node) +``` \ No newline at end of file diff --git a/docs/lua_functions/HasCoin.md b/docs/lua_functions/HasCoin.md index 9285b39..90b7ca4 100644 --- a/docs/lua_functions/HasCoin.md +++ b/docs/lua_functions/HasCoin.md @@ -1,20 +1,21 @@ -Function: HasCoin(Spawn, Value) +### Function: HasCoin(Spawn, Value) -Description: Checks if a player (Spawn) has at least a certain amount of coin (Value in copper) on them. +**Description:** Checks if a player (Spawn) has at least a certain amount of coin (Value in copper) on them. -Parameters: +**Parameters:** +- `Spawn`: Spawn – The player whose coin purse to check. +- `Value`: Int32 – The amount of coin (in copper units) to check for. - Spawn: Spawn – The player whose coin purse to check. - Value: Int32 – The amount of coin (in copper units) to check for. +**Returns:** Boolean – true (1) if the player has at least that amount of coin; false (0) if they do not have enough money. -Returns: Boolean – true (1) if the player has at least that amount of coin; false (0) if they do not have enough money. - -Example: +**Example:** +```lua -- Example usage (charging a fee if the player can afford it) if HasCoin(Player, 5000) then -- 5000 copper = 50 silver RemoveCoin(Player, 5000) SendMessage(Player, "You pay 50 silver for the item.") else SendMessage(Player, "You don't have enough coin.") -end \ No newline at end of file +end +``` \ No newline at end of file diff --git a/docs/lua_functions/HasControlEffect.md b/docs/lua_functions/HasControlEffect.md index 1a535d0..6ebd76c 100644 --- a/docs/lua_functions/HasControlEffect.md +++ b/docs/lua_functions/HasControlEffect.md @@ -1,20 +1,14 @@ -### Function: HasControlEffect(param1, param2, param3, param4, param5) +### Function: HasControlEffect(spawn, type) **Description:** -Placeholder description. +Identifies if the Spawn has the control effect type defined. The Control Effect Type list can be found at https://github.com/emagi/eq2emu/blob/main/docs/data_types/control_effect_types.md **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. -- `param5`: int8 - Small integer or boolean flag. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `type` (int32) - Integer value `type`. -**Returns:** None. +**Returns:** True if the Spawn has the control effect type specified, otherwise False. **Example:** -```lua --- Example usage -HasControlEffect(..., ..., ..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/HasItem.md b/docs/lua_functions/HasItem.md index 1bac9ac..0b3ca1c 100644 --- a/docs/lua_functions/HasItem.md +++ b/docs/lua_functions/HasItem.md @@ -1,20 +1,20 @@ -Function: HasItem(Player, ItemID, IncludeBank) +### Function: HasItem(Player, ItemID, IncludeBank) -Description: Determines whether a given player possesses an item with the specified Item ID. +**Description:** +Determines whether a given player possesses an item with the specified Item ID. -Parameters: +**Parameters:** +- `Player`: Spawn – The player or NPC to check for the item. (Typically a Player.) +- `ItemID`: Int32 – The unique ID of the item to check for. +- `IncudeBank`: Boolean – If we should check the bank also - Player: Spawn – The player or NPC to check for the item. (Typically a Player.) +**Returns:** Boolean – true (1) if the spawn’s inventory contains at least one of the specified item; false (0) if the item is not present. - ItemID: Int32 – The unique ID of the item to check for. - - IncudeBank: Boolean – If we should check the bank also - -Returns: Boolean – true (1) if the spawn’s inventory contains at least one of the specified item; false (0) if the item is not present. - -Example: +**Example:** +```lua -- Example usage from: ItemScripts/GeldranisVial.lua if HasItem(Player, FilledVial) == false then SummonItem(Player, FilledVial, 1) -end \ No newline at end of file +end +``` \ No newline at end of file diff --git a/docs/lua_functions/HasLootItem.md b/docs/lua_functions/HasLootItem.md index 5905d21..d3fa2ce 100644 --- a/docs/lua_functions/HasLootItem.md +++ b/docs/lua_functions/HasLootItem.md @@ -1,17 +1,23 @@ -### Function: HasLootItem(param1, param2) +### Function: HasLootItem(spawn, item_id) **Description:** -Placeholder description. +Identifies if the specified spawn has the item_id in it's loot drop table. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: int32 - Integer value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `item_id` (uint32) - Integer value `item_id`. **Returns:** None. **Example:** ```lua --- Example usage -HasLootItem(..., ...) +-- From Quests/FarJourneyFreeport/TasksaboardtheFarJourney.lua + rat = GetSpawnFromList(spawns, i-1) + if rat then + SetAttackable(rat, 1) + if HasLootItem(rat, 11615) == false then + AddLootItem(rat, 11615) + end + end ``` diff --git a/docs/lua_functions/HasPendingLoot.md b/docs/lua_functions/HasPendingLoot.md index df8d6e2..83b53ab 100644 --- a/docs/lua_functions/HasPendingLoot.md +++ b/docs/lua_functions/HasPendingLoot.md @@ -1,17 +1,29 @@ -### Function: HasPendingLoot(param1, param2) +### Function: HasPendingLoot(entity, player) **Description:** -Placeholder description. +Identifies if the Player has pending loot with the targetted Entity (NPC). **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: Spawn - The spawn or entity involved. +- `entity` (int32) - Integer value `entity`. +- `player` (Spawn) - Spawn object representing `player`. **Returns:** None. **Example:** ```lua --- Example usage -HasPendingLoot(..., ...) +-- 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/HasPendingLootItem.md b/docs/lua_functions/HasPendingLootItem.md index 34d8439..9d0e105 100644 --- a/docs/lua_functions/HasPendingLootItem.md +++ b/docs/lua_functions/HasPendingLootItem.md @@ -1,18 +1,15 @@ -### Function: HasPendingLootItem(param1, param2, param3) +### Function: HasPendingLootItem(entity, player, item_id) **Description:** -Placeholder description. +Identifies if the Player has a specific pending loot of item_id with the targetted Entity (NPC). **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: Spawn - The spawn or entity involved. -- `param3`: int32 - Integer value. +- `entity` (int32) - Integer value `entity`. +- `player` (Spawn) - Spawn object representing `player`. +- `item_id` (uint32) - Integer value `item_id`. **Returns:** None. **Example:** -```lua --- Example usage -HasPendingLootItem(..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/HasPendingQuest.md b/docs/lua_functions/HasPendingQuest.md index 7ed9f2d..b0a1b06 100644 --- a/docs/lua_functions/HasPendingQuest.md +++ b/docs/lua_functions/HasPendingQuest.md @@ -1,19 +1,48 @@ -### Function: HasPendingQuest(param1, param2, param3, param4) +### Function: HasPendingQuest(player, quest_id) **Description:** -Placeholder description. +Identifies if the Player has a pending quest acceptance window for the quest_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`. +- `quest_id` (uint32) - Integer value `quest_id`. **Returns:** None. **Example:** ```lua --- Example usage -HasPendingQuest(..., ..., ..., ...) +-- From SpawnScripts/ElddarGrove/NaturalistTummyfill.lua + +function hailed(NPC, Spawn) + local playerLevel = GetLevel(Spawn) + local quests = nil + + -- Determine the quests based on the player's level (20-29) + if playerLevel >= 20 and playerLevel <= 24 then + quests = questsByLevel["20-24"] + elseif playerLevel >= 25 and playerLevel <= 29 then + quests = questsByLevel["25-29"] + end + + if quests then + -- Check if the player already has an active quest + for _, questID in ipairs(quests) do + if HasQuest(Spawn, questID) then + -- If the player has an active quest, inform them and exit + Say(NPC, "You're already on a task. Finish it first before taking another.") + return + elseif HasPendingQuest(Spawn, questID) then + -- If the player has a pending quest, do nothing and exit + return + end + end + -- If no quest was found, offer a new one + local newQuestID = quests[math.random(#quests)] + OfferQuest(NPC, Spawn, newQuestID) + Say(NPC, "I have a task for someone of your experience. Will you take it?") + else + Say(NPC, "I have no tasks suitable for your level. You may need to seek another challenge.") + end +end ``` diff --git a/docs/lua_functions/HasQuestRewardItem.md b/docs/lua_functions/HasQuestRewardItem.md index 20a32cd..d609467 100644 --- a/docs/lua_functions/HasQuestRewardItem.md +++ b/docs/lua_functions/HasQuestRewardItem.md @@ -1,17 +1,14 @@ -### Function: HasQuestRewardItem(param1, param2) +### Function: HasQuestRewardItem(quest, item_id) **Description:** -Placeholder description. +Return's true if the item_id is present on the Quest's item reward list (not selectable). **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: int32 - Integer value. +- `quest` (Quest) - Quest object representing `quest`. +- `item_id` (uint32) - Integer value `item_id`. -**Returns:** None. +**Returns:** True if present on the quest reward item list. Otherwise false. **Example:** -```lua --- Example usage -HasQuestRewardItem(..., ...) -``` +Example Required diff --git a/docs/lua_functions/InLava.md b/docs/lua_functions/InLava.md index dc6c916..adc28fa 100644 --- a/docs/lua_functions/InLava.md +++ b/docs/lua_functions/InLava.md @@ -1,16 +1,18 @@ -Function: InLava(Spawn) +### Function: InLava(Spawn) -Description: Checks if the specified spawn is in lava. Similar to InWater, but specifically for lava volumes which might cause damage. +**Description:** +Checks if the specified spawn is in lava. Similar to InWater, but specifically for lava volumes which might cause damage. -Parameters: +**Parameters:** +- `Spawn`: Spawn – The entity to check. - Spawn: Spawn – The entity to check. +**Returns:** Boolean – true if the spawn is currently in lava; false otherwise. -Returns: Boolean – true if the spawn is currently in lava; false otherwise. - -Example: +**Example:** +```lua -- Example usage (tell the player they are standing in lava) if InLava(Player) then SendMessage(Player, "Feels toasty here..", "red") -end \ No newline at end of file +end +``` \ No newline at end of file diff --git a/docs/lua_functions/InWater.md b/docs/lua_functions/InWater.md index 22e2d8c..3de7983 100644 --- a/docs/lua_functions/InWater.md +++ b/docs/lua_functions/InWater.md @@ -1,18 +1,20 @@ -Function: InWater(Spawn) +### Function: InWater(Spawn) -Description: Determines if the given spawn is currently submerged in water. +**Description:** +Determines if the given spawn is currently submerged in water. -Parameters: +**Parameters:** +- `Spawn`: Spawn – The entity to check. - Spawn: Spawn – The entity to check. +**Returns:** Boolean – true if the spawn is in water; false if not. -Returns: Boolean – true if the spawn is in water; false if not. - -Example: +**Example:** +```lua -- Example usage (If NPC is in water make them glow) if InWater(NPC) then SpawnSet(NPC, "visual_state", 2103) else SpawnSet(NPC, "visual_state", 0) -end \ No newline at end of file +end +``` \ No newline at end of file diff --git a/docs/lua_functions/IsEpic.md b/docs/lua_functions/IsEpic.md index 3e0bdef..7879731 100644 --- a/docs/lua_functions/IsEpic.md +++ b/docs/lua_functions/IsEpic.md @@ -1,15 +1,15 @@ -Function: IsEpic(Spawn) +### Function: IsEpic(Spawn) -Description: Checks if the given NPC is flagged as an “Epic” encounter. +**Description:** Checks if the given NPC is flagged as an “Epic” encounter. -Parameters: +**Parameters:** +- `Spawn`: Spawn – The NPC to check. - Spawn: Spawn – The NPC to check. +**Returns:** Boolean – true if the spawn is an Epic tier NPC; false otherwise. -Returns: Boolean – true if the spawn is an Epic tier NPC; false otherwise. - -Example: +**Example:** +```lua -- Example AtrebasEtherealBindings.lua (Spells Script) function precast(Caster, Target) -- Does not affect Epic targets @@ -17,4 +17,5 @@ function precast(Caster, Target) return false, 43 end return true -end \ No newline at end of file +end +``` \ No newline at end of file diff --git a/docs/lua_functions/ModifyHP.md b/docs/lua_functions/ModifyHP.md index 7c4ae0e..2308215 100644 --- a/docs/lua_functions/ModifyHP.md +++ b/docs/lua_functions/ModifyHP.md @@ -1,17 +1,24 @@ -### Function: ModifyHP(param1, param2) +### Function: ModifyHP(spawn, value) **Description:** -Placeholder description. +Sets the Spawn's HP to the value if the value plus the current health is greater than the Spawn's Total HP. If the current health plus the is less than the total hp, then it will restore the current HP up to the value. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `value` (sint32) - Integer value `value`. **Returns:** None. **Example:** ```lua --- Example usage -ModifyHP(..., ...) +-- From ItemScripts/guiderobes.lua +function equipped(Item, Spawn) + while HasItem(Spawn, 157245) + do + PlayAnimation(Spawn, 16583) + end + Emote(Spawn, "feels empowered.") + ModifyHP(Spawn, 1000000000) +end ``` diff --git a/docs/lua_functions/ModifyMaxHP.md b/docs/lua_functions/ModifyMaxHP.md index dc81129..6a95e40 100644 --- a/docs/lua_functions/ModifyMaxHP.md +++ b/docs/lua_functions/ModifyMaxHP.md @@ -1,17 +1,16 @@ -### Function: ModifyMaxHP(param1, param2) +### Function: ModifyMaxHP(spawn, value) **Description:** -Placeholder description. +Sets the Maximum HP of the Spawn to the value provided. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `value` (sint32) - Integer value `value`. **Returns:** None. **Example:** ```lua --- Example usage -ModifyMaxHP(..., ...) +ModifyMaxHP(NPC, 10000) ``` diff --git a/docs/lua_functions/ModifyMaxPower.md b/docs/lua_functions/ModifyMaxPower.md index 067fd25..1bcf3c5 100644 --- a/docs/lua_functions/ModifyMaxPower.md +++ b/docs/lua_functions/ModifyMaxPower.md @@ -1,17 +1,16 @@ -### Function: ModifyMaxPower(param1, param2) +### Function: ModifyMaxPower(spawn, value) **Description:** -Placeholder description. +Sets the Maximum Power of the Spawn to the value provided. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `value` (int32) - Integer value `value`. **Returns:** None. **Example:** ```lua --- Example usage -ModifyMaxPower(..., ...) +ModifyMaxPower(NPC, 10000) ``` diff --git a/docs/lua_functions/ModifyPower.md b/docs/lua_functions/ModifyPower.md index 9921179..b07dbb3 100644 --- a/docs/lua_functions/ModifyPower.md +++ b/docs/lua_functions/ModifyPower.md @@ -1,17 +1,31 @@ -### Function: ModifyPower(param1, param2) +### Function: ModifyPower(spawn, value) **Description:** -Placeholder description. +Sets the Spawn's Power to the value if the value plus the current power is greater than the Spawn's Total Power. If the current power plus the is less than the total power, then it will restore the current power up to the value. + **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `value` (int32) - Integer value `value`. **Returns:** None. **Example:** ```lua --- Example usage -ModifyPower(..., ...) +-- From SpawnScripts/Commonlands/TerraThud.lua +function spawn(NPC, Spawn) + local Level = GetLevel(NPC) + + if Level == 21 then + SetMaxHP(NPC, 6885) + ModifyHP(NPC, 6885) + SetMaxPower(NPC, 1650) + ModifyPower(NPC, 1650) + elseif Level == 22 then + SetMaxHP(NPC, 7500) + ModifyHP(NPC, 7500) + SetMaxPower(NPC, 1750) + ModifyPower(NPC, 1750) + end ``` diff --git a/docs/lua_functions/MoveToLocation.md b/docs/lua_functions/MoveToLocation.md index 83d7b2f..85e41cb 100644 --- a/docs/lua_functions/MoveToLocation.md +++ b/docs/lua_functions/MoveToLocation.md @@ -1,23 +1,27 @@ -### Function: MoveToLocation(param1, param2, param3, param4, param5, param6, param7, param8) +### Function: MoveToLocation(spawn, x, y, z, speed, lua_function, more_points, use_nav_path) **Description:** -Placeholder description. +Tells NPC to move to the location specified in the x,y,z. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: float - Floating point value. -- `param3`: float - Floating point value. -- `param4`: float - Floating point value. -- `param5`: float - Floating point value. -- `param6`: string - String value. -- `param7`: bool - Boolean value (true/false). -- `param8`: bool - Boolean value (true/false). +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `x` (int32) - Integer value `x`. +- `y` (int32) - Integer value `y`. +- `z` (int32) - Integer value `z`. +- `speed` (int32) - Integer value `speed`. +- `lua_function` (int32) - Integer value `lua_function`. +- `more_points` (int32) - Integer value `more_points`. +- `use_nav_path` (int32) - Integer value `use_nav_path`. **Returns:** None. **Example:** ```lua --- Example usage -MoveToLocation(..., ..., ..., ..., ..., ..., ..., ...) +-- From SpawnScripts/BeggarsCourt/aBrotherhoodenforcer.lua +function spawn(NPC) + if GetSpawnLocationID(NPC) == 403031 then + MoveToLocation(NPC, -14.62, 2.25, -6.99, 3, "", true) + MoveToLocation(NPC, -17.68, 3.00, -21.58, 3, "", false) + end ``` diff --git a/docs/lua_functions/MovementLoopAdd.md b/docs/lua_functions/MovementLoopAdd.md index 8282cc0..4d53928 100644 --- a/docs/lua_functions/MovementLoopAdd.md +++ b/docs/lua_functions/MovementLoopAdd.md @@ -1,26 +1,49 @@ -### Function: MovementLoopAdd(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11) +### Function: MovementLoopAdd(spawn, x, y, z, speed, delay, function, heading, exclude_heading, use_nav_path) **Description:** -Placeholder description. +Adds a waypoint for the NPC to reach in order of the supplied waypoints. Calls function when arriving at the waypoint destination. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: float - Floating point value. -- `param4`: float - Floating point value. -- `param5`: float - Floating point value. -- `param6`: float - Floating point value. -- `param7`: int32 - Integer value. -- `param8`: string - String value. -- `param9`: float - Floating point value. -- `param10`: bool - Boolean value (true/false). -- `param11`: bool - Boolean value (true/false). +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `x` (int32) - Integer value `x`. +- `y` (int32) - Integer value `y`. +- `z` (int32) - Integer value `z`. +- `speed` (int32) - Integer value `speed`. +- `delay` (int32) - Integer value `delay`. +- `function` (int32) - Integer value `function`. +- `heading` (int32) - Integer value `heading`. +- `exclude_heading` (int32) - Integer value `exclude_heading`. +- `use_nav_path` (int32) - Integer value `use_nav_path`. **Returns:** None. **Example:** ```lua --- Example usage -MovementLoopAdd(..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ...) +-- From SpawnScripts/FarJourneyFreeport/agoblin.lua +function run_around_loop(NPC) + MovementLoopAdd(NPC, -4.43, -2.07, 6.17, 5, 1) + MovementLoopAdd(NPC, -4.43, -2.07, 6.17, 5, 3, "run_around_loop_pause1") + MovementLoopAdd(NPC, -4.43, -2.07, 6.17, 5, 0) + MovementLoopAdd(NPC, -5.23, -2.01, 0.39, 5, 1) + MovementLoopAdd(NPC, -5.23, -2.01, 0.39, 5, 3, "run_around_loop_pause2") + MovementLoopAdd(NPC, -5.23, -2.01, 0.39, 5, 0) + MovementLoopAdd(NPC, -4.88, -2.06, 4.26, 5, 1) + MovementLoopAdd(NPC, -4.88, -2.06, 4.26, 5, 3, "run_around_loop_pause3") + MovementLoopAdd(NPC, -4.88, -2.06, 4.26, 5, 0) + MovementLoopAdd(NPC, 3.94, -2.07, 0.66, 5, 1) + MovementLoopAdd(NPC, 3.94, -2.07, 0.66, 5, 3, "run_around_loop_pause4") + MovementLoopAdd(NPC, 3.94, -2.07, 0.66, 5, 0) + MovementLoopAdd(NPC, 2.84, -2.07, -2.07, 5, 1) + MovementLoopAdd(NPC, 2.84, -2.07, -2.07, 5, 3, "run_around_loop_pause5") + MovementLoopAdd(NPC, 2.84, -2.07, -2.07, 5, 0) + MovementLoopAdd(NPC, 3.41, -1.99, -7.42, 5, 1) + MovementLoopAdd(NPC, 3.41, -1.99, -7.42, 5, 3, "run_around_loop_pause6") + MovementLoopAdd(NPC, 3.41, -1.99, -7.42, 5, 0) + MovementLoopAdd(NPC, -2.75, -2.02, -5.82, 5, 0) + MovementLoopAdd(NPC, -2.63, 1.21, -18.11,5,1) + MovementLoopAdd(NPC, -2.63, 1.21, -18.11,5,3,"run_around_loop_pause7") + MovementLoopAdd(NPC, -2.63, 1.21, -18.11,3,0) + MovementLoopAdd(NPC, -2.75, -2.02, -5.82, 5, 0) +end ``` diff --git a/docs/lua_functions/OfferQuest.md b/docs/lua_functions/OfferQuest.md index efd7492..20a5cab 100644 --- a/docs/lua_functions/OfferQuest.md +++ b/docs/lua_functions/OfferQuest.md @@ -1,23 +1,22 @@ -### Function: OfferQuest(param1, param2, param3, param4, param5, param6, param7, param8) +### Function: OfferQuest(npc, player, quest_id, forced) **Description:** -Placeholder description. +NPC Offers the quest window or auto accept of the quest to the Player. **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`: int32 - Integer value. -- `param8`: bool - Boolean value (true/false). +- `npc` (Spawn) - Spawn object representing `npc`. +- `player` (Spawn) - Spawn object representing `player`. +- `quest_id` (uint32) - Integer value `quest_id`. +- `forced` (int32) - Integer value `forced`. **Returns:** None. **Example:** ```lua --- Example usage -OfferQuest(..., ..., ..., ..., ..., ..., ..., ...) +-- 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/PlayAnimation.md b/docs/lua_functions/PlayAnimation.md index df643f7..2b8460b 100644 --- a/docs/lua_functions/PlayAnimation.md +++ b/docs/lua_functions/PlayAnimation.md @@ -1,21 +1,22 @@ -### Function: PlayAnimation(param1, param2, param3, param4, param5, param6) +### Function: PlayAnimation(spawn, anim, target, hide_type) **Description:** -Placeholder description. +The spawn will play the animation `anim` type specified. See the Appearance IDs by client in the ReferenceList here https://wiki.eq2emu.com/ReferenceLists +Note that the target and hide_type are optional fields. Setting the hide_type to 1 will mean only the target receives the update. Setting to 2 will exclude the target and send to all others. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: int32 - Integer value. -- `param5`: Spawn - The spawn or entity involved. -- `param6`: int8 - Small integer or boolean flag. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `anim` (int32) - Integer value `anim`. +- `target` (Spawn) - Spawn objet representing `target`. +- `hide_type` (int32) - Integer value `hide_type`. **Returns:** None. **Example:** ```lua --- Example usage -PlayAnimation(..., ..., ..., ..., ..., ...) +-- From ItemScripts/CrestridersTonic.lua +function cast(Item, Player) +PlayAnimation(Player, 11422) -- No joking its drink animation +end ``` diff --git a/docs/lua_functions/PlayAnimationString.md b/docs/lua_functions/PlayAnimationString.md index 43d956e..7f1533b 100644 --- a/docs/lua_functions/PlayAnimationString.md +++ b/docs/lua_functions/PlayAnimationString.md @@ -1,23 +1,26 @@ -### Function: PlayAnimationString(param1, param2, param3, param4, param5, param6, param7, param8) +### Function: PlayAnimationString(spawn, name, opt_target, set_no_target, use_all_spelltargets, ignore_self) **Description:** -Placeholder description. +Play an animation by using the string to all Player's or only a specific optional_target (Player). Review Appearance ID's in the Reference List https://wiki.eq2emu.com/ReferenceLists by client for more details. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: string - String value. -- `param5`: Spawn - The spawn or entity involved. -- `param6`: bool - Boolean value (true/false). -- `param7`: bool - Boolean value (true/false). -- `param8`: bool - Boolean value (true/false). +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `name` (string) - String `name`. +- `opt_target` (int32) - Integer value `opt_target`. +- `set_no_target` (int32) - Integer value `set_no_target`. +- `use_all_spelltargets` (int32) - Integer value `use_all_spelltargets`. +- `ignore_self` (int32) - Integer value `ignore_self`. **Returns:** None. **Example:** ```lua --- Example usage -PlayAnimationString(..., ..., ..., ..., ..., ..., ..., ...) +-- From Spells/Commoner/UnholyFear.lua +function cast(Caster, Target) + local targets = GetSpellTargets() + for k,v in ipairs(targets) do + if GetLevel(v) < GetLevel(Caster) then + PlayAnimationString(v, "cringe", nil, true) + end ``` diff --git a/docs/lua_functions/PlayFlavor.md b/docs/lua_functions/PlayFlavor.md index 5c6600d..40e5caa 100644 --- a/docs/lua_functions/PlayFlavor.md +++ b/docs/lua_functions/PlayFlavor.md @@ -1,23 +1,42 @@ -### Function: PlayFlavor(param1, param2, param3, param4, param5, param6, param7, param8) +### Function: PlayFlavor(spawn, mp3_string, text_string, emote_string, key1, key2, player, language) **Description:** -Placeholder description. +Allows Player/NPC to display a text bubble and/or mp3 voiceovers (with usually required key1/key2 values). **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: string - String value. -- `param3`: string - String value. -- `param4`: string - String value. -- `param5`: int32 - Integer value. -- `param6`: int32 - Integer value. -- `param7`: Spawn - The spawn or entity involved. -- `param8`: int8 - Small integer or boolean flag. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `mp3_string` (string) - String `mp3_string`. +- `text_string` (string) - String `text_string`. +- `emote_string` (string) - String `emote_string`. +- `key1` (int32) - Integer value `key1`. +- `key2` (int32) - Integer value `key2`. +- `player` (Spawn) - Spawn object representing `player`. +- `language` (int32) - Integer value `language`. **Returns:** None. **Example:** ```lua --- Example usage -PlayFlavor(..., ..., ..., ..., ..., ..., ..., ...) +-- From ItemScripts/AcommemorativeFreeportCoin.lua +function examined(Item, Player) +conversation = CreateConversation() +PlayFlavor(Player,"voiceover/english/tullia_domna/fprt_hood04/quests/tulladomna/tulla_x1_initial.mp3","","",309451026,621524268,Player) +--PlayFlavor(Player,"voiceover/english/overlord_lucan_d_lere/fprt_west/lucan_isle_speech.mp3","","",2912329438, 4090300715,Player) + + local choice = MakeRandomInt(1,6) + + if choice == 1 then + PlayFlavor(Player, "voiceover/english/overlord_lucan_d_lere/fprt_west/lucan_isle_speech_4.mp3", "You show potential, but there are many who seek the auspices of Lucan, and I only have time for champions.", "", 2060818628, 3998142234, Player, 0) + elseif choice == 2 then + PlayFlavor(Player, "voiceover/english/overlord_lucan_d_lere/fprt_west/lucan_isle_speech_5.mp3", "Prove yourself, and I shall grant you shelter at the edge of my city, and the chance to earn your place as a proud citizen of Freeport.", "", 4115014723, 2723692261, Player, 0) + elseif choice == 3 then + PlayFlavor(Player, "voiceover/english/overlord_lucan_d_lere/fprt_west/lucan_isle_speech_8.mp3", "Together we will restore the glory of ages past, crush the Sons of Zek, and sweep aside the decadent nation of Qeynos!", "", 140890899, 2835297833, Player, 0) + elseif choice == 4 then + PlayFlavor(Player, "voiceover/english/overlord_lucan_d_lere/fprt_west/lucan_isle_speech_9.mp3", "With my guidance, you shall gain power and glory as you have never imagined, but should you turn against me, you will find that my wrath is a terrible thing ... Now go!", "", 3855854568, 2247480313, Player, 0) + elseif choice == 5 then + PlayFlavor(Player, "voiceover/english/overlord_lucan_d_lere/fprt_west/lucan_isle_speech_7.mp3", "Succeed, and you will share the fortunes of Freeport as we reshape this broken world.", "", 2666628260, 1943756642, Player, 0) + elseif choice == 6 then + PlayFlavor(Player, "voiceover/english/overlord_lucan_d_lere/fprt_west/lucan_isle_speech_6.mp3", "Go now, and begin the trials that I have set for you.", "", 1244918730, 586509135, Player, 0) + end ``` diff --git a/docs/lua_functions/PlayFlavorID.md b/docs/lua_functions/PlayFlavorID.md index fa8e122..c81f764 100644 --- a/docs/lua_functions/PlayFlavorID.md +++ b/docs/lua_functions/PlayFlavorID.md @@ -1,21 +1,26 @@ -### Function: PlayFlavorID(param1, param2, param3, param4, param5, param6) +### Function: PlayFlavorID(spawn, type, id, index, player, language) **Description:** -Placeholder description. +Uses the database dialog_play_flavors and dialog_play_voices. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: int8 - Small integer or boolean flag. -- `param3`: int32 - Integer value. -- `param4`: int16 - Short integer value. -- `param5`: Spawn - The spawn or entity involved. -- `param6`: int8 - Small integer or boolean flag. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `type` (int32) - Integer value `type`. +- `id` (uint32) - Integer value `id`. +- `index` (int32) - Integer value `index`. +- `player` (Spawn) - Spawn object representing `player`. +- `language` (int32) - Integer value `language`. **Returns:** None. **Example:** -```lua --- Example usage -PlayFlavorID(..., ..., ..., ..., ..., ...) +```sql +insert into voiceovers set type_id=2,id=100,indexed=1,mp3_string="voiceover/english/gnoll_base_1/ft/gnoll/gnoll_base_1_2_garbled_2f8caa7b.mp3", text_string="Krovel grarggt ereverrrn", key1=2385604574, key2=3717589402, garbled=1,garble_link_id=1; + +insert into voiceovers set type_id=2,id=100,indexed=1,mp3_string="voiceover/english/sean_wellfayer/qey_harbor/100_qst_sean_wellfayer_multhail1_5dca659c.mp3", text_string="I don't think fishing interests you. Perhaps you should be on your way!", key1=1997164956, key2=747011072, garbled=0,garble_link_id=1; +``` + +```lua +PlayFlavorID(NPC, 2, 100, 1, nil, 18) ``` diff --git a/docs/lua_functions/PlaySound.md b/docs/lua_functions/PlaySound.md index c667d7d..8eb61e8 100644 --- a/docs/lua_functions/PlaySound.md +++ b/docs/lua_functions/PlaySound.md @@ -1,21 +1,21 @@ -### Function: PlaySound(param1, param2, param3, param4, param5, param6) +### Function: PlaySound(spawn, sound_string, x, y, z, player) **Description:** -Placeholder description. +Plays a sound using the sound_string to the area or specified player. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: string - String value. -- `param3`: float - Floating point value. -- `param4`: float - Floating point value. -- `param5`: float - Floating point value. -- `param6`: Spawn - The spawn or entity involved. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `sound_string` (string) - String `sound_string`. +- `x` (int32) - Integer value `x`. +- `y` (int32) - Integer value `y`. +- `z` (int32) - Integer value `z`. +- `player` (Spawn) - Spawn object representing `player`. **Returns:** None. **Example:** ```lua --- Example usage -PlaySound(..., ..., ..., ..., ..., ...) +-- From ItemScripts/BardCertificationPapers.lua +PlaySound(Player, "sounds/test/endquest.wav", GetX(Player), GetY(Player), GetZ(Player), Player) ``` diff --git a/docs/lua_functions/PlayVoice.md b/docs/lua_functions/PlayVoice.md index cc7051a..18513ee 100644 --- a/docs/lua_functions/PlayVoice.md +++ b/docs/lua_functions/PlayVoice.md @@ -1,20 +1,29 @@ -### Function: PlayVoice(param1, param2, param3, param4, param5) +### Function: PlayVoice(spawn, mp3_string, key1, key2, player) **Description:** -Placeholder description. +Spawn plays a mp3 voiceover with no text bubble. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: string - String value. -- `param3`: int32 - Integer value. -- `param4`: int32 - Integer value. -- `param5`: Spawn - The spawn or entity involved. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `mp3_string` (string) - String `mp3_string`. +- `key1` (int32) - Integer value `key1`. +- `key2` (int32) - Integer value `key2`. +- `player` (Spawn) - Spawn object representing `player`. **Returns:** None. **Example:** ```lua --- Example usage -PlayVoice(..., ..., ..., ..., ...) +-- From SpawnScripts/Antonica/TheSageofAges.lua +function RandomGreeting(NPC, Spawn) + local choice = MakeRandomInt(1,3) + + if choice == 1 then + PlayVoice(NPC, "voiceover/english/voice_emotes/greetings/greetings_2_1022.mp3", 0, 0, Spawn) + elseif choice == 2 then + PlayVoice(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1022.mp3", 0, 0, Spawn) + elseif choice == 3 then + PlayVoice(NPC, "voiceover/english/voice_emotes/greetings/greetings_1_1022.mp3", 0, 0, Spawn) + end ``` diff --git a/docs/lua_functions/ProvidesQuest.md b/docs/lua_functions/ProvidesQuest.md index 974e0cc..73e09e1 100644 --- a/docs/lua_functions/ProvidesQuest.md +++ b/docs/lua_functions/ProvidesQuest.md @@ -1,17 +1,19 @@ -### Function: ProvidesQuest(param1, param2) +### Function: ProvidesQuest(npc, quest_id) **Description:** -Placeholder description. +The NPC provides a quest offering to Player's. This will support the feather flags for players. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: int32 - Integer value. +- `npc` (Spawn) - Spawn object representing `npc`. +- `quest_id` (uint32) - Integer value `quest_id`. **Returns:** None. **Example:** ```lua --- Example usage -ProvidesQuest(..., ...) +-- From SpawnScripts/Antonica/AGriffonTamer.lua +function spawn(NPC) + ProvidesQuest(NPC, GriffonEggs) +end ``` diff --git a/docs/lua_functions/QuestIsComplete.md b/docs/lua_functions/QuestIsComplete.md index 60f5d4f..6861157 100644 --- a/docs/lua_functions/QuestIsComplete.md +++ b/docs/lua_functions/QuestIsComplete.md @@ -1,17 +1,22 @@ -### Function: QuestIsComplete(param1, param2) +### Function: QuestIsComplete(player, quest_id) **Description:** -Placeholder description. +Identifies if the quest has been completed or not based on the quest_id. **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. **Example:** ```lua --- Example usage -QuestIsComplete(..., ...) +-- From Quests/Baubbleshire/helping_some_friends.lua +function step2_complete_talkedToDrundo(Quest, QuestGiver, Player) + UpdateQuestStepDescription(Quest, 2, "I have given Drundo the walnut pie.") + + if QuestIsComplete(Player, HELPING_SOME_FRIENDS) then + pranks_given(Quest, QuestGiver, Player) + end ``` diff --git a/docs/lua_functions/QuestReturnNPC.md b/docs/lua_functions/QuestReturnNPC.md index c152bfe..8b967ee 100644 --- a/docs/lua_functions/QuestReturnNPC.md +++ b/docs/lua_functions/QuestReturnNPC.md @@ -1,17 +1,21 @@ -### Function: QuestReturnNPC(param1, param2) +### Function: QuestReturnNPC(quest, spawn_id) **Description:** -Placeholder description. +Sets the return NPC point for a Quest when the quest has been completed. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: int32 - Integer value. +- `quest` (Quest) - Quest object representing `quest`. +- `spawn_id` (uint32) - Integer value `spawn_id`. **Returns:** None. **Example:** ```lua --- Example usage -QuestReturnNPC(..., ...) +-- From Quests/Hallmark/archetype_selection.lua +function Init(Quest) + AddQuestStepChat(Quest, 1, "I need to talk to Garven Tralk", 1, "I need to talk to Garven Tralk", 11, 3250020) + AddQuestStepCompleteAction(Quest, 1, "QuestComplete") + QuestReturnNPC(Quest, 3250020) +end ``` diff --git a/docs/lua_functions/QuestStepIsComplete.md b/docs/lua_functions/QuestStepIsComplete.md index 0a6fe4d..2016c2f 100644 --- a/docs/lua_functions/QuestStepIsComplete.md +++ b/docs/lua_functions/QuestStepIsComplete.md @@ -1,18 +1,26 @@ -### Function: QuestStepIsComplete(param1, param2, param3) +### Function: QuestStepIsComplete(player, quest_id, step_id) **Description:** -Placeholder description. +Returns if the Player has completed the step_id in the specified quest_id. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: int32 - Integer value. -- `param3`: int32 - Integer value. +- `player` (Spawn) - Spawn object representing `player`. +- `quest_id` (uint32) - Integer value `quest_id`. +- `step_id` (uint32) - Integer value `step_id`. **Returns:** None. **Example:** ```lua --- Example usage -QuestStepIsComplete(..., ..., ...) +-- From ItemScripts/aboarfiendhoof.lua +function examined(Item, Player) +if not HasQuest(Player, LoreAndLegendBoarfiend) and not HasCompletedQuest(Player, LoreAndLegendBoarfiend) then +OfferQuest(nil, Player, LoreAndLegendBoarfiend) +elseif not QuestStepIsComplete(Player, LoreAndLegendBoarfiend, 4) then +conversation = CreateConversation() +AddConversationOption(conversation, "Begin to study...", "Step_Complete") +AddConversationOption(conversation, "No, put away", "CloseItemConversation") +StartDialogConversation(conversation, 2, Item, Player, "This item can be used to learn the secrets of the boarfiend. Do you wish to study it?") +end ``` diff --git a/docs/lua_functions/RegisterQuest.md b/docs/lua_functions/RegisterQuest.md index 184640b..0ca4e88 100644 --- a/docs/lua_functions/RegisterQuest.md +++ b/docs/lua_functions/RegisterQuest.md @@ -1,27 +1,18 @@ -### Function: RegisterQuest(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11, param12) +### Function: RegisterQuest(quest, name, type, zone, level, description) **Description:** -Placeholder description. +Allows overriding the Quet's name, type, zone, level and description details. **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`: string - String value. -- `param9`: string - String value. -- `param10`: string - String value. -- `param11`: int16 - Short integer value. -- `param12`: string - String value. +- `quest` (Quest) - Quest object representing `quest`. +- `name` (string) - String `name`. +- `type` (int32) - Integer value `type`. +- `zone` (Zone) - Zone object representing `zone`. +- `level` (int32) - Integer value `level`. +- `description` (int32) - Integer value `description`. **Returns:** None. **Example:** -```lua --- Example usage -RegisterQuest(..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/RemoveControlEffect.md b/docs/lua_functions/RemoveControlEffect.md index aba6589..ae9a2af 100644 --- a/docs/lua_functions/RemoveControlEffect.md +++ b/docs/lua_functions/RemoveControlEffect.md @@ -1,21 +1,20 @@ -### Function: RemoveControlEffect(param1, param2, param3, param4, param5, param6) +### Function: RemoveControlEffect(spawn, type, only_remove_spawn) **Description:** -Placeholder description. +Removes a control effect from the Spawn or from the spell targets of a spell. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. -- `param5`: int8 - Small integer or boolean flag. -- `param6`: int8 - Small integer or boolean flag. +- `Spawn` (Spawn) - Spawn object reference `spawn`. +- `type` (int32) - Integer value `type`. +- `only_remove_spawn` (int32) - Integer value `only_remove_spawn`. **Returns:** None. **Example:** ```lua --- Example usage -RemoveControlEffect(..., ..., ..., ..., ..., ...) +-- From Spells/AA/DazingBash.lua +function remove(Caster, Target) + RemoveControlEffect(Target, 3) +end ``` diff --git a/docs/lua_functions/RemoveItem.md b/docs/lua_functions/RemoveItem.md index 83258d1..d0bf88f 100644 --- a/docs/lua_functions/RemoveItem.md +++ b/docs/lua_functions/RemoveItem.md @@ -1,18 +1,68 @@ -### Function: RemoveItem(param1, param2, param3) +### Function: RemoveItem(spawn, item_id, quantity) **Description:** -Placeholder description. +Removes an item_id of the quantity specified from the Player's inventory if possible. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: int32 - Integer value. -- `param3`: int16 - Short integer value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `item_id` (uint32) - Integer value `item_id`. +- `quantity` (int32) - Integer value `quantity`. -**Returns:** None. +**Returns:** True if able to remove the specified item_id and quantity, otherwise False if failed. **Example:** ```lua --- Example usage -RemoveItem(..., ..., ...) +-- From ItemScripts/aBagofBasicProvisions.lua +function examined(Item, Player) +RemoveItem(Player,1001011,1) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SendMessage(Player, "You found 20 flasks of water in the bag.") +SendMessage(Player, "You found 20 rations in the bag.") +--[[ alignment = GetDeity(Player) --THESE ARE COMMEMORATIVE COINS. THIS ITEM HAS BEEN GIVEN TO THE AMBASSADORS FOR PLAYERS SELECTING THEIR CITY. THIS REDUCES THE CHANCE THE WRONG COIN IS GIVEN. + if alignment == 0 then + SummonItem(Player, 1413,1) -- evil rewards + else + SummonItem(Player, 1414,1) -- good rewards + end]]-- +end ``` diff --git a/docs/lua_functions/RemoveLootItem.md b/docs/lua_functions/RemoveLootItem.md index 1bcbba6..cb7a474 100644 --- a/docs/lua_functions/RemoveLootItem.md +++ b/docs/lua_functions/RemoveLootItem.md @@ -1,17 +1,23 @@ -### Function: RemoveLootItem(param1, param2) +### Function: RemoveLootItem(spawn, item_id) **Description:** -Placeholder description. +Removes a loot item from the Spawn(NPC). **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: int32 - Integer value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `item_id` (uint32) - Integer value `item_id`. **Returns:** None. **Example:** ```lua --- Example usage -RemoveLootItem(..., ...) +-- From SpawnScripts/Antonica/adankfurdockwarden.lua +function death(NPC, Spawn) +if GetQuestStep(Spawn, QUEST_3) == 2 then +if not HasItem(Spawn, 7800) then + AddLootItem(Spawn, 7800) +elseif HasItem(Spawn, 7800) then +RemoveLootItem(Spawn, 7800) +end ``` diff --git a/docs/lua_functions/RemovePrimaryEntityCommand.md b/docs/lua_functions/RemovePrimaryEntityCommand.md index 658de49..0438712 100644 --- a/docs/lua_functions/RemovePrimaryEntityCommand.md +++ b/docs/lua_functions/RemovePrimaryEntityCommand.md @@ -1,16 +1,17 @@ -Function: RemovePrimaryEntityCommand(Spawn, CommandString) +### Function: RemovePrimaryEntityCommand(Spawn, CommandString) -Description: Removes a previously added primary entity command from the specified spawn entirely. Players will no longer see that option when interacting with the spawn. +**Description:** +Removes a previously added primary entity command from the specified spawn entirely. Players will no longer see that option when interacting with the spawn. -Parameters: +**Parameters:** +- `Spawn`: Spawn – The entity from which to remove the command. +- `CommandString`: String – The name of the command to remove. - Spawn: Spawn – The entity from which to remove the command. +**Returns:** None. - CommandString: String – The name of the command to remove. - -Returns: None. - -Example: +**Example:** +```lua -- Example usage (Remove hail from command list) -RemovePrimaryEntityCommand(QuestNPC, "hail") \ No newline at end of file +RemovePrimaryEntityCommand(QuestNPC, "hail") +``` \ No newline at end of file diff --git a/docs/lua_functions/RemoveRecipeFromPlayer.md b/docs/lua_functions/RemoveRecipeFromPlayer.md index ba2eff9..39cd3a4 100644 --- a/docs/lua_functions/RemoveRecipeFromPlayer.md +++ b/docs/lua_functions/RemoveRecipeFromPlayer.md @@ -1,17 +1,14 @@ -### Function: RemoveRecipeFromPlayer(param1, param2) +### Function: RemoveRecipeFromPlayer(player, recipe_id) **Description:** -Placeholder description. +Removes the recipe_id from the Player's recipe book. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: int32 - Integer value. +- `player` (Spawn) - Spawn object representing `player`. +- `recipe_id` (uint32) - Integer value `recipe_id`. -**Returns:** None. +**Returns:** True if successfully removed from recipe book, otherwise False if unable to remove from recipe book. **Example:** -```lua --- Example usage -RemoveRecipeFromPlayer(..., ...) -``` +Example Required diff --git a/docs/lua_functions/RemoveRegion.md b/docs/lua_functions/RemoveRegion.md index 980406a..4b4da94 100644 --- a/docs/lua_functions/RemoveRegion.md +++ b/docs/lua_functions/RemoveRegion.md @@ -1,19 +1,15 @@ -### Function: RemoveRegion(param1, param2, param3, param4) +### Function: RemoveRegion(zone, version, region_name) **Description:** -Placeholder description. +Removes a region by name from the the 3d space tracking. **Parameters:** -- `param1`: ZoneServer - The zone object. -- `param2`: unknown - Unknown type. -- `param3`: int32 - Integer value. -- `param4`: string - String value. +- `zone` (Zone) - Zone object representing `zone`. +- `version` (int32) - Integer value `version`. +- `region_name` (string) - String `region_name`. **Returns:** None. **Example:** -```lua --- Example usage -RemoveRegion(..., ..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/RemoveSkillBonus.md b/docs/lua_functions/RemoveSkillBonus.md index 67f799d..44c1df8 100644 --- a/docs/lua_functions/RemoveSkillBonus.md +++ b/docs/lua_functions/RemoveSkillBonus.md @@ -1,17 +1,18 @@ -### Function: RemoveSkillBonus(param1, param2) +### Function: RemoveSkillBonus(spawn) **Description:** -Placeholder description. +Remove's any skill bonuses added to the Spawn (if outside a spells script) or all spell targets of a spell from AddSkillBonus (if inside a spell script). **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. +- `spawn` (Spawn) - Spawn object reference `spawn`. **Returns:** None. **Example:** ```lua --- Example usage -RemoveSkillBonus(..., ...) +-- From Spells/AA/BattlemagesFervor.lua +function remove(Caster, Target) + RemoveSkillBonus(Target) +end ``` diff --git a/docs/lua_functions/RemoveSpawnIDAccess.md b/docs/lua_functions/RemoveSpawnIDAccess.md index 59d61d7..9074896 100644 --- a/docs/lua_functions/RemoveSpawnIDAccess.md +++ b/docs/lua_functions/RemoveSpawnIDAccess.md @@ -1,20 +1,15 @@ -### Function: RemoveSpawnIDAccess(param1, param2, param3, param4, param5) +### Function: RemoveSpawnIDAccess(spawn, id, zone) **Description:** -Placeholder description. +Removes the Spawn(Player) access to any of the `id` spawn ids inside the Zone specified. If zone is not provided, Spawn's zone is used. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: int32 - Integer value. -- `param5`: ZoneServer - The zone object. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `id` (uint32) - Integer value `id`. +- `zone` (Zone) - Zone object representing `zone`. **Returns:** None. **Example:** -```lua --- Example usage -RemoveSpawnIDAccess(..., ..., ..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/RemoveSpellBonus.md b/docs/lua_functions/RemoveSpellBonus.md index 065c256..81d1375 100644 --- a/docs/lua_functions/RemoveSpellBonus.md +++ b/docs/lua_functions/RemoveSpellBonus.md @@ -1,17 +1,18 @@ -### Function: RemoveSpellBonus(param1, param2) +### Function: RemoveSpellBonus(spawn) **Description:** -Placeholder description. +Remove's any spell bonuses from AddSpellBonus. If inside a spell Script RemoveSpellBonus() will remove all spell targets bonuses, RemoveSpellBonus(Target) removes only that Spawn's spell bonuses. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. +- `spawn` (Spawn) - Spawn object reference `spawn`. **Returns:** None. **Example:** ```lua --- Example usage -RemoveSpellBonus(..., ...) +-- From Spells/AA/AbilityAptitude.lua +function remove(Caster, Target) + RemoveSpellBonus(Target) +end ``` diff --git a/docs/lua_functions/RemoveSpellBookEntry.md b/docs/lua_functions/RemoveSpellBookEntry.md index 85a74ca..b69019f 100644 --- a/docs/lua_functions/RemoveSpellBookEntry.md +++ b/docs/lua_functions/RemoveSpellBookEntry.md @@ -1,17 +1,21 @@ -### Function: RemoveSpellBookEntry(param1, param2) +### Function: RemoveSpellBookEntry(player, spellid) **Description:** -Placeholder description. +Removes the spellid from the Player's spell book. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: int32 - Integer value. +- `player` (Spawn) - Spawn object representing `player`. +- `spellid` (uint32) - Integer value `spellid`. **Returns:** None. **Example:** ```lua --- Example usage -RemoveSpellBookEntry(..., ...) +-- From ItemScripts/BrawlerCertificationPapers.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/RemoveWidgetFromSpawnMap.md b/docs/lua_functions/RemoveWidgetFromSpawnMap.md index 3f53487..b7ab214 100644 --- a/docs/lua_functions/RemoveWidgetFromSpawnMap.md +++ b/docs/lua_functions/RemoveWidgetFromSpawnMap.md @@ -1,17 +1,14 @@ -### Function: RemoveWidgetFromSpawnMap(param1, param2) +### Function: RemoveWidgetFromSpawnMap(spawn, widget_id) **Description:** -Placeholder description. +Removes the widget from the map (line of sight and heightmap checks). **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: int32 - Integer value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `widget_id` (uint32) - Integer value `widget_id`. **Returns:** None. **Example:** -```lua --- Example usage -RemoveWidgetFromSpawnMap(..., ...) -``` +Example Required diff --git a/docs/lua_functions/RemoveWidgetFromZoneMap.md b/docs/lua_functions/RemoveWidgetFromZoneMap.md index 1238d6a..6ddc0c6 100644 --- a/docs/lua_functions/RemoveWidgetFromZoneMap.md +++ b/docs/lua_functions/RemoveWidgetFromZoneMap.md @@ -1,17 +1,23 @@ -### Function: RemoveWidgetFromZoneMap(param1, param2) +### Function: RemoveWidgetFromZoneMap(zone, widget_id) **Description:** -Placeholder description. +Removes the widget from the 3d world space in the client and server. Must be used in preinit_zone_script **Parameters:** -- `param1`: ZoneServer - The zone object. -- `param2`: int32 - Integer value. +- `zone` (Zone) - Zone object representing `zone`. +- `widget_id` (uint32) - Integer value `widget_id`. **Returns:** None. **Example:** ```lua --- Example usage -RemoveWidgetFromZoneMap(..., ...) +-- From ZoneScripts/ThunderingSteppes.lua +function preinit_zone_script(Zone) + RemoveWidgetFromZoneMap(Zone, 2909687498) + RemoveWidgetFromZoneMap(Zone, 506885674) + RemoveWidgetFromZoneMap(Zone, 800135876) + RemoveWidgetFromZoneMap(Zone, 2944954936) + +end ``` diff --git a/docs/lua_functions/ReplaceWidgetFromClient.md b/docs/lua_functions/ReplaceWidgetFromClient.md index 16560c5..cf3e858 100644 --- a/docs/lua_functions/ReplaceWidgetFromClient.md +++ b/docs/lua_functions/ReplaceWidgetFromClient.md @@ -1,22 +1,18 @@ -### Function: ReplaceWidgetFromClient(param1, param2, param3, param4, param5, param6, param7) +### Function: ReplaceWidgetFromClient(player, widget_id, x, y, z, grid_id) **Description:** -Placeholder description. +Can relocate a widget from its current location in the client map to a new location. Must be called after client has sent sys_client_avatar_ready **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: int32 - Integer value. -- `param3`: int8 - Small integer or boolean flag. -- `param4`: float - Floating point value. -- `param5`: float - Floating point value. -- `param6`: float - Floating point value. -- `param7`: int32 - Integer value. +- `player` (Spawn) - Spawn object representing `player`. +- `widget_id` (uint32) - Integer value `widget_id`. +- `x` (int32) - Integer value `x`. +- `y` (int32) - Integer value `y`. +- `z` (int32) - Integer value `z`. +- `grid_id` (uint32) - Integer value `grid_id`. **Returns:** None. **Example:** -```lua --- Example usage -ReplaceWidgetFromClient(..., ..., ..., ..., ..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/Say.md b/docs/lua_functions/Say.md index 2a24a02..0a3ef65 100644 --- a/docs/lua_functions/Say.md +++ b/docs/lua_functions/Say.md @@ -1,20 +1,35 @@ -### Function: Say(param1, param2, param3, param4, param5) +### Function: Say(spawn, message, player, dist, language) **Description:** -Placeholder description. +Sends a Say message from the Spawn to the general area based on distance, or otherwise to a specific Player if specified, otherwise optional/nil. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: string - String value. -- `param3`: Spawn - The spawn or entity involved. -- `param4`: float - Floating point value. -- `param5`: int32 - Integer value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `message` (string) - String `message`. +- `player` (Spawn) - Spawn object representing `player`. +- `dist` (int32) - Integer value `dist`. +- `language` (int32) - Integer value `language`. **Returns:** None. **Example:** ```lua --- Example usage -Say(..., ..., ..., ..., ...) +-- From ItemScripts/DrawingRay.lua +function used(Item, Player) + quest = GetQuest(Player, CAVES_CONSUL_BREE_QUEST_3) + --Say(Player, "RAY HAS BEEN USED") + if HasQuest(Player, CAVES_CONSUL_BREE_QUEST_3) then + spawn = GetTarget(Player) + -- Say(Player, "PLAYER HAS QUEST") + if spawn ~= nil then + --Say(Player, "SPAWN IS NOT NIL") + -- river behemoth remains + if GetSpawnID(spawn) == RIVER_BEHEMOTH_REMAINS_ID then + CastSpell(Player, 5104, 1) + GiveQuestItem(quest, Player, "", RIVER_STONE_ID) + -- Say(Player, "ITEM OBTAINED") + else + SendMessage(Player, "The Drawing Ray has no effect. Emma said it must be used on the remains of a river behemoth.") + end ``` diff --git a/docs/lua_functions/SayOOC.md b/docs/lua_functions/SayOOC.md index f996e2a..8648150 100644 --- a/docs/lua_functions/SayOOC.md +++ b/docs/lua_functions/SayOOC.md @@ -1,20 +1,17 @@ -### Function: SayOOC(param1, param2, param3, param4, param5) +### Function: SayOOC(spawn, message, player, dist, language) **Description:** -Placeholder description. +Sends a Out of Character message from the Spawn to the general area based on the distance, or otherwise to a specific Player if specified, otherwise optional/nil. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: string - String value. -- `param3`: Spawn - The spawn or entity involved. -- `param4`: float - Floating point value. -- `param5`: int32 - Integer value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `message` (string) - String `message`. +- `player` (Spawn) - Spawn object representing `player`. +- `dist` (int32) - Integer value `dist`. +- `language` (int32) - Integer value `language`. **Returns:** None. **Example:** -```lua --- Example usage -SayOOC(..., ..., ..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/SendHearCast.md b/docs/lua_functions/SendHearCast.md index 2ecacbb..fde8e74 100644 --- a/docs/lua_functions/SendHearCast.md +++ b/docs/lua_functions/SendHearCast.md @@ -1,21 +1,17 @@ -### Function: SendHearCast(param1, param2, param3, param4, param5, param6) +### Function: SendHearCast(spell, spell_visual_id, cast_time, caster, target) **Description:** -Placeholder description. +Sends a notice to the area that they see visually per Spell Visuals in https://wiki.eq2emu.com/ReferenceLists and receive a spell message in their chat window based on Caster and Target. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: Spawn - The spawn or entity involved. -- `param3`: int32 - Integer value. -- `param4`: int16 - Short integer value. -- `param5`: Spawn - The spawn or entity involved. -- `param6`: Spawn - The spawn or entity involved. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `spell_visual_id` (uint32) - Integer value `spell_visual_id`. +- `cast_time` (int32) - Time value `cast_time` in seconds. +- `caster` (Spawn) - Spawn object representing `caster`. +- `target` (Spawn) - Spawn object representing `target`. **Returns:** None. **Example:** -```lua --- Example usage -SendHearCast(..., ..., ..., ..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/SendMessage.md b/docs/lua_functions/SendMessage.md index ca74390..b5df304 100644 --- a/docs/lua_functions/SendMessage.md +++ b/docs/lua_functions/SendMessage.md @@ -1,18 +1,68 @@ -### Function: SendMessage(param1, param2, param3) +### Function: SendMessage(spawn, message, color_str) **Description:** -Placeholder description. +Sends a direct channel message to the Spawn/Player. The color_str is optional, default is white, "red" and "yellow" is offered. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: string - String value. -- `param3`: string - String value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `message` (string) - String `message`. +- `color_str` (string) - String `color_str`. **Returns:** None. **Example:** ```lua --- Example usage -SendMessage(..., ..., ...) +-- From ItemScripts/aBagofBasicProvisions.lua +function examined(Item, Player) +RemoveItem(Player,1001011,1) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SendMessage(Player, "You found 20 flasks of water in the bag.") +SendMessage(Player, "You found 20 rations in the bag.") +--[[ alignment = GetDeity(Player) --THESE ARE COMMEMORATIVE COINS. THIS ITEM HAS BEEN GIVEN TO THE AMBASSADORS FOR PLAYERS SELECTING THEIR CITY. THIS REDUCES THE CHANCE THE WRONG COIN IS GIVEN. + if alignment == 0 then + SummonItem(Player, 1413,1) -- evil rewards + else + SummonItem(Player, 1414,1) -- good rewards + end]]-- +end ``` diff --git a/docs/lua_functions/SendNewAdventureSpells.md b/docs/lua_functions/SendNewAdventureSpells.md index 9ab0329..dc45348 100644 --- a/docs/lua_functions/SendNewAdventureSpells.md +++ b/docs/lua_functions/SendNewAdventureSpells.md @@ -1,16 +1,13 @@ -### Function: SendNewAdventureSpells(param1) +### Function: SendNewAdventureSpells(player) **Description:** -Placeholder description. +Sends adventure spells by their level. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. +- `player` (Spawn) - Spawn object representing `player`. **Returns:** None. **Example:** -```lua --- Example usage -SendNewAdventureSpells(...) -``` +Example Required diff --git a/docs/lua_functions/SendNewTradeskillSpells.md b/docs/lua_functions/SendNewTradeskillSpells.md index a877b36..2642d4c 100644 --- a/docs/lua_functions/SendNewTradeskillSpells.md +++ b/docs/lua_functions/SendNewTradeskillSpells.md @@ -1,16 +1,13 @@ -### Function: SendNewTradeskillSpells(param1) +### Function: SendNewTradeskillSpells(player) **Description:** -Placeholder description. +Sends tradeskill spells by their level. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. +- `player` (Spawn) - Spawn object representing `player`. **Returns:** None. **Example:** -```lua --- Example usage -SendNewTradeskillSpells(...) -``` +Example Required diff --git a/docs/lua_functions/SendPopUpMessage.md b/docs/lua_functions/SendPopUpMessage.md index 01ca701..ff9a230 100644 --- a/docs/lua_functions/SendPopUpMessage.md +++ b/docs/lua_functions/SendPopUpMessage.md @@ -1,22 +1,25 @@ -### Function: SendPopUpMessage(param1, param2, param3, param4, param5, param6, param7) +### Function: SendPopUpMessage(spawn, message, red, green, blue) **Description:** -Placeholder description. +Sends a popup message to the Spawn(Player) with the message in the popup. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: string - String value. -- `param5`: int8 - Small integer or boolean flag. -- `param6`: int8 - Small integer or boolean flag. -- `param7`: int8 - Small integer or boolean flag. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `message` (string) - String `message`. +- `red` (int32) - Integer value `red`. +- `green` (int32) - Integer value `green`. +- `blue` (int32) - Integer value `blue`. **Returns:** None. **Example:** ```lua --- Example usage -SendPopUpMessage(..., ..., ..., ..., ..., ..., ...) +-- From ItemScripts/BardCertificationPapers.lua +function QuestStart(Item,Player) + OfferQuest(nil,Player,Quest) + conversation = CreateConversation() + AddConversationOption(conversation, "[Put the signed certificate away]","TaskDone") + StartDialogConversation(conversation, 2, Item, Player, "The Shady Swashbuckler might have some gear I can use...") +end ``` diff --git a/docs/lua_functions/SendStateCommand.md b/docs/lua_functions/SendStateCommand.md index 0fadb24..0d5971e 100644 --- a/docs/lua_functions/SendStateCommand.md +++ b/docs/lua_functions/SendStateCommand.md @@ -1,18 +1,25 @@ -### Function: SendStateCommand(param1, param2, param3) +### Function: SendStateCommand(spawn, new_state, player) **Description:** -Placeholder description. +Updates the state of the Spawn and it's behavior, can optionally be sent to a single Player. The new_state is based on the Appearance ID's https://wiki.eq2emu.com/ReferenceLists by client version. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: int32 - Integer value. -- `param3`: Spawn - The spawn or entity involved. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `new_state` (int32) - Integer value `new_state`. +- `player` (Spawn) - Spawn object representing `player`. **Returns:** None. **Example:** ```lua --- Example usage -SendStateCommand(..., ..., ...) +-- From Quests/TheCryptofBetrayal/forgotten_potion.lua +function Accepted(Quest, QuestGiver, Player) + FaceTarget(QuestGiver, Player) + local conversation = CreateConversation() + if GetClientVersion(Player) == 546 then + SendStateCommand(QuestGiver, 13061) + else + PlayAnimation(QuestGiver, 13061) + end ``` diff --git a/docs/lua_functions/SendUpdateDefaultCommand.md b/docs/lua_functions/SendUpdateDefaultCommand.md index 857405f..f152bcc 100644 --- a/docs/lua_functions/SendUpdateDefaultCommand.md +++ b/docs/lua_functions/SendUpdateDefaultCommand.md @@ -1,20 +1,19 @@ -Function: SendUpdateDefaultCommand(Spawn, Distance, CommandString, Player) +### Function: SendUpdateDefaultCommand(Spawn, Distance, CommandString, Player) -Description: Updates the default highlighted command for an entity, as seen on hover or target window. This is often used after changing accessible commands to ensure the correct default action (usually the first allowed command) is highlighted. +**Description:** +Updates the default highlighted command for an entity, as seen on hover or target window. This is often used after changing accessible commands to ensure the correct default action (usually the first allowed command) is highlighted. -Parameters: +**Parameters:** +- `Spawn`: Spawn – The entity to update. +- `Distance`: Float – The maximum distance the command can be used. +- `CommandString`: String – The command to provide access. +- `Player`: Spawn – The player whom has access to the command (optional to specify a specific Player). - Spawn: Spawn – The entity to update. +**Returns:** None. - Distance: Float – The maximum distance the command can be used. - - CommandString: String – The command to provide access. - - Player: Spawn – The player whom has access to the command (optional to specify a specific Player). - -Returns: None. - -Example: +**Example:** +```lua -- Example usage (after toggling commands on an NPC, refresh its default action) -SendUpdateDefaultCommand(NPC, 10.0, "hail") \ No newline at end of file +SendUpdateDefaultCommand(NPC, 10.0, "hail") +``` diff --git a/docs/lua_functions/SetAccessToEntityCommand.md b/docs/lua_functions/SetAccessToEntityCommand.md index 469808e..bd89ef6 100644 --- a/docs/lua_functions/SetAccessToEntityCommand.md +++ b/docs/lua_functions/SetAccessToEntityCommand.md @@ -1,20 +1,19 @@ -Function: SetAccessToEntityCommand(Spawn, Player, CommandString, Allowed) +### Function: SetAccessToEntityCommand(Spawn, Player, CommandString, Allowed) -Description: Controls whether a particular primary entity command (right-click option) is enabled for a given spawn. You can use this to enable or disable specific interactions dynamically. +**Description:** +Controls whether a particular primary entity command (right-click option) is enabled for a given spawn. You can use this to enable or disable specific interactions dynamically. -Parameters: +**Parameters:** +- `Spawn`: Spawn – The entity whose command access to modify. +- `Player`: Spawn – The Player who will receive access to the command. +- `CommandString`: String – The name of the command (same as used in AddPrimaryEntityCommand). +- `Allowed`: UInt8 – `1` to allow players to use this command on the spawn; `0` to remove it. - Spawn: Spawn – The entity whose command access to modify. - - Player: Spawn – The Player who will receive access to the command. +**Returns:** Return's true if successfully adding access to the entity command. - CommandString: String – The name of the command (same as used in AddPrimaryEntityCommand). - - Allowed: UInt8 – `1` to allow players to use this command on the spawn; `0` to remove it. - -Returns: Return's true if successfully adding access to the entity command. - -Example: +**Example:** +```lua -- Example usage (disable the 'Buy' option on a merchant after shop closes) -SetAccessToEntityCommand(MerchantNPC, "Buy", 0) \ No newline at end of file +SetAccessToEntityCommand(MerchantNPC, "Buy", 0) +``` \ No newline at end of file diff --git a/docs/lua_functions/SetAccessToEntityCommandByCharID.md b/docs/lua_functions/SetAccessToEntityCommandByCharID.md index c19e6e0..6104a5d 100644 --- a/docs/lua_functions/SetAccessToEntityCommandByCharID.md +++ b/docs/lua_functions/SetAccessToEntityCommandByCharID.md @@ -1,20 +1,19 @@ -Function: SetAccessToEntityCommandByCharID(Spawn, CharID, CommandString, Allowed) +### Function: SetAccessToEntityCommandByCharID(Spawn, CharID, CommandString, Allowed) -Description: Similar to SetAccessToEntityCommand, but targets a specific player (by character ID) and spawn. It toggles a command’s availability for that one player on the given spawn. +**Description:** +Similar to SetAccessToEntityCommand, but targets a specific player (by character ID) and spawn. It toggles a command’s availability for that one player on the given spawn. -Parameters: +**Parameters:** +- `Spawn`: Spawn – The entity offering the command. +- `CharID`: Int32 – The character ID of the player whose access to adjust. +- `CommandString`: String – The command name. +- `Allowed`: UInt8 – `1` to allow that player to use the command; `0` to deny them. - Spawn: Spawn – The entity offering the command. +**Returns:** If successful at setting permission to the entity command, function return's true. - CharID: Int32 – The character ID of the player whose access to adjust. - - CommandString: String – The command name. - - Allowed: UInt8 – `1` to allow that player to use the command; `0` to deny them. - -Returns: If successful at setting permission to the entity command, function return's true. - -Example: +**Example:** +```lua -- Example usage (allow only a specific player to use a secret door’s “Open” command) -SetAccessToEntityCommandByCharID(SecretDoor, PlayerCharID, "Open", 1) \ No newline at end of file +SetAccessToEntityCommandByCharID(SecretDoor, PlayerCharID, "Open", 1) +``` \ No newline at end of file diff --git a/docs/lua_functions/SetAdventureClass.md b/docs/lua_functions/SetAdventureClass.md index 7b1f51b..f0bd8f5 100644 --- a/docs/lua_functions/SetAdventureClass.md +++ b/docs/lua_functions/SetAdventureClass.md @@ -1,17 +1,19 @@ -### Function: SetAdventureClass(param1, param2) +### Function: SetAdventureClass(spawn, value) **Description:** -Placeholder description. +Changes the Spawn(Player) class to the new value. Class list is available at https://wiki.eq2emu.com/ReferenceLists/ClassList **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: int8 - Small integer or boolean flag. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `value` (int32) - Integer value `value`. **Returns:** None. **Example:** ```lua --- Example usage -SetAdventureClass(..., ...) +-- From ItemScripts/BardCertificationPapers.lua + StartDialogConversation(conversation, 2, Item, Player, "You are now known as \n\n"..GetName(Player).." the Bard.") + if GetClass(Player)== 1 or GetClass(Player)== 0 then + SetAdventureClass(Player,35) ``` diff --git a/docs/lua_functions/SetAggroRadius.md b/docs/lua_functions/SetAggroRadius.md index 29f14e1..65be5ff 100644 --- a/docs/lua_functions/SetAggroRadius.md +++ b/docs/lua_functions/SetAggroRadius.md @@ -1,20 +1,22 @@ -### Function: SetAggroRadius(param1, param2, param3, param4, param5) +### Function: SetAggroRadius(spawn, distance, override_) **Description:** -Placeholder description. +Sets the aggro radius of the Spawn(NPC). The override_ flag will set the base aggro radius to the same value. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: float - Floating point value. -- `param5`: bool - Boolean value (true/false). +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `distance` (int32) - Distance `distance`. +- `override_` (int32) - Integer value `override_`. **Returns:** None. **Example:** ```lua --- Example usage -SetAggroRadius(..., ..., ..., ..., ...) +-- From SpawnScripts/Commonlands/aMilitiaGuard.lua +function spawn(NPC) + NPCModule(NPC, Spawn) + SetAggroRadius(NPC, 20) + AddTimer(NPC, 180000, "despawn", 1) +end ``` diff --git a/docs/lua_functions/SetAgi.md b/docs/lua_functions/SetAgi.md index 79cd981..c88cb48 100644 --- a/docs/lua_functions/SetAgi.md +++ b/docs/lua_functions/SetAgi.md @@ -1,18 +1,14 @@ -### Function: SetAgi(param1, param2, param3) +### Function: SetAgi(spawn, value) **Description:** -Placeholder description. +Set's the Spawn's agility to the value. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: float - Floating point value. +- `luaspell` (int32) - Integer value `luaspell`. +- `value` (int32) - Integer value `value`. **Returns:** None. **Example:** -```lua --- Example usage -SetAgi(..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/SetAgiBase.md b/docs/lua_functions/SetAgiBase.md index 59e15d3..bc41a0c 100644 --- a/docs/lua_functions/SetAgiBase.md +++ b/docs/lua_functions/SetAgiBase.md @@ -1,17 +1,22 @@ -### Function: SetAgiBase(param1, param2) +### Function: SetAgiBase(spawn, value) **Description:** -Placeholder description. +Set's the Spawn's base agility to the value. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: int16 - Short integer value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `value` (int32) - Integer value `value`. **Returns:** None. **Example:** ```lua --- Example usage -SetAgiBase(..., ...) +-- 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/SetAttackable.md b/docs/lua_functions/SetAttackable.md index e9cae27..2d483cb 100644 --- a/docs/lua_functions/SetAttackable.md +++ b/docs/lua_functions/SetAttackable.md @@ -1,17 +1,27 @@ -### Function: SetAttackable(param1, param2) +### Function: SetAttackable(spawn, attackable) **Description:** -Placeholder description. +Sets the Spawn attackable or not. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: int8 - Small integer or boolean flag. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `attackable` (int32) - Integer value `attackable`. **Returns:** None. **Example:** ```lua --- Example usage -SetAttackable(..., ...) +-- From Quests/FarJourneyFreeport/TasksaboardtheFarJourney.lua +function CurrentStep(Quest, QuestGiver, Player) + if GetQuestStepProgress(Player, 524,2) == 0 and GetQuestStep(Player, 524) == 2 then + i = 1 + spawns = GetSpawnListBySpawnID(Player, 270010) + repeat + spawn = GetSpawnFromList(spawns, i-1) + if spawn then + ChangeHandIcon(spawn, 1) + AddPrimaryEntityCommand(nil, spawn) + SpawnSet(NPC, "targetable", 1, true, true) + end ``` diff --git a/docs/lua_functions/SetCanBind.md b/docs/lua_functions/SetCanBind.md index b1c7186..7fb788f 100644 --- a/docs/lua_functions/SetCanBind.md +++ b/docs/lua_functions/SetCanBind.md @@ -1,18 +1,14 @@ -### Function: SetCanBind(param1, param2, param3) +### Function: SetCanBind(spawn, canbind) **Description:** -Placeholder description. +Sets if the zone allows to bind. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: int32 - Integer value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `canbind` (int32) - Integer value `canbind`. **Returns:** None. **Example:** -```lua --- Example usage -SetCanBind(..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/SetCanEvac.md b/docs/lua_functions/SetCanEvac.md index e2da22f..6670260 100644 --- a/docs/lua_functions/SetCanEvac.md +++ b/docs/lua_functions/SetCanEvac.md @@ -1,18 +1,14 @@ -### Function: SetCanEvac(param1, param2, param3) +### Function: SetCanEvac(spawn, canevac) **Description:** -Placeholder description. +Sets if the zone allows evac in the area. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: int32 - Integer value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `canevac` (int32) - Integer value `canevac`. **Returns:** None. **Example:** -```lua --- Example usage -SetCanEvac(..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/SetCanGate.md b/docs/lua_functions/SetCanGate.md index 664eed9..01dcf5a 100644 --- a/docs/lua_functions/SetCanGate.md +++ b/docs/lua_functions/SetCanGate.md @@ -1,18 +1,14 @@ -### Function: SetCanGate(param1, param2, param3) +### Function: SetCanGate(spawn, cangate) **Description:** -Placeholder description. +Sets if the zone allows gate in the area. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: int32 - Integer value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `cangate` (int32) - Integer value `cangate`. **Returns:** None. **Example:** -```lua --- Example usage -SetCanGate(..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/SetCastOnAggroComplete.md b/docs/lua_functions/SetCastOnAggroComplete.md index 45a306b..70cb9d6 100644 --- a/docs/lua_functions/SetCastOnAggroComplete.md +++ b/docs/lua_functions/SetCastOnAggroComplete.md @@ -1,19 +1,14 @@ -### Function: SetCastOnAggroComplete(param1, param2, param3, param4) +### Function: SetCastOnAggroComplete(spawn, value) **Description:** -Placeholder description. +Overrides the cast on aggro complete flag for an NPC. **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`. +- `value` (Bool) - Bool `value`. **Returns:** None. **Example:** -```lua --- Example usage -SetCastOnAggroComplete(..., ..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/SetCoinTmpReward.md b/docs/lua_functions/SetCoinTmpReward.md index 48baa46..29b09db 100644 --- a/docs/lua_functions/SetCoinTmpReward.md +++ b/docs/lua_functions/SetCoinTmpReward.md @@ -1,17 +1,14 @@ -### Function: SetCoinTmpReward(param1, param2) +### Function: SetCoinTmpReward(quest, coins) **Description:** -Placeholder description. +Set the temporary reward for the quest to the coins in copper. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: unknown - Unknown type. +- `quest` (Quest) - Quest object representing `quest`. +- `coins` (int32) - Integer value `coins`. **Returns:** None. **Example:** -```lua --- Example usage -SetCoinTmpReward(..., ...) -``` +Example Required diff --git a/docs/lua_functions/SetCompleteFlag.md b/docs/lua_functions/SetCompleteFlag.md index 5e59b69..46223b0 100644 --- a/docs/lua_functions/SetCompleteFlag.md +++ b/docs/lua_functions/SetCompleteFlag.md @@ -1,17 +1,19 @@ -### Function: SetCompleteFlag(param1, param2) +### Function: SetCompleteFlag(quest) **Description:** -Placeholder description. +Set the quest flag as completed. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: unknown - Unknown type. +- `quest` (Quest) - Quest object representing `quest`. **Returns:** None. **Example:** ```lua --- Example usage -SetCompleteFlag(..., ...) +-- From Quests/Darklight/ASolidifiedFront.lua +function QuestComplete(Quest, QuestGiver, Player) + SetCompleteFlag(Quest) + GiveQuestReward(Quest, Player) +end ``` diff --git a/docs/lua_functions/SetCompletedDescription.md b/docs/lua_functions/SetCompletedDescription.md index 722b944..8f92545 100644 --- a/docs/lua_functions/SetCompletedDescription.md +++ b/docs/lua_functions/SetCompletedDescription.md @@ -1,17 +1,14 @@ -### Function: SetCompletedDescription(param1, param2) +### Function: SetCompletedDescription(quest, description) **Description:** -Placeholder description. +Sets the quest description to display when completed. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: string - String value. +- `quest` (Quest) - Quest object representing `quest`. +- `description` (int32) - Integer value `description`. **Returns:** None. **Example:** -```lua --- Example usage -SetCompletedDescription(..., ...) -``` +Example Required diff --git a/docs/lua_functions/SetDeity.md b/docs/lua_functions/SetDeity.md index bd803bb..fd60bba 100644 --- a/docs/lua_functions/SetDeity.md +++ b/docs/lua_functions/SetDeity.md @@ -1,17 +1,14 @@ -### Function: SetDeity(param1, param2) +### Function: SetDeity(spawn, value) **Description:** -Placeholder description. +Set's the deity of the Spawn. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: int8 - Small integer or boolean flag. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `value` (int32) - Integer value `value`. **Returns:** None. **Example:** -```lua --- Example usage -SetDeity(..., ...) -``` +Example Required diff --git a/docs/lua_functions/SetFactionID.md b/docs/lua_functions/SetFactionID.md index aab6003..a725864 100644 --- a/docs/lua_functions/SetFactionID.md +++ b/docs/lua_functions/SetFactionID.md @@ -1,17 +1,14 @@ -### Function: SetFactionID(param1, param2) +### Function: SetFactionID(spawn, value) **Description:** -Placeholder description. +Sets the faction of the Spawn(NPC). **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: int32 - Integer value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `value` (int32) - Integer value `value`. **Returns:** None. **Example:** -```lua --- Example usage -SetFactionID(..., ...) -``` +Example Required diff --git a/docs/lua_functions/SetHeading.md b/docs/lua_functions/SetHeading.md index 794cc09..32f592e 100644 --- a/docs/lua_functions/SetHeading.md +++ b/docs/lua_functions/SetHeading.md @@ -1,17 +1,19 @@ -### Function: SetHeading(param1, param2) +### Function: SetHeading(spawn, value) **Description:** -Placeholder description. +Sets the heading of the Spawn. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: float - Floating point value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `value` (int32) - Integer value `value`. **Returns:** None. **Example:** ```lua --- Example usage -SetHeading(..., ...) +-- From SpawnScripts/Baubbleshire/DonnaFairbanks.lua +function Heading(NPC) + SetHeading(NPC,"133") +end ``` diff --git a/docs/lua_functions/SetInfoFlag.md b/docs/lua_functions/SetInfoFlag.md index a425d05..deb68c8 100644 --- a/docs/lua_functions/SetInfoFlag.md +++ b/docs/lua_functions/SetInfoFlag.md @@ -1,16 +1,22 @@ -### Function: SetInfoFlag(param1) +### Function: SetInfoFlag(spawn) **Description:** -Placeholder description. +Enables the info flag to trigger a spawn update. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. +- `spawn` (Spawn) - Spawn object representing `spawn`. **Returns:** None. **Example:** ```lua --- Example usage -SetInfoFlag(...) +-- From SpawnScripts/Antonica/HaddekVimki.lua +function spawn(NPC) + ProvidesQuest(NPC, RunningOutOfBeer) + ProvidesQuest(NPC, OuchMyHead) + ProvidesQuest(NPC, RiseAndShineWine) + ProvidesQuest(NPC, PracticalJokeOnBlarton) + SetPlayerProximityFunction(NPC, 10, "InRange", Spawn) +end ``` diff --git a/docs/lua_functions/SetInt.md b/docs/lua_functions/SetInt.md index 7bffdaf..e44a3fd 100644 --- a/docs/lua_functions/SetInt.md +++ b/docs/lua_functions/SetInt.md @@ -1,18 +1,14 @@ -### Function: SetInt(param1, param2, param3) +### Function: SetInt(spawn, value) **Description:** -Placeholder description. +Sets the Spawn's intelligence to the specified value. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. +- `luaspell` (int32) - Integer value `luaspell`. +- `value` (int32) - Integer value `value`. **Returns:** None. **Example:** -```lua --- Example usage -SetInt(..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/SetIntBase.md b/docs/lua_functions/SetIntBase.md index 09f727b..238eada 100644 --- a/docs/lua_functions/SetIntBase.md +++ b/docs/lua_functions/SetIntBase.md @@ -1,17 +1,22 @@ -### Function: SetIntBase(param1, param2) +### Function: SetIntBase(spawn, value) **Description:** -Placeholder description. +Sets the Spawn's base intelligence to the specified value. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: int16 - Short integer value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `value` (int32) - Integer value `value`. **Returns:** None. **Example:** ```lua --- Example usage -SetIntBase(..., ...) +-- 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/SetLocationProximityFunction.md b/docs/lua_functions/SetLocationProximityFunction.md index f367a2f..ac615a2 100644 --- a/docs/lua_functions/SetLocationProximityFunction.md +++ b/docs/lua_functions/SetLocationProximityFunction.md @@ -1,22 +1,68 @@ -### Function: SetLocationProximityFunction(param1, param2, param3, param4, param5, param6, param7) +### Function: SetLocationProximityFunction(zone, x, y, z, max_variation, in_range_function, leaving_range_function) **Description:** -Placeholder description. +Creates a ZoneScript proximity function for in range and leaving range respectively. **Parameters:** -- `param1`: ZoneServer - The zone object. -- `param2`: float - Floating point value. -- `param3`: float - Floating point value. -- `param4`: float - Floating point value. -- `param5`: float - Floating point value. -- `param6`: string - String value. -- `param7`: string - String value. +- `zone` (Zone) - Zone object representing `zone`. +- `x` (int32) - Integer value `x`. +- `y` (int32) - Integer value `y`. +- `z` (int32) - Integer value `z`. +- `max_variation` (int32) - Integer value `max_variation`. +- `in_range_function` (int32) - Distance `in_range_function`. +- `leaving_range_function` (int32) - Distance `leaving_range_function`. **Returns:** None. **Example:** ```lua --- Example usage -SetLocationProximityFunction(..., ..., ..., ..., ..., ..., ...) +-- From ZoneScripts/Antonica.lua +function init_zone_script(Zone) + SetLocationProximityFunction(Zone, -2128.93, -28.4328, 614.081, 10, "GriffonTower", "Leave") -- Steppes from Qeynos + SetLocationProximityFunction(Zone, -904.472, -7.23051, -610.321, 10, "GriffonTower", "Leave") -- Oracle from Qeynos + SetLocationProximityFunction(Zone, 337.246, -17.3142, 537.882, 10, "GriffonTower", "Leave") -- Qeynos from Steppes + SetLocationProximityFunction(Zone, -912.659, -7.21881, -599.911, 10, "GriffonTower", "Leave") -- Oracle from Steppes + SetLocationProximityFunction(Zone, 327.727, -17.3058, 529.95, 10, "GriffonTower", "Leave") -- Qeynos from Oracle + SetLocationProximityFunction(Zone, -2136.6, -28.5276, 608.087, 10, "GriffonTower", "Leave") -- Steppese from oracle + + SetLocationProximityFunction(Zone,127.20, -24.88, 468.20, 60, "CraterLake","LeaveLocation") + SetLocationProximityFunction(Zone,-102.51, -18.43, 100.64, 95, "CentralFarmlands","LeaveLocation") + SetLocationProximityFunction(Zone,-123.97, -16.37, 585.85, 35, "QeynosHills","LeaveLocation") + SetLocationProximityFunction(Zone,-442.50, 2.15, 551.88, 25, "Claymore","LeaveLocation") + SetLocationProximityFunction(Zone,-503.16, -18.23, 396.36, 95, "QeynosPlains","LeaveLocation") + SetLocationProximityFunction(Zone,-753.87, -3.03, 592.89, 160, "ArcherWoods","LeaveLocation") + SetLocationProximityFunction(Zone,-1191.42, -20.26, 261.38, 70, "QeynosHighway","LeaveLocation") + SetLocationProximityFunction(Zone,-1299.50, 38.29, 44.79, 20, "BellsofVhalen","LeaveLocation") + SetLocationProximityFunction(Zone,-1506.60, -14.37, -11.08, 55, "GladeoftheCoven","LeaveLocation") + SetLocationProximityFunction(Zone,-1567.28, 2.28, 609.58, 90, "BrambleWoods","LeaveLocation") + SetLocationProximityFunction(Zone,424.28, -43.66, 733.90, 50, "ClodwindPoint","LeaveLocation") + SetLocationProximityFunction(Zone,348.00, -9.39, 809.95, 35, "MarinersIsland","LeaveLocation") + SetLocationProximityFunction(Zone,188.45, -19.38, 863.55, 35, "CastawayIsland","LeaveLocation") + SetLocationProximityFunction(Zone,5.57, -9.66, 1028.04, 35, "QeynosSheperdsIsle","LeaveLocation") + SetLocationProximityFunction(Zone,-796.74, -28.08, 1029.75, 30, "WoodedIsle","LeaveLocation") + SetLocationProximityFunction(Zone,-917.46, -17.69, 1052.23, 30, "MemorialIsle","LeaveLocation") + SetLocationProximityFunction(Zone,-327,-14,-501 , 55, "WatchtowerPlains","LeaveLocation") + SetLocationProximityFunction(Zone,326.08,-35.05,-517.55, 30, "MistyIsle","LeaveLocation") + SetLocationProximityFunction(Zone,241.24, -29.62, -682.48, 25, "BridgewayIsle","LeaveLocation") + SetLocationProximityFunction(Zone,334.98, -21.37, -621.86, 30, "AbandonedIsle","LeaveLocation") + SetLocationProximityFunction(Zone,361.84, -19.69, -664.18, 18, "TombofVarsoon","LeaveLocation") + SetLocationProximityFunction(Zone,382.58, -31.81, -798.15, 25, "LonelyIsle","LeaveLocation") + SetLocationProximityFunction(Zone,382.58, -31.81, -798.15, 20, "TravelersIsle","LeaveLocation") + SetLocationProximityFunction(Zone,-376.53, -0.70, -369.36, 85, "ArdentHills","LeaveLocation") + SetLocationProximityFunction(Zone,-555.33, -12.85, -319.13, 18, "KeepoftheArdentNeedle","LeaveLocation") + SetLocationProximityFunction(Zone,-804.55, -32.01, -422.03, 50, "TowerLands","LeaveLocation") + SetLocationProximityFunction(Zone,-1033.81, 14.12, -630.33, 20, "ToweroftheOracles","LeaveLocation") + SetLocationProximityFunction(Zone,-1410.68, -13.88, -742.63, 100, "RuinsofCaltorsis","LeaveLocation") + SetLocationProximityFunction(Zone,-1865, -38, -550, 70, "WindstalkerVillage","LeaveLocation") + SetLocationProximityFunction(Zone,-2182.37, -11.79, -818.23, 100, "WindstalkerHighlands","LeaveLocation") + SetLocationProximityFunction(Zone,-2262.04, -24.72, -570.99, 90, "CoastalGrove","LeaveLocation") + SetLocationProximityFunction(Zone,-2048.99, 15.74, -483.06, 20, "FangbreakerKeep","LeaveLocation") + SetLocationProximityFunction(Zone,-1851.41, -22.03, -194.27, 90, "NorthernFarmlands","LeaveLocation") + SetLocationProximityFunction(Zone,-2104, -43, 438, 20, "KeepoftheGnollSlayer","LeaveLocation") + SetLocationProximityFunction(Zone,-1755, -14, 521, 80, "GnollslayerHighlands","LeaveLocation") + SetLocationProximityFunction(Zone,-1973.00, -20.08, 640.00, 80, "ScarecrowFields","LeaveLocation") + SetLocationProximityFunction(Zone,-2082.70, 47.26, 1029.12, 100, "HiddenVale","LeaveLocation") + +end ``` diff --git a/docs/lua_functions/SetLootCoin.md b/docs/lua_functions/SetLootCoin.md index f9d1254..a88eb8b 100644 --- a/docs/lua_functions/SetLootCoin.md +++ b/docs/lua_functions/SetLootCoin.md @@ -1,17 +1,38 @@ -### Function: SetLootCoin(param1, param2) +### Function: SetLootCoin(spawn, val) **Description:** -Placeholder description. +Sets the Spawn's loot drop of coin in copper. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: int32 - Integer value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `val` (int32) - Integer value `val`. **Returns:** None. **Example:** ```lua --- Example usage -SetLootCoin(..., ...) +-- From SpawnScripts/GMHall/TwoFace.lua +function Yes1(NPC, Spawn) + FaceTarget(NPC, Spawn) + conversation = CreateConversation() + coins = 5000 + local poolCoins = RemoveCoin(Spawn, coins) + --[[This little section will pool coins but will only last until player logs out =( + local npcCoins = GetLootCoin(NPC) + Say(NPC, "I have " .. npcCoins .. " coins. And I just stole from you.") + --]] + if(poolCoins) then + --[[local totalCoins = npcCoins + coins + SetLootCoin(NPC, totalCoins)--]] + PlaySound(NPC, "voiceover/english/voice_emotes/thank/thank_2_1054.mp3", GetX(NPC), GetY(NPC), GetZ(NPC)) + Say(NPC, "Thank you, let's begin!") + randpick = math.random(1, 2) + AddConversationOption(conversation, "Heads!", "Heads1") + AddConversationOption(conversation, "Tails!", "Tails1") + StartConversation(conversation, NPC, Spawn, GetName(Spawn) .. ", I'm going to flip a coin, call it in the air...") + else + Say(NPC, "I'm sorry but you don't have enough money, begone.") + PlaySound(NPC, "sounds/combat/impact/leather/impact_metal_to_leather04.wav", GetX(NPC), GetY(NPC), GetZ(NPC)) + end ``` diff --git a/docs/lua_functions/SetLootDropType.md b/docs/lua_functions/SetLootDropType.md index a737585..5a2e1a6 100644 --- a/docs/lua_functions/SetLootDropType.md +++ b/docs/lua_functions/SetLootDropType.md @@ -1,17 +1,14 @@ -### Function: SetLootDropType(param1, param2) +### Function: SetLootDropType(spawn, loot_drop_type) **Description:** -Placeholder description. +When set to 0 (default) for a Spawn it will drop its loot as a group (unless its a body drop). If set to 1 then this NPC, despite being in a group will drop it's own loot chest. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: int32 - Integer value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `loot_drop_type` (int32) - Integer value `loot_drop_type`. **Returns:** None. **Example:** -```lua --- Example usage -SetLootDropType(..., ...) -``` +Example Required diff --git a/docs/lua_functions/SetLootTier.md b/docs/lua_functions/SetLootTier.md index fa18641..8aea899 100644 --- a/docs/lua_functions/SetLootTier.md +++ b/docs/lua_functions/SetLootTier.md @@ -1,17 +1,14 @@ -### Function: SetLootTier(param1, param2) +### Function: SetLootTier(spawn, loot_tier) **Description:** -Placeholder description. +When set to 0 (default) all loot for the Spawn's table applies. If loot_tier is increased then it will restrict the items to tiers equal or below the loot_tier provided. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: int32 - Integer value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `loot_tier` (int32) - Integer value `loot_tier`. **Returns:** None. **Example:** -```lua --- Example usage -SetLootTier(..., ...) -``` +Example Required diff --git a/docs/lua_functions/SetMaxHP.md b/docs/lua_functions/SetMaxHP.md index 4619eab..ae6ddeb 100644 --- a/docs/lua_functions/SetMaxHP.md +++ b/docs/lua_functions/SetMaxHP.md @@ -1,18 +1,19 @@ -### Function: SetMaxHP(param1, param2, param3) +### Function: SetMaxHP(spawn, value) **Description:** -Placeholder description. +Set's the Max HP of the Spawn (As a Spell Bonus) to the new value. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. +- `spawn` (Spawn) - Spawn object reference `spawn`. +- `value` (int32) - Integer value `value`. **Returns:** None. **Example:** ```lua --- Example usage -SetMaxHP(..., ..., ...) +-- From ItemScripts/devpotion.lua +function examined(Item, Player) +SetMaxHP(Player, GetMaxHP * 3) +end ``` diff --git a/docs/lua_functions/SetMaxHPBase.md b/docs/lua_functions/SetMaxHPBase.md index f60bcbe..2da5e9b 100644 --- a/docs/lua_functions/SetMaxHPBase.md +++ b/docs/lua_functions/SetMaxHPBase.md @@ -1,17 +1,14 @@ -### Function: SetMaxHPBase(param1, param2) +### Function: SetMaxHPBase(spawn, value) **Description:** -Placeholder description. +Set's the Total Base HP of the Spawn to the value provided. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `value` (int32) - Integer value `value`. **Returns:** None. **Example:** -```lua --- Example usage -SetMaxHPBase(..., ...) -``` +Example Required diff --git a/docs/lua_functions/SetMaxPower.md b/docs/lua_functions/SetMaxPower.md index bd3f464..9277fc7 100644 --- a/docs/lua_functions/SetMaxPower.md +++ b/docs/lua_functions/SetMaxPower.md @@ -1,18 +1,30 @@ -### Function: SetMaxPower(param1, param2, param3) +### Function: SetMaxPower(spawn, value) **Description:** -Placeholder description. +Set's the Max Power of the Spawn (As a Spell Bonus) to the new value. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. +- `spawn` (Spawn) - Spawn object reference `spawn`. +- `value` (int32) - Integer value `value`. **Returns:** None. **Example:** ```lua --- Example usage -SetMaxPower(..., ..., ...) +-- From SpawnScripts/Commonlands/TerraThud.lua +function spawn(NPC, Spawn) + local Level = GetLevel(NPC) + + if Level == 21 then + SetMaxHP(NPC, 6885) + ModifyHP(NPC, 6885) + SetMaxPower(NPC, 1650) + ModifyPower(NPC, 1650) + elseif Level == 22 then + SetMaxHP(NPC, 7500) + ModifyHP(NPC, 7500) + SetMaxPower(NPC, 1750) + ModifyPower(NPC, 1750) + end ``` diff --git a/docs/lua_functions/SetMaxPowerBase.md b/docs/lua_functions/SetMaxPowerBase.md index ce3f811..ea2fd32 100644 --- a/docs/lua_functions/SetMaxPowerBase.md +++ b/docs/lua_functions/SetMaxPowerBase.md @@ -1,17 +1,14 @@ -### Function: SetMaxPowerBase(param1, param2) +### Function: SetMaxPowerBase(spawn, value) **Description:** -Placeholder description. +Set's the Total Base Power of the Spawn to the value provided. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `value` (int32) - Integer value `value`. **Returns:** None. **Example:** -```lua --- Example usage -SetMaxPowerBase(..., ...) -``` +Example Required diff --git a/docs/lua_functions/SetModelType.md b/docs/lua_functions/SetModelType.md index 1d44157..b9d4038 100644 --- a/docs/lua_functions/SetModelType.md +++ b/docs/lua_functions/SetModelType.md @@ -1,17 +1,25 @@ -### Function: SetModelType(param1, param2) +### Function: SetModelType(spawn, value) **Description:** -Placeholder description. +Set's the Spawn's model type to the value supplied, see Model IDs in the Reference Lists https://wiki.eq2emu.com/ReferenceLists by client version for more information. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: int16 - Short integer value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `value` (int32) - Integer value `value`. **Returns:** None. **Example:** ```lua --- Example usage -SetModelType(..., ...) +-- From SpawnScripts/ForestRuins/hiddentools.lua +function casted_on(NPC, Spawn, Message) + if HasQuest(Spawn, CACHES_QUEST_ID) then + if Message == "Spinkle nullification powder" then + AddStepProgress(Spawn, FAVORS_QUEST_ID, 1, 1) + SetModelType(NPC,5210) + SpawnMob(NPC, toolGuard) + Attack(toolGuard, Spawn) + AddTimer(NPC,15000,Despawn) + end ``` diff --git a/docs/lua_functions/SetMount.md b/docs/lua_functions/SetMount.md index d548552..09300bc 100644 --- a/docs/lua_functions/SetMount.md +++ b/docs/lua_functions/SetMount.md @@ -1,17 +1,20 @@ -### Function: SetMount(param1, param2) +### Function: SetMount(spawn, value) **Description:** -Placeholder description. +Set's the Spawn's mount to the model type supplied as the value, see Model IDs in the Reference Lists https://wiki.eq2emu.com/ReferenceLists by client version for more information. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: int16 - Short integer value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `value` (int32) - Integer value `value`. **Returns:** None. **Example:** ```lua --- Example usage -SetMount(..., ...) +-- From SpawnScripts/Antonica/AGriffonTamer.lua +function QeynosToOracle(NPC, Spawn) + StartAutoMount(Spawn, 85) + SetMount(Spawn, 225) +end ``` diff --git a/docs/lua_functions/SetMountColor.md b/docs/lua_functions/SetMountColor.md index de6f228..0a1c0d0 100644 --- a/docs/lua_functions/SetMountColor.md +++ b/docs/lua_functions/SetMountColor.md @@ -1,22 +1,28 @@ -### Function: SetMountColor(param1, param2, param3, param4, param5, param6, param7) +### Function: SetMountColor(spawn, red, green, blue, red, green, blue) **Description:** -Placeholder description. +Sets the mount's colors for the Spawn specified. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: int8 - Small integer or boolean flag. -- `param3`: int8 - Small integer or boolean flag. -- `param4`: int8 - Small integer or boolean flag. -- `param5`: int8 - Small integer or boolean flag. -- `param6`: int8 - Small integer or boolean flag. -- `param7`: int8 - Small integer or boolean flag. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `red` (int32) - Integer value `red`. +- `green` (int32) - Integer value `green`. +- `blue` (int32) - Integer value `blue`. +- `red` (int32) - Integer value `red`. +- `green` (int32) - Integer value `green`. +- `blue` (int32) - Integer value `blue`. **Returns:** None. **Example:** ```lua --- Example usage -SetMountColor(..., ..., ..., ..., ..., ..., ...) +-- From SpawnScripts/BeggarsCourt/AdjunctCaptainRommuls.lua +function spawn(NPC) + SetMount(NPC, 6831) + SetMountColor(NPC, 1, 1, 1, 255, 1, 1) + + MoveToLocation(NPC, -8.13, 4.00, -42.68, 3, "", true) + MoveToLocation(NPC, -14.43, 3.57, -27.02, 3, "", false) +end ``` diff --git a/docs/lua_functions/SetPlayerPOVGhost.md b/docs/lua_functions/SetPlayerPOVGhost.md index 7b7dcf1..b092589 100644 --- a/docs/lua_functions/SetPlayerPOVGhost.md +++ b/docs/lua_functions/SetPlayerPOVGhost.md @@ -1,17 +1,14 @@ -### Function: SetPlayerPOVGhost(param1, param2) +### Function: SetPlayerPOVGhost(player, spawn) **Description:** -Placeholder description. +Set's the Player's POV Ghost to another Spawn if needed, or nil to reset. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: Spawn - The spawn or entity involved. +- `player` (Spawn) - Spawn object representing `player`. +- `spawn` (Spawn) - Spawn object representing `spawn`. **Returns:** None. **Example:** -```lua --- Example usage -SetPlayerPOVGhost(..., ...) -``` +Example Required diff --git a/docs/lua_functions/SetPlayerProximityFunction.md b/docs/lua_functions/SetPlayerProximityFunction.md index 118704b..6eee46f 100644 --- a/docs/lua_functions/SetPlayerProximityFunction.md +++ b/docs/lua_functions/SetPlayerProximityFunction.md @@ -1,19 +1,21 @@ -### Function: SetPlayerProximityFunction(param1, param2, param3, param4) +### Function: SetPlayerProximityFunction(spawn, distance, in_range_function, leaving_range_function) **Description:** -Placeholder description. +The Spawn (NPC) will be notified of a Player entering in range or leaving range. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: float - Floating point value. -- `param3`: string - String value. -- `param4`: string - String value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `distance` (int32) - Distance `distance`. +- `in_range_function` (int32) - Distance `in_range_function`. +- `leaving_range_function` (int32) - Distance `leaving_range_function`. **Returns:** None. **Example:** ```lua --- Example usage -SetPlayerProximityFunction(..., ..., ..., ...) +-- From SpawnScripts/Antonica/adistressedmerchant.lua +function spawn(NPC) + SetPlayerProximityFunction(NPC, 15, "InRange") +end ``` diff --git a/docs/lua_functions/SetPosition.md b/docs/lua_functions/SetPosition.md index 5810ca4..47b9299 100644 --- a/docs/lua_functions/SetPosition.md +++ b/docs/lua_functions/SetPosition.md @@ -1,20 +1,24 @@ -### Function: SetPosition(param1, param2, param3, param4, param5) +### Function: SetPosition(spawn, x, y, z, heading) **Description:** -Placeholder description. +Set's the current position of the Spawn to the x,y,z,heading provided. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: float - Floating point value. -- `param3`: float - Floating point value. -- `param4`: float - Floating point value. -- `param5`: float - Floating point value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `x` (int32) - Integer value `x`. +- `y` (int32) - Integer value `y`. +- `z` (int32) - Integer value `z`. +- `heading` (int32) - Integer value `heading`. **Returns:** None. **Example:** ```lua --- Example usage -SetPosition(..., ..., ..., ..., ...) +-- From SpawnScripts/Commonlands/ExecutionerSelindi.lua +function LeaveRange(NPC,Spawn) +if HasCompletedQuest(Spawn,5890) and CanReceiveQuest(Spawn,5891) then + SetPosition(Spawn,-1344.42, -69.53, 333.57, 218.64) + PlayFlavor(NPC,"","Hey! I need to speak with you!","beckon",0,0,Spawn) +end ``` diff --git a/docs/lua_functions/SetQuestCompleteAction.md b/docs/lua_functions/SetQuestCompleteAction.md index 411a945..a8c7f1d 100644 --- a/docs/lua_functions/SetQuestCompleteAction.md +++ b/docs/lua_functions/SetQuestCompleteAction.md @@ -1,17 +1,14 @@ -### Function: SetQuestCompleteAction(param1, param2) +### Function: SetQuestCompleteAction(quest, action) **Description:** -Placeholder description. +Quest function to call when the quest being completed is triggered. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: string - String value. +- `quest` (Quest) - Quest object representing `quest`. +- `action` (string) - String value `action`. **Returns:** None. **Example:** -```lua --- Example usage -SetQuestCompleteAction(..., ...) -``` +Example Required diff --git a/docs/lua_functions/SetQuestPrereqLevel.md b/docs/lua_functions/SetQuestPrereqLevel.md index 73b6069..fbaa347 100644 --- a/docs/lua_functions/SetQuestPrereqLevel.md +++ b/docs/lua_functions/SetQuestPrereqLevel.md @@ -1,17 +1,14 @@ -### Function: SetQuestPrereqLevel(param1, param2) +### Function: SetQuestPrereqLevel(quest, level) **Description:** -Placeholder description. +Set a pre requirement level to receive the quest. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: int16 - Short integer value. +- `quest` (Quest) - Quest object representing `quest`. +- `level` (int32) - Integer value `level`. **Returns:** None. **Example:** -```lua --- Example usage -SetQuestPrereqLevel(..., ...) -``` +Example Required diff --git a/docs/lua_functions/SetQuestRewardComment.md b/docs/lua_functions/SetQuestRewardComment.md index 061345c..3ed211d 100644 --- a/docs/lua_functions/SetQuestRewardComment.md +++ b/docs/lua_functions/SetQuestRewardComment.md @@ -1,17 +1,14 @@ -### Function: SetQuestRewardComment(param1, param2) +### Function: SetQuestRewardComment(quest, comment) **Description:** -Placeholder description. +Set's a comment for the quest reward, older clients do not display much text. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: string - String value. +- `quest` (Quest) - Quest object representing `quest`. +- `comment` (int32) - Integer value `comment`. **Returns:** None. **Example:** -```lua --- Example usage -SetQuestRewardComment(..., ...) -``` +Example Required diff --git a/docs/lua_functions/SetQuestRewardExp.md b/docs/lua_functions/SetQuestRewardExp.md index bd8bb3a..c472ad2 100644 --- a/docs/lua_functions/SetQuestRewardExp.md +++ b/docs/lua_functions/SetQuestRewardExp.md @@ -1,17 +1,14 @@ -### Function: SetQuestRewardExp(param1, param2) +### Function: SetQuestRewardExp(quest, exp) **Description:** -Placeholder description. +Set's the quest reward experience. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: int32 - Integer value. +- `quest` (Quest) - Quest object representing `quest`. +- `exp` (int32) - Integer value `exp`. **Returns:** None. **Example:** -```lua --- Example usage -SetQuestRewardExp(..., ...) -``` +Example Required diff --git a/docs/lua_functions/SetQuestRewardStatus.md b/docs/lua_functions/SetQuestRewardStatus.md index bfa6d2d..2b74978 100644 --- a/docs/lua_functions/SetQuestRewardStatus.md +++ b/docs/lua_functions/SetQuestRewardStatus.md @@ -1,19 +1,26 @@ -### Function: SetQuestRewardStatus(param1, param2, param3, param4) +### Function: SetQuestRewardStatus(quest, status, min_status_earned, max_status_earned) **Description:** -Placeholder description. +Set's the quest reward status. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: int32 - Integer value. -- `param3`: int32 - Integer value. -- `param4`: int32 - Integer value. +- `quest` (Quest) - Quest object representing `quest`. +- `status` (int32) - Integer value `status`. +- `min_status_earned` (int32) - Integer value `min_status_earned`. +- `max_status_earned` (int32) - Integer value `max_status_earned`. **Returns:** None. **Example:** ```lua --- Example usage -SetQuestRewardStatus(..., ..., ..., ...) +-- From Quests/Antonica/these_boots_were_made_for.lua +function Init(Quest) + AddQuestStepHarvest(Quest, 1, "Harvest 100 iron clusters in Antonica for Hwal, making sure to save them to give to him.", 100, 100, "Hwal needs me to gather the raw materials for the weapons he's planning to make for the sentries.", 1085, 8395) + AddQuestStepHarvest(Quest, 2, "Harvest 100 severed maple in Antonica for Hwal, making sure to save the wood to give to him.", 100, 100, "Hwal needs me to gather the raw materials for the weapons he's planning to make for the sentries.", 824, 12101) + AddQuestStepCompleteAction(Quest, 1, "Step1Complete") + AddQuestStepCompleteAction(Quest, 2, "Step2Complete") + SetQuestFeatherColor(Quest, 1) -- PURPLE FOR HERITAGE QUESTS + SetQuestRewardStatus(Quest, 29666) +end ``` diff --git a/docs/lua_functions/SetQuestYellow.md b/docs/lua_functions/SetQuestYellow.md index 49115c2..4f6eaed 100644 --- a/docs/lua_functions/SetQuestYellow.md +++ b/docs/lua_functions/SetQuestYellow.md @@ -1,17 +1,13 @@ -### Function: SetQuestYellow(param1, param2) +### Function: SetQuestYellow(quest) **Description:** -Placeholder description. +Set's the quest journal display status to yellow. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: unknown - Unknown type. +- `quest` (Quest) - Quest object representing `quest`. **Returns:** None. **Example:** -```lua --- Example usage -SetQuestYellow(..., ...) -``` +Example Required diff --git a/docs/lua_functions/SetRequiredHistory.md b/docs/lua_functions/SetRequiredHistory.md index 01da3f2..1c37568 100644 --- a/docs/lua_functions/SetRequiredHistory.md +++ b/docs/lua_functions/SetRequiredHistory.md @@ -1,22 +1,22 @@ -### Function: SetRequiredHistory(param1, param2, param3, param4, param5, param6, param7) +### Function: SetRequiredHistory(spawn, event_id, value1, value2, flag_override) **Description:** -Placeholder description. +Set required history to interact with the Spawn. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: int32 - Integer value. -- `param4`: int32 - Integer value. -- `param5`: int32 - Integer value. -- `param6`: int8 - Small integer or boolean flag. -- `param7`: int16 - Short integer value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `event_id` (uint32) - Integer value `event_id`. +- `value1` (int32) - Integer value `value1`. +- `value2` (int32) - Integer value `value2`. +- `flag_override` (int32) - Integer value `flag_override`. **Returns:** None. **Example:** ```lua --- Example usage -SetRequiredHistory(..., ..., ..., ..., ..., ..., ...) +-- From SpawnScripts/Nektropos1/BasementSecretDoor.lua +function spawn(NPC) + SetRequiredHistory(NPC, HISTORY.NEK_CASTLE_BASEMENT_ACCESS, 1) +end ``` diff --git a/docs/lua_functions/SetRequiredQuest.md b/docs/lua_functions/SetRequiredQuest.md index 174cbda..7b47a91 100644 --- a/docs/lua_functions/SetRequiredQuest.md +++ b/docs/lua_functions/SetRequiredQuest.md @@ -1,22 +1,21 @@ -### Function: SetRequiredQuest(param1, param2, param3, param4, param5, param6, param7) +### Function: SetRequiredQuest(spawn, quest_id, quest_step, flag_override) **Description:** -Placeholder description. +Set a required quest to access the Spawn. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: int32 - Integer value. -- `param4`: int16 - Short integer value. -- `param5`: int8 - Small integer or boolean flag. -- `param6`: int8 - Small integer or boolean flag. -- `param7`: int16 - Short integer value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `quest_id` (uint32) - Integer value `quest_id`. +- `quest_step` (int32) - Integer value `quest_step`. +- `flag_override` (int32) - Integer value `flag_override`. **Returns:** None. **Example:** ```lua --- Example usage -SetRequiredQuest(..., ..., ..., ..., ..., ..., ...) +-- From SpawnScripts/Antonica/furlinedglovesdownhay.lua +function spawn(NPC) + SetRequiredQuest(NPC, 5815, 3) +end ``` diff --git a/docs/lua_functions/SetServerControlFlag.md b/docs/lua_functions/SetServerControlFlag.md index a146f07..aa733c1 100644 --- a/docs/lua_functions/SetServerControlFlag.md +++ b/docs/lua_functions/SetServerControlFlag.md @@ -1,19 +1,24 @@ -### Function: SetServerControlFlag(param1, param2, param3, param4) +### Function: SetServerControlFlag(spawn, param, param_value, value) **Description:** -Placeholder description. +Tie to the control effect types found in https://github.com/emagi/eq2emu/blob/main/docs/data_types/control_effect_types.md **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: int8 - Small integer or boolean flag. -- `param3`: int8 - Small integer or boolean flag. -- `param4`: int8 - Small integer or boolean flag. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `param` (int32) - Integer value `param`. +- `param_value` (int32) - Integer value `param_value`. +- `value` (int32) - Integer value `value`. **Returns:** None. **Example:** ```lua --- Example usage -SetServerControlFlag(..., ..., ..., ...) +-- From SpawnScripts/everfrost_frostfell_new01/BrenloBixiebopperVI1586827.lua +function InRange(NPC, Spawn) + Say(NPC, "Hey! Get outta my way! I am practicing for the all Halfling Olympics!") + --SetServerControlFlag(Spawn, 4, 64, 1) + PlayAnimation(Spawn, 11767) + --AddTimer(NPC, 4000, "Control", 1, Spawn) +end ``` diff --git a/docs/lua_functions/SetSpawnGroupID.md b/docs/lua_functions/SetSpawnGroupID.md index 052cc6d..a885012 100644 --- a/docs/lua_functions/SetSpawnGroupID.md +++ b/docs/lua_functions/SetSpawnGroupID.md @@ -1,17 +1,14 @@ -### Function: SetSpawnGroupID(param1, param2) +### Function: SetSpawnGroupID(spawn, new_group_id) **Description:** -Placeholder description. +Set's the spawn's encounter new group id. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: int32 - Integer value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `new_group_id` (uint32) - Integer value `new_group_id`. **Returns:** None. **Example:** -```lua --- Example usage -SetSpawnGroupID(..., ...) -``` +Example Required diff --git a/docs/lua_functions/SetSpeed.md b/docs/lua_functions/SetSpeed.md index 16a89fb..7443dd1 100644 --- a/docs/lua_functions/SetSpeed.md +++ b/docs/lua_functions/SetSpeed.md @@ -1,17 +1,27 @@ -### Function: SetSpeed(param1, param2) +### Function: SetSpeed(spawn, value) **Description:** -Placeholder description. +Set's the speed of the spawn. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: float - Floating point value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `value` (int32) - Integer value `value`. **Returns:** None. **Example:** ```lua --- Example usage -SetSpeed(..., ...) +-- From SpawnScripts/Darklight/awellspringcub.lua +function casted_on(NPC, Caster, SpellName) + if SpellName == "Leash" then + if GetQuestStep(Caster, DrawUponWellsprings) == 1 then + if GetTempVariable(Caster, "cub") == nil then + SetTempVariable(Caster, "cub", NPC) + SpawnSet(NPC, "attackable", "0") + SpawnSet(NPC, "show_level", "0") + SetFollowTarget(NPC, Caster) + SetSpeed(NPC, 9) + ToggleFollow(NPC) + end ``` diff --git a/docs/lua_functions/SetSta.md b/docs/lua_functions/SetSta.md index 9e4a20a..c90b225 100644 --- a/docs/lua_functions/SetSta.md +++ b/docs/lua_functions/SetSta.md @@ -1,18 +1,14 @@ -### Function: SetSta(param1, param2, param3) +### Function: SetSta(spawn, value) **Description:** -Placeholder description. +Set's the Spawn's stamina to the value provided. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: float - Floating point value. +- `luaspell` (int32) - Integer value `luaspell`. +- `value` (int32) - Integer value `value`. **Returns:** None. **Example:** -```lua --- Example usage -SetSta(..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/SetStaBase.md b/docs/lua_functions/SetStaBase.md index 75a1614..de8fda8 100644 --- a/docs/lua_functions/SetStaBase.md +++ b/docs/lua_functions/SetStaBase.md @@ -1,17 +1,22 @@ -### Function: SetStaBase(param1, param2) +### Function: SetStaBase(spawn, value) **Description:** -Placeholder description. +Set's the Spawn's base stamina to the value provided. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: int16 - Short integer value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `value` (int32) - Integer value `value`. **Returns:** None. **Example:** ```lua --- Example usage -SetStaBase(..., ...) +-- 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/SetStatusTmpReward.md b/docs/lua_functions/SetStatusTmpReward.md index 42df01b..87aab92 100644 --- a/docs/lua_functions/SetStatusTmpReward.md +++ b/docs/lua_functions/SetStatusTmpReward.md @@ -1,17 +1,14 @@ -### Function: SetStatusTmpReward(param1, param2) +### Function: SetStatusTmpReward(quest, status) **Description:** -Placeholder description. +Set the quest's temporary status reward. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: int32 - Integer value. +- `quest` (Quest) - Quest object representing `quest`. +- `status` (int32) - Integer value `status`. **Returns:** None. **Example:** -```lua --- Example usage -SetStatusTmpReward(..., ...) -``` +Example Required diff --git a/docs/lua_functions/SetStepComplete.md b/docs/lua_functions/SetStepComplete.md index 0ae575a..019d152 100644 --- a/docs/lua_functions/SetStepComplete.md +++ b/docs/lua_functions/SetStepComplete.md @@ -1,22 +1,23 @@ -### Function: SetStepComplete(param1, param2, param3, param4, param5, param6, param7) +### Function: SetStepComplete(player, quest_id, step) **Description:** -Placeholder description. +Set the Quest step as complete. **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` (int32) - Integer value `step`. **Returns:** None. **Example:** ```lua --- Example usage -SetStepComplete(..., ..., ..., ..., ..., ..., ...) +-- From ItemScripts/abixieeye.lua +function Step_Complete(Item, Player) +if HasItem(Player,1219,1) then + SetStepComplete(Player, LoreAndLegendBixie, 4) + CloseItemConversation(Item, Player) + RemoveItem(Player, 1219) +end ``` diff --git a/docs/lua_functions/SetStr.md b/docs/lua_functions/SetStr.md index a92ca6e..eac5834 100644 --- a/docs/lua_functions/SetStr.md +++ b/docs/lua_functions/SetStr.md @@ -1,18 +1,14 @@ -### Function: SetStr(param1, param2, param3) +### Function: SetStr(spawn, value) **Description:** -Placeholder description. +Set's the Spawn's strength to the value provided. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: float - Floating point value. +- `luaspell` (int32) - Integer value `luaspell`. +- `value` (int32) - Integer value `value`. **Returns:** None. **Example:** -```lua --- Example usage -SetStr(..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/SetStrBase.md b/docs/lua_functions/SetStrBase.md index 4462e22..575b9e2 100644 --- a/docs/lua_functions/SetStrBase.md +++ b/docs/lua_functions/SetStrBase.md @@ -1,17 +1,22 @@ -### Function: SetStrBase(param1, param2) +### Function: SetStrBase(spawn, value) **Description:** -Placeholder description. +Set's the Spawn's base strength to the value provided. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: int16 - Short integer value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `value` (int32) - Integer value `value`. **Returns:** None. **Example:** ```lua --- Example usage -SetStrBase(..., ...) +-- 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/SetTradeskillClass.md b/docs/lua_functions/SetTradeskillClass.md index e07539b..0fa57cd 100644 --- a/docs/lua_functions/SetTradeskillClass.md +++ b/docs/lua_functions/SetTradeskillClass.md @@ -1,17 +1,26 @@ -### Function: SetTradeskillClass(param1, param2) +### Function: SetTradeskillClass(spawn, value) **Description:** -Placeholder description. - +Set's the Spawn's tradeskill class to the value provided, class list is available at https://wiki.eq2emu.com/ReferenceLists/ClassList **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: int8 - Small integer or boolean flag. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `value` (int32) - Integer value `value`. **Returns:** None. **Example:** ```lua --- Example usage -SetTradeskillClass(..., ...) +-- From SpawnScripts/Baubbleshire/RalaEurocarry.lua +function dlg_39_1(NPC, Spawn) + FaceTarget(NPC, Spawn) + conversation = CreateConversation() +if GetTradeskillLevel(Spawn) <2 then + Quest = GetQuest(Spawn,5749) + SummonItem(Spawn,1030001,1) + SetTradeskillLevel(Spawn,2) + SetTradeskillClass(Spawn,1) + SendMessage(Spawn, "You are now an Artisan!") + SendPopUpMessage(Spawn, "You are now an Artisan!", 200, 200, 200) + end ``` diff --git a/docs/lua_functions/SetVisualFlag.md b/docs/lua_functions/SetVisualFlag.md index 56d14d4..7708a06 100644 --- a/docs/lua_functions/SetVisualFlag.md +++ b/docs/lua_functions/SetVisualFlag.md @@ -1,16 +1,22 @@ -### Function: SetVisualFlag(param1) +### Function: SetVisualFlag(spawn) **Description:** -Placeholder description. +Set the visual flag on the Spawn to initiate a update on the Spawns visual data. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. +- `spawn` (Spawn) - Spawn object representing `spawn`. **Returns:** None. **Example:** ```lua --- Example usage -SetVisualFlag(...) +-- From SpawnScripts/Antonica/HaddekVimki.lua +function spawn(NPC) + ProvidesQuest(NPC, RunningOutOfBeer) + ProvidesQuest(NPC, OuchMyHead) + ProvidesQuest(NPC, RiseAndShineWine) + ProvidesQuest(NPC, PracticalJokeOnBlarton) + SetPlayerProximityFunction(NPC, 10, "InRange", Spawn) +end ``` diff --git a/docs/lua_functions/SetWis.md b/docs/lua_functions/SetWis.md index 4b65648..c755888 100644 --- a/docs/lua_functions/SetWis.md +++ b/docs/lua_functions/SetWis.md @@ -1,18 +1,14 @@ -### Function: SetWis(param1, param2, param3) +### Function: SetWis(spawn, value) **Description:** -Placeholder description. +Set's the Spawn's wisdom to the value provided. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: Spawn - The spawn or entity involved. -- `param3`: float - Floating point value. +- `spawn` (Spawn) - Spawn reference object `spawn`. +- `value` (int32) - Integer value `value`. **Returns:** None. **Example:** -```lua --- Example usage -SetWis(..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/SetWisBase.md b/docs/lua_functions/SetWisBase.md index 8ae47fd..85e6921 100644 --- a/docs/lua_functions/SetWisBase.md +++ b/docs/lua_functions/SetWisBase.md @@ -1,17 +1,27 @@ -### Function: SetWisBase(param1, param2) +### Function: SetWisBase(spawn, value) **Description:** -Placeholder description. +Set's the Spawn's base wisdom to the value provided. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: int16 - Short integer value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `value` (int32) - Integer value `value`. **Returns:** None. **Example:** ```lua --- Example usage -SetWisBase(..., ...) +-- From SpawnScripts/Generic/CombatModule.lua +function regen(NPC, Spawn) + + -- In-combat health regeneration + SetInfoStructUInt(NPC, "hp_regen_override", 1) -- Set to 0 to disable and allow the server to set the regen rate. + SetInfoStructSInt(NPC, "hp_regen", 0) -- Set Regen Amount. Default 0 + + -- In-combat power regeneration + SetInfoStructUInt(NPC, "pw_regen_override", 1) -- Set to 0 to disable and allow the server to set the regen rate. + SetInfoStructSInt(NPC, "pw_regen", 0) -- Set Regen Amount. Default 0 + +end ``` diff --git a/docs/lua_functions/Shout.md b/docs/lua_functions/Shout.md index 974d138..72594de 100644 --- a/docs/lua_functions/Shout.md +++ b/docs/lua_functions/Shout.md @@ -1,20 +1,22 @@ -### Function: Shout(param1, param2, param3, param4, param5) +### Function: Shout(spawn, message, player, dist, language) **Description:** -Placeholder description. +Send's a shout from the Spawn into the general vicinity based on the distance provided, or otherwise the player if specified. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: string - String value. -- `param3`: Spawn - The spawn or entity involved. -- `param4`: float - Floating point value. -- `param5`: int32 - Integer value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `message` (string) - String `message`. +- `player` (Spawn) - Spawn object representing `player`. +- `dist` (int32) - Integer value `dist`. +- `language` (int32) - Integer value `language`. **Returns:** None. **Example:** ```lua --- Example usage -Shout(..., ..., ..., ..., ...) +-- From SpawnScripts/Castleview/BupipaGuryup.lua +function Tryout3(NPC,Spawn) +PlayFlavor(NPC, "","Oh... this is wonderful!","happy",0,0,Spawn) +end ``` diff --git a/docs/lua_functions/Spawn.md b/docs/lua_functions/Spawn.md index 2dd4a84..230be94 100644 --- a/docs/lua_functions/Spawn.md +++ b/docs/lua_functions/Spawn.md @@ -1,24 +1,29 @@ -### Function: Spawn(param1, param2, param3, param4, param5, param6, param7, param8, param9) +### Function: Spawn(zone, spawn_id, x, y, z, heading) **Description:** -Placeholder description. +Create's a new Spawn from the spawn database table based on the spawn_id (id parameter in the database). **Parameters:** -- `param1`: ZoneServer - The zone object. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: int32 - Integer value. -- `param5`: int8 - Small integer or boolean flag. -- `param6`: float - Floating point value. -- `param7`: float - Floating point value. -- `param8`: float - Floating point value. -- `param9`: float - Floating point value. +- `zone` (Zone) - Zone object representing `zone`. +- `spawn_id` (uint32) - Integer value `spawn_id`. +- `x` (int32) - Integer value `x`. +- `y` (int32) - Integer value `y`. +- `z` (int32) - Integer value `z`. +- `heading` (int32) - Integer value `heading`. **Returns:** None. **Example:** ```lua --- Example usage -Spawn(..., ..., ..., ..., ..., ..., ..., ..., ...) +-- From Quests/QueensColony/the_source_of_evil.lua +function step3_complete_talkedToSorcerer(Quest, QuestGiver, Player) + UpdateQuestStepDescription(Quest, 3, "I spoke with Sorcerer Oofala.") + UpdateQuestTaskGroupDescription(Quest, 3, "I spoke with Sorcerer Oofala.") + --Spawn(GetZone(Player), 2530142, false, GetX(Player), GetY(Player), GetZ(Player)) + --Spawn the Dark Blademaster once you approach his location only if the player has a quest (zonescript) + --x = 154.66 y = 1.38397 z = -178.158 heading = 349.984 + AddQuestStepKill(Quest, 4, "Kill the Dark Blademaster near the fog on Sapswill Hill.", 1, 100, "Oofala explained that by removing the totems, the evil has been disturbed and produced a champion to fight back. I will need to confront the Dark Blademaster. He has emerged from a tent on Sapswill Hill.", 611, 2530032) + AddQuestStepCompleteAction(Quest, 4, "step4_complete_killedBlademaster") +end ``` diff --git a/docs/lua_functions/SpawnMove.md b/docs/lua_functions/SpawnMove.md index ce78deb..56cacf8 100644 --- a/docs/lua_functions/SpawnMove.md +++ b/docs/lua_functions/SpawnMove.md @@ -1,22 +1,16 @@ -### Function: SpawnMove(param1, param2, param3, param4, param5, param6, param7) +### Function: SpawnMove(spawn, player, max_distance, type) **Description:** -Placeholder description. +Allows a player to move a Spawn/Object, also restricting the max_distance of movement. Type represents either "floor" (default), "wall" or "ceiling" **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. -- `param6`: float - Floating point value. -- `param7`: string - String value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `player` (Spawn) - Spawn object representing `player`. +- `max_distance` (int32) - Distance `max_distance`. +- `type` (string) - String value `type`. **Returns:** None. **Example:** -```lua --- Example usage -SpawnMove(..., ..., ..., ..., ..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/SpawnSet.md b/docs/lua_functions/SpawnSet.md index e29dca5..00a2bbd 100644 --- a/docs/lua_functions/SpawnSet.md +++ b/docs/lua_functions/SpawnSet.md @@ -1,22 +1,49 @@ -### Function: SpawnSet(param1, param2, param3, param4, param5, param6, param7) +### Function: SpawnSet(spawn, variable, value, no_update, temporary_flag, index) **Description:** -Placeholder description. +Set a spawn setting on the specified spawn. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: string - String value. -- `param4`: string - String value. -- `param5`: bool - Boolean value (true/false). -- `param6`: bool - Boolean value (true/false). -- `param7`: int8 - Small integer or boolean flag. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `variable` (int32) - Integer value `variable`. +- `value` (int32) - Integer value `value`. +- `no_update` (int32) - Integer value `no_update`. +- `temporary_flag` (int32) - Integer value `temporary_flag`. +- `index` (int32) - Integer value `index`. **Returns:** None. **Example:** ```lua --- Example usage -SpawnSet(..., ..., ..., ..., ..., ..., ...) +-- From ItemScripts/pirateskull.lua + function FeedGuurok(Item, Player) + zone = GetZone(Player) + Guurok = GetSpawnByLocationID(zone, 433001) + if GetTempVariable(Guurok, "FeedCounter") == "0" then + SpawnSet(Guurok, "size", "100") + SetTempVariable(Guurok, "FeedCounter", 1) + elseif GetTempVariable(Guurok, "FeedCounter") == "1" then + SpawnSet(Guurok, "size", "105") + SetTempVariable(Guurok, "FeedCounter", 2) + elseif GetTempVariable(Guurok, "FeedCounter") == "2" then + SetTempVariable(Guurok, "FeedCounter", 3) + SpawnSet(Guurok, "size", "110") +elseif GetTempVariable(Guurok, "FeedCounter") == "3" then + SetTempVariable(Guurok, "FeedCounter", 4) + SpawnSet(Guurok, "size", "115") +elseif GetTempVariable(Guurok, "FeedCounter") == "4" then + SetTempVariable(Guurok, "FeedCounter", 5) + SpawnSet(Guurok, "size", "120") +elseif GetTempVariable(Guurok, "FeedCounter") == "5" then + SetTempVariable(Guurok, "FeedCounter", 6) + SpawnSet(Guurok, "size", "125") +elseif GetTempVariable(Guurok, "FeedCounter") == "6" then + SetTempVariable(Guurok, "FeedCounter", 666) + SpawnSet(Guurok, "size", "130") + SpawnSet(Guurok, "visual_state", "3632") + SpawnSet(Guurok, "show_level", "1") + SpawnSet(Guurok, "attackable", "1") + SpawnSet(Guurok, "faction", "1") + end ``` diff --git a/docs/lua_functions/SpawnSetByDistance.md b/docs/lua_functions/SpawnSetByDistance.md index de757fd..8018cf0 100644 --- a/docs/lua_functions/SpawnSetByDistance.md +++ b/docs/lua_functions/SpawnSetByDistance.md @@ -1,22 +1,30 @@ -### Function: SpawnSetByDistance(param1, param2, param3, param4, param5, param6, param7) +### Function: SpawnSetByDistance(spawn, max_distance, variable, value) **Description:** -Placeholder description. +Set a spawn setting on one or more spawns in a radius of the source. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: Spawn - The spawn or entity involved. -- `param3`: float - Floating point value. -- `param4`: float - Floating point value. -- `param5`: string - String value. -- `param6`: int8 - Small integer or boolean flag. -- `param7`: string - String value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `max_distance` (int32) - Distance `max_distance`. +- `variable` (int32) - Integer value `variable`. +- `value` (int32) - Integer value `value`. **Returns:** None. **Example:** ```lua --- Example usage -SpawnSetByDistance(..., ..., ..., ..., ..., ..., ...) +-- From SpawnScripts/OutpostOverlord/evilgoblintent1.lua +function casted_on(NPC, Spawn, SpellName) + if SpellName == "burn tent" then + if CheckTent(Spawn, NPC) == true then + if GetQuestStep(Spawn, TheFinalAssault) == 2 then + SpawnSetByDistance(NPC, 15, "visual_state", 491) + KillSpawnByDistance(NPC, 15, 0, 1) + AddStepProgress(Spawn, TheFinalAssault, 2, 1) + BurnTent(Spawn, NPC) + elseif GetQuestStep(Spawn, TheFinalAssault) == 3 then + SetStepComlete(Spawn, TheFinalAssault, 2) + else + end ``` diff --git a/docs/lua_functions/SpellDamage.md b/docs/lua_functions/SpellDamage.md index 668e831..9bb175b 100644 --- a/docs/lua_functions/SpellDamage.md +++ b/docs/lua_functions/SpellDamage.md @@ -1,23 +1,25 @@ -### Function: SpellDamage(param1, param2, param3, param4, param5, param6, param7, param8) +### Function: SpellDamage(target, type, min_damage, max_damage, crit_mod, no_calcs, class_id) **Description:** -Placeholder description. +Damage a Target inside of a Spell Script. **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. -- `param7`: int32 - Integer value. -- `param8`: int32 - Integer value. +- `luaspell` (int32) - Integer value `luaspell`. +- `type` (int32) - Integer value `type`. +- `min_damage` (int32) - Integer value `min_damage`. +- `max_damage` (int32) - Integer value `max_damage`. +- `crit_mod` (int32) - Integer value `crit_mod`. +- `no_calcs` (int32) - Integer value `no_calcs`. +- `class_id` (uint32) - Integer value `class_id`. **Returns:** None. **Example:** ```lua --- Example usage -SpellDamage(..., ..., ..., ..., ..., ..., ..., ...) +-- From Spells/AA/AmbidexterousCasting.lua +function cast(Caster, Target, DmgType, MinVal, MaxVal) + Interrupt(Caster, Target) +SpellDamage(Target, DmgType, MinVal, MaxVal) +end ``` diff --git a/docs/lua_functions/SpellDamageExt.md b/docs/lua_functions/SpellDamageExt.md index 93bf3dc..1eb4b83 100644 --- a/docs/lua_functions/SpellDamageExt.md +++ b/docs/lua_functions/SpellDamageExt.md @@ -1,25 +1,34 @@ -### Function: SpellDamageExt(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10) +### Function: SpellDamageExt(target, type, min_damage, max_damage, crit_mod, no_calcs, override_packet_type, take_power, class_id) **Description:** -Placeholder description. +Damage a Target inside of a Spell Script, offers power 'damage' support. **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. -- `param7`: int32 - Integer value. -- `param8`: int32 - Integer value. -- `param9`: int32 - Integer value. -- `param10`: int32 - Integer value. +- `luaspell` (int32) - Integer value `luaspell`. +- `type` (int32) - Integer value `type`. +- `min_damage` (int32) - Integer value `min_damage`. +- `max_damage` (int32) - Integer value `max_damage`. +- `crit_mod` (int32) - Integer value `crit_mod`. +- `no_calcs` (int32) - Integer value `no_calcs`. +- `override_packet_type` (int32) - Integer value `override_packet_type`. +- `take_power` (int32) - Integer value `take_power`. +- `class_id` (uint32) - Integer value `class_id`. **Returns:** None. **Example:** ```lua --- Example usage -SpellDamageExt(..., ..., ..., ..., ..., ..., ..., ..., ..., ...) +-- From Spells/Scout/Bard/WaltsSingingBlade.lua +function damage(Caster, Target, DmgType, MinVal, MaxVal, MinPwr, MaxPwr) + Level = GetLevel(Caster) + SpellLevel = 15 + Mastery = SpellLevel + 10 + StrBonus = GetStr(Caster) / 10 + IntBonus = GetInt(Caster) / 10 + + if Level < Mastery then + LvlBonus = Level - SpellLevel + else LvlBonus = Mastery - SpellLevel + end ``` diff --git a/docs/lua_functions/SpellHeal.md b/docs/lua_functions/SpellHeal.md index a04260e..857af12 100644 --- a/docs/lua_functions/SpellHeal.md +++ b/docs/lua_functions/SpellHeal.md @@ -1,23 +1,24 @@ -### Function: SpellHeal(param1, param2, param3, param4, param5, param6, param7, param8) +### Function: SpellHeal(heal_type, min_heal, max_heal, target, crit_mod, no_calcs, custom_spell_name) **Description:** -Placeholder description. +Heal or Increase Power of a Target inside of a spell script. heal_type is "heal" or "power". **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: string - String value. -- `param3`: int32 - Integer value. -- `param4`: int32 - Integer value. -- `param5`: Spawn - The spawn or entity involved. -- `param6`: int32 - Integer value. -- `param7`: int32 - Integer value. -- `param8`: string - String value. +- `heal_type` (string) - String value `heal_type`. +- `min_heal` (int32) - Integer value `min_heal`. +- `max_heal` (int32) - Integer value `max_heal`. +- `target` (Spawn) - Spawn object representing `target`. +- `crit_mod` (int32) - Integer value `crit_mod`. +- `no_calcs` (int32) - Integer value `no_calcs`. +- `custom_spell_name` (string) - String `custom_spell_name`. **Returns:** None. **Example:** ```lua --- Example usage -SpellHeal(..., ..., ..., ..., ..., ..., ..., ...) +-- From Spells/AA/AncestralChanneling.lua +function cast(Caster, Target, HealMin, HealMax, HoTMin, HoTMax) +SpellHeal("Heal", HealMin, HealMax) +end ``` diff --git a/docs/lua_functions/SpellHealPct.md b/docs/lua_functions/SpellHealPct.md index 82377fc..4a181a3 100644 --- a/docs/lua_functions/SpellHealPct.md +++ b/docs/lua_functions/SpellHealPct.md @@ -1,24 +1,25 @@ -### Function: SpellHealPct(param1, param2, param3, param4, param5, param6, param7, param8, param9) +### Function: SpellHealPct(heal_type, percentage, current_value, caster_value, target, crit_mod, no_calcs, custom_spell_name) **Description:** -Placeholder description. +Heal or Increase Power percentage of a Target inside of a spell script. heal_type is "heal" or "power". **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: string - String value. -- `param3`: float - Floating point value. -- `param4`: bool - Boolean value (true/false). -- `param5`: bool - Boolean value (true/false). -- `param6`: Spawn - The spawn or entity involved. -- `param7`: int32 - Integer value. -- `param8`: int32 - Integer value. -- `param9`: string - String value. +- `heal_type` (string) - String value `heal_type`. +- `percentage` (int32) - Integer value `percentage`. +- `current_value` (int32) - Integer value `current_value`. +- `caster_value` (int32) - Integer value `caster_value`. +- `target` (Spawn) - Spawn object representing `target`. +- `crit_mod` (int32) - Integer value `crit_mod`. +- `no_calcs` (int32) - Integer value `no_calcs`. +- `custom_spell_name` (string) - String `custom_spell_name`. **Returns:** None. **Example:** ```lua --- Example usage -SpellHealPct(..., ..., ..., ..., ..., ..., ..., ..., ...) +-- From Spells/Commoner/HateSpores.lua +function cast(Caster, Target, Pwr) + SpellHealPct("Power", Pwr, false, true, Target) +end ``` diff --git a/docs/lua_functions/StartConversation.md b/docs/lua_functions/StartConversation.md index 5f540ac..0fcab9c 100644 --- a/docs/lua_functions/StartConversation.md +++ b/docs/lua_functions/StartConversation.md @@ -1,25 +1,29 @@ -### Function: StartConversation(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10) +### Function: StartConversation(conversation, source, player, text, mp3, key1, key2, language, can_close) **Description:** -Placeholder description. +Begin a conversation with the Player from the Source Spawn with the previously established conversation options. **Parameters:** -- `param1`: ConversationOption[] - List of conversation options. -- `param2`: unknown - Unknown type. -- `param3`: Spawn - The spawn or entity involved. -- `param4`: Spawn - The spawn or entity involved. -- `param5`: string - String value. -- `param6`: string - String value. -- `param7`: int32 - Integer value. -- `param8`: int32 - Integer value. -- `param9`: int32 - Integer value. -- `param10`: int32 - Integer value. +- `conversation` (Conversation) - Conversation object representing `conversation`. +- `source` (Spawn) - Spawn object representing `source`. +- `player` (Spawn) - Spawn object representing `player`. +- `text` (string) - String `text`. +- `mp3` (int32) - Integer value `mp3`. +- `key1` (int32) - Integer value `key1`. +- `key2` (int32) - Integer value `key2`. +- `language` (int32) - Integer value `language`. +- `can_close` (bool) - Boolean flag `can_close`. **Returns:** None. **Example:** ```lua --- Example usage -StartConversation(..., ..., ..., ..., ..., ..., ..., ..., ..., ...) +-- From Quests/Antonica/attack_of_the_killer_bear.lua +function Accepted(Quest, QuestGiver, Player) + FaceTarget(QuestGiver, Player) + local conversation = CreateConversation() + AddConversationOption(conversation, "I will be careful.") + StartConversation(conversation, QuestGiver, Player, "Be careful though! This one is big!") +end ``` diff --git a/docs/lua_functions/StartDialogConversation.md b/docs/lua_functions/StartDialogConversation.md index 071bfb1..ec972d9 100644 --- a/docs/lua_functions/StartDialogConversation.md +++ b/docs/lua_functions/StartDialogConversation.md @@ -1,27 +1,33 @@ -### Function: StartDialogConversation(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11, param12) +### Function: StartDialogConversation(conversation, type, spawn, player, text, mp3, key1, key2, language, can_close) **Description:** -Placeholder description. +Begin a conversation with the Player from the Source Spawn with the previously established conversation options. **Parameters:** -- `param1`: ConversationOption[] - List of conversation options. -- `param2`: unknown - Unknown type. -- `param3`: int8 - Small integer or boolean flag. -- `param4`: Spawn - The spawn or entity involved. -- `param5`: Item - An item reference. -- `param6`: Spawn - The spawn or entity involved. -- `param7`: string - String value. -- `param8`: string - String value. -- `param9`: int32 - Integer value. -- `param10`: int32 - Integer value. -- `param11`: int8 - Small integer or boolean flag. -- `param12`: int32 - Integer value. +- `conversation` (Conversation) - Conversation object representing `conversation`. +- `type` (int32) - Integer value `type`. +- `item` (Item) - Item object representing `item`. +- `player` (Spawn) - Spawn object representing `player`. +- `text` (string) - String `text`. +- `mp3` (int32) - Integer value `mp3`. +- `key1` (int32) - Integer value `key1`. +- `key2` (int32) - Integer value `key2`. +- `language` (int32) - Integer value `language`. +- `can_close` (bool) - Boolean flag `can_close`. **Returns:** None. **Example:** ```lua --- Example usage -StartDialogConversation(..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ...) +-- 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/Stealth.md b/docs/lua_functions/Stealth.md index 9363625..44e17c1 100644 --- a/docs/lua_functions/Stealth.md +++ b/docs/lua_functions/Stealth.md @@ -1,21 +1,19 @@ -### Function: Stealth(param1, param2, param3, param4, param5, param6) +### Function: Stealth(type, spawn) **Description:** -Placeholder description. +Type of 1 is stealth, 2 is invis. If Spawn is specified will only apply to Spawn, otherwise applied to all spell targets in a Spell Script. **Parameters:** -- `param1`: int8 - Small integer or boolean flag. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. -- `param5`: unknown - Unknown type. -- `param6`: Spawn - The spawn or entity involved. +- `type` (int8) - Integer value `type`. +- `spawn` (Spawn) - Spawn object representing `spawn`. **Returns:** None. **Example:** ```lua --- Example usage -Stealth(..., ..., ..., ..., ..., ...) +-- From Spells/Camouflage.lua +function cast(Caster, Target) + Stealth(1) +end ``` diff --git a/docs/lua_functions/StopTimer.md b/docs/lua_functions/StopTimer.md index 336b3f5..dcd313f 100644 --- a/docs/lua_functions/StopTimer.md +++ b/docs/lua_functions/StopTimer.md @@ -1,19 +1,26 @@ -### Function: StopTimer(param1, param2, param3, param4) +### Function: StopTimer(spawn, function) **Description:** -Placeholder description. +Stops an active timer that is to call the `function`. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: string - String value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `function` (int32) - Integer value `function`. **Returns:** None. **Example:** ```lua --- Example usage -StopTimer(..., ..., ..., ...) +-- From SpawnScripts/The Deserted Mine/ShyzintheCoercer.lua +function spawnthirdwaveisalivefinal(NPC) + local zone = GetZone(NPC) + local firstwavegrp = GetGroup(GetSpawnGroupByID(zone, 4122)) + if not firstwavegrp == nil then + SetTempVariable(NPC, "combat_notfinish", "0") + for k,v in ipairs(firstwavegrp) do + if IsAlive(GetSpawnByLocationID(zone, v)) then + SetTempVariable(NPC, "combat_notfinish", "1") + break + end ``` diff --git a/docs/lua_functions/SummonItem.md b/docs/lua_functions/SummonItem.md index bea732f..7b9cf4b 100644 --- a/docs/lua_functions/SummonItem.md +++ b/docs/lua_functions/SummonItem.md @@ -1,20 +1,69 @@ -### Function: SummonItem(param1, param2, param3, param4, param5) +### Function: SummonItem(spawn, item_id, location, item_count) **Description:** -Placeholder description. +Summon's an item to the Spawn's inventory. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: int32 - Integer value. -- `param3`: int8 - Small integer or boolean flag. -- `param4`: string - String value. -- `param5`: int16 - Short integer value. +- `spawn` (Spawn) - Spawn object representing `spawn`. +- `item_id` (uint32) - Integer value `item_id`. +- `location` (int32) - Integer value `location`. +- `item_count` (int32) - Quantity `item_count`. **Returns:** None. **Example:** ```lua --- Example usage -SummonItem(..., ..., ..., ..., ...) +-- From ItemScripts/aBagofBasicProvisions.lua +function examined(Item, Player) +RemoveItem(Player,1001011,1) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36684,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SummonItem(Player, 36211,0) +SendMessage(Player, "You found 20 flasks of water in the bag.") +SendMessage(Player, "You found 20 rations in the bag.") +--[[ alignment = GetDeity(Player) --THESE ARE COMMEMORATIVE COINS. THIS ITEM HAS BEEN GIVEN TO THE AMBASSADORS FOR PLAYERS SELECTING THEIR CITY. THIS REDUCES THE CHANCE THE WRONG COIN IS GIVEN. + if alignment == 0 then + SummonItem(Player, 1413,1) -- evil rewards + else + SummonItem(Player, 1414,1) -- good rewards + end]]-- +end ``` diff --git a/docs/lua_functions/ToggleCharacterFlag.md b/docs/lua_functions/ToggleCharacterFlag.md index 9b1df0d..c16297c 100644 --- a/docs/lua_functions/ToggleCharacterFlag.md +++ b/docs/lua_functions/ToggleCharacterFlag.md @@ -1,19 +1,14 @@ -### Function: ToggleCharacterFlag(param1, param2, param3, param4) +### Function: ToggleCharacterFlag(player, flag_id) **Description:** -Placeholder description. +Toggles a character flag, auto consume, hide hood, helm, etc. Refer to player.h #define CF_... flags. **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`. +- `flag_id` (uint32) - Integer value `flag_id`. **Returns:** None. **Example:** -```lua --- Example usage -ToggleCharacterFlag(..., ..., ..., ...) -``` +Example Required diff --git a/docs/lua_functions/ToggleTracking.md b/docs/lua_functions/ToggleTracking.md index 2071177..03f6877 100644 --- a/docs/lua_functions/ToggleTracking.md +++ b/docs/lua_functions/ToggleTracking.md @@ -1,16 +1,18 @@ -### Function: ToggleTracking(param1) +### Function: ToggleTracking(spawn) **Description:** -Placeholder description. +Toggles the tracking on or off for the Caster. **Parameters:** -- `param1`: Spawn - The spawn or entity involved. +- `spawn` (Spawn) - Spawn object representing `spawn`. **Returns:** None. **Example:** ```lua --- Example usage -ToggleTracking(...) +-- From Spells/Commoner/Tracking.lua +function cast(Caster, Target) + ToggleTracking(Caster) +end ``` diff --git a/docs/lua_functions/UpdateQuestDescription.md b/docs/lua_functions/UpdateQuestDescription.md index 4ff2965..e8f6d54 100644 --- a/docs/lua_functions/UpdateQuestDescription.md +++ b/docs/lua_functions/UpdateQuestDescription.md @@ -1,17 +1,22 @@ -### Function: UpdateQuestDescription(param1, param2) +### Function: UpdateQuestDescription(quest, description) **Description:** -Placeholder description. +Update the current quest description. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: string - String value. +- `quest` (Quest) - Quest object representing `quest`. +- `description` (int32) - Integer value `description`. **Returns:** None. **Example:** ```lua --- Example usage -UpdateQuestDescription(..., ...) +-- From Quests/AlphaTest/stowaway_antonica.lua +function QuestCheck1(Quest, QuestGiver, Player) + if QuestStepIsComplete(Player,5858,2) and QuestStepIsComplete(Player,5858,3)and QuestStepIsComplete(Player,5858,4) then + UpdateQuestTaskGroupDescription(Quest, 1, "I have found all I need to Fast-Track to Qeynos.") + UpdateQuestDescription(Quest, "I have all the necessary parts for the Fast-Track passage to Qeynos. The ride was a bit cramped...") + GiveQuestReward(Quest, Player) +end ``` diff --git a/docs/lua_functions/UpdateQuestStepDescription.md b/docs/lua_functions/UpdateQuestStepDescription.md index ed95d74..672f835 100644 --- a/docs/lua_functions/UpdateQuestStepDescription.md +++ b/docs/lua_functions/UpdateQuestStepDescription.md @@ -1,18 +1,26 @@ -### Function: UpdateQuestStepDescription(param1, param2, param3) +### Function: UpdateQuestStepDescription(quest, step, description) **Description:** -Placeholder description. +Update the description of the quest step specified. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: int32 - Integer value. -- `param3`: string - String value. +- `quest` (Quest) - Quest object representing `quest`. +- `step` (int32) - Integer value `step`. +- `description` (int32) - Integer value `description`. **Returns:** None. **Example:** ```lua --- Example usage -UpdateQuestStepDescription(..., ..., ...) +-- From Quests/AlphaTest/stowaway_antonica.lua +function Step1Complete(Quest) + UpdateQuestStepDescription(Quest, 1, "I have arrived in Antonica mostly intact.") + AddQuestStepChat(Quest, 2, "I need to meet up with the Shady Swashbuckler near the lighthouse in Antonica.", 1, "The Shady Swashbuckler provided me passage to Antonica. He will have the paperwork I need when I get there.", 11, 121874) + AddQuestStepObtainItem(Quest, 3, "I must fill out Qeynos Citizenship papers.", 1,100, "The Shady Swashbuckler provided me passage to Antonica. He will have the paperwork I need when I get there.", 75, 1001095) + AddQuestStepObtainItem(Quest, 4, "I must fill out Class Certification paperwork.", 1,100, "The Shady Swashbuckler provided me passage to Antonica. He will have the paperwork I need when I get there.", 2183, 1001096,1001097,1001098,1001099,1001100,1001101,1001102,1001103,1001104,1001105,1001106,1001107) + AddQuestStepCompleteAction(Quest, 2, "Step2Complete") + AddQuestStepCompleteAction(Quest, 3, "Step3Complete") + AddQuestStepCompleteAction(Quest, 4, "Step4Complete") +end ``` diff --git a/docs/lua_functions/UpdateQuestTaskGroupDescription.md b/docs/lua_functions/UpdateQuestTaskGroupDescription.md index a671b53..7200b1e 100644 --- a/docs/lua_functions/UpdateQuestTaskGroupDescription.md +++ b/docs/lua_functions/UpdateQuestTaskGroupDescription.md @@ -1,19 +1,23 @@ -### Function: UpdateQuestTaskGroupDescription(param1, param2, param3, param4) +### Function: UpdateQuestTaskGroupDescription(quest, step, description) **Description:** -Placeholder description. +Update the task group description of the quest. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: int32 - Integer value. -- `param3`: string - String value. -- `param4`: int8 - Small integer or boolean flag. +- `quest` (Quest) - Quest object representing `quest`. +- `step` (int32) - Integer value `step`. +- `description` (int32) - Integer value `description`. **Returns:** None. **Example:** ```lua --- Example usage -UpdateQuestTaskGroupDescription(..., ..., ..., ...) +-- From Quests/AlphaTest/stowaway_antonica.lua +function QuestCheck1(Quest, QuestGiver, Player) + if QuestStepIsComplete(Player,5858,2) and QuestStepIsComplete(Player,5858,3)and QuestStepIsComplete(Player,5858,4) then + UpdateQuestTaskGroupDescription(Quest, 1, "I have found all I need to Fast-Track to Qeynos.") + UpdateQuestDescription(Quest, "I have all the necessary parts for the Fast-Track passage to Qeynos. The ride was a bit cramped...") + GiveQuestReward(Quest, Player) +end ``` diff --git a/docs/lua_functions/UpdateQuestZone.md b/docs/lua_functions/UpdateQuestZone.md index b5e9942..6e524d5 100644 --- a/docs/lua_functions/UpdateQuestZone.md +++ b/docs/lua_functions/UpdateQuestZone.md @@ -1,17 +1,23 @@ -### Function: UpdateQuestZone(param1, param2) +### Function: UpdateQuestZone(quest, zone) **Description:** -Placeholder description. +Update the quest's zone setting. **Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: string - String value. +- `quest` (Quest) - Quest object representing `quest`. +- `zone` (Zone) - Zone object representing `zone`. **Returns:** None. **Example:** ```lua --- Example usage -UpdateQuestZone(..., ...) +-- From Quests/Antonica/a_foul_wind.lua +function Init(Quest) + SetQuestFeatherColor(Quest, 3) + SetQuestRepeatable(Quest) + UpdateQuestZone(Quest,"Firemyst Gully: A Foul Wind") + AddQuestStepZoneLoc(Quest, 1, "I need to seek out Firemyst Gully in the center of Antonica.", 10, "I need to seek out Lord Nalin at Firemyst Gully in eastern Antonica.", 2183, -1188.04, -13.62, 706.57,14) + AddQuestStepCompleteAction(Quest, 1, "QuestComplete") +end ``` diff --git a/docs/lua_functions/Zone.md b/docs/lua_functions/Zone.md index b34cc19..6427be4 100644 --- a/docs/lua_functions/Zone.md +++ b/docs/lua_functions/Zone.md @@ -1,22 +1,23 @@ -### Function: Zone(param1, param2, param3, param4, param5, param6, param7) +### Function: Zone(zone, player, x, y, z, heading) **Description:** -Placeholder description. +Zone the player to the destination zone,x,y,z,heading. **Parameters:** -- `param1`: ZoneServer - The zone object. -- `param2`: unknown - Unknown type. -- `param3`: Spawn - The spawn or entity involved. -- `param4`: float - Floating point value. -- `param5`: float - Floating point value. -- `param6`: float - Floating point value. -- `param7`: float - Floating point value. +- `zone` (Zone) - Zone object representing `zone`. +- `player` (Spawn) - Spawn object representing `player`. +- `x` (int32) - Integer value `x`. +- `y` (int32) - Integer value `y`. +- `z` (int32) - Integer value `z`. +- `heading` (int32) - Integer value `heading`. **Returns:** None. **Example:** ```lua --- Example usage -Zone(..., ..., ..., ..., ..., ..., ...) +-- From ItemScripts/BetaVoucher.lua +function examined(Item, Spawn) + Zone(GetZone(1), Spawn, 48.28, -1.08, 44.05, 221.37) +end ```