Hello Everyone,
I am working on a set of scripts that involve an NPC that gives out Languages, however there are certain parameters to getting those languages.
Here is an example of the script that is called when a player chooses the "Drow" language to learn:
void main()
{
object oPC = GetPCSpeaker();
object oLang = GetItemPossessedBy(oPC, "lang_token");
if (GetIsObjectValid(GetItemPossessedBy(oPC, "hlslang_13"))==TRUE)
{
SendMessageToPC(oPC, "You have already learned this language.");
return;
}
if (GetIsObjectValid(GetItemPossessedBy(oPC, "lang_token"))==FALSE)
{
SendMessageToPC(oPC, "You can not learn anymore languages right now.");
return;
}
if (GetIsObjectValid(GetItemPossessedBy(oPC, "hlslang_13"))==FALSE)
{
DestroyObject(oLang);
CreateItemOnObject("hlslang_13", GetPCSpeaker(), 1);
}
}
Now, what I need to do is set-up a function that checks several things:
1) It needs to group together 16 different items, with different tags.
2) It needs to check to see how many of those items the player has.
3) It needs to check the INT bonus that a character has.
4) If a player has enough INT (for example, 12 INT, giving an additional language), then he/she can select the appropriate conversation option to bring up the full list of languages available on the server.
Also, if anyone sees area for improvement in my script above, please let me know. My scripting knowledge is a work in progress, and if there are easier solutions, I would love to hear them.
Thanks!
Modifié par Evelath, 16 avril 2011 - 04:11 .