No categories assigned

LUA:GetQuestCompleteCount

Revision as of 23:26, 8 July 2015 by Jabantiz (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

LUA - GetQuestCompleteCount

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


LUA Functions: 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