Difference between revisions of "LUA:AddLanguage"

(Created page with "{{PageHeaderChild|LUA|GetQuestCompleteCount}} == GetQuestCompleteCount() == Gets the number of times the given quest has been completed by the given player == Syntax == var = ...")
 
Line 1: Line 1:
{{PageHeaderChild|LUA|GetQuestCompleteCount}}
+
{{PageHeaderChild|LUA|AddLanguage}}
  
== GetQuestCompleteCount() ==
+
== AddLanguage() ==
Gets the number of times the given quest has been completed by the given player
+
Gives the player the language
  
  
 
== Syntax ==
 
== Syntax ==
var = GetQuestCompleteCount(param1, param2)
+
AddLanguage(param1, param2)
  
 
== Parameters ==
 
== Parameters ==
 
; Required - ''param1'' (Spawn), ''param2'' (int32)
 
; 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 language ID.
 
 
== Returns ==
 
; int16
 
  
 
== Usage ==
 
== Usage ==
 
<pre>
 
<pre>
 
function hailed(NPC, Spawn)
 
function hailed(NPC, Spawn)
    local count = GetQuestCompleteCount(Spawn, Quest1)
+
Say(NPC, "This is Halasian language", 0, 1)
    if count <= 4 then
+
local con = CreateConversation()
        OfferQuest(Spawn, Quest1)
+
    else
+
if not HasLanguage(Spawn, 1) then
        OfferQuest(Spawn, Quest2)
+
AddConversationOption(con, "Yes please!", "AddLang")
    end
+
AddConversationOption(con, "No thanks.")
 +
StartConversation(con, NPC, Spawn, "You do not know Halasian? Would you like to learn it?")
 +
else
 +
AddConversationOption(con, "Yes I do.")
 +
StartConversation(con, NPC, Spawn, "You know Halasian?")
 +
end
 +
end
 +
 
 +
function AddLang(NPC, Spawn)
 +
AddLanguage(Spawn, 1)
 +
 +
local con = CreateConversation()
 +
AddConversationOption(con, "Yay!")
 +
StartConversation(con, NPC, Spawn, "Here you go")
 
end
 
end
 
</pre>
 
</pre>
  
This will offer the player a different quest if they completed Quest1 4 times
+
This NPC will give the player the "Halasian" language if they select the right option.
 +
 
 +
== Notes ==
 +
Language ID's <br />
 +
0  = Common <br />
 +
1  = Halasian <br />
 +
2  = Thexian <br />
 +
3  = Dwarven <br />
 +
4 = Erudian <br />
 +
5  = Guktan <br />
 +
6  = Gnomish <br />
 +
7  = Ayr'Dal <br />
 +
8  = Stout <br />
 +
9  = Koada'Dal <br />
 +
10 = Lucanic <br />
 +
11 = Antonican <br />
 +
12 = Sebilisian <br />
 +
13 = Kerran <br />
 +
14 = Oggish <br />
 +
15 = Ykeshan <br />
 +
16 = Feir'Dal <br />
 +
17 = Orcish <br />
 +
18 = Gnollish <br />
 +
19 = Draconic <br />
 +
20 = Goblish <br />
 +
21 = Thulian <br />
 +
22 = Words of Shade <br />
 +
23 = Fayefolk <br />
 +
24 = Chaos Tongue <br />
 +
25 = Krombral <br />
 +
26 = Ratongan <br />
 +
27 = Druzaic <br />
 +
28 = Uruvanian <br />
 +
29 = Death's Whisper <br />
 +
30 = Screechsong <br />
 +
31 = Volant <br />
 +
32 = Argot <br />
 +
33 = Serilian <br />
 +
34 = Tik-Tok <br />
 +
35 = Faerlie <br />
 +
36 = Gorwish <br />
 +
37 = Sathirian <br />
 +
38 = Di'Zokian <br />
 +
39 = Froak <br />
 +
40 = Shisik <br />
 +
41 = Sul'Dal <br />
 +
42 = Ancient Draconic <br />
 +
43 = Fleshless Tongue <br />
 +
44 = Gymy <br />

Revision as of 21:30, 10 July 2015

LUA - AddLanguage

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


AddLanguage()

Gives the player the language


Syntax

AddLanguage(param1, param2)

Parameters

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

Usage

function hailed(NPC, Spawn)
	Say(NPC, "This is Halasian language", 0, 1)
	local con = CreateConversation()
	
	if not HasLanguage(Spawn, 1) then
		AddConversationOption(con, "Yes please!", "AddLang")
		AddConversationOption(con, "No thanks.")
		StartConversation(con, NPC, Spawn, "You do not know Halasian? Would you like to learn it?")
	else
		AddConversationOption(con, "Yes I do.")
		StartConversation(con, NPC, Spawn, "You know Halasian?")
	end
end

function AddLang(NPC, Spawn)
	AddLanguage(Spawn, 1)
	
	local con = CreateConversation()
	AddConversationOption(con, "Yay!")
	StartConversation(con, NPC, Spawn, "Here you go")
end

This NPC will give the player the "Halasian" language if they select the right option.

Notes

Language ID's
0 = Common
1 = Halasian
2 = Thexian
3 = Dwarven
4 = Erudian
5 = Guktan
6 = Gnomish
7 = Ayr'Dal
8 = Stout
9 = Koada'Dal
10 = Lucanic
11 = Antonican
12 = Sebilisian
13 = Kerran
14 = Oggish
15 = Ykeshan
16 = Feir'Dal
17 = Orcish
18 = Gnollish
19 = Draconic
20 = Goblish
21 = Thulian
22 = Words of Shade
23 = Fayefolk
24 = Chaos Tongue
25 = Krombral
26 = Ratongan
27 = Druzaic
28 = Uruvanian
29 = Death's Whisper
30 = Screechsong
31 = Volant
32 = Argot
33 = Serilian
34 = Tik-Tok
35 = Faerlie
36 = Gorwish
37 = Sathirian
38 = Di'Zokian
39 = Froak
40 = Shisik
41 = Sul'Dal
42 = Ancient Draconic
43 = Fleshless Tongue
44 = Gymy