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!

How the "TaskCApi.Broadcast" works?

Junior Spellweaver
Joined
Jan 29, 2015
Messages
118
Reaction score
5
I created a script task in /gamed/config/tasklist/tasklist1.lua, hoping to trigger a broadcast after some logic, but I don't know how it works.
e.g.
Code:
--完成该任务时服务器调用   	OnAward = function(TASKINTERFACE_POINTER, bSuccess)   		if bSuccess then			math.randomseed(os.time())			local luckValueID = 10	--幸运值的声望id			local luckGrade = TaskCApi.GetTaskCompleteTimesFromFinishTimeTaskList(TASKINTERFACE_POINTER,15372)	--幸运等级			local rand = {333,250,200,166,125,111}			if luckGrade < 6 then				local temp = math.random(1,1000)				if temp <= rand[luckGrade+1] then					TaskCApi.ModifyTaskFinishCnt(TASKINTERFACE_POINTER, 15372, 1)		--幸运等级+1					TaskCApi.DeliverNewTask(TASKINTERFACE_POINTER,15420)				--仅用于喊话的任务				else					TaskCApi.Broadcast(TASKINTERFACE_POINTER ,15371, TaskBroadcastChannel.Trade)				end			end			TaskCApi.DeliverRegionReputation(TASKINTERFACE_POINTER,luckValueID,-66)	--收幸运值   		end   		return 0   	end

In "TaskCApi.Broadcast(TASKINTERFACE_POINTER ,15371, TaskBroadcastChannel.Trade)",where to set the broadcast text?
 
Experienced Elementalist
Joined
Jul 2, 2012
Messages
221
Reaction score
21
see 2 files:
task_list_text.lua and task_list_text_string.lua

example:
TaskCApi.Broadcast(TASKINTERFACE_POINTER ,14754,TaskBroadcastChannel.Trade)

task_list_text.lua:
TaskListText[14754]={
TaskTributeText = TaskListTextString[14754].TaskTributeText
}

task_list_text_string.lua:
TaskListTextString[14754]={
TaskTributeText = "^ffd700You received 1 point of Dedication.",
}
 
Upvote 0
Junior Spellweaver
Joined
Jan 29, 2015
Messages
118
Reaction score
5
see 2 files:
task_list_text.lua and task_list_text_string.lua

example:
TaskCApi.Broadcast(TASKINTERFACE_POINTER ,14754,TaskBroadcastChannel.Trade)

task_list_text.lua:
TaskListText[14754]={
TaskTributeText = TaskListTextString[14754].TaskTributeText
}

task_list_text_string.lua:
TaskListTextString[14754]={
TaskTributeText = "^ffd700You received 1 point of Dedication.",
}
I tried it. It seems that there is something wrong with it. It can produce a broadcast, but it shows"error" rather than the contents of broadcast.
 
Upvote 0
Back
Top