init
This commit is contained in:
		
							
								
								
									
										117
									
								
								LogicServer/data/functions/GlobalMiscExpand/GlobalMisc.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										117
									
								
								LogicServer/data/functions/GlobalMiscExpand/GlobalMisc.txt
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,117 @@ | ||||
| --全局的比较零散的函数,放在这里,被全局脚本包含  | ||||
| ------#include "data\functions\ActorSystems\WingSystem\Wing.txt" once	--翅膀 | ||||
| --每日重置的数据,以便节省存储 | ||||
| DailyFlagDefine =  | ||||
| { | ||||
| 	--UseExpBoxTimes = 1			--每日使用经验盒子的次数 | ||||
| } | ||||
|  | ||||
| --检查活动礼包各种卡 | ||||
| --[[ | ||||
| 	4、内测新手卡; | ||||
| 	5、好评卡(100万张); | ||||
| 	6、VIP特权礼包(5万张); | ||||
| 	7、王者礼包(5万张); | ||||
| --]] | ||||
| function checkNewPlayerNumber(sysarg,number,typeid) | ||||
| 	checkPlayerNumber(sysarg,number,typeid) | ||||
| end | ||||
|  | ||||
| function checkPlayerNumber(sysarg,number,type) | ||||
| 	if (not number) then return false end | ||||
| 	--设置动态变量 用于判断输入窗口类型  | ||||
| 	local sDvar = Actor.getDyanmicVar(sysarg) | ||||
| 	--sDvar.getRewardCodeBag = tonumber(type)  --增值类型  用于限制每个按钮只能固定输入类型  | ||||
|  | ||||
| 	sDvar.getRewardCodeBag = 0 | ||||
| 	Actor.queryServicesAddCard(sysarg, number, true) | ||||
| end | ||||
|  | ||||
| --玩家开始游戏要执行的参数 | ||||
| function startPlay(sysarg) | ||||
| 	--添加初始的任务 | ||||
| 	local sceneId = Actor.getSceneId(sysarg) | ||||
| 	--local qId = FirstEnterQuestMap[sceneId] | ||||
| 	local qId = 1 | ||||
| 	if qId then | ||||
| 		Actor.addQuest(sysarg, qId) | ||||
| 	end	 | ||||
| end | ||||
|  | ||||
| --第一次开始游戏欢迎界面 | ||||
| function checkFirstQuest(sysarg) | ||||
| 	if Actor.getQuestCount(sysarg) == 0 then | ||||
| 		local boResult = true | ||||
| 		local qid = 1 | ||||
| 			--local qId = FirstEnterQuestMap[sceneId] | ||||
| 		if Actor.isFinishQuest(sysarg, qid) then | ||||
| 			boResult = false | ||||
| 		end | ||||
| 		 | ||||
| 		if boResult then | ||||
| 			Actor.openDialogs(sysarg,diWelcome) | ||||
| 		end | ||||
| 	end | ||||
| end | ||||
|  | ||||
| --添加一个buf | ||||
| function addSameTypeBuff(sysarg, ItemId, BuffId) | ||||
| 	----print("addSameTypeBuff ItemId="..ItemId..", BuffId="..BuffId) | ||||
| 	if Actor.getItemCount(sysarg, ItemId) > 0 then | ||||
| 		if Actor.removeItem(sysarg, ItemId, 1) < 1 then	--扣除一个道具 | ||||
| 			return false | ||||
| 		else | ||||
| 			Actor.addBuffById(sysarg, BuffId)  	--59 | ||||
| 		end | ||||
| 	end | ||||
| 	return true | ||||
| end | ||||
|  | ||||
| function emptyFunc(sysarg) | ||||
| end | ||||
|  | ||||
| --获取每日变量(每日跨0点清空) | ||||
| function GetDailyFlag( sysarg, key ) | ||||
| 	local sVar = Actor.getStaticVar(sysarg) | ||||
| 	if not sVar.dailyFalgs then | ||||
| 		sVar.dailyFalgs = {} | ||||
| 	end | ||||
| 	return sVar.dailyFalgs[key] | ||||
| end | ||||
|  | ||||
| --设置每日变量 | ||||
| function SetDailyFlag(sysarg, key, value ) | ||||
| 	local sVar = Actor.getStaticVar(sysarg) | ||||
| 	if not sVar.dailyFalgs then | ||||
| 		sVar.dailyFalgs = {} | ||||
| 	end | ||||
| 	sVar.dailyFalgs[key] = value | ||||
| end | ||||
|  | ||||
| --[[批量使用道具成功(有每日最大次数限制) | ||||
| 处理部分策划特殊要求 | ||||
| lastCout:该道具剩余使用次数 | ||||
| ]] | ||||
| function OnBatchUseItem( sysarg, itemId, count, addValue, lastCout ) | ||||
| 	----print("OnBatchUseItem, itemId="..itemId..", count="..count..", addValue="..addValue.. | ||||
| 	--	", lastCout="..lastCout) | ||||
| 	if itemId == 893 then		--经验勾玉 | ||||
| 		local msg = string.format(OldLang.Script.ExpJade002, addValue, lastCout) | ||||
| 		Actor.sendTipmsg( sysarg, string.format(msg), ttFlyTip) | ||||
| 	end | ||||
| end | ||||
|  | ||||
| --boss令结束 | ||||
| function OnUseTokenBossEnd(bossarg, actorId) | ||||
| 	if Actor.hasState(bossarg,esStateDeath) then | ||||
| 		return | ||||
| 	end | ||||
| 	if Actor.getIntProperty(bossarg, PROP_CREATURE_HP) <= 0 then | ||||
| 		return | ||||
| 	end | ||||
| 	local hBoss = Actor.getHandle(bossarg) | ||||
| 	sysarg = Actor.getActorById(actorId)  | ||||
| 	if sysarg then | ||||
| 		Actor.sendTipmsg( sysarg, OldLang.Script.UseBossToken003, ttFlyTip ) | ||||
| 	end | ||||
| end | ||||
| @@ -0,0 +1,70 @@ | ||||
| --ScriptTimeConfig中调用的方法放在这里,被全局脚本包含  | ||||
| --#include "data\config\misc\ScriptTimerSystemMsg.txt" once 	ScriptTImer执行的一些系统公告配置 | ||||
|  | ||||
| --重置系统级的一些数据,一个服在0点会调用一次 | ||||
| function ResetSysDate() | ||||
| 	refreshStore() | ||||
| 	System.RefeshWorldLevel() | ||||
| end | ||||
|  | ||||
| --定时保存文件(商城动态文件) | ||||
| function SaveFiles() | ||||
| 	System.saveFiles() | ||||
| end | ||||
|  | ||||
|  | ||||
| --[[每日清除商城某些ladble的商品数据 | ||||
| 0表示是普通的商城,1表示限时抢购,2-神秘商店,3-绑定元宝商城,4-职业宗师商店 | ||||
| 玩家购买1、3的商品,需要每天重置其购买数量 | ||||
| 普通的商城:商品不限购 | ||||
| ]] | ||||
| function  refreshStore() | ||||
| 	System.refreshStore(3)  	--清空绑定元宝tab页的商品购买数据 | ||||
|     System.refreshStore(1)  	--限时抢购 | ||||
|     System.refreshStore(4) 		--职业宗师商店 | ||||
| end | ||||
|  | ||||
|  | ||||
| --周一0点重置 | ||||
| function WeekReset() | ||||
| end | ||||
|  | ||||
| --更新排行榜 | ||||
| function updateRankData() | ||||
| 	System.updateRankData() | ||||
| end | ||||
| --每30分钟更新头衔,在updateRankData后更新 | ||||
| function updateMaintainTopTitle() | ||||
| 	System.CallmaintainTopTitle() | ||||
| end | ||||
|  | ||||
| --ScriptTimer通用的系统公告 | ||||
| function SystemMsg(id) | ||||
| 	id = tonumber(id) | ||||
| 	local msgCfg | ||||
| 	for i,v in ipairs(ScriptTimerSystemMsgConfig) do | ||||
| 		if v.id == id then | ||||
| 			msgCfg = v | ||||
| 		end | ||||
| 	end | ||||
| 	if not msgCfg then | ||||
| 		return | ||||
| 	end | ||||
| 	if type(msgCfg.CondFunc) == "function" then | ||||
| 		if not msgCfg.CondFunc() then | ||||
| 			return | ||||
| 		end | ||||
| 	end | ||||
| 	System.broadcastTipmsg(msgCfg.msg, msgCfg.type) | ||||
| end | ||||
|  | ||||
| --发送怪的死亡次数到后台 | ||||
| function CountMonsterDeadToLog() | ||||
| 	--System.sendMonsterDeadToLog() | ||||
| end | ||||
|  | ||||
| --发送物品产出统计 | ||||
| function CountItemOutPutToLog() | ||||
| 	System.sendItemOutPutToLog() | ||||
| end | ||||
|  | ||||
		Reference in New Issue
	
	Block a user