Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[help] ERROR QUEST

Newbie Spellweaver
Joined
Jun 21, 2011
Messages
16
Reaction score
1
Code:
quest: error     In quest 40 a error occured in 'check': [string "chunk"]:106: invalid arguments to method call
quest: error     In quest 40 a error occured in 'check': [string "chunk"]:106: invalid arguments to method call
quest: error     In quest 40 a error occured in 'check': [string "chunk"]:106: invalid arguments to method call

Code:
-- Saga is Licensed under Creative Commons Attribution-NonCommerial-ShareAlike 3.0 License
-- http://creativecommons.org/licenses/by-nc-sa/3.0/
-- Generated By Quest Extractor on 2/8/2008 3:46:14 PM
-- Rev DJ on 7/18/2011

local QuestID = 40;
local ReqClv = 10;
local ReqJlv = 0;
local NextQuest = 150;
local RewZeny = 430;
local RewCxp = 480;
local RewJxp = 0;
local RewWxp = 0; 
local RewItem1 = 1700113; 
local RewItem2 = 52; 
local RewItemCount1 = 11; 
local RewItemCount2 = 1; 
local StepID = 0;

-- Modify steps below for gameplay

function QUEST_VERIFY(cid)
	Saga.GeneralDialog(cid, 36);
	return 0;
end

function QUEST_START(cid)
	Saga.AddStep(cid, QuestID, 4001);
	Saga.AddStep(cid, QuestID, 4002);	
	Saga.AddStep(cid, QuestID, 4003);	
	Saga.InsertQuest(cid, QuestID, 2);
	return 0;
end

function QUEST_FINISH(cid)
	-- Gives all rewards
	Saga.GiveItem(cid, RewItem1, RewItemCount1 );
	Saga.GiveItem(cid, RewItem2, RewItemCount2 );
	Saga.GiveZeny(cid, RewZeny);
	Saga.GiveExp(cid, RewCxp, RewJxp, RewWxp);
	Saga.InsertQuest(cid, NextQuest, 1 );
	return 0;
end

function QUEST_CANCEL(cid)
	return 0;
end

function QUEST_STEP_1(cid)
	--Scacciano Dialog: 36
	-- Default Task
	Saga.ClearWaypoints(cid, QuestID);
	Saga.StepComplete(cid, QuestID, StepID);
	return 0;
end

function QUEST_STEP_2(cid)
    -- Swim to the Northern Hodemimes bridge 
	if Saga.FindPosition(cid, QuestID, StepID, 6139.905, -32132.1, -112.362, 2) < 1000 then
		Saga.SubstepComplete(cid, QuestID, StepID);
	end
	
	-- Check if all substeps are completed
    for i = 1, 1 do
         if Saga.IsSubStepCompleted(cid, QuestID, StepID, i) == false then
			return -1;
		 end
    end		
	
	Saga.StepComplete(cid, QuestID, StepID);
	return 0;
end

function QUEST_STEP_3(cid)
	-- Report to Scacciano Morrigan     
	Saga.AddWaypoint(cid, QuestID, StepID, 1, 1003);      
	
	-- Check for completion
	local ret = Saga.GetNPCIndex(cid);    
	if ret == 1003 then
		Saga.GeneralDialog(cid, 95);		
		Saga.SubstepComplete(cid, QuestID, StepID, 1);
	end	
	
    -- Check if all substeps are completed
    for i = 1, 1 do
		if Saga.IsSubStepCompleted(cid, QuestID, StepID, i) == false then
			return -1;
		end
    end	
    
    Saga.ClearWaypoints(cid, QuestID); 
	Saga.StepComplete(cid, QuestID, StepID);
	Saga.QuestComplete(cid, QuestID);	        
	return -1;	
end

function QUEST_CHECK(cid)
	-- Check all steps for progress
	local CurStepID = Saga.GetStepIndex(cid, QuestID );
	local ret = -1;
	StepID = CurStepID;
	
	if CurStepID == 4001 then
		ret = QUEST_STEP_1(cid);
	elseif CurStepID == 4002 then
		ret = QUEST_STEP_2(cid);
	elseif CurStepID == 4003 then
		ret = QUEST_STEP_3(cid);
	end
	
	if ret == 0 then
		QUEST_CHECK(cid)
	end
	
	return ret;
end
 
Back
Top