more work on quest api

TurmoilToad
2018-11-21 09:33:54 -05:00
parent 987de7eb71
commit 230cdf3b16
+241 -26
@@ -305,7 +305,7 @@ if ($text!~/Hail|Hi|Hello/i) # Will check if the text does not contain "Hail", "
      **Parmeter:**
      uint16 instance_id
      instance_id _(uint16)_
      **Usage:**
@@ -324,7 +324,7 @@ quest::AssignGroupToInstance($Instance);
      **Parmeter:**
      uint16 instance_id
      instance_id _(uint16)_
      **Usage:**
@@ -341,7 +341,7 @@ quest::AssignRaidToInstance($Instance);
      **Parameter:**
      uint16 instance_id
      instance_id _(uint16)_
      **Usage:**
@@ -373,7 +373,7 @@ quest::summonitem(quest::ChooseRandom(1001, 1004, 1011);
      **Parameter(s):**
      string zone_name, uint16 version, uint32 duration
      zone_name _(string)_, version _(uint16)_, duration _(uint32)_
      **Usage:**
@@ -388,7 +388,7 @@ quest::CreateInstance("mirb", 50, 10800);
      **Parameter(s):**
      uint16 instance_id
      instance_id _(uint16)_
      **Usage:**
@@ -403,7 +403,7 @@ quest::DestroyInstance(50);
      **Parameter(s):**
      uint32 zone, uint16 version
      zone _(uint32)_, version _(uint16)_
      **Usage:**
@@ -419,7 +419,7 @@ quest::FlagInstanceByGroupLeader(237,50);
      **Parameter(s):**
      uint32 zone, uint16 version
      zone _(uint32)_, version _(uint16)_
      **Usage:**
@@ -435,7 +435,7 @@ quest::FlagInstanceByRaidLeader(237,50);
      **Parameter(s):**
      uint8 mode [0-3]
      mode [0-3] _(uint8)_
      **Usage:**
@@ -451,7 +451,7 @@ quest::FlyMode(1);
      **Parameter(s):**
      uint16 instance_id)
      instance_id _(uint16)_
      **Usage:**
@@ -467,7 +467,7 @@ quest::GetCharactersInInstance(50); #:: Returns 50,123456
      **Parameter(s):**
      string zone_name, uint16 version
      zone_name _(string)_, version _(uint16)_
      **Usage:**
@@ -480,7 +480,7 @@ my $Instance = quest::GetInstanceID($zonesn, $instanceversion); #:: Returns uint
quest::AssignToInstance($Instance);
```
### GetInstanceTimer()
### GetInstanceTimer
      **Parameter(s):**
@@ -495,23 +495,238 @@ quest::AssignToInstance($Instance);
quest::GetInstanceTimer(); #:: Returns uint32
```
(work in progress)
### GetInstanceTimerByID
      **Parameter(s):**
      instance_id _(uint16)_
      **Usage:**
      Returns the duration timer of the specified instance.
      Note: If you do not provide an instance_id in the method it defaults to instance id 0 and returns 0 for time remaining.
      **Example**
```perl
#:: Create a scalar variable to store instance_id
my $Instance = quest::GetInstanceID($zonesn, $instanceversion); #:: Returns uint16
quest::GetInstanceTimerByID($Instance); #:: Returns timer int
```
### GetSpellResistType
      **Parameter(s):**
      spell_id _(uint32)_
      **Usage:**
      Returns the [Resist Type](https://github.com/EQEmu/Server/wiki/Resist-Types) of the specified spell.
      **Example**
```perl
quest::GetSpellResistType($spell_id); #:: Returns int
```
### GetSpellTargetType
      **Parameter(s):**
      spell_id _(uint32)_
      **Usage:**
      Returns the [Target Type](https://github.com/EQEmu/Server/wiki/Target-Types) of the specified spell.
      **Example**
```perl
quest::GetSpellTargetType($spell_id); #:: Returns int
```
### GetTimeSeconds
      **Parameter(s):**
      None.
      **Usage:**
      Returns unix time in seconds.
      **Example:**
```perl
quest::GetTimeSeconds(); #:: Returns int
```
### GetZoneID
      **Parameter(s):**
      zone _(string)_
      **Usage:**
      Returns the zone id.
      **Example:**
```perl
quest::GetZoneID($zonesn); #:: Returns int
```
### GetZoneLongName
      **Parameter(s):**
      zone _(string)_
      **Usage:**
      Returns the long name of the zone.
      **Example:**
```perl
quest::GetZoneLongName($zonesn); #:: Returns string
```
### IsBeneficialSpell
      **Parameter(s):**
      spell_id _(uint32)_
      **Usage:**
      Returns true if the specified spell is beneficial.
      **Example:**
```perl
quest::IsBeneficialSpell($spell_id); #:: Returns 0 or 1
```
### IsEffectInSpell
      **Parameter(s):**
      spell_id _(uint32)_, effect_id _(uint32)_
      **Usage:**
      Returns true if the specified spell has the specified [Spell Effect](https://github.com/EQEmu/Server/wiki/Spell-Effect-IDs).
      **Example:**
```perl
#:: Check for Spell Effect 23 - Fear
quest::IsEffectInSpell($spell_id, 23); #:: Returns 0 or 1
```
### IsRunning
      **Parameter(s):**
      None.
      **Usage:**
      Returns the running state--0 is walking, 1 is running.
      **Example:**
```perl
quest::IsRunning(); #:: Returns 0 or 1
```
### LearnRecipe
      **Parameter(s):**
      recipe_id _(uint32)_
      **Usage:**
      Makes the client learn a recipe.
      **Example:**
```perl
#:: Teach recipe_id 2141 - Pickled Bixie
quest::LearnRecipe(2141);
```
### MerchantCountItem
      **Parameter(s):**
      npc_id _(uint32)_, item_id _(uint32)_
      **Usage:**
      Returns the number of the specified item in stock at the specified merchant.
      **Example:**
```perl
#:: Find out how many 12260 - Fuzzlecutter Formula 5000 are in stock at Ping_Fuzzlecutter (9133)
quest::MerchantCountItem(9133, 12260); #:: Returns int
```
### MerchantSetItem
      **Parameter(s):**
      npc_id _(uint32)_, item_id _(uint32)_, quantity _(uint32)_
      **Usage:**
      Changes the number of the specified items in stock, at the specified quantity, at the specified merchant.
      **Example:**
```perl
#:: Make sure there is plenty of 12260 - Fuzzlecutter Formula 5000 in stock at Ping_Fuzzlecutter (9133)
quest::MerchantSetItem(9133, 12260, 1000); #:: Quantity 1000
```
### ModifyNPCStat
      **Parameter(s):**
      key _(string)_, value _(string)_
      **Usage:**
      Changes the specified [npc_types](https://github.com/EQEmu/Server/wiki/npc_types) stat of the specified NPC on the fly--changes are not saved to the npc_types in the DB.
      **Example:**
```perl
#:: Adjust the runspeed to 1.25
quest::modifynpcstat("runspeed", 1.25);
```
### MovePCInstance
      **Parameter(s):**
      zone_id _(uint32)_, instance_id _(uint32)_, x _(float)_, y _(float)_, z _(float)_, heading _(float)_
      **Usage:**
      Moves a player to the specified instance of the specified zone at the specified location and heading.
      **Example:**
```perl
sub EVENT_CLICKDOOR {
#:: Match door id 3: Frozen Nightmare (mirb) zone in
if ($doorid == 3) {
#:: Create a scalar variable to store instance_id--GetInstanceID returns int
my $InstanceMirB = quest::GetInstanceID("mirb",50);
#:: Match if an instance exists
if ($InstanceMirB > 0) {
#:: Move the player to mirb (237), to their instance, at X - 607, Y - 1503, Z - 33, Heading - 0 (north)
quest::MovePCInstance(237,$InstanceMirB,607,1503,33,0);
}
}
}
```
(Work in Progress)
```perl
quest::GetInstanceTimerByID(uint16 instance_id)
quest::GetSpellResistType(uint32 spell_id)
quest::GetSpellTargetType(uint32 spell_id)
quest::GetTimeSeconds()
quest::GetZoneID(string zone)
quest::GetZoneLongName(string zone)
quest::IsBeneficialSpell(uint32 spell_id)
quest::IsEffectInSpell(uint32 spell_id, uint32 effect_id)
quest::IsRunning()
quest::LearnRecipe(int recipe_id)
quest::MerchantCountItem(uint32 npc_id, uint32 item_id)
quest::MerchantSetItem(uint32 npc_id, uint32 item_id, [uint32 quantity])
quest::ModifyNPCStat(string key, string value)
quest::MovePCInstance(int zone_id, int instance_id, float x, float y, float z, [float heading])
quest::RemoveAllFromInstance(uint16 instance_id)
quest::RemoveFromInstance(uint16 instance_id)
quest::SendMail(stirng to, string from, string subject, string message)