Even more lua functions documented, 170 this time
This commit is contained in:
parent
4a3f34efe1
commit
18880019dc
@ -1,19 +1,16 @@
|
||||
### Function: CreatePersistedRespawn(param1, param2, param3, param4)
|
||||
### Function: CreatePersistedRespawn(location_id, spawn_type, respawn_time, zone_id)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Creates a persisted respawn time if the zone shuts down, the time will be persisted.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: int32 - Integer value.
|
||||
- `param2`: int32 - Integer value.
|
||||
- `param3`: int32 - Integer value.
|
||||
- `param4`: int32 - Integer value.
|
||||
- `location_id` (uint32) - Integer value `location_id`.
|
||||
- `spawn_type` (uint32) - Integer value `spawn_type`.
|
||||
- `respawn_time` (uint32) - Time value `respawn_time` in seconds.
|
||||
- `zone_id` (uint32) - Integer value `zone_id`.
|
||||
|
||||
**Returns:** None.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
CreatePersistedRespawn(..., ..., ..., ...)
|
||||
```
|
||||
Example Required
|
||||
|
@ -1,23 +1,24 @@
|
||||
### Function: CreateWidgetRegion(param1, param2, param3, param4, param5, param6, param7, param8)
|
||||
### Function: CreateWidgetRegion(zone, version, region_name, env_name, grid_id, widget_id, dist)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Creates a new region to track a grid and/or widget id against a region_name and/or env_name.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: ZoneServer - The zone object.
|
||||
- `param2`: unknown - Unknown type.
|
||||
- `param3`: int32 - Integer value.
|
||||
- `param4`: string - String value.
|
||||
- `param5`: string - String value.
|
||||
- `param6`: int32 - Integer value.
|
||||
- `param7`: int32 - Integer value.
|
||||
- `param8`: float - Floating point value.
|
||||
- `zone` (Zone) - Zone object representing `zone`.
|
||||
- `version` (uint32) - Integer value `version`.
|
||||
- `region_name` (string) - String `region_name`.
|
||||
- `env_name` (string) - String `env_name`.
|
||||
- `grid_id` (uint32) - Integer value `grid_id`.
|
||||
- `widget_id` (uint32) - Integer value `widget_id`.
|
||||
- `dist` (float) - float value `dist`.
|
||||
|
||||
**Returns:** None.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
CreateWidgetRegion(..., ..., ..., ..., ..., ..., ..., ...)
|
||||
-- From ZoneScripts/IsleRefuge1.lua
|
||||
function init_zone_script(Zone)
|
||||
CreateWidgetRegion(Zone, 0, "TestRegion", "", 924281492, 4117633379, 2.0)
|
||||
end
|
||||
```
|
||||
|
@ -1,22 +1,25 @@
|
||||
### Function: CureByControlEffect(param1, param2, param3, param4, param5, param6, param7)
|
||||
### Function: CureByControlEffect(cure_count, cure_type, cure_name, cure_level, target)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Cures the control effects. cure_count controls the amount of cures activated, cure_type will be the control effect type. If in a spell script and no target it will apply to all spell targets.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: unknown - Unknown type.
|
||||
- `param2`: int8 - Small integer or boolean flag.
|
||||
- `param3`: unknown - Unknown type.
|
||||
- `param4`: int8 - Small integer or boolean flag.
|
||||
- `param5`: string - String value.
|
||||
- `param6`: int8 - Small integer or boolean flag.
|
||||
- `param7`: Spawn - The spawn or entity involved.
|
||||
- `cure_count` (uint8) - Integer value `cure_count`.
|
||||
- `cure_type` (uint8) - Integer value `cure_type`.
|
||||
- `cure_name` (string) - String `cure_name`.
|
||||
- `cure_level` (uint8) - Integer value `cure_level`.
|
||||
- `target` (Spawn) - Spawn object representing `target`.
|
||||
|
||||
**Returns:** None.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
CureByControlEffect(..., ..., ..., ..., ..., ..., ...)
|
||||
-- From Spells/Priest/Cleric/Inquisitor/FerventFaith.lua
|
||||
function cast(Caster, Target, Levels)
|
||||
CureByControlEffect(1, 1, "Cure", Levels)
|
||||
CureByControlEffect(1, 2, "Cure", Levels)
|
||||
CureByControlEffect(1, 3, "Cure", Levels)
|
||||
CureByControlEffect(1, 4, "Cure", Levels)
|
||||
end
|
||||
```
|
||||
|
@ -1,23 +1,33 @@
|
||||
### Function: CureByType(param1, param2, param3, param4, param5, param6, param7, param8)
|
||||
### Function: CureByType(cure_count, cure_type, cure_name, cure_level, target, caster)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Cures the control effects. cure_count controls the amount of cures activated, cure_type will be the control effect type. If in a spell script and no target it will apply to all spell targets.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: unknown - Unknown type.
|
||||
- `param2`: int8 - Small integer or boolean flag.
|
||||
- `param3`: unknown - Unknown type.
|
||||
- `param4`: int8 - Small integer or boolean flag.
|
||||
- `param5`: string - String value.
|
||||
- `param6`: int8 - Small integer or boolean flag.
|
||||
- `param7`: Spawn - The spawn or entity involved.
|
||||
- `param8`: Spawn - The spawn or entity involved.
|
||||
- `cure_count` (uint8) - Integer value `cure_count`.
|
||||
- `cure_type` (uint8) - Integer value `cure_type`.
|
||||
- `cure_name` (string) - String `cure_name`.
|
||||
- `cure_level` (uint8) - Integer value `cure_level`.
|
||||
- `target` (Spawn) - Spawn object representing `target`.
|
||||
- `caster` (Spawn) - Spawn object representing `caster`.
|
||||
|
||||
**Returns:** None.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
CureByType(..., ..., ..., ..., ..., ..., ..., ...)
|
||||
-- From ItemScripts/cure_test.lua
|
||||
function used(Item, Player, Target)
|
||||
local effect_type = GetItemEffectType(Item)
|
||||
|
||||
if effect_type < 7 then -- 7 is cure all
|
||||
CureByType(1, effect_type, "", (GetLevel(Player) * 1.08) + 1, Target, Player)
|
||||
elseif effect_type == 7 then
|
||||
CureByType(1, 1, "", (GetLevel(Player) * 1.08) + 1, Target, Player)
|
||||
CureByType(1, 2, "", (GetLevel(Player) * 1.08) + 1, Target, Player)
|
||||
CureByType(1, 3, "", (GetLevel(Player) * 1.08) + 1, Target, Player)
|
||||
CureByType(1, 4, "", (GetLevel(Player) * 1.08) + 1, Target, Player)
|
||||
CureByType(1, 5, "", (GetLevel(Player) * 1.08) + 1, Target, Player)
|
||||
CureByType(1, 6, "", (GetLevel(Player) * 1.08) + 1, Target, Player)
|
||||
end
|
||||
```
|
||||
|
@ -1,18 +1,14 @@
|
||||
### Function: DamageEquippedItems(param1, param2, param3)
|
||||
### Function: DamageEquippedItems(spawn, damage_amount)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Cause a percentage based amount of damage to equipped items. damage_amount 5 = 5%
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `param2`: unknown - Unknown type.
|
||||
- `param3`: int32 - Integer value.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
- `damage_amount` (uint32) - Quantity `damage_amount`.
|
||||
|
||||
**Returns:** None.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
DamageEquippedItems(..., ..., ...)
|
||||
```
|
||||
Example Required
|
||||
|
@ -1,31 +1,38 @@
|
||||
### Function: DamageSpawn(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11, param12, param13, param14, param15, param16)
|
||||
### Function: DamageSpawn(attacker, victim, type, dmg_type, low_damage, high_damage, spell_name, crit_mod)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Damages the victim by the attacker. `type` represents damage packet types listed here https://github.com/emagi/eq2emu/blob/main/docs/data_types/damage_packet_types.md converted from hex to decimal.
|
||||
|
||||
**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`: int8 - Small integer or boolean flag.
|
||||
- `param8`: int8 - Small integer or boolean flag.
|
||||
- `param9`: int32 - Integer value.
|
||||
- `param10`: int32 - Integer value.
|
||||
- `param11`: string - String value.
|
||||
- `param12`: int8 - Small integer or boolean flag.
|
||||
- `param13`: int8 - Small integer or boolean flag.
|
||||
- `param14`: int8 - Small integer or boolean flag.
|
||||
- `param15`: int8 - Small integer or boolean flag.
|
||||
- `param16`: int8 - Small integer or boolean flag.
|
||||
- `attacker` (Spawn) - Spawn object representing `attacker`.
|
||||
- `victim` (Spawn) - Spawn object representing `victim`.
|
||||
- `type` (uint8) - Integer value `type`.
|
||||
- `dmg_type` (uint8) - Integer value `dmg_type`.
|
||||
- `low_damage` (uint32) - Integer value `low_damage`.
|
||||
- `high_damage` (uint32) - Integer value `high_damage`.
|
||||
- `spell_name` (string) - String `spell_name`.
|
||||
- `crit_mod` (uint8) - Integer value `crit_mod`.
|
||||
|
||||
**Returns:** None.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
DamageSpawn(..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ...)
|
||||
-- From RegionScripts/exp04_dun_droga_nurga/naj_lavaregion_damage.lua
|
||||
function TakeLavaDamage(Spawn)
|
||||
local invul = IsInvulnerable(Spawn)
|
||||
if invul == true then
|
||||
return 0
|
||||
end
|
||||
|
||||
local hp = GetHP(Spawn)
|
||||
local level = GetLevel(Spawn)
|
||||
local damageToTake = level * 25
|
||||
-- if we don't have enough HP make them die to pain and suffering not self
|
||||
if hp <= damageToTake then
|
||||
KillSpawn(Spawn, null, 1)
|
||||
else
|
||||
DamageSpawn(Spawn, Spawn, 192, 3, damageToTake, damageToTake, "Lava Burn", 0, 0, 1, 1)
|
||||
end
|
||||
end
|
||||
```
|
||||
|
@ -1,16 +1,18 @@
|
||||
Function: DeleteDBShardID(ShardID)
|
||||
### Function: DeleteDBShardID(ShardID)
|
||||
|
||||
Description: Removes the database record for a given spirit shard, effectively deleting the shard (often after it’s been collected or expired).
|
||||
**Description:**
|
||||
Removes the database record for a given spirit shard, effectively deleting the shard (often after it’s been collected or expired).
|
||||
|
||||
Parameters:
|
||||
**Parameters:**
|
||||
- `shardid` (uint32) - Integer value `shardid`.
|
||||
|
||||
ShardID: Int32 – The ID of the shard to delete.
|
||||
**Returns:** None.
|
||||
|
||||
Returns: Boolean – true if a shard record was found and deleted; false if not.
|
||||
|
||||
Example:
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage (clean up a shard after player retrieves it)
|
||||
if DeleteDBShardID(shardID) then
|
||||
SendMessage(Player, "You feel whole again as your spirit shard dissipates.", "white")
|
||||
end
|
||||
end
|
||||
```
|
||||
|
@ -1,17 +1,21 @@
|
||||
### Function: DeleteSpellBook(param1, param2)
|
||||
### Function: DeleteSpellBook(player, type_selection)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Delete all spell entries in a spell book. `type_selection` represents DELETE_TRADESKILLS = 1, DELETE_SPELLS = 2, DELETE_COMBAT_ART = 4, DELETE_ABILITY = 8, DELETE_NOT_SHOWN = 16. The `type_selection` can be an added combination of the delete options, for example a value of 7 (1+2+4) would delete tradeskills, spells and combat arts.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `param2`: int8 - Small integer or boolean flag.
|
||||
- `player` (Spawn) - Spawn object representing `player`.
|
||||
- `type_selection` (uint8) - Integer value `type_selection`.
|
||||
|
||||
**Returns:** None.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
DeleteSpellBook(..., ...)
|
||||
-- From SpawnScripts/Generic/SubClassToCommoner.lua
|
||||
function RemoveGear(NPC,player)
|
||||
-- many other parts to the script function
|
||||
-- this example deletes spells and combat arts.
|
||||
DeleteSpellBook(player, 6)
|
||||
end
|
||||
```
|
||||
|
@ -1,17 +1,30 @@
|
||||
### Function: Despawn(param1, param2)
|
||||
### Function: Despawn(spawn, delay)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Despawns the defined spawn, delay is optional, if provided the Despawn will take place after a delay.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `param2`: int32 - Integer value.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
- `delay` (uint32) - Integer value `delay`.
|
||||
|
||||
**Returns:** None.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
Despawn(..., ...)
|
||||
-- From Quests/BigBend/gnomore_gnomesteaks.lua
|
||||
function Step1Complete(Quest, QuestGiver, Player)
|
||||
UpdateQuestStepDescription(Quest, 1, "Looks like Ruzb is beyond salvation.")
|
||||
UpdateQuestTaskGroupDescription(Quest, 1, "Looks like Ruzb just couldn't keep away from the gnomesteaks. His loss.")
|
||||
|
||||
local zone = GetZone(Player)
|
||||
local RuzbNPC = GetSpawnByLocationID(zone, 388762, false)
|
||||
Despawn(RuzbNPC)
|
||||
|
||||
local Ruzb = GetSpawnByLocationID(zone, 133773787, false)
|
||||
local SpawnRuzb = SpawnByLocationID(zone, 133773787,false)
|
||||
|
||||
AddQuestStepKill(Quest, 2, "I need to kill Ruzb!", 1, 100, "I need to kill Ruzb after he attacked me.", 91, 1340140)
|
||||
AddQuestStepCompleteAction(Quest, 2, "Step2Complete")
|
||||
end
|
||||
```
|
||||
|
@ -1,18 +1,15 @@
|
||||
### Function: DespawnByLocationID(param1, param2, param3)
|
||||
### Function: DespawnByLocationID(zone, location_id, delay)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Despawns a spawn by a zone and location_id. If there is a delay specified then the despawn triggers after the delay.
|
||||
|
||||
**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`.
|
||||
- `delay` (uint32) - Integer value `delay`.
|
||||
|
||||
**Returns:** None.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
DespawnByLocationID(..., ..., ...)
|
||||
```
|
||||
Example Required
|
||||
|
@ -1,14 +1,21 @@
|
||||
Function: DismissPet(Spawn)
|
||||
### Function: DismissPet(Spawn)
|
||||
|
||||
Description: Dismisses (despawns) the specified player’s active pet. This works for combat pets, cosmetic pets, deity pets, etc., causing them to vanish as if the player dismissed them manually.
|
||||
**Description:**
|
||||
Dismisses (despawns) the specified player’s active pet. This works for combat pets, cosmetic pets, deity pets, etc., causing them to vanish as if the player dismissed them manually.
|
||||
|
||||
Parameters:
|
||||
**Parameters:**
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
Spawn: Spawn – The player whose pet should be dismissed.
|
||||
**Returns:** None.
|
||||
|
||||
Returns: None.
|
||||
**Example:**
|
||||
|
||||
Example:
|
||||
|
||||
-- Example usage (dismissing a pet at the end of an event)
|
||||
DismissPet(Player)
|
||||
```lua
|
||||
-- From Spells/AA/SummonAnimatedTome.lua
|
||||
function remove(Caster, Target)
|
||||
RemoveSpellBonus(Target)
|
||||
pet = GetCosmeticPet(Caster)
|
||||
if pet ~= nil then
|
||||
DismissPet(pet)
|
||||
end
|
||||
```
|
||||
|
@ -1,19 +1,22 @@
|
||||
### Function: DisplayText(param1, param2, param3, param4)
|
||||
### Function: DisplayText(player, type, text)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Displays Channel Text on the Player's screen (without a Spawn attributed with a name, just a plain message). The `type` are based on channel types in https://github.com/emagi/eq2emu/blob/main/docs/data_types/channel_types.md and support will vary on client version.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `param2`: unknown - Unknown type.
|
||||
- `param3`: int8 - Small integer or boolean flag.
|
||||
- `param4`: string - String value.
|
||||
- `player` (Spawn) - Spawn object representing `player`.
|
||||
- `type` (uint8) - Integer value `type`.
|
||||
- `text` (string) - String `text`.
|
||||
|
||||
**Returns:** None.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
DisplayText(..., ..., ..., ...)
|
||||
-- From Quests/Antonica/wanted_gnoll_bandit.lua
|
||||
function Accepted(Quest, QuestGiver, Player)
|
||||
if HasItem(Player,3213)then
|
||||
DisplayText(Spawn, 34, "You roll up the wanted poster and stuff it in your quest satchle.")
|
||||
RemoveItem(Player,3213,1)
|
||||
end
|
||||
```
|
||||
|
@ -1,19 +1,26 @@
|
||||
### Function: Emote(param1, param2, param3, param4)
|
||||
### Function: Emote(spawn, message, spawn2, player)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
The spawn sends an emote to the general area, spawn2 is whom the emote is targetted at. If player is defined then the emote will only be sent to that player.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `param2`: string - String value.
|
||||
- `param3`: Spawn - The spawn or entity involved.
|
||||
- `param4`: Spawn - The spawn or entity involved.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
- `message` (string) - String `message`.
|
||||
- `spawn2` (Spawn) - Spawn object representing `spawn2`.
|
||||
- `player` (Spawn) - Spawn object representing `player`.
|
||||
|
||||
**Returns:** None.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
Emote(..., ..., ..., ...)
|
||||
-- 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
|
||||
```
|
||||
|
@ -1,18 +1,17 @@
|
||||
### Function: EnableGameEvent(param1, param2, param3)
|
||||
### Function: EnableGameEvent(player, event_name, enabled)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Triggers a game event on the Player's interface/UI, all behavior depends on the event_name. The `event_name` options are defined in https://github.com/emagi/eq2emu/blob/main/docs/data_types/game_events.md
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `param2`: string - String value.
|
||||
- `param3`: int8 - Small integer or boolean flag.
|
||||
- `player` (Spawn) - Spawn object representing `player`.
|
||||
- `event_name` (string) - String `event_name`.
|
||||
- `enabled` (uint8) - Integer value `enabled`.
|
||||
|
||||
**Returns:** None.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
EnableGameEvent(..., ..., ...)
|
||||
EnableGameEvent(Player, "UI_SCREENSHOT", 1) -- client takes a screenshot
|
||||
```
|
||||
|
@ -1,14 +1,19 @@
|
||||
Function: EndAutoMount(Spawn)
|
||||
### Function: EndAutoMount(Spawn)
|
||||
|
||||
Description: Dismounts a player who was auto-mounted via StartAutoMount. Typically called at the end of an automated travel route or upon leaving the area where auto-mount is enforced.
|
||||
**Description:**
|
||||
Dismounts a player who was auto-mounted via StartAutoMount. Typically called at the end of an automated travel route or upon leaving the area where auto-mount is enforced.
|
||||
|
||||
Parameters:
|
||||
**Parameters:**
|
||||
- `player` (Spawn) - Spawn object representing `player`.
|
||||
|
||||
Spawn: Spawn – The player to dismount.
|
||||
**Returns:** None.
|
||||
|
||||
Returns: None.
|
||||
**Example:**
|
||||
|
||||
Example:
|
||||
|
||||
-- Example usage (dismount the player after griffon flight ends)
|
||||
EndAutoMount(Player)
|
||||
```lua
|
||||
-- From ZoneScripts/Antonica.lua
|
||||
function GriffonTower(Zone, Spawn)
|
||||
if IsPlayer(Spawn) and IsOnAutoMount(Spawn) then
|
||||
EndAutoMount(Spawn)
|
||||
end
|
||||
```
|
||||
|
@ -1,26 +1,22 @@
|
||||
Function: Evac(Player, X, Y, Z, Heading)
|
||||
### Function: Evac(player, x, y, z, heading)
|
||||
|
||||
Description: Evacuates the Player (optional field) or their group (No fields) to a safe spot, typically the zone’s designated evacuation point (e.g., the zone entrance). This mimics the effect of an evac spell.
|
||||
**Description:**
|
||||
Evacuates the Player (optional field) or their group (No fields) to a safe spot, typically the zone’s designated evacuation point (e.g., the zone entrance). This mimics the effect of an evac spell.
|
||||
|
||||
Parameters:
|
||||
**Parameters:**
|
||||
- `player` (Spawn) - Spawn object reference. The player (usually the caster of the evac or the one whose group to evac). This is optional, if Player is set Evac is self only. Otherwise Evac() is for a spell script against all spell targets.
|
||||
- `x` (float) - Optional X Coordinate (must supply X,Y,Z,Heading). If for group set Player to nil.
|
||||
- `y` (float) - Optional Y Coordinate (must supply X,Y,Z,Heading). If for group set Player to nil.
|
||||
- `z` (float) - Optional Z Coordinate (must supply X,Y,Z,Heading). If for group set Player to nil.
|
||||
- `heading` (float) - Optional Heading Coordinate (must supply X,Y,Z,Heading). If for group set Player to nil.
|
||||
|
||||
Player: Spawn – The player (usually the caster of the evac or the one whose group to evac). This is optional, if Player is set Evac is self only. Otherwise Evac() is for a spell script against all spell targets.
|
||||
X: Float - Optional X Coordinate (must supply X,Y,Z,Heading). If for group set Player to nil.
|
||||
Y: Float - Optional Y Coordinate (must supply X,Y,Z,Heading). If for group set Player to nil.
|
||||
Z: Float - Optional Z Coordinate (must supply X,Y,Z,Heading). If for group set Player to nil.
|
||||
Heading: Float - Optional Heading Coordinate (must supply X,Y,Z,Heading). If for group set Player to nil.
|
||||
|
||||
Returns: None.
|
||||
**Returns:** None.
|
||||
|
||||
Example:
|
||||
**Example:**
|
||||
|
||||
-- In a Spell Script such as Fighter\Crusader\Shadowknight\ShadowyElusion.lua
|
||||
```lua
|
||||
-- From Spells/Fighter/Crusader/Shadowknight/ShadowyElusion.lua
|
||||
function cast(Caster, Target)
|
||||
Evac()
|
||||
end
|
||||
|
||||
-- Evac just Player
|
||||
Evac(Player, X, Y, Z, Heading)
|
||||
|
||||
-- Evac group to specific coordinates
|
||||
Evac(nil, X, Y, Z, Heading)
|
||||
```
|
||||
|
@ -1,19 +1,33 @@
|
||||
### Function: FaceTarget(param1, param2, param3, param4)
|
||||
### Function: FaceTarget(spawn, target, reset_action_state)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
The spawn will be forced to face the target. The reset_action_state is true by default, unless otherwise specified as false, then the FaceTarget may not be honored if the Spawn is doing another activity.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `param2`: unknown - Unknown type.
|
||||
- `param3`: Spawn - The spawn or entity involved.
|
||||
- `param4`: bool - Boolean value (true/false).
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
- `target` (Spawn) - Spawn object representing `target`.
|
||||
- `reset_action_state` (bool) - Boolean flag `reset_action_state`.
|
||||
|
||||
**Returns:** None.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
FaceTarget(..., ..., ..., ...)
|
||||
-- From ItemScripts/pirateskull.lua
|
||||
function PlaceSkull(Item, Player)
|
||||
zone = GetZone(Player)
|
||||
Guurok = GetSpawnByLocationID(zone, 433001)
|
||||
local distancecheck = GetDistance(Guurok, Player)
|
||||
if distancecheck > 8 then
|
||||
RemoveItem(Player, 10399)
|
||||
SendMessage(Player, "The skull crumbles to dust on the ground.", "yellow")
|
||||
CloseItemConversation(Item, Player)
|
||||
elseif distancecheck < 8 then
|
||||
FeedGuurok(Item, Player)
|
||||
SendMessage(Player, "The Guurok snatches the skull as you place it on the ground.", "yellow")
|
||||
FaceTarget(NPC, Player)
|
||||
PlayFlavor(Guurok, "", "", "attack", 0, 0)
|
||||
CloseItemConversation(Item, Player)
|
||||
RemoveItem(Player, 10399)
|
||||
end
|
||||
```
|
||||
|
@ -1,16 +1,28 @@
|
||||
Function: FlashWindow(Player, WindowName, FlashSeconds)
|
||||
### Function: FlashWindow(player, window_name, flash_seconds)
|
||||
|
||||
Description: Causes a UI window to flash (usually its icon or border) on the client to draw attention. For example, flashing the quest journal icon when a new quest is added.
|
||||
**Description:**
|
||||
Causes a UI window to flash (usually its icon or border) on the client to draw attention. For example, flashing the quest journal icon when a new quest is added.
|
||||
|
||||
Parameters:
|
||||
**Parameters:**
|
||||
- `player` (Spawn) – The player whose UI to affect.
|
||||
- `window_name` (string) – The window or UI element name to flash.
|
||||
- `flash_seconds`(float) - Flash time of the window in seconds.
|
||||
|
||||
Player: Spawn – The player whose UI to affect.
|
||||
WindowName: String – The window or UI element name to flash.
|
||||
FlashSeconds: Float - Flash time of the window in seconds.
|
||||
|
||||
Returns: None.
|
||||
**Returns:** None.
|
||||
|
||||
Example:
|
||||
**Example:**
|
||||
|
||||
-- Example usage (flash the quest journal when a quest is updated for 2 seconds).
|
||||
FlashWindow(Player, "MainHUD.StartMenu.quest_journal", 2.0)
|
||||
```lua
|
||||
-- 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
|
||||
```
|
||||
|
@ -1,17 +1,18 @@
|
||||
### Function: Gate(param1, param2)
|
||||
### Function: Gate(spell)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Gate's the current Spawn to their bind point.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: unknown - Unknown type.
|
||||
- `param2`: Spawn - The spawn or entity involved.
|
||||
**Parameters:** None.
|
||||
|
||||
**Returns:** None.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
Gate(..., ...)
|
||||
-- From SpawnScripts/CircleElders/GMHelper.lua
|
||||
function BindPointOption(NPC, Spawn)
|
||||
Despawn(NPC)
|
||||
Gate(Spawn)
|
||||
end
|
||||
```
|
||||
|
@ -1,18 +1,14 @@
|
||||
### Function: GetAAInfo(param1, param2, param3)
|
||||
### Function: GetAAInfo(spawn, type)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Returns AA info based on the type string. The `type` string can be assigned_aa, unassigned_aa, assigned_tradeskill_aa, unassigned_tradeskill_aa, assigned_prestige_aa, unassigned_prestige_aa, assigned_tradeskill_prestige_aa and unassigned_tradeskill_prestige_aa.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `param2`: unknown - Unknown type.
|
||||
- `param3`: string - String value.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
- `type` (string) - String `type`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** If `type` is valid in the list, returns the SInt32 value of the AA field type.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetAAInfo(..., ..., ...)
|
||||
```
|
||||
Example Required
|
||||
|
@ -1,18 +1,13 @@
|
||||
### Function: GetAggroRadius(param1, param2, param3)
|
||||
### Function: GetAggroRadius(spawn)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Gets the aggro radius (float) of the Spawn.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `param2`: unknown - Unknown type.
|
||||
- `param3`: unknown - Unknown type.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** Float of the Spawn/NPC if valid.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetAggroRadius(..., ..., ...)
|
||||
```
|
||||
Example Required
|
||||
|
@ -1,16 +1,27 @@
|
||||
### Function: GetAgi(param1)
|
||||
### Function: GetAgi(spawn)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Return's the current agility of the Spawn.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** SInt32 value of the Spawn's agility.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetAgi(...)
|
||||
-- From SpawnScripts/Commonlands/MarcusWarklar.lua
|
||||
function spawn(NPC)
|
||||
dmgMod = math.floor(GetStr(NPC)/10)
|
||||
HPRegenMod = math.floor(GetSta(NPC)/10)
|
||||
PwRegenMod = math.floor(GetAgi(NPC)/10)
|
||||
SetInfoStructUInt(NPC, "override_primary_weapon", 1)
|
||||
SetInfoStructUInt(NPC, "primary_weapon_damage_low", math.floor(95 + dmgMod))
|
||||
SetInfoStructUInt(NPC, "primary_weapon_damage_high", math.floor(175 + dmgMod))
|
||||
SetInfoStructUInt(NPC, "hp_regen_override", 1)
|
||||
SetInfoStructSInt(NPC, "hp_regen", 80 + HPRegenMod)
|
||||
SetInfoStructUInt(NPC, "pw_regen_override", 1)
|
||||
SetInfoStructSInt(NPC, "pw_regen", 30 + PwRegenMod)
|
||||
end
|
||||
```
|
||||
|
@ -1,16 +1,13 @@
|
||||
### Function: GetAgiBase(param1)
|
||||
### Function: GetAgiBase(spawn)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Gets the base agility of the Spawn.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** SInt32 value of the Spawn's base agility.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetAgiBase(...)
|
||||
```
|
||||
Example Required
|
||||
|
@ -1,20 +1,27 @@
|
||||
Function: GetAlignment(Player)
|
||||
### Function: GetAlignment(Player)
|
||||
|
||||
Description: Returns the alignment of the player character – typically Good, Neutral, or Evil in EQ2. Alignment often affects starting city and some quest options.
|
||||
**Description:**
|
||||
Returns the alignment of the player character – typically Good, Neutral, or Evil in EQ2. Alignment often affects starting city and some quest options.
|
||||
|
||||
Parameters:
|
||||
**Parameters:**
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
Player: Spawn – The player to query.
|
||||
**Example:**
|
||||
|
||||
Returns: Int32 – An alignment value (e.g., 0=Neutral, 1=Good, 2=Evil as commonly used).
|
||||
|
||||
Example:
|
||||
|
||||
-- Example usage (greet players differently by alignment)
|
||||
if GetAlignment(Player) == 1 then
|
||||
Say(NPC, "Well met, friend of Qeynos.")
|
||||
elseif GetAlignment(Player) == 0 then
|
||||
Say(NPC, "I smell the stench of Freeport on you.")
|
||||
elseif GetAlignment(Player) == 2 then
|
||||
Say(NPC, "Neutrality you say?")
|
||||
end
|
||||
```lua
|
||||
-- From ItemScripts/ForgeryFreeportCitizenshipPapers.lua
|
||||
function Faction(Item,Player)
|
||||
Freeport = GetFactionAmount(Player, 11)
|
||||
Freeport_Add = (10000-Freeport)
|
||||
Freeport = GetFactionAmount(Player, 12)
|
||||
Freeport_Add = (-20000-Freeport)
|
||||
Neriak = GetFactionAmount(Player, 13)
|
||||
Kelethin = GetFactionAmount(Player, 14)
|
||||
Halas = GetFactionAmount(Player, 16)
|
||||
Gorowyn = GetFactionAmount(Player, 17)
|
||||
alignment = GetAlignment(Player)
|
||||
if Freeport <10000 and Freeport >=0 then ChangeFaction(Player, 11, Freeport_Add)
|
||||
elseif Freeport <0 then ChangeFaction(Player, 11, (Freeport*-1))
|
||||
Faction(Item,Player)
|
||||
end
|
||||
```
|
||||
|
@ -1,17 +1,36 @@
|
||||
### Function: GetArchetypeName(param1, param2)
|
||||
### Function: GetArchetypeName(spawn)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Gets the base class of the Spawn and then determines the archetype name of the Spawn. The C++ code calls GetClassNameCase which changes the case sensitivity in that only the first letter is upper case for the classname. See https://github.com/emagi/eq2emu/blob/main/docs/data_types/classes.md and use the Display Name.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `param2`: unknown - Unknown type.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** The class name in string format. As listed under Display Name in classes https://github.com/emagi/eq2emu/blob/main/docs/data_types/classes.md
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetArchetypeName(..., ...)
|
||||
-- From SpawnScripts/FrostfangSea/KnutOrcbane.lua
|
||||
function hailed(NPC, Spawn)
|
||||
FaceTarget(NPC, Spawn)
|
||||
conversation = CreateConversation()
|
||||
|
||||
if not HasCompletedQuest(Spawn, NothingWaste) then
|
||||
PlayFlavor(NPC, "", "There are some coldain that could use your help. Speak with Dolur Axebeard or Belka Thunderheart at the Great Shelf.", "nod", 1689589577, 4560189, Spawn)
|
||||
elseif not HasCompletedQuest(Spawn, ImpishThreats) and not HasQuest(Spawn, ImpishThreats) then
|
||||
PlayFlavor(NPC, "knut_orcbane/halas/cragged_spine/knut_orcbane_004.mp3", "", "", 2960091072, 298935483, Spawn)
|
||||
AddConversationOption(conversation, "Thank you.", "Quest1Chat_1")
|
||||
AddConversationOption(conversation, "What cause is that?", "Quest1Chat_10")
|
||||
AddConversationOption(conversation, "Not me. I'm just passing through.")
|
||||
local archetype = GetArchetypeName(Spawn)
|
||||
if archetype == 'Fighter' then
|
||||
archetype_message = "strong fighter"
|
||||
elseif archetype == 'Mage' then
|
||||
archetype_message = 'powerful mage'
|
||||
elseif archetype == 'Scout' then
|
||||
archetype_message = 'stealthy scout'
|
||||
else
|
||||
archetype_message = 'caring priest'
|
||||
end
|
||||
```
|
||||
|
@ -1,17 +1,14 @@
|
||||
### Function: GetArrowColor(param1, param2)
|
||||
### Function: GetArrowColor(player, level)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Returns the arrow color based on the level against the Player's level.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `param2`: int8 - Small integer or boolean flag.
|
||||
- `player` (Spawn) - Spawn object representing `player`.
|
||||
- `level` (uint8) - Integer value `level`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** Return is UINT32 represents the arrow colors GRAY 0, GREEN 1, BLUE 2, WHITE 3, YELLOW 4, ORANGE 5, RED 6.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetArrowColor(..., ...)
|
||||
```
|
||||
Example Required
|
||||
|
@ -1,18 +1,13 @@
|
||||
### Function: GetBaseAggroRadius(param1, param2, param3)
|
||||
### Function: GetBaseAggroRadius(spawn)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Return's the base aggro radius of the Spawn.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `param2`: unknown - Unknown type.
|
||||
- `param3`: unknown - Unknown type.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** Base aggro radius of the spawn in float.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetBaseAggroRadius(..., ..., ...)
|
||||
```
|
||||
Example Required
|
||||
|
@ -1,18 +1,19 @@
|
||||
### Function: GetBoundZoneID(param1, param2, param3)
|
||||
### Function: GetBoundZoneID(spawn)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Gets the zone id the Spawn(Player) is bound in.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `param2`: unknown - Unknown type.
|
||||
- `param3`: unknown - Unknown type.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** Returns UINT32 of the Zone ID.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetBoundZoneID(..., ..., ...)
|
||||
-- From Spells/Commoner/CalltoHome.lua
|
||||
function precast(Caster, Target)
|
||||
if GetBoundZoneID(Caster) == 0 then
|
||||
return false
|
||||
end
|
||||
```
|
||||
|
@ -1,17 +1,25 @@
|
||||
### Function: GetCanBind(param1, param2)
|
||||
### Function: GetCanBind(spawn)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Gets if the Spawn(Player) can bind in the current zone.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `param2`: unknown - Unknown type.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** Returns UINT32 1 if you can bind, otherwise 0.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetCanBind(..., ...)
|
||||
-- From Spells/Commoner/SetRecallPoint.lua
|
||||
function cast(Caster, Target)
|
||||
|
||||
canbind = GetCanBind(Caster)
|
||||
incombat = IsInCombat(Caster)
|
||||
|
||||
if ( incombat == true)
|
||||
then
|
||||
SendMessage(Caster, "You cannot use Set Recall Point while in combat.", "red")
|
||||
goto exit;
|
||||
end
|
||||
```
|
||||
|
@ -1,17 +1,23 @@
|
||||
### Function: GetCanEvac(param1, param2)
|
||||
### Function: GetCanEvac(spawn)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Gets if the Spawn(Player) can evac in the current zone.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `param2`: unknown - Unknown type.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** Returns UINT32 1 if you can evac, otherwise 0.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetCanEvac(..., ...)
|
||||
-- From Spells/Scout/Escape.lua
|
||||
function precast(Caster, Target)
|
||||
if(GetCanEvac(Caster) == 1)
|
||||
then
|
||||
return true
|
||||
else
|
||||
SendMessage(Caster, "You cannot use evacuate spells in this zone.", "red")
|
||||
return false
|
||||
end
|
||||
```
|
||||
|
@ -1,17 +1,17 @@
|
||||
### Function: GetCanGate(Spawn)
|
||||
### Function: GetCanGate(spawn)
|
||||
|
||||
**Description:**
|
||||
Checks if the Spawn is allowed to use Gate spells in this zone or area.
|
||||
|
||||
**Parameters:**
|
||||
- `Spawn`: Spawn - The spawn to check if Gate is allowed.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** Returns UINT32 1 if you can gate, otherwise 0.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage Spells/Commoner/CalltoHome.lua (spell to send player to their Bind with Gate)
|
||||
-- From Spells/Commoner/CalltoHome.lua
|
||||
function precast(Caster, Target)
|
||||
if GetBoundZoneID(Caster) == 0 then
|
||||
return false
|
||||
@ -27,8 +27,4 @@ function precast(Caster, Target)
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
function cast(Caster, Target)
|
||||
Gate(Caster)
|
||||
end
|
||||
```
|
||||
|
@ -1,18 +1,27 @@
|
||||
### Function: GetCasterSpellLevel(param1, param2, param3)
|
||||
### Function: GetCasterSpellLevel(spell)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Gets the Caster's spell level. The `spell` field is optional for outside a spell script, if inside a spell script the current spell is assumed.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: unknown - Unknown type.
|
||||
- `param2`: unknown - Unknown type.
|
||||
- `param3`: unknown - Unknown type.
|
||||
- `spell` (Spell) - Spell object representing `spell`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** The spell caster's level in UINT32 format.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetCasterSpellLevel(..., ..., ...)
|
||||
-- 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
|
||||
```
|
||||
|
@ -1,19 +1,14 @@
|
||||
### Function: GetCharacterFlag(param1, param2, param3, param4)
|
||||
### Function: GetCharacterFlag(player, flag_id)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Gets the current character flag value for the flag_id specified. Refer to the CF_.. flags in the Player.h
|
||||
|
||||
**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` (int32) - Integer value `flag_id`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** Boolean return's true if the flag is enabled or false if disabled.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetCharacterFlag(..., ..., ..., ...)
|
||||
```
|
||||
Example Required
|
||||
|
@ -1,16 +1,29 @@
|
||||
### Function: GetCharacterID(param1)
|
||||
### Function: GetCharacterID(spawn)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Gets the character id of the current Spawn(Player).
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** UINT32 value of Spawn's the character id. 0 if not a Player.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetCharacterID(...)
|
||||
-- From SpawnScripts/Generic/SpiritShard.lua
|
||||
function recovershard(NPC, Spawn)
|
||||
local charid = GetShardCharID(NPC)
|
||||
|
||||
if GetCharacterID(Spawn) == charid then
|
||||
local DebtToRemovePct = GetRuleFlagFloat("R_Combat", "ShardDebtRecoveryPercent")
|
||||
local DeathXPDebt = GetRuleFlagFloat("R_Combat", "DeathExperienceDebt")
|
||||
|
||||
local debt = GetInfoStructFloat(Spawn, "xp_debt")
|
||||
local DebtToRemove = (DebtToRemovePct/100.0)*(DeathXPDebt/100.0);
|
||||
if debt > DebtToRemove then
|
||||
SetInfoStructFloat(Spawn, "xp_debt", debt - DebtToRemove)
|
||||
else
|
||||
SetInfoStructFloat(Spawn, "xp_debt", 0.0)
|
||||
end
|
||||
```
|
||||
|
@ -1,17 +1,19 @@
|
||||
Function: GetCharmedPet(Spawn)
|
||||
### Function: GetCharmedPet(Spawn)
|
||||
|
||||
Description: Returns the NPC that the given player or NPC has charmed, if any. When a player charms an NPC (through a spell), that NPC becomes a pet under their control — this function retrieves it.
|
||||
**Description:**
|
||||
Returns the NPC that the given player or NPC has charmed, if any. When a player charms an NPC (through a spell), that NPC becomes a pet under their control — this function retrieves it.
|
||||
|
||||
Parameters:
|
||||
**Parameters:**
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
Spawn: Spawn – The entity (usually a player) who may have a charmed pet.
|
||||
**Example:**
|
||||
|
||||
Returns: Spawn – The charmed pet NPC if one exists, or nil if there is no active charmed pet.
|
||||
|
||||
Example:
|
||||
|
||||
-- Example usage (checking if player currently has a charmed creature)
|
||||
local charmed = GetCharmedPet(Player)
|
||||
if charmed ~= nil then
|
||||
Say(charmed, "I am under your control...")
|
||||
end
|
||||
```lua
|
||||
-- From Spells/Mage/Enchanter/Charm.lua
|
||||
function remove(Caster, Target)
|
||||
local pet = GetCharmedPet(Caster)
|
||||
if pet ~= nil then
|
||||
RemoveSpellBonus(pet)
|
||||
DismissPet(pet)
|
||||
end
|
||||
```
|
||||
|
@ -1,19 +1,15 @@
|
||||
### Function: GetChoiceSpawnID(param1, param2, param3, param4)
|
||||
### Function: GetChoiceSpawnID(spawn, commandMatch, declineValue)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Spawn represents the Player with the choice window. Return's the spawn_id if the choice was determined from a previously provided CreateChoiceWindow. This remains until ClearChoice is called.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `param2`: unknown - Unknown type.
|
||||
- `param3`: string - String value.
|
||||
- `param4`: int8 - Small integer or boolean flag.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
- `commandMatch` (string) - String `commandMatch`.
|
||||
- `declineValue` (uint8) - Integer value `declineValue`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** UInt32 of the spawn_id the Player is using the choice dialog with.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetChoiceSpawnID(..., ..., ..., ...)
|
||||
```
|
||||
Example Required
|
||||
|
@ -1,16 +1,44 @@
|
||||
### Function: GetClass(param1)
|
||||
### Function: GetClass(spawn)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Gets the adventure class of the Spawn.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** UInt32 adventure class id for the Spawn. See https://github.com/emagi/eq2emu/blob/main/docs/data_types/classes.md for the ID numbers.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetClass(...)
|
||||
-- From ItemScripts/aQeynosianCommemorativeBundle.lua
|
||||
function Weapon(Item,Player)
|
||||
if GetClass(Player)==FIGHTER or GetClass(Player)==WARRIOR or GetClass(Player)==GUARDIAN or GetClass(Player)==BERSERKER then
|
||||
SummonItem(Player, 85495,1 )
|
||||
elseif GetClass(Player)==BRAWLER or GetClass(Player)==MONK or GetClass(Player)==BRUISER or GetClass(Player)==ANIMALIST or GetClass(Player)==BEASTLORD then
|
||||
SummonItem(Player,85483,1)
|
||||
elseif GetClass(Player)==CRUSADER or GetClass(Player)==SHADOWKNIGHT or GetClass(Player)==PALADIN then
|
||||
SummonItem(Player,85485,1)
|
||||
|
||||
elseif GetClass(Player)==PRIEST or GetClass(Player)==CLERIC or GetClass(Player)==TEMPLAR or GetClass(Player)==INQUISITOR or GetClass(Player)==SHAPER or GetClass(Player)==CHANNELER then
|
||||
GSummonItem(Player,85484,1)
|
||||
elseif GetClass(Player)==DRUID or GetClass(Player)==WARDEN or GetClass(Player)==FURY then
|
||||
SummonItem(Player,85486,1)
|
||||
elseif GetClass(Player)==SHAMAN or GetClass(Player)==MYSTIC or GetClass(Player)==DEFILER then
|
||||
SummonItem(Player,85492,1)
|
||||
|
||||
elseif GetClass(Player)==MAGE or GetClass(Player)==SORCERER or GetClass(Player)==WIZARD or GetClass(Player)==WARLOCK then
|
||||
SummonItem(Player,85493,1)
|
||||
elseif GetClass(Player)==ENCHANTER or GetClass(Player)==ILLUSIONIST or GetClass(Player)==COERCER then
|
||||
SummonItem(Player,85487,1)
|
||||
elseif GetClass(Player)==SUMMONER or GetClass(Player)==CONJUROR or GetClass(Player)==NECROMANCER then
|
||||
SummonItem(Player,85494,1)
|
||||
|
||||
elseif GetClass(Player)==SCOUT or GetClass(Player)==ROGUE or GetClass(Player)==SWASHBUCKLER or GetClass(Player)==BRIGAND then
|
||||
SummonItem(Player,85491,1)
|
||||
elseif GetClass(Player)==BARD or GetClass(Player)==TROUBADOR or GetClass(Player)==DIRGE then
|
||||
SummonItem(Player,85482,1)
|
||||
elseif GetClass(Player)==RANGER or GetClass(Player)==ASSASSIN or GetClass(Player)==PREDATOR then
|
||||
SummonItem(Player,85489,1)
|
||||
end
|
||||
```
|
||||
|
@ -1,16 +1,13 @@
|
||||
### Function: GetClassName(param1)
|
||||
### Function: GetClassName(spawn)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Gets the class name of the Spawn. In the Class Constant format in the classes table https://github.com/emagi/eq2emu/blob/main/docs/data_types/classes.md
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** String of the class name for the Spawn, using the Class Constant format (all upper case) in https://github.com/emagi/eq2emu/blob/main/docs/data_types/classes.md
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetClassName(...)
|
||||
```
|
||||
Example Required
|
||||
|
@ -1,16 +1,32 @@
|
||||
Function: GetClientVersion(Spawn)
|
||||
### Function: GetClientVersion(Spawn)
|
||||
|
||||
Description: Retrieves the game client version of the specified player (useful if the server supports multiple client versions). This can determine differences in available features or UI.
|
||||
**Description:**
|
||||
Retrieves the game client version of the specified player (useful if the server supports multiple client versions). This can determine differences in available features or UI.
|
||||
|
||||
Parameters:
|
||||
**Parameters:**
|
||||
- `player` (Spawn) - Spawn object representing `player`.
|
||||
|
||||
Spawn: Spawn – The player whose client version to get.
|
||||
**Returns:** UInt32 value of the client version, Isle of Refuge = 373, Desert of Flames (not CD, January 2006) = 546, Kingdom of Sky (Feb 2006 DVD) = 561
|
||||
|
||||
Returns: Int32 – The client version number (for example, corresponding to certain expansions or patches).
|
||||
**Example:**
|
||||
|
||||
Example:
|
||||
|
||||
-- Example usage (check if player’s client supports a feature)
|
||||
if GetClientVersion(Player) < REQUIRED_CLIENT_VERSION then
|
||||
SendMessage(Player, "Please update your client for the best experience.", "yellow")
|
||||
end
|
||||
```lua
|
||||
-- From ItemScripts/AcommemorativeQeynosCoin.lua
|
||||
function examined(Item, Player)
|
||||
choice = MakeRandomInt(0,100)
|
||||
if choice >=2 then
|
||||
if GetClientVersion(Player) >546 then
|
||||
conversation = CreateConversation()
|
||||
PlayFlavor(Player, "voiceover/english/queen_antonia_bayle/qey_north/antonia_isle_speech_1.mp3", "", "", 499186274, 1744595600, Player)
|
||||
-- PlayFlavor(Player,"voiceover/english/tullia_domna/fprt_hood04/quests/tulladomna/tulla_x1_initial.mp3","","",309451026,621524268,Player)
|
||||
-- PlayFlavor(Player,"voiceover/english/queen_antonia_bayle/qey_north/antonia_isle_speech.mp3","","", 2297205435, 1273418227,Player)
|
||||
AddConversationOption(conversation, "\"Many among you...\"", "visage03")
|
||||
AddConversationOption(conversation, "Put the coin away.", "CloseItemConversation")
|
||||
StartDialogConversation(conversation, 2, Item, Player, "As you clutch the coin in your hand, you hear a voice magically speaking in your mind. \"Good traveler, you have seen much in your journey, and now you seek refuge in our humble City of Qeynos. As ruler and servant of the good people of Qeynos, I, Antonia Bayle, welcome you.\"")
|
||||
else
|
||||
conversation = CreateConversation()
|
||||
PlayFlavor(Player,"voiceover/english/queen_antonia_bayle/qey_north/antonia_isle_speech.mp3","","", 2297205435, 1273418227,Player)
|
||||
AddConversationOption(conversation, "Put the coin away.", "CloseItemConversation")
|
||||
StartDialogConversation(conversation, 2, Item, Player, "As you clutch the coin in your hand, you hear a voice magically speaking in your mind.")
|
||||
end
|
||||
```
|
||||
|
@ -1,16 +1,34 @@
|
||||
### Function: GetCoinMessage(param1)
|
||||
### Function: GetCoinMessage(total_coins)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Gets the translated string message of the total coins in copper to copper, silver, gold and platinum.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: int32 - Integer value.
|
||||
- `total_coins` (uint32) - Integer value `total_coins`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** String representation of the coins.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetCoinMessage(...)
|
||||
-- From SpawnScripts/Generic/aGigglegibberGoblinGamblinGameVendor.lua
|
||||
function hailed(NPC, Spawn)
|
||||
FaceTarget(NPC, Spawn)
|
||||
conversation = CreateConversation()
|
||||
|
||||
AddConversationOption(conversation, "Thanks.")
|
||||
StartConversation(conversation, NPC, Spawn, "The current jackpot is " .. GetCoinMessage(GetVariableValue("gambling_current_jackpot")) .. ".")
|
||||
|
||||
--[[
|
||||
PlayFlavor(NPC, "", "", "", 0, 0, Spawn)
|
||||
AddConversationOption(conversation, "How did a goblin get in here? Don't you kill people?", "dlg_0_1")
|
||||
AddConversationOption(conversation, "I think I'd rather keep my money, thanks.")
|
||||
StartConversation(conversation, NPC, Spawn, "Buy ticket, you! Only ten shiny coins! You give just ten shiny coins and maybe you get um... many shinier coins!")
|
||||
if convo==1 then
|
||||
PlayFlavor(NPC, "", "", "", 0, 0, Spawn)
|
||||
AddConversationOption(conversation, "How did a goblin get in here? Don't you kill people?", "dlg_1_1")
|
||||
AddConversationOption(conversation, "What do you know about the disappearance of Lord Bowsprite?")
|
||||
AddConversationOption(conversation, "I think I'd rather keep my money, thanks.")
|
||||
StartConversation(conversation, NPC, Spawn, "Buy ticket, you! Only ten shiny coins! You give just ten shiny coins and maybe you get um... many shinier coins!")
|
||||
end
|
||||
```
|
||||
|
@ -1,17 +1,21 @@
|
||||
Function: GetCosmeticPet(Spawn)
|
||||
### Function: GetCosmeticPet(Spawn)
|
||||
|
||||
Description: Returns the cosmetic pet (fun pet) entity of the given player if one is currently summoned.
|
||||
**Description:**
|
||||
Returns the cosmetic pet (fun pet) entity of the given player if one is currently summoned.
|
||||
|
||||
Parameters:
|
||||
**Parameters:**
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
Spawn: Spawn – The player whose cosmetic pet to retrieve.
|
||||
**Returns:** Spawn – The cosmetic pet spawn if active, or nil if the player has no cosmetic pet out.
|
||||
|
||||
Returns: Spawn – The cosmetic pet spawn if active, or nil if the player has no cosmetic pet out.
|
||||
**Example:**
|
||||
|
||||
Example:
|
||||
|
||||
-- Example usage (pet-related quest checking if a particular pet is summoned)
|
||||
local pet = GetCosmeticPet(Player)
|
||||
if pet ~= nil and GetName(pet) == "Frostfell Elf" then
|
||||
Say(NPC, "I see you have a festive friend with you!")
|
||||
end
|
||||
```lua
|
||||
-- From Spells/AA/SummonAnimatedTome.lua
|
||||
function remove(Caster, Target)
|
||||
RemoveSpellBonus(Target)
|
||||
pet = GetCosmeticPet(Caster)
|
||||
if pet ~= nil then
|
||||
DismissPet(pet)
|
||||
end
|
||||
```
|
||||
|
@ -1,16 +1,30 @@
|
||||
### Function: GetCurrentHP(param1)
|
||||
### Function: GetCurrentHP(spawn)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Returns the current HP of the Spawn, this can be represented as GetHP(spawn) as well.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** SInt32 current hp value of the spawn.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetCurrentHP(...)
|
||||
-- From SpawnScripts/GreaterFaydark/grobins.lua
|
||||
function healthchanged(NPC)
|
||||
|
||||
if GetCurrentHP(NPC) <= (GetMaxHP(NPC) / 2) then
|
||||
choice = math.random(1,4)
|
||||
if choice == 1 then
|
||||
PlayFlavor(NPC, "voiceover/english/exp03_combatvo/goblin_greater_faydark/ft/_exp03/goblin/goblin_greater_faydark_battle_25d9a433.mp3", "Grum! Grum! ", "", 1460066353, 1003945639, Spawn)
|
||||
elseif choice == 2 then
|
||||
PlayFlavor(NPC, "voiceover/english/exp03_combatvo/goblin_greater_faydark/ft/_exp03/goblin/goblin_greater_faydark_battle_4e5ee4ae.mp3", "Smash the squishies.", "", 3016834030, 2330929155, Spawn)
|
||||
elseif choice == 3 then
|
||||
PlayFlavor(NPC, "voiceover/english/exp03_combatvo/goblin_greater_faydark/ft/_exp03/goblin/goblin_greater_faydark_battle_603b0f3b.mp3", "Run away from the mines!", "", 861506750, 2339330363, Spawn)
|
||||
elseif choice == 4 then
|
||||
PlayFlavor(NPC, "voiceover/english/exp03_combatvo/goblin_greater_faydark/ft/_exp03/goblin/goblin_greater_faydark_battle_cf61b767.mp3", "Groblin's go!", "", 1309387887, 223459313, Spawn)
|
||||
else
|
||||
-- say nothing
|
||||
end
|
||||
```
|
||||
|
@ -1,16 +1,13 @@
|
||||
### Function: GetCurrentPower(param1)
|
||||
### Function: GetCurrentPower(spawn)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Returns the current Power of the Spawn, this can be represented as GetPower(spawn) as well.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** SInt32 current power value of the spawn.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetCurrentPower(...)
|
||||
```
|
||||
Example Required
|
||||
|
@ -1,16 +1,18 @@
|
||||
### Function: GetCurrentZoneSafeLocation(param1)
|
||||
### Function: GetCurrentZoneSafeLocation(spawn)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Returns the X, Y, Z of the current zone safe location by using the supplied Spawn's zone.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** x,y,z as returned array.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetCurrentZoneSafeLocation(...)
|
||||
function cast(Caster, Target)
|
||||
x,y,z = GetCurrentZoneSafeLocation(Caster)
|
||||
SetPosition(Caster, x, y, z)
|
||||
end
|
||||
```
|
||||
|
@ -1,16 +1,66 @@
|
||||
### Function: GetDeity(param1)
|
||||
### Function: GetDeity(spawn)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Gets the deity of the spawn.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** UInt32 of the Spawn's Deity.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetDeity(...)
|
||||
-- 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
|
||||
```
|
||||
|
@ -1,16 +1,18 @@
|
||||
Function: GetDeityPet(Spawn)
|
||||
### Function: GetDeityPet(spawn)
|
||||
|
||||
Description: Retrieves the deity pet entity belonging to the specified player, if the deity pet is currently summoned.
|
||||
**Description:**
|
||||
Retrieves the deity pet entity belonging to the specified player, if the deity pet is currently summoned.
|
||||
|
||||
Parameters:
|
||||
**Parameters:**
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
Spawn: Spawn – The player whose deity pet to get.
|
||||
**Example:**
|
||||
|
||||
Returns: Spawn – The deity pet spawn if it is currently active, or nil if no deity pet is out.
|
||||
|
||||
Example:
|
||||
|
||||
-- Example usage (check for deity pet presence)
|
||||
if GetDeityPet(Player) ~= nil then
|
||||
SendMessage(Player, "Your deity companion watches over you.", "white")
|
||||
end
|
||||
```lua
|
||||
-- From Spells/Commoner/PeacefulVisage.lua
|
||||
function remove(Caster, Target)
|
||||
pet = GetDeityPet(Caster)
|
||||
if pet ~= nil then
|
||||
DismissPet(pet)
|
||||
end
|
||||
```
|
||||
|
@ -1,16 +1,23 @@
|
||||
### Function: GetDifficulty(param1)
|
||||
### Function: GetDifficulty(spawn)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Gets the difficulty value of the current spawn. 10+ usually represents epics, 6+ heroic, so on.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** UInt32 of the Spawn's difficulty setting.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetDifficulty(...)
|
||||
-- From SpawnScripts/Generic/CombatModule.lua
|
||||
function combatModule(NPC, Spawn)
|
||||
level = GetLevel(NPC) -- NPC Level
|
||||
difficulty = GetDifficulty(NPC) -- NPC Difficulty || Function in testing phase, default to 6 if necessary.
|
||||
levelSwitch(NPC)
|
||||
regen(NPC)
|
||||
attributes(NPC)
|
||||
|
||||
end
|
||||
```
|
||||
|
@ -1,18 +1,24 @@
|
||||
### Function: GetDistance(param1, param2, param3)
|
||||
### Function: GetDistance(spawn, spawn2, include_radius)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Gets the distance between the two spawns, spawn and spawn2. The include_radius is optional when set to true will use the collision radius of the spawn to reduce distance of the spawns.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `param2`: Spawn - The spawn or entity involved.
|
||||
- `param3`: int8 - Small integer or boolean flag.
|
||||
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
- `spawn2` (Spawn) - Spawn object representing `spawn2`.
|
||||
- `include_radius` (uint8) - Distance `include_radius`.
|
||||
**Returns:** None.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetDistance(..., ..., ...)
|
||||
-- From ItemScripts/FroglokPondstoneEvil.lua
|
||||
function used(Item, Player)
|
||||
local Cube = 331142
|
||||
local Spawn2 = GetSpawn(Player, Cube)
|
||||
if Spawn2 == nil then SendMessage(Player, "You must seek an ancient pond to use this item.", "Yellow") else
|
||||
local Distance = GetDistance(Player, Spawn2)
|
||||
if Distance > 50 then SendMessage(Player, "You must seek an ancient pond to use this item.", "Yellow")
|
||||
else CastSpell(Player, 2550399, 1)
|
||||
end
|
||||
```
|
||||
|
@ -1,18 +1,24 @@
|
||||
### Function: GetEncounter(param1, param2, param3)
|
||||
### Function: GetEncounter(spawn)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Gets the encounter list of the Spawn(NPC).
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `param2`: unknown - Unknown type.
|
||||
- `param3`: unknown - Unknown type.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** Table list of Spawn's in the encounter list
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetEncounter(..., ..., ...)
|
||||
-- From ItemScripts/LaserGoggles.lua
|
||||
function used(Item, Player)
|
||||
local target = GetTarget(Player)
|
||||
if target ~= nil and IsEntity(target) then
|
||||
local encounter = GetEncounter(target)
|
||||
if encounter ~= nil then
|
||||
doDamage(Player, target, damage)
|
||||
else
|
||||
doDamage(Player, target, damage)
|
||||
end
|
||||
```
|
||||
|
@ -1,18 +1,12 @@
|
||||
### Function: GetEncounterSize(param1, param2, param3)
|
||||
### Function: GetEncounterSize(spawn)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Gets the encounter list size of the Spawn(NPC).
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `param2`: unknown - Unknown type.
|
||||
- `param3`: unknown - Unknown type.
|
||||
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
**Returns:** None.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetEncounterSize(..., ..., ...)
|
||||
```
|
||||
Example Required
|
||||
|
@ -1,17 +1,30 @@
|
||||
### Function: GetFactionAmount(param1, param2)
|
||||
### Function: GetFactionAmount(player, faction_id)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Gets the amount of faction value the player has with the specified faction_id.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `param2`: int32 - Integer value.
|
||||
- `player` (Spawn) - Spawn reference object `player`.
|
||||
- `faction_id` (uint32) - Integer value `faction_id`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** SInt32 faction amount of the Player.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetFactionAmount(..., ...)
|
||||
-- From ItemScripts/ForgeryFreeportCitizenshipPapers.lua
|
||||
function Faction(Item,Player)
|
||||
Freeport = GetFactionAmount(Player, 11)
|
||||
Freeport_Add = (10000-Freeport)
|
||||
Freeport = GetFactionAmount(Player, 12)
|
||||
Freeport_Add = (-20000-Freeport)
|
||||
Neriak = GetFactionAmount(Player, 13)
|
||||
Kelethin = GetFactionAmount(Player, 14)
|
||||
Halas = GetFactionAmount(Player, 16)
|
||||
Gorowyn = GetFactionAmount(Player, 17)
|
||||
alignment = GetAlignment(Player)
|
||||
if Freeport <10000 and Freeport >=0 then ChangeFaction(Player, 11, Freeport_Add)
|
||||
elseif Freeport <0 then ChangeFaction(Player, 11, (Freeport*-1))
|
||||
Faction(Item,Player)
|
||||
end
|
||||
```
|
||||
|
@ -1,16 +1,25 @@
|
||||
### Function: GetFactionID(param1)
|
||||
### Function: GetFactionID(spawn)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Gets the faction_id of the current Spawn.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** UInt32 faction_id of the Spawn.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetFactionID(...)
|
||||
-- From SpawnScripts/Caves/GuardBelaire.lua
|
||||
function InRange(NPC, Spawn)
|
||||
if GetFactionAmount(Spawn,11)>=5000 then
|
||||
if GetLevel(Spawn) ==8 or GetLevel(Spawn)==9 then
|
||||
ClassCheck(NPC,Spawn)
|
||||
end
|
||||
end
|
||||
if GetFactionID(Spawn) ==1 then
|
||||
Attack(NPC,Spawn)
|
||||
end
|
||||
end
|
||||
```
|
||||
|
@ -1,17 +1,19 @@
|
||||
Function: GetFollowTarget(Spawn)
|
||||
### Function: GetFollowTarget(Spawn)
|
||||
|
||||
Description: Retrieves the current follow target of a given NPC or pet. If the spawn is following someone, this returns the entity being followed.
|
||||
**Description:**
|
||||
Retrieves the current follow target of a given NPC or pet. If the spawn is following someone, this returns the entity being followed.
|
||||
|
||||
Parameters:
|
||||
**Parameters:**
|
||||
- `spawn` (Spawn) – Spawn object representing NPC (or player’s pet) that might be following a target.
|
||||
|
||||
Spawn: Spawn – The NPC (or player’s pet) that might be following a target.
|
||||
**Returns:** Spawn – The entity that Spawn is currently following, or nil if it’s not following anyone.
|
||||
|
||||
Returns: Spawn – The entity that Spawn is currently following, or nil if it’s not following anyone.
|
||||
|
||||
Example:
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage (check who an escort NPC is following)
|
||||
local leader = GetFollowTarget(EscortNPC)
|
||||
if leader == Player then
|
||||
Say(EscortNPC, "I am right behind you!")
|
||||
end
|
||||
end
|
||||
```
|
||||
|
@ -1,16 +1,25 @@
|
||||
### Function: GetGender(param1)
|
||||
### Function: GetGender(spawn)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Gets the gender of the current spawn. 0 = Female, 1 = Male
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
**Returns:** None.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetGender(...)
|
||||
-- From Quests/BeggarsCourt/an_errand_for_the_queen.lua
|
||||
function Accepted(Quest, QuestGiver, Player)
|
||||
FaceTarget(QuestGiver, Player)
|
||||
Dialog.New(QuestGiver, Player)
|
||||
Dialog.AddDialog("Well, you're late, good man. I've been puffing up my cheeks and snorting loudly, hoping you'd find me. My entourage deserted me, and now you must execute them. Go find these ogres and kill them; they hide in the Sprawl and call themselves Giantslayer Bashers. Now, go child. Queenly blessings to you!")
|
||||
Dialog.AddVoiceover("voiceover/english/tullia_domna/fprt_hood04/quests/tulladomna/tulla_x1_accept.mp3", 2208976682, 3386849948)
|
||||
PlayFlavor(QuestGiver, "", "", "scold", 0, 0, Player, 0)
|
||||
Dialog.AddOption("At once, my 'Queen'.")
|
||||
if GetGender(Player)== 2 then
|
||||
Dialog.AddOption("I'm not a man, but ...err, Yes, my 'Queen'.")
|
||||
end
|
||||
```
|
||||
|
@ -1,19 +1,23 @@
|
||||
Function: GetGroup(Spawn)
|
||||
### Function: GetGroup(Spawn)
|
||||
|
||||
Description: Returns the group object that the given spawn (player or NPC) belongs to. This can be used to iterate over group members or to perform group-wide actions.
|
||||
**Description:**
|
||||
Returns an array of Spawns that the given spawn (player or NPC) belongs to. This can be used to iterate over group members or to perform group-wide actions.
|
||||
|
||||
Parameters:
|
||||
**Parameters:**
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
Spawn: Spawn – The entity whose group is requested (typically a Player).
|
||||
**Returns:** An array of Spawn objects that represents the spawn’s group. If the spawn is not in a group, this may return nil.
|
||||
|
||||
Returns: Group – A group object or identifier that represents the spawn’s group. If the spawn is not in a group, this may return nil or an empty group reference.
|
||||
**Example:**
|
||||
|
||||
Example:
|
||||
|
||||
-- Example usage (send a message to all members of a player's group)
|
||||
local group = GetGroup(Player)
|
||||
if group ~= nil then
|
||||
for _, member in ipairs(GetGroupMembers(group)) do
|
||||
SendMessage(member, "A teammate has activated the device!")
|
||||
end
|
||||
end
|
||||
```lua
|
||||
-- From SpawnScripts/Generic/AlexaLockets.lua -- v is the Spawn object reference, k is the position in the array.
|
||||
function hailed(NPC, Spawn)
|
||||
if GetTempVariable(NPC, "talking") ~= "true" then
|
||||
StartDialogLoop(NPC, Spawn)
|
||||
local player_group = GetGroup(Spawn)
|
||||
if player_group ~= nil then
|
||||
for k,v in ipairs(player_group) do
|
||||
SetPlayerHistory(v, HISTORY.NEK_CASTLE_LIBRARY_ACCESS, 1)
|
||||
end
|
||||
```
|
||||
|
@ -1,16 +1,18 @@
|
||||
Function: GetHateList(NPC)
|
||||
### Function: GetHateList(spawn)
|
||||
|
||||
Description: Returns a list of all spawns currently on the specified NPC’s hate (aggro) list. This includes anyone who has attacked or otherwise generated hate on the NPC.
|
||||
**Description:**
|
||||
Returns a list of all spawns currently on the specified NPC’s hate (aggro) list. This includes anyone who has attacked or otherwise generated hate on the NPC.
|
||||
|
||||
Parameters:
|
||||
**Parameters:**
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
NPC: Spawn – The NPC whose hate list to retrieve.
|
||||
**Returns:** Table – A list/array of spawns that the NPC currently hates.
|
||||
|
||||
Returns: Table – A list/array of spawns that the NPC currently hates, typically sorted by hate amount (highest first).
|
||||
|
||||
Example:
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage (apply an effect to all players an epic boss has aggro on)
|
||||
for _, enemy in ipairs(GetHateList(EpicBoss)) do
|
||||
CastSpell(EpicBoss, AOE_DEBUFF_ID, 1, enemy)
|
||||
end
|
||||
CastSpell(enemy, AOE_DEBUFF_ID, 1, EpicBoss) -- this assumes the AOE_DEBUFF_ID has no cast time so the mob can instantly cast
|
||||
end
|
||||
```
|
||||
|
@ -1,16 +1,23 @@
|
||||
### Function: GetHeading(param1)
|
||||
### Function: GetHeading(spawn)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Get the heading of the specified Spawn.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
**Returns:** None.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetHeading(...)
|
||||
-- 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
|
||||
```
|
||||
|
@ -1,16 +1,22 @@
|
||||
### Function: GetID(param1)
|
||||
### Function: GetID(spawn)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Gets the current ID of the Spawn for the Zone.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** UInt32 ID of the Spawn for it's current instance in the zone.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetID(...)
|
||||
-- From Spells/Commoner/DetectGood.lua
|
||||
function cast(Caster, Target)
|
||||
local targets = GetGroup(Caster)
|
||||
if targets ~= nil then
|
||||
for k,v in ipairs(targets) do
|
||||
if GetAlignment(Target) == 1 and GetID(Target) == GetID(v) then
|
||||
ApplySpellVisual(v,136)
|
||||
end
|
||||
```
|
||||
|
@ -1,16 +1,30 @@
|
||||
Function: GetInfoStructFloat(Spawn, FieldName)
|
||||
### Function: GetInfoStructFloat(spawn, field)
|
||||
|
||||
Description: Retrieves a floating-point field from a spawn’s info data. Could be used for precise position, speed multipliers, etc. if stored there.
|
||||
**Description:**
|
||||
Retrieves a floating-point field from a spawn’s info data. Could be used for precise position, speed multipliers, etc. if stored there. See https://github.com/emagi/eq2emu/blob/main/docs/data_types/info_struct.md for a full list of options.
|
||||
|
||||
Parameters:
|
||||
**Parameters:**
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
- `field` (string) - String `field`.
|
||||
|
||||
Spawn: Spawn – The entity whose info to check.
|
||||
**Returns:** Float – The value of that field.
|
||||
|
||||
FieldName: String – The name of the float field.
|
||||
**Example:**
|
||||
|
||||
Returns: Float – The value of the field.
|
||||
|
||||
Example:
|
||||
|
||||
-- Example usage (get an entity's size scale factor)
|
||||
local scale = GetInfoStructFloat(NPC, "size")
|
||||
```lua
|
||||
-- From SpawnScripts/Generic/SpiritShard.lua
|
||||
function recovershard(NPC, Spawn)
|
||||
local charid = GetShardCharID(NPC)
|
||||
FindSpellVisualByID
|
||||
if GetCharacterID(Spawn) == charid then
|
||||
local DebtToRemovePct = GetRuleFlagFloat("R_Combat", "ShardDebtRecoveryPercent")
|
||||
local DeathXPDebt = GetRuleFlagFloat("R_Combat", "DeathExperienceDebt")
|
||||
|
||||
local debt = GetInfoStructFloat(Spawn, "xp_debt")
|
||||
local DebtToRemove = (DebtToRemovePct/100.0)*(DeathXPDebt/100.0);
|
||||
if debt > DebtToRemove then
|
||||
SetInfoStructFloat(Spawn, "xp_debt", debt - DebtToRemove)
|
||||
else
|
||||
SetInfoStructFloat(Spawn, "xp_debt", 0.0)
|
||||
end
|
||||
```
|
||||
|
@ -1,16 +1,21 @@
|
||||
Function: GetInfoStructSInt(Spawn, FieldName)
|
||||
### Function: GetInfoStructSInt(spawn, field)
|
||||
|
||||
Description: Gets a signed integer field from the spawn’s info struct. Similar to GetInfoStructUInt but for fields that can be negative.
|
||||
**Description:**
|
||||
Gets a signed integer field from the spawn’s info struct. Similar to GetInfoStructUInt but for fields that can be negative. See https://github.com/emagi/eq2emu/blob/main/docs/data_types/info_struct.md for a full list of options.
|
||||
|
||||
Parameters:
|
||||
**Parameters:**
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
- `field` (string) - String `field`.
|
||||
|
||||
Spawn: Spawn – The entity to query.
|
||||
**Returns:** SInt32 – The value of that field.
|
||||
|
||||
FieldName: String – The field name to retrieve.
|
||||
**Example:**
|
||||
|
||||
Returns: Int32 – The value of that field.
|
||||
|
||||
Example:
|
||||
|
||||
-- Example usage (get an NPC's faction alignment which could be negative or positive)
|
||||
local faction = GetInfoStructSInt(NPC, "faction_id")
|
||||
```lua
|
||||
-- From Spells/BattleRest.lua
|
||||
function cast(Caster, Target)
|
||||
CurrentRegen = GetInfoStructSInt(Caster, "hp_regen")
|
||||
AddSpellBonus(Caster, 600, math.ceil(CurrentRegen * 0.05))
|
||||
AddSpellBonus(Caster, 0, 2)
|
||||
end
|
||||
```
|
||||
|
@ -1,16 +1,17 @@
|
||||
Function: GetInfoStructString(Spawn, FieldName)
|
||||
### Function: GetInfoStructString(spawn, field)
|
||||
|
||||
Description: Retrieves a string field from the spawn’s info data structure. The info struct contains various attributes of a spawn (like name, last name, guild, etc.). FieldName is the identifier of the string field.
|
||||
**Description:**
|
||||
Retrieves a string field from the spawn’s info data structure. The info struct contains various attributes of a spawn (like name, last name, guild, etc.). FieldName is the identifier of the string field. See https://github.com/emagi/eq2emu/blob/main/docs/data_types/info_struct.md for a full list of options.
|
||||
|
||||
Parameters:
|
||||
**Parameters:**
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
- `field` (string) - String `field`.
|
||||
|
||||
Spawn: Spawn – The entity to query.
|
||||
**Returns:** String – The value of that field, or an empty string if not set.
|
||||
|
||||
FieldName: String – The field to retrieve (e.g., "last_name", "guild_name").
|
||||
|
||||
Returns: String – The value of that field, or an empty string if not set.
|
||||
|
||||
Example:
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage (get a player's surname)
|
||||
local surname = GetInfoStructString(Player, "last_name")
|
||||
local surname = GetInfoStructString(Player, "last_name")
|
||||
```
|
||||
|
@ -1,18 +1,22 @@
|
||||
Function: GetInfoStructUInt(Spawn, FieldName)
|
||||
### Function: GetInfoStructUInt(spawn, field)
|
||||
|
||||
Description: Retrieves an unsigned integer field from a spawn’s info struct. This can include things like level, model type, gender, etc.
|
||||
**Description:**
|
||||
Retrieves an unsigned integer field from a spawn’s info struct. This can include things like level, model type, gender, etc. See https://github.com/emagi/eq2emu/blob/main/docs/data_types/info_struct.md for a full list of options.
|
||||
|
||||
Parameters:
|
||||
**Parameters:**
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
- `field` (string) - String `field`.
|
||||
|
||||
Spawn: Spawn – The entity in question.
|
||||
**Returns:** Int32 – The value of the field.
|
||||
|
||||
FieldName: String – The name of the UInt field to get (e.g., "age", "race_id").
|
||||
**Example:**
|
||||
|
||||
Returns: Int32 – The value of the field.
|
||||
|
||||
Example:
|
||||
|
||||
-- Example usage (check an NPC's model type for conditional behavior)
|
||||
if GetInfoStructUInt(NPC, "model_type") == 3 then
|
||||
-- model_type 3 (maybe indicating a mounted model)
|
||||
end
|
||||
```lua
|
||||
-- From Spells/Fighter/Crusader/PowerCleave.lua
|
||||
function precast(Caster, Target)
|
||||
local wield_type = GetInfoStructUInt(Caster, "wield_type")
|
||||
if wield_type ~= 4 then
|
||||
SendMessage(Caster, "Must have a two-handed weapon equipped", "yellow")
|
||||
return false, 70
|
||||
end
|
||||
```
|
||||
|
@ -1,16 +1,28 @@
|
||||
### Function: GetInt(param1)
|
||||
### Function: GetInt(spawn)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Gets the intelligence of the current Spawn.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** Gets the UInt32 value of the Spawn's current intelligence.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetInt(...)
|
||||
-- From Spells/Commoner/BlightoftheMorning.lua
|
||||
function proc(Caster, Target, Type, DmgType, MinVal, MaxVal)
|
||||
Spell = GetSpell(2550441)
|
||||
DmgBonus = math.floor(GetInt(Caster)/10)
|
||||
MinDmg = MinVal + DmgBonus
|
||||
MaxDmg = MaxVal + DmgBonus
|
||||
|
||||
if Type == 3 then
|
||||
SetSpellDataIndex(Spell, 0, DmgType)
|
||||
SetSpellDataIndex(Spell, 1, MinDmg)
|
||||
SetSpellDataIndex(Spell, 2, MaxDmg)
|
||||
CastCustomSpell(Spell, Caster, Target)
|
||||
RemoveTriggerFromSpell(1)
|
||||
end
|
||||
```
|
||||
|
@ -1,16 +1,13 @@
|
||||
### Function: GetIntBase(param1)
|
||||
### Function: GetIntBase(spawn)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Gets the base intelligence of the current Spawn.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** UInt32 of the Spawn's base intelligence.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetIntBase(...)
|
||||
```
|
||||
Example Required
|
||||
|
@ -1,17 +1,19 @@
|
||||
### Function: GetItemCount(param1, param2)
|
||||
### Function: GetItemCount(item)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Get's the item count of the specified Item object.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Item - An item reference.
|
||||
- `param2`: unknown - Unknown type.
|
||||
- `item` (Item) - Item object representing `item`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** UInt32 value of the quantity/count available in the current item stack.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetItemCount(..., ...)
|
||||
-- From ItemScripts/anaxeedge.lua
|
||||
function obtained(Item, Player)
|
||||
if HasQuest(Player, Gnasher) or HasCompletedQuest(Player, Gnasher) or GetItemCount(3560) > 1 then
|
||||
RemoveItem(Player, 3560)
|
||||
end
|
||||
```
|
||||
|
@ -1,17 +1,28 @@
|
||||
### Function: GetItemEffectType(param1, param2)
|
||||
### Function: GetItemEffectType(item)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Get the effect type of the item.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Item - An item reference.
|
||||
- `param2`: unknown - Unknown type.
|
||||
- `item` (Item) - Item object representing `item`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** UInt32 value of the item effect type.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetItemEffectType(..., ...)
|
||||
-- From ItemScripts/cure_test.lua
|
||||
function used(Item, Player, Target)
|
||||
local effect_type = GetItemEffectType(Item)
|
||||
|
||||
if effect_type < 7 then -- 7 is cure all
|
||||
CureByType(1, effect_type, "", (GetLevel(Player) * 1.08) + 1, Target, Player)
|
||||
elseif effect_type == 7 then
|
||||
CureByType(1, 1, "", (GetLevel(Player) * 1.08) + 1, Target, Player)
|
||||
CureByType(1, 2, "", (GetLevel(Player) * 1.08) + 1, Target, Player)
|
||||
CureByType(1, 3, "", (GetLevel(Player) * 1.08) + 1, Target, Player)
|
||||
CureByType(1, 4, "", (GetLevel(Player) * 1.08) + 1, Target, Player)
|
||||
CureByType(1, 5, "", (GetLevel(Player) * 1.08) + 1, Target, Player)
|
||||
CureByType(1, 6, "", (GetLevel(Player) * 1.08) + 1, Target, Player)
|
||||
end
|
||||
```
|
||||
|
@ -1,17 +1,19 @@
|
||||
### Function: GetItemID(param1, param2)
|
||||
### Function: GetItemID(item)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Get Item ID of the specified Item object.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Item - An item reference.
|
||||
- `param2`: unknown - Unknown type.
|
||||
- `item` (Item) - Item object representing `item`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** UInt32 value of the item id.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetItemID(..., ...)
|
||||
-- From ItemScripts/Darkheart.lua
|
||||
function used(Item, Player)
|
||||
local item_id = GetItemID(Item)
|
||||
CastSpell(Player, SPELLID, SPELL_TIERS[item_id])
|
||||
end
|
||||
```
|
||||
|
@ -1,18 +1,14 @@
|
||||
### Function: GetItemSkillReq(param1, param2, param3)
|
||||
### Function: GetItemSkillReq(item, type)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Get the skill id requirement for the item. Type 1 is skill_req1, Type 2 is skill_req2.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Item - An item reference.
|
||||
- `param2`: unknown - Unknown type.
|
||||
- `param3`: int32 - Integer value.
|
||||
- `item` (Item) - Item object representing `item`.
|
||||
- `type` (uint32) - Integer value `type`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** UInt32 Skill ID required to use the item.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetItemSkillReq(..., ..., ...)
|
||||
```
|
||||
Example Required
|
||||
|
@ -1,17 +1,21 @@
|
||||
### Function: GetItemType(param1, param2)
|
||||
### Function: GetItemType(item)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Gets the defined type of the item described in the database. See https://github.com/emagi/eq2emu/blob/main/docs/data_types/item_types.md for item types.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Item - An item reference.
|
||||
- `param2`: unknown - Unknown type.
|
||||
- `item` (Item) - Item object representing `item`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** UInt32 value of the item type.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetItemType(..., ...)
|
||||
-- From Spells/Fighter/Crusader/UnyieldingAdvance.lua
|
||||
function precast(Caster, Target)
|
||||
local item = GetEquippedItemBySlot(Caster, 1)
|
||||
if not item or GetItemType(item) ~= 4 then
|
||||
SendMessage(Caster, "Must have shield equipped", "yellow")
|
||||
return false, 70
|
||||
end
|
||||
```
|
||||
|
@ -1,16 +1,15 @@
|
||||
### Function: GetLevel(param1)
|
||||
### Function: GetLevel(spawn)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Gets the current level of the spawn (not effective level).
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** UInt32 value of the Spawn's level.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetLevel(...)
|
||||
local level = GetLevel(Player)
|
||||
```
|
||||
|
@ -1,16 +1,37 @@
|
||||
### Function: GetLootCoin(param1)
|
||||
### Function: GetLootCoin(spawn)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Get the loot coin in copper assigned to the spawn.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** UInt32 in copper of the spawn's lootable coin.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetLootCoin(...)
|
||||
-- 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
|
||||
```
|
||||
|
@ -1,16 +1,13 @@
|
||||
### Function: GetLootDropType(param1)
|
||||
### Function: GetLootDropType(spawn)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Get the loot drop type of the spawn. Return is: 0 - default drop all chest type as a group, 1 - this is a primary mob it drops its own loot
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** UInt32 value of the loot drop type
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetLootDropType(...)
|
||||
```
|
||||
Example Required
|
||||
|
@ -1,16 +1,13 @@
|
||||
### Function: GetLootTier(param1)
|
||||
### Function: GetLootTier(spawn)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Gets the loot tier of the spawn.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** UInt32 value of the loot tier.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetLootTier(...)
|
||||
```
|
||||
Example Required
|
||||
|
@ -1,16 +1,24 @@
|
||||
### Function: GetMaxHP(param1)
|
||||
### Function: GetMaxHP(spawn)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Gets the maximum (total) hp of the spawn.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** SInt32 of the max hp for the spawn.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetMaxHP(...)
|
||||
-- From ItemScripts/cadavers_dram.lua
|
||||
function used(Item, Player)
|
||||
if GetQuestStep(Player, BecomingOrcbane) == 1 then
|
||||
local target = GetTarget(Player)
|
||||
if GetSpawnID(target) == 4700105 then
|
||||
if GetHP(target) < GetMaxHP(target) * .20 then
|
||||
CastEntityCommand(Player, target, 1299, "cadaver's dram")
|
||||
else
|
||||
SendMessage(Player, "You must use this on a Ry'Gorr tunneler that is under 20 percent life.", "yellow")
|
||||
end
|
||||
```
|
||||
|
@ -1,16 +1,13 @@
|
||||
### Function: GetMaxHPBase(param1)
|
||||
### Function: GetMaxHPBase(spawn)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Gets the Spawn's base hp.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** SInt32 base hp value.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetMaxHPBase(...)
|
||||
```
|
||||
Example Required
|
||||
|
@ -1,16 +1,20 @@
|
||||
### Function: GetMaxPower(param1)
|
||||
### Function: GetMaxPower(spawn)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Gets the Spawn's maximum (total) power.
|
||||
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** SInt32 maximum (total) power of the spawn.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetMaxPower(...)
|
||||
-- From Spells/Centered.lua
|
||||
function cast(Caster, Target)
|
||||
MaxPower = GetMaxPower(Caster)
|
||||
AddSpellBonus(Caster, 501, math.floor(MaxPower * 0.025))
|
||||
end
|
||||
```
|
||||
|
@ -1,16 +1,20 @@
|
||||
### Function: GetMaxPowerBase(param1)
|
||||
### Function: GetMaxPowerBase(spawn)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Gets the Spawn's base power.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** SInt32 base power of the spawn.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetMaxPowerBase(...)
|
||||
-- From Spells/Commoner/DualBreed.lua
|
||||
function cast(Caster, Target)
|
||||
PowerBonus = math.ceil(GetMaxPowerBase(Caster) * 0.03)
|
||||
AddSpellBonus(Caster, 1, 2)
|
||||
AddSpellBonus(Caster, 501, PowerBonus)
|
||||
end
|
||||
```
|
||||
|
@ -1,16 +1,22 @@
|
||||
### Function: GetModelType(param1)
|
||||
### Function: GetModelType(spawn)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Get the model type of the current spawn, see https://wiki.eq2emu.com/ReferenceLists Game Models / Model IDs by client version for the ID list.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
**Returns:** None.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetModelType(...)
|
||||
-- From ItemScripts/SilverTweezers.lua
|
||||
function used(Item, Player)
|
||||
local target = GetTarget(Player)
|
||||
if target ~= nil then
|
||||
local model = GetModelType(target)
|
||||
if model == 81 or model == 82 or model == 91 or model == 93 or model == 94 or model == 95 or model == 96 or model == 97 or model == 98 or model == 99 or model == 100 or model == 101 or model == 102 then
|
||||
CastSpell(target, 2550000, 1, Player)
|
||||
end
|
||||
```
|
||||
|
@ -1,17 +1,24 @@
|
||||
Function: GetMostHated(NPC)
|
||||
### Function: GetMostHated(NPC)
|
||||
|
||||
Description: Retrieves the spawn that currently has the highest hate (aggro) on the specified NPC’s hate list. This is usually the NPC’s current primary target in combat.
|
||||
**Description:**
|
||||
Retrieves the spawn that currently has the highest hate (aggro) on the specified NPC’s hate list. This is usually the NPC’s current primary target in combat.
|
||||
|
||||
Parameters:
|
||||
**Parameters:**
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
NPC: Spawn – The NPC whose hate list to examine.
|
||||
**Example:**
|
||||
|
||||
Returns: Spawn – The entity with top hate on the NPC (often the tank or highest damage dealer), or nil if the NPC has no hate list.
|
||||
|
||||
Example:
|
||||
|
||||
-- Example usage (make the boss shout at whoever has top aggro)
|
||||
local topAggro = GetMostHated(BossNPC)
|
||||
if topAggro ~= nil then
|
||||
Say(BossNPC, "I will destroy you, " .. GetName(topAggro) .. "!")
|
||||
end
|
||||
```lua
|
||||
-- From SpawnScripts/A Meeting of the Minds/Borxx.lua
|
||||
function borxxConvo5(NPC, Spawn)
|
||||
local overlord = GetSpawn(NPC, 5560003)
|
||||
local hated = GetMostHated(overlord)
|
||||
local braxx = GetSpawn(NPC, 5560004)
|
||||
local brixx = GetSpawn(NPC, 5560005)
|
||||
FaceTarget(NPC, overlord)
|
||||
Say(NPC, "So be it.")
|
||||
Attack(NPC, hated)
|
||||
Attack(braxx, hated)
|
||||
Attack(brixx, hated)
|
||||
end
|
||||
```
|
||||
|
@ -1,16 +1,19 @@
|
||||
### Function: GetMount(param1)
|
||||
### Function: GetMount(spawn)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Gets the spawn object that represents the mount for the Spawn provided.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** Mount Spawn object of the Spawn specified.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetMount(...)
|
||||
-- From Spells/Commoner/AbyssalCarpet.lua
|
||||
function precast(Caster)
|
||||
if GetMount(Caster) > 0 then
|
||||
return false
|
||||
end
|
||||
```
|
||||
|
@ -1,16 +1,21 @@
|
||||
### Function: GetName(param1)
|
||||
### Function: GetName(spawn)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Gets the string name of the Spawn.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** string name of the specified Spawn.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetName(...)
|
||||
-- From ItemScripts/awellspringcubleash.lua
|
||||
function used(Item, Player)
|
||||
target = GetTarget(Player)
|
||||
if GetName(target) == 'a wellspring cub' and GetTempVariable(Player, "cub") == nil then
|
||||
if not IsInCombat(target) then
|
||||
CastEntityCommand(Player, target, 1278, "Leash")
|
||||
end
|
||||
```
|
||||
|
@ -1,14 +1,24 @@
|
||||
Function: GetOrigX(Spawn)
|
||||
### Function: GetOrigX(Spawn)
|
||||
|
||||
Description: Returns the original X coordinate of the specified spawn’s spawn point (where it was initially placed in the zone).
|
||||
**Description:**
|
||||
Returns the original X coordinate of the specified spawn’s spawn point (where it was initially placed in the zone).
|
||||
|
||||
Parameters:
|
||||
**Parameters:**
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
Spawn: Spawn – The entity to query.
|
||||
**Returns:** Float – The X position of the spawn’s original location.
|
||||
|
||||
Returns: Float – The X position of the spawn’s original location.
|
||||
**Example:**
|
||||
|
||||
Example:
|
||||
```lua
|
||||
-- From SpawnScripts/OutpostOverlord/acliffdiverhawk.lua
|
||||
function ReturnHome(NPC)
|
||||
|
||||
-- Example usage (see how far an NPC has moved from its spawn point on X axis)
|
||||
local deltaX = math.abs(GetX(NPC) - GetOrigX(NPC))
|
||||
local x = GetOrigX(NPC)
|
||||
local y = GetORigY(NPC)
|
||||
local z = GetOrigZ(NPC)
|
||||
|
||||
if IsInCombat(NPC) == false then
|
||||
MoveToLocation(NPC, x, y, z, 5)
|
||||
end
|
||||
```
|
||||
|
@ -1,14 +1,24 @@
|
||||
Function: GetOrigY(Spawn)
|
||||
### Function: GetOrigY(Spawn)
|
||||
|
||||
Description: Returns the original Y coordinate (vertical position) of the spawn’s starting point in the zone.
|
||||
**Description:**
|
||||
Returns the original Y coordinate (vertical position) of the spawn’s starting point in the zone.
|
||||
|
||||
Parameters:
|
||||
**Parameters:**
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
Spawn: Spawn – The entity in question.
|
||||
**Returns:** Float – The Y position of the spawn’s original location.
|
||||
|
||||
Returns: Float – The Y coordinate of its original spawn location.
|
||||
**Example:**
|
||||
|
||||
Example:
|
||||
```lua
|
||||
-- From SpawnScripts/OutpostOverlord/acliffdiverhawk.lua
|
||||
function ReturnHome(NPC)
|
||||
|
||||
-- Example usage (for debugging an NPC's elevation change)
|
||||
print("NPC original Y: " .. GetOrigY(NPC) .. ", current Y: " .. GetY(NPC))
|
||||
local x = GetOrigX(NPC)
|
||||
local y = GetORigY(NPC)
|
||||
local z = GetOrigZ(NPC)
|
||||
|
||||
if IsInCombat(NPC) == false then
|
||||
MoveToLocation(NPC, x, y, z, 5)
|
||||
end
|
||||
```
|
||||
|
@ -1,14 +1,24 @@
|
||||
Function: GetOrigZ(Spawn)
|
||||
### Function: GetOrigZ(Spawn)
|
||||
|
||||
Description: Returns the original Z coordinate of where the spawn was initially placed.
|
||||
**Description:**
|
||||
Returns the original Z coordinate of where the spawn was initially placed.
|
||||
|
||||
Parameters:
|
||||
**Parameters:**
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
Spawn: Spawn – The entity to check.
|
||||
**Returns:** Float – The Z position of the spawn’s original location.
|
||||
|
||||
Returns: Float – The Z position of the spawn’s original location.
|
||||
**Example:**
|
||||
|
||||
Example:
|
||||
```lua
|
||||
-- From SpawnScripts/OutpostOverlord/acliffdiverhawk.lua
|
||||
function ReturnHome(NPC)
|
||||
|
||||
-- Example usage (calculate how far NPC roamed from spawn point horizontally)
|
||||
local distanceFromSpawn = math.sqrt((GetX(NPC)-GetOrigX(NPC))^2 + (GetZ(NPC)-GetOrigZ(NPC))^2)
|
||||
local x = GetOrigX(NPC)
|
||||
local y = GetORigY(NPC)
|
||||
local z = GetOrigZ(NPC)
|
||||
|
||||
if IsInCombat(NPC) == false then
|
||||
MoveToLocation(NPC, x, y, z, 5)
|
||||
end
|
||||
```
|
||||
|
@ -1,18 +1,13 @@
|
||||
### Function: GetOwner(param1, param2, param3)
|
||||
### Function: GetOwner(spawn)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Gets the Owner Spawn object in reference to the spawn provided (Pet/Charmed).
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `param2`: unknown - Unknown type.
|
||||
- `param3`: unknown - Unknown type.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** Return's the owner spawn object.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetOwner(..., ..., ...)
|
||||
```
|
||||
Example Required
|
||||
|
@ -1,19 +1,24 @@
|
||||
### Function: GetPCTOfHP(param1, param2, param3, param4)
|
||||
### Function: GetPCTOfHP(spawn, pct)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Get the Spawn's amount of hp in UInt32 value using a float percentage.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `param2`: unknown - Unknown type.
|
||||
- `param3`: unknown - Unknown type.
|
||||
- `param4`: float - Floating point value.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
- `pct` (float) - Floating point value `pct`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** UInt32 representation of the hp against the percentage provided for the Spawn.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetPCTOfHP(..., ..., ..., ...)
|
||||
-- From Spells/Fighter/Brawler/Monk/Mendpct.lua
|
||||
function cast(Caster, Target, CureLvls, MinVal, MaxVal)
|
||||
-- Dispels 7 levels of noxious hostile effects on target
|
||||
CureByType(CureLvls, 3);
|
||||
--Heals target for 8.1 - 9.9% of max health
|
||||
SpellHeal("Heal", GetPCTOfHP(Caster, MinVal), GetPCTOfHP(Caster, MaxVal),0 , 2, 1)
|
||||
|
||||
|
||||
end
|
||||
```
|
||||
|
@ -1,19 +1,19 @@
|
||||
### Function: GetPCTOfPower(param1, param2, param3, param4)
|
||||
### Function: GetPCTOfPower(spawn, pct)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Get the Spawn's amount of power in UInt32 value using a float percentage.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `param2`: unknown - Unknown type.
|
||||
- `param3`: unknown - Unknown type.
|
||||
- `param4`: float - Floating point value.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
- `pct` (float) - float value `pct`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** UInt32 representation of the power against the percentage provided for the Spawn.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetPCTOfPower(..., ..., ..., ...)
|
||||
-- From Spells/Commoner/BlessingofFaith.lua
|
||||
function cast(Caster, Target, pctHeal)
|
||||
SpellHeal("Power", GetPCTOfPower(Caster, pctHeal))
|
||||
end
|
||||
```
|
||||
|
@ -1,16 +1,13 @@
|
||||
### Function: GetPassengerSpawnList(param1)
|
||||
### Function: GetPassengerSpawnList(spawn)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Gets a list of passengers on a boat / widget / object.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** Table of Spawn object references on the object.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetPassengerSpawnList(...)
|
||||
```
|
||||
Example Required
|
||||
|
@ -1,17 +1,23 @@
|
||||
Function: GetPet(Spawn)
|
||||
### Function: GetPet(Spawn)
|
||||
|
||||
Description: Retrieves the pet entity of the given spawn, if one exists. For players, this returns their current summoned combat pet (summoner or necromancer pet, etc.), or for NPCs, a charmed pet or warder.
|
||||
**Description:**
|
||||
Retrieves the pet entity of the given spawn, if one exists. For players, this returns their current summoned combat pet (summoner or necromancer pet, etc.), or for NPCs, a charmed pet or warder.
|
||||
|
||||
Parameters:
|
||||
**Parameters:**
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
Spawn: Spawn – The owner whose pet we want to get.
|
||||
**Return:** Spawn object of the pet that the owner spawn currently has.
|
||||
|
||||
Returns: Spawn – The pet entity of the owner, or nil if no pet is present.
|
||||
**Example:**
|
||||
|
||||
Example:
|
||||
|
||||
-- Example usage (command a player's pet to attack if it exists)
|
||||
local pet = GetPet(Player)
|
||||
if pet ~= nil then
|
||||
Attack(pet, TargetNPC)
|
||||
end
|
||||
```lua
|
||||
-- From Spells/CamtursEnergizingAura.lua
|
||||
function cast(Caster, Target)
|
||||
level = GetLevel(Caster)
|
||||
Pet = GetPet(Caster)
|
||||
AddSpellBonus(Caster, 500, math.ceil(level * 2.75))
|
||||
AddSpellBonus(Caster, 501, math.ceil(level * 2.75))
|
||||
AddSpellBonus(Caster, 200, level * 5 + 99)
|
||||
CastSpell(Pet, 2550518)
|
||||
end
|
||||
```
|
||||
|
@ -1,20 +1,23 @@
|
||||
Function: GetPlayerHistory(Player, HistoryID)
|
||||
### Function: GetPlayerHistory(Player, HistoryID)
|
||||
|
||||
Description: Retrieves the value of a specific player history flag. This tells if a player has a certain historical event or choice recorded (and what value it is).
|
||||
**Description:**
|
||||
Retrieves the value of a specific player history flag. This tells if a player has a certain historical event or choice recorded (and what value it is).
|
||||
|
||||
Parameters:
|
||||
**Parameters:**
|
||||
- `player` (Spawn) - Spawn object representing `player`.
|
||||
- `event_id` (uint32) - Integer value `event_id`.
|
||||
|
||||
Player: Spawn – The player to check.
|
||||
**Returns:** Value of the historical value of SetPlayerHistory.
|
||||
|
||||
HistoryID: Int32 – The history flag ID to retrieve.
|
||||
**Example:**
|
||||
|
||||
Returns: Int32 – The value of that history entry for the player (commonly 0 or 1, but could be other integers if used as counters).
|
||||
|
||||
Example:
|
||||
|
||||
-- Example usage (branch dialog if player has a specific history flag)
|
||||
if GetPlayerHistory(Player, ALLIED_WITH_GNOLLS_HISTORY_ID) == 1 then
|
||||
Say(NPC, "Welcome, friend of the Gnolls!")
|
||||
else
|
||||
Say(NPC, "Stranger, tread carefully...")
|
||||
end
|
||||
```lua
|
||||
-- From SpawnScripts/Antonica/CaptainBeltho.lua
|
||||
function hailed(NPC, Spawn)
|
||||
SetPlayerHistory(Spawn, 8, 0)
|
||||
if GetPlayerHistory(Spawn, 8) == nil then
|
||||
Say(Spawn, "ur player history is nil")
|
||||
elseif GetPlayerHistory(Spawn, 8) then
|
||||
Say(Spawn, "ur player history is not nil")
|
||||
end
|
||||
```
|
||||
|
@ -1,16 +1,20 @@
|
||||
Function: GetPlayersInZone(Zone)
|
||||
### Function: GetPlayersInZone(Zone)
|
||||
|
||||
Description: Retrieves a list of all player spawns currently present in the specified zone.
|
||||
**Description:** Retrieves a list of all player spawns currently present in the specified zone.
|
||||
|
||||
Parameters:
|
||||
**Parameters:**
|
||||
- `zone` (Zone) - Zone object representing `zone`.
|
||||
|
||||
Zone: Zone – The zone object or context to search in.
|
||||
**Returns:** Table - Spawns array list of players in current zone.
|
||||
|
||||
Returns: Table – A list (array) of player Spawn objects in that zone.
|
||||
**Example:**
|
||||
|
||||
Example:
|
||||
|
||||
-- Example usage (announce a message to all players in the zone)
|
||||
for _, player in ipairs(GetPlayersInZone(GetZone(NPC))) do
|
||||
SendMessage(player, "The dragon roars in the distance!", "red")
|
||||
end
|
||||
```lua
|
||||
-- From SpawnScripts/Classic_forest/TheBasaltWatcher.lua
|
||||
function wakeup(NPC)
|
||||
local players = GetPlayersInZone(GetZone(NPC)) --zone callout and activation
|
||||
for index, player in pairs(players) do
|
||||
SendPopUpMessage(player, "Grinding stone can be heard as something ancient stirs in the ruins.", 255, 255, 0)
|
||||
SendMessage(player, "Grinding stone can be heard as something ancient stirs in the ruins.","yellow")
|
||||
end
|
||||
```
|
||||
|
@ -1,17 +1,32 @@
|
||||
### Function: GetQuest(param1, param2)
|
||||
### Function: GetQuest(player, quest_id)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Gets the quest object reference for the player and quest_id specified if they have the quest.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `param2`: int32 - Integer value.
|
||||
- `player` (Spawn) - Spawn object representing `player`.
|
||||
- `quest_id` (uint32) - Integer value `quest_id`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** Quest object reference in relation to the Player.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetQuest(..., ...)
|
||||
-- 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
|
||||
```
|
||||
|
@ -1,19 +1,29 @@
|
||||
Function: GetQuestCompleteCount(Spawn, QuestID)
|
||||
### Function: GetQuestCompleteCount(Spawn, QuestID)
|
||||
|
||||
Description: Retrieves how many times the specified player (Spawn) has completed a particular quest (identified by QuestID). For non-repeatable quests this is usually 0 or 1; for repeatable quests it could be higher.
|
||||
**Description:**
|
||||
Retrieves how many times the specified player (Spawn) has completed a particular quest (identified by QuestID). For non-repeatable quests this is usually 0 or 1; for repeatable quests it could be higher.
|
||||
|
||||
Parameters:
|
||||
**Parameters:**
|
||||
- `player` (Spawn) - Spawn object representing `player`.
|
||||
- `quest_id` (uint32) - Integer value `quest_id`.
|
||||
|
||||
Spawn: Spawn – The player to check.
|
||||
**Returns:** UInt32 value of how many times the quest was completed.
|
||||
|
||||
QuestID: Int32 – The quest ID to count completions of.
|
||||
**Example:**
|
||||
|
||||
Returns: Int32 – The number of times the player has completed that quest.
|
||||
|
||||
Example:
|
||||
|
||||
-- Example usage (give a different dialogue if the player has done a quest multiple times)
|
||||
local timesDone = GetQuestCompleteCount(Player, 9001)
|
||||
if timesDone > 0 then
|
||||
Say(NPC, "Back again? You know the drill.")
|
||||
end
|
||||
```lua
|
||||
-- From Quests/TheSerpentSewer/fresh_samples.lua
|
||||
function Accepted(Quest, QuestGiver, Player)
|
||||
if GetQuestCompleteCount(Player, Quest) == 0 then
|
||||
FaceTarget(QuestGiver, Player)
|
||||
local conversation = CreateConversation()
|
||||
PlayFlavor(QuestGiver, "voiceover/english/marcus_puer/fprt_sewer02/marcuspuer006.mp3", "", "", 2102514737, 183908223, Player)
|
||||
AddConversationOption(conversation, "Alright then. ")
|
||||
StartConversation(conversation, QuestGiver, Player, "Well I need samples from the creatures down here, of course! You can handle this small request, right? Of course you can! Splendid! Now off with you, off with your adventuring.")
|
||||
elseif GetQuestCompleteCount(Player, QUest) > 0 then
|
||||
PlayFlavor(QuestGiver, "voiceover/english/marcus_puer/fprt_sewer02/marcuspuer007.mp3", "", "", 794343, 2060215246, Player)
|
||||
local conversation = CreateConversation()
|
||||
AddConversationOption(conversation, "I'm on it.")
|
||||
StartConversation(conversation, QuestGiver, Player, "I need more of the same, really, just bits and pieces, bits and pieces of the creatures down here. Now hop to it. Remember, they need to be fresh! The fresher, the more potent, that's what mom always said.")
|
||||
end
|
||||
```
|
||||
|
@ -1,15 +1,74 @@
|
||||
Function: GetQuestFlags(Quest)
|
||||
### Function: GetQuestFlags(Quest)
|
||||
|
||||
Description: Retrieves the bitwise flags set for a quest. These flags might denote various quest properties (such as hidden, completed, failed, etc.). This is more of an internal function for quest data management.
|
||||
**Description:**
|
||||
Retrieves the bitwise flags set for a quest. These flags might denote various quest properties (such as hidden, completed, failed, etc.). This is more of an internal function for quest data management.
|
||||
|
||||
Parameters:
|
||||
**Parameters:**
|
||||
- `quest` (Quest) - Quest object representing `quest`.
|
||||
|
||||
Quest: Quest – The quest object in question.
|
||||
**Returns:** UInt32 set of quest flags
|
||||
|
||||
Returns: Int32 – The flags value for the quest.
|
||||
**Example:**
|
||||
|
||||
Example:
|
||||
```lua
|
||||
-- From Quests/EnchantedLands/HelpingSarmaSingebellows.lua
|
||||
function Accepted(Quest, QuestGiver, Player)
|
||||
|
||||
if GetTempVariable(Player, "HelpingSarmaSingebellows") == "true" then
|
||||
PlayFlavor(NPC, "voiceover/english/sarma_singebellows/enchanted/sarma_singebellows002.mp3", "", "", 2943069626, 2445316031, Spawn)
|
||||
AddConversationOption(conversation, "I shall return when they are destroyed.")
|
||||
StartConversation(conversation, NPC, Spawn, "Excellent! You worked hard to kill all of those goblins, but we need to make sure they don't regain their foothold.")
|
||||
else
|
||||
PlayFlavor(NPC, "voiceover/english/sarma_singebellows/enchanted/sarma_singebellows002.mp3", "", "", 2943069626, 2445316031, Spawn)
|
||||
AddConversationOption(conversation, "As you wish.")
|
||||
StartConversation(conversation, NPC, Spawn, "Excellent! Goblins are tainting the water and withering the trees at a watermill by a nearby lake. I want you to destroy as many of them as you can!")
|
||||
end
|
||||
|
||||
SetTempVariable(Player, "HelpingSarmaSingebellows", nil)
|
||||
|
||||
if GetQuestFlags(Quest) == 0 then
|
||||
local quantity = math.random(8, 12)
|
||||
local flags = 0
|
||||
|
||||
if quantity == 8 then
|
||||
flags = flags + kill8
|
||||
elseif quantity == 9 then
|
||||
flags = flags + kill9
|
||||
elseif quantity == 10 then
|
||||
flags = flags + kill10
|
||||
elseif quantity == 11 then
|
||||
flags = flags + kill11
|
||||
elseif quantity == 12 then
|
||||
flags = flags + kill12
|
||||
end
|
||||
|
||||
SetQuestFlags(Quest, flags)
|
||||
SetStep(Quest, Player, quantity)
|
||||
|
||||
else -- need the else for /reload quest
|
||||
CheckBitMask(Quest, Player, GetQuestFlags(Quest))
|
||||
end
|
||||
end
|
||||
|
||||
-- Example usage (debugging quest state flags)
|
||||
local flags = GetQuestFlags(Quest)
|
||||
print("Quest flags: " .. flags)
|
||||
function hasflag(flags, flag)
|
||||
return flags % (2*flag) >= flag
|
||||
end
|
||||
|
||||
function CheckBitMask(Quest, Player, Flags)
|
||||
local quantity = 0
|
||||
|
||||
if hasflag(Flags, kill8) then
|
||||
quantity = 8
|
||||
elseif hasflag(Flags, kill9) then
|
||||
quantity = 9
|
||||
elseif hasflag(Flags, kill10) then
|
||||
quantity = 10
|
||||
elseif hasflag(Flags, kill11) then
|
||||
quantity = 11
|
||||
elseif hasflag(Flags, kill12) then
|
||||
quantity = 12
|
||||
end
|
||||
|
||||
SetStep(Quest, Player, quantity)
|
||||
end
|
||||
```
|
||||
|
@ -1,17 +1,20 @@
|
||||
### Function: GetQuestStep(param1, param2)
|
||||
### Function: GetQuestStep(player, quest_id)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Gets the current quest step of the quest 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.
|
||||
**Returns:** UInt32 current step the player is on with the quest.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetQuestStep(..., ...)
|
||||
-- From ItemScripts/ABloodsabermeddlernote.lua
|
||||
function decipher(Item, Player)
|
||||
if GetQuestStep(Player, AnIntriguingEye) == 2 then
|
||||
SetStepComplete(Player, AnIntriguingEye, 2)
|
||||
end
|
||||
```
|
||||
|
@ -1,20 +1,26 @@
|
||||
### Function: GetQuestStepProgress(param1, param2, param3, param4, param5)
|
||||
### Function: GetQuestStepProgress(player, quest_id, step_id)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Gets the current progress of the quest step for the player.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `param2`: unknown - Unknown type.
|
||||
- `param3`: unknown - Unknown type.
|
||||
- `param4`: int32 - Integer value.
|
||||
- `param5`: 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.
|
||||
**Returns:** UInt32 current progress of the step.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetQuestStepProgress(..., ..., ..., ..., ...)
|
||||
-- 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
|
||||
```
|
||||
|
@ -1,16 +1,44 @@
|
||||
### Function: GetRace(param1)
|
||||
### Function: GetRace(spawn)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Gets the race of the Spawn. See https://wiki.eq2emu.com/ReferenceLists/RaceList for a list.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** UInt32 race of the Spawn.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetRace(...)
|
||||
-- From ItemScripts/ForgeryFreeportCitizenshipPapers.lua
|
||||
function examined(Item, Player)
|
||||
local Race = GetRace(Player)
|
||||
conversation = CreateConversation()
|
||||
if not HasQuest(Player,BB)
|
||||
and not HasQuest(Player,BB_F)
|
||||
|
||||
and not HasQuest(Player,BC)
|
||||
and not HasQuest(Player,BC_F)
|
||||
|
||||
and not HasQuest(Player,SB)
|
||||
and not HasQuest(Player,SB_F)
|
||||
|
||||
and not HasQuest(Player,LA)
|
||||
and not HasQuest(Player,LA_F)
|
||||
|
||||
and not HasQuest(Player,SY)
|
||||
and not HasQuest(Player,SY_F)
|
||||
|
||||
and not HasQuest(Player,TS)
|
||||
and not HasQuest(Player,TS_F) then
|
||||
|
||||
if CanReceiveQuest(Player,BB) or
|
||||
CanReceiveQuest(Player,BC) or
|
||||
CanReceiveQuest(Player,SB) or
|
||||
CanReceiveQuest(Player,LA) or
|
||||
CanReceiveQuest(Player,SY) or
|
||||
CanReceiveQuest(Player,TS) then
|
||||
AddConversationOption(conversation, "[Glance over the forms]","Intro")
|
||||
end
|
||||
```
|
||||
|
@ -1,16 +1,36 @@
|
||||
Function: GetRaceBaseType(Spawn)
|
||||
### Function: GetRaceBaseType(Spawn)
|
||||
|
||||
Description: Returns the base race category of the spawn, which may be similar to GetRaceType but often refers to an even broader grouping (like “Player” vs “NPC” races or base model types).
|
||||
**Description:**
|
||||
Returns the base race category of the spawn, refer to the database race types tables.
|
||||
|
||||
Parameters:
|
||||
**Parameters:**
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
Spawn: Spawn – The entity to check.
|
||||
**Example:**
|
||||
|
||||
Returns: Int32 – An identifier for the base race category.
|
||||
```lua
|
||||
-- From Spells/Priest/Cleric/RadiantStrike.lua
|
||||
function cast(Caster, Target, DmgType, MinVal, MaxVal)
|
||||
|
||||
Level = GetLevel(Caster)
|
||||
SpellLevel = 11
|
||||
Mastery = SpellLevel + 10
|
||||
StatBonus = GetInt(Caster) / 10
|
||||
|
||||
if Level < Mastery then
|
||||
LvlBonus = Level - SpellLevel
|
||||
else LvlBonus = Mastery - SpellLevel
|
||||
end
|
||||
|
||||
Example:
|
||||
DmgBonus = LvlBonus + StatBonus
|
||||
MaxDmg = math.floor(DmgBonus) * 2 + MaxVal
|
||||
MinDmg = math.floor(DmgBonus) * 2 + MaxVal
|
||||
|
||||
SpellDamage(Target, DmgType, MinDmg, MaxDmg)
|
||||
|
||||
if GetRaceBaseType(Target) == 333 then
|
||||
SpellDamage(Target, Dmgtype, MinDmg, MaxDmg)
|
||||
end
|
||||
|
||||
-- Example usage (check if a target is a player character or an NPC by base type)
|
||||
if GetRaceBaseType(Target) == BASE_RACE_PLAYER then
|
||||
Say(NPC, "Greetings, adventurer.")
|
||||
end
|
||||
end
|
||||
```
|
||||
|
@ -1,16 +1,13 @@
|
||||
### Function: GetRaceName(param1)
|
||||
### Function: GetRaceName(spawn)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Gets the string name of the Spawn's race.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** String of the spawn's race.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetRaceName(...)
|
||||
```
|
||||
Example Required
|
||||
|
@ -1,16 +1,21 @@
|
||||
Function: GetRaceType(Spawn)
|
||||
### Function: GetRaceType(Spawn)
|
||||
|
||||
Description: Retrieves the race type category ID of the specified spawn. Instead of the specific race (human, elf, etc.), this returns a broader category (e.g., humanoid, animal, etc.).
|
||||
**Description:**
|
||||
Retrieves the race type category ID of the specified spawn. Instead of the specific race (human, elf, etc.), this returns a broader category (e.g., humanoid, animal, etc.).
|
||||
|
||||
Parameters:
|
||||
**Parameters:**
|
||||
- `spawn` (Spawn) - Spawn object representing `spawn`.
|
||||
|
||||
Spawn: Spawn – The entity whose race type to get.
|
||||
**Example:**
|
||||
|
||||
Returns: Int32 – The race type ID of the spawn (corresponding to categories in game data).
|
||||
```lua
|
||||
-- From Spells/Priest/Cleric/Templar/DivineStrike.lua
|
||||
function cast(Caster, Target, DmgType, MinDmg, MaxDmg)
|
||||
SpellDamage(Target, DmgType, MinDmg, MaxDmg)
|
||||
|
||||
Example:
|
||||
|
||||
-- Example usage (determine if NPC is animal-type for a charm spell)
|
||||
if GetRaceType(NPC) == RACE_TYPE_ANIMAL then
|
||||
SendMessage(Player, "This creature can be charmed by your spell.", "white")
|
||||
end
|
||||
--[[ We don't have racetypes on npcs yet
|
||||
if GetRaceType(Target) == "Undead" then
|
||||
SpellDamage(Target, DmgType, MinDmg, MaxDmg)
|
||||
end--]]
|
||||
end
|
||||
```
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user