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...")
 
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
  

Revision as of 23:26, 8 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 (int8)
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