Difference between revisions of "LUA:GetQuestCompleteCount"

(Created page with "{{PageHeaderChild|LUA|GetQuestCompleteCount}} == LUA Functions: GetQuestCompleteCount() == Gets the number of times the given quest has been completed by the given player == S...")
 
m (moved GetQuestCompleteCount to LUA:GetQuestCompleteCount: I screwed up when creating thse pages)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{PageHeaderChild|LUA|GetQuestCompleteCount}}
 
{{PageHeaderChild|LUA|GetQuestCompleteCount}}
  
== LUA Functions: GetQuestCompleteCount() ==
+
== GetQuestCompleteCount() ==
 
Gets the number of times the given quest has been completed by the given player
 
Gets the number of times the given quest has been completed by the given player
  
Line 9: Line 9:
  
 
== Parameters ==
 
== Parameters ==
; Required - ''param1'' (Spawn), ''param2'' (int8)
+
; Required - ''param1'' (Spawn), ''param2'' (int32)
 
: ''param1'' is a reference to a player.
 
: ''param1'' is a reference to a player.
 
: ''param2'' is the quest ID.
 
: ''param2'' is the quest ID.

Latest revision as of 00:01, 29 July 2015

LUA - GetQuestCompleteCount

Return to: LUA | Tutorials | Portal | Forum | Project Manager | Bug Tracker


GetQuestCompleteCount()

Gets the number of times the given quest has been completed by the given player


Syntax

var = GetQuestCompleteCount(param1, param2)

Parameters

Required - param1 (Spawn), param2 (int32)
param1 is a reference to a player.
param2 is the quest ID.

Returns

int16

Usage

function hailed(NPC, Spawn)
    local count = GetQuestCompleteCount(Spawn, Quest1)
    if count <= 4 then
        OfferQuest(Spawn, Quest1)
    else
        OfferQuest(Spawn, Quest2)
    end
end

This will offer the player a different quest if they completed Quest1 4 times