Tipologie server:
*Resursă folosită:
*ServerFiles utilizat:
*Syserr:. Calls undeclared function! :
choiceMission.GetInfo
choiceMission.GiveReward
Error occured on quest ./pre_qc/misiune_kill_lv5.lua
Poză:
*Detalii suplimentare:
Cod: Selectaţi tot
quest misiune_kill_lv5 begin
state start begin
function GetInfo()
-- returning an array of multiple sub arrays that contain monster info
return {{173, 10}, {174, 10}}; -- {vnum mob, number kill}
end
function GiveReward()
say(gameforge[LC()][2365]) -- "ai terminat misiune! "
pc.give_item2(19, 1)
set_state("done")
end
when login or levelup with pc.get_level() >= 2 begin
send_letter("Misiune Kill Lv5")
end
when button or info begin
say_title("Misiune Kill Lv5")
say(gameforge[LC()][2343]) -- "alege kill. "
say(gameforge[LC()][718]) -- "Alege: "
local choiceMonsters = choiceMission.GetInfo();
local choiceTable = {};
for index, info in ipairs(choiceMonsters) do
table.insert(choiceTable, string.format("x%d - %s", info[2], mob_name(info[1])));
end table.insert(choiceTable, gameforge[LC()][81]); -- "Inchide"
local selectChoice = select_table(choiceTable);
if (selectChoice != table.getn(choiceTable)) then
pc.setqf("missionIndex", selectChoice);
set_state("mission");
say(gameforge[LC()][2345]) -- "Ok! Incepe "
end
end
end
state mission begin
when login or enter begin
local choiceMonsters = choiceMission.GetInfo();
local missionIndex = pc.getqf("missionIndex");
send_letter("Scelta in corso")
q.set_counter_name(string.format(" %s ", mob_name(choiceMonsters[missionIndex][1])))
q.set_counter_value(choiceMonsters[missionIndex][2] - pc.getqf("missionContor"));
end
when button or info begin
say_title("Misiune Kill Lv5")
say(gameforge[LC()][2351]) --"info misiune "
say("")
say("")
local choiceMonsters = choiceMission.GetInfo();
local missionIndex = pc.getqf("missionIndex");
if (pc.getqf("missionContor") < choiceMonsters[missionIndex][2]) then
say(string.format("Ti mancano da uccidere %d - %s", choiceMonsters[missionIndex][2] - pc.getqf("missionContor"), mob_name(choiceMonsters[missionIndex][1])))
q.set_counter_value(choiceMonsters[missionIndex][2] - pc.getqf("missionContor"));
end
end
when kill begin
local npcRace = npc.get_race();
local choiceMonsters = choiceMission.GetInfo();
local missionIndex = pc.getqf("missionIndex");
if (npcRace == choiceMonsters[missionIndex][1]) then
local missionContor = pc.getqf("missionContor");
if (pc.getqf("missionContor") < choiceMonsters[missionIndex][2]) then
q.set_counter_value(choiceMonsters[missionIndex][2] - (missionContor + 1));
pc.setqf("missionContor", missionContor + 1);
if missionContor + 1 == choiceMonsters[missionIndex][2] then
choiceMission.GiveReward();
end
end
end
end
end
state done begin
when enter begin
set_quest_state("misiune_kill_lv6", "run")
q.done();
end
end
end



