⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ev_agit_common.txt

📁 JA++的最新...很多ROSF都用这个 ] 是个不错的东西-3-
💻 TXT
📖 第 1 页 / 共 2 页
字号:
//===================================================================
//Ragnarok Online EP2.5 GVG Script	ev_agit_common      by kalen
//每星期设定修正 by Deme
// 汉化和修正 : FPE
// Jathena++ 论坛:http://www.foxofice.net/bbs
//===================================================================

//=========================================================================
// 攻城战的开始·结束计时
//	从const.txt取得设定时间
//	(GvGWeekDay, GvGTimeST, GvGTimeST, GvGTime*ST, GvGTime*ED)
//
// ■MAP服务器启动后的60秒之后判断是否开始
//-------------------------------------------------------------------------

-	script	#AgitConfig	-1,{
	end;
OnInit:
	if(GvGWeekDay == 0)
		end;
	//如果有开启工会战,那么对应的位元为1
	for(set '@i,0; '@i<7; set '@i,'@i+1) {
		set '@mask,1<<'@i;
		set 'open['@i],(GvGWeekDay & '@mask)? 1: 0;
	}
	//设定每周工会战起始时间
	if(GvGTimeST == GvGTimeED) {
		setarray 'dbt,GvGTime0ST,GvGTime1ST,GvGTime2ST,GvGTime3ST,GvGTime4ST,GvGTime5ST,GvGTime6ST;
		setarray 'fin,GvGTime0ED,GvGTime1ED,GvGTime2ED,GvGTime3ED,GvGTime4ED,GvGTime5ED,GvGTime6ED;
	}
	//每天都是相同的时间
	else {
		cleararray 'dbt,GvGTimeST,7;
		cleararray 'fin,GvGTimeED,7;
	}
	set 'flag,1;
	initnpctimer;
	end;

OnTimer60000:
	//启动60秒后进行判断
	if('flag) {
		set '@day,gettime(4);
		set '@min,gettime(3)*100+gettime(2);
		//当前时间为工会战时间
		if('open['@day] && '@min>='dbt['@day] && '@min<'fin['@day]) {
			announce "攻城战重新开始",8;
			debugmes "攻城战重新开始 [ " +gettimestr("%H:%M",6)+ " ]";
			agitstart;
		}
		set 'flag,0;
		setnpctimer gettime(1)*1000;	//现在时刻为0时的修正
		end;
	}
	if(gettime(1) > 0)	//1秒以上交错产生时的修正
		setnpctimer gettime(1)*1000;
	else
		initnpctimer;
	//24点结束时的例外处理
	set '@day,gettime(4);
	set '@min,gettime(3)*100+gettime(2);
	if('@min == 0) {
		set '@prev,('@day>0)? '@day-1: 6;
		if('open['@prev] && 'fin['@prev]==2400) {
			if('open['@day]==0 || 'dbt['@day]>0) {
				announce "攻城战结束",8;
				debugmes "攻城战结束 [ " +gettimestr("%H:%M",6)+ " ]";
				agitend;
			}
			end;
		}
	}
	if('open['@day]==0)
		end;
	if('@min == 'dbt['@day]) {
		announce "攻城战开始",8;
		debugmes "攻城战开始 [ " +gettimestr("%H:%M",6)+ " ]";
		agitstart;
	}
	else if('@min == 'fin['@day]) {
		announce "攻城战结束",8;
		debugmes "攻城战结束 [ " +gettimestr("%H:%M",6)+ " ]";
		agitend;
	}
	end;
}


//-----GM专用的调试程序-----
//===========================================================
//prontera.gat,152,208,0	script	GvG控制台	111,{
//	if(getgmlevel()==0)
//		end;
//	mes "[GvG-Control^ff0000(GM专用)^000000]";
//	mes "攻城战模式设定";
//	next;
//	switch (select("开始","停止","调试","取消")) {
//	case 1:
//		announce "攻城战开始",0;
//		agitstart;
//		break;
//	case 2:
//		announce "攻城战结束",0;
//		agitend;
//		break;
//	case 3:
//		setarray '@chr$,"日","一","二","三","四","五","六";
//		for(set '@i,0; '@i<7; set '@i,'@i+1)
//			mes '@chr$['@i]+ "星期 : " +(getelementofarray( getvariableofnpc('open,"#AgitConfig"),'@i ))? "○": "×";
//		next;
//		if(GvGTimeST != GvGTimeED) {
//			mes "每天时间 " +GvGTimeST+ " ~ " +GvGTimeED;
//			break;
//		}
//		for(set '@i,0; '@i<7; set '@i,'@i+1) {
//			mes '@chr$['@i]+ "星期 : " +getelementofarray( getvariableofnpc('dbt,"#AgitConfig"),'@i )+
//						" ~ " +getelementofarray( getvariableofnpc('fin,"#AgitConfig"),'@i );
//		}
//		break;
//	}
//	close;
//}
//===========================================================

//--------------------------------------------------------------------
prontera.gat,159,208,0	script	工会宝箱控制台	111,{
	if ( !(getgmlevel()) ) close;
	mes "[TBOX Control^ff0000(GM专用)^000000]";
	mes "要刷出工会宝箱吗?";
	next;
	if ( select("是","否") == 2 ) close;
	callsub Ltbox;
	mes "[TBOX Control^ff0000(GM专用)^000000]";
	mes "已经刷出工会宝箱了。";
	close;
OnClock0000:
	callsub Ltbox;
	end;
Ltbox:
	callfunc "make_t_box","aldeg_cas01.gat",114,218,123,227,1324,1325;
	callfunc "make_t_box","aldeg_cas02.gat",130,226,139,235,1326,1327;
	callfunc "make_t_box","aldeg_cas03.gat",220,264,229,273,1328,1329;
	callfunc "make_t_box","aldeg_cas04.gat",80,8,89,17,1330,1331;
	callfunc "make_t_box","aldeg_cas05.gat",58,8,67,17,1332,1333;
	callfunc "make_t_box","gefg_cas01.gat",150,108,157,115,1334,1335;
	callfunc "make_t_box","gefg_cas02.gat",136,112,145,118,1336,1337;
	callfunc "make_t_box","gefg_cas03.gat",266,286,273,293,1338,1339;
	callfunc "make_t_box","gefg_cas04.gat",112,114,119,123,1340,1341;
	callfunc "make_t_box","gefg_cas05.gat",140,106,147,113,1342,1343;
	callfunc "make_t_box","payg_cas01.gat",286,4,295,7,1344,1345;
	callfunc "make_t_box","payg_cas02.gat",140,140,149,143,1346,1347;
	callfunc "make_t_box","payg_cas03.gat",154,164,162,172,1348,1349;
	callfunc "make_t_box","payg_cas04.gat",142,44,151,51,1350,1351;
	callfunc "make_t_box","payg_cas05.gat",152,128,161,131,1352,1353;
	callfunc "make_t_box","prtg_cas01.gat",7,205,15,212,1354,1355;
	callfunc "make_t_box","prtg_cas02.gat",198,224,205,231,1356,1357;
	callfunc "make_t_box","prtg_cas03.gat",184,128,192,135,1358,1359;
	callfunc "make_t_box","prtg_cas04.gat",266,158,273,165,1360,1361;
	callfunc "make_t_box","prtg_cas05.gat",272,174,279,181,1362,1363;
	return;
}

//====================================================================
//Function
//====================================================================
//---------------------------------------------------------------
//清空秘密基地数据并重设怪物
//callfunc "resetcastledata",MAP名,"::OnRecvCastleYYY","kapra_XXXgYY",@GIDXX,"::OnGDEMPSetYYY";
function	script	resetcastledata	{
	killmonsterall getarg(0);
	disablenpc getarg(2);
	setcastledata getarg(0),1,0;
	setcastledata getarg(0),2,1;
	setcastledata getarg(0),3,1;
	setcastledata getarg(0),4,0;
	setcastledata getarg(0),5,0;
	setcastledata getarg(0),6,0;
	setcastledata getarg(0),7,0;
	setcastledata getarg(0),8,0;
	setcastledata getarg(0),9,0;
	setcastledata getarg(0),10,0;
	setcastledata getarg(0),11,0;
	setcastledata getarg(0),12,0;
	setcastledata getarg(0),13,0;
	setcastledata getarg(0),14,0;
	setcastledata getarg(0),15,0;
	setcastledata getarg(0),16,0;
	setcastledata getarg(0),17,0;
	getcastledata getarg(0),0,getarg(1);
	announce "秘密基地 [" + getcastlename(getarg(0)) + "] 被 [" + getguildname(getarg(3)) + "] 工会让出了。",0;
	maprespawnguildid getarg(0),getcastledata(getarg(0),1),7;
	if (agitcheck(0)) donpcevent getarg(4);
	end;
	return;
}
//---------------------------------------------------------------
//华丽金属的破坏和秘密基地数据更新
//callfunc "resetcastledata2","MAP","::OnRecvCastleYYY";
function	script	resetcastledata2	{
	killmonsterall getarg(0);
	set @WinGuildID,getcharid(2);
	if (@WinGuildID <= 0) end;
	setcastledata getarg(0),1,@WinGuildID;
	set @Economy,getcastledata(getarg(0),2)-5;
	if (@Economy<1) set @Economy,1;
	setcastledata getarg(0),2,@Economy;
	set @Deffence,getcastledata(getarg(0),3)-5;
	if (@Deffence<1) set @Deffence,1;
	setcastledata getarg(0),3,@Deffence;
	setcastledata getarg(0),4,0;
	setcastledata getarg(0),5,0;
	setcastledata getarg(0),6,0;
	setcastledata getarg(0),7,0;
	setcastledata getarg(0),8,0;
	setcastledata getarg(0),9,0;
	setcastledata getarg(0),10,0;
	setcastledata getarg(0),11,0;
	setcastledata getarg(0),12,0;
	setcastledata getarg(0),13,0;
	setcastledata getarg(0),14,0;
	setcastledata getarg(0),15,0;
	setcastledata getarg(0),16,0;
	setcastledata getarg(0),17,0;
	announce "秘密基地 [" + getcastlename(getarg(0)) + "] 被 [" + getguildname(@WinGuildID) + "] 工会占领了。",0;
	mapannounce getarg(0),"华丽金属被破坏了",17;
	getcastledata getarg(0),0,getarg(1);
	return;
}
//---------------------------------------------------------------
//解散工会时的秘密基地数据更新
//callfunc "resetcastledata3","MAP","::OnRecvCastleYYY","::OnGDEMPSetYYY";
function	script	resetcastledata3	{
	killmonsterall getarg(0);
	setcastledata getarg(0),1,0;
	setcastledata getarg(0),2,1;
	setcastledata getarg(0),3,1;
	setcastledata getarg(0),4,0;
	setcastledata getarg(0),5,0;
	setcastledata getarg(0),6,0;
	setcastledata getarg(0),7,0;
	setcastledata getarg(0),8,0;
	setcastledata getarg(0),9,0;
	setcastledata getarg(0),10,0;
	setcastledata getarg(0),11,0;
	setcastledata getarg(0),12,0;
	setcastledata getarg(0),13,0;
	setcastledata getarg(0),14,0;
	setcastledata getarg(0),15,0;
	setcastledata getarg(0),16,0;
	setcastledata getarg(0),17,0;
	getcastledata getarg(0),0,getarg(1);
	maprespawnguildid getarg(0),getcastledata(getarg(0),1),7;
	if (agitcheck(0)) donpcevent getarg(2);
	end;
	return;
}
//---------------------------------------------------------------
//工会宝箱刷新处理
//callfunc "make_t_box","MAP",x0,y0,x1,y1,MobID1,MobID2;
function	script	make_t_box	{
	setcastledata getarg(0),2,getcastledata(getarg(0),2)+getcastledata(getarg(0),4);
	setcastledata getarg(0),3,getcastledata(getarg(0),3)+getcastledata(getarg(0),5);
	setcastledata getarg(0),4,0;//重置投资商业度的次数
	setcastledata getarg(0),5,0;//重置投资防御度的次数
	killmonster getarg(0),"TresureBox";
	set $@boxnum1,2+(getcastledata(getarg(0),2)+5)/10;
	set $@boxnum2,2+getcastledata(getarg(0),2)/10;
	if ($@boxnum1 > 12)	set $@boxnum1,12;
	if ($@boxnum2 > 12)	set $@boxnum2,12;
	areamonster getarg(0),getarg(1),getarg(2),getarg(3),getarg(4),"宝箱",getarg(5),$@boxnum1,"TresureBox";
	areamonster getarg(0),getarg(1),getarg(2),getarg(3),getarg(4),"宝箱",getarg(6),$@boxnum2,"TresureBox";
	return;
}
//---------------------------------------------------------------
//攻城战开始处理
//callfunc "agitstarting","MAP","OnGDEMPSetYYY";
function	script	agitstarting	{
	maprespawnguildid getarg(0),getcastledata(getarg(0),1),2;
	donpcevent getarg(1);
	GvgOn getarg(0);
	return;
}
//---------------------------------------------------------------
//旗
//callfunc "flagsc","MAP",AreaFlag,ReturnFlag,X,Y;
//*AreaFlag 1=Aldebaran,2=Other
//*ReturnFlag 1=Allow,2=Deny
function	script	flagsc	{
	set @GID,getcastledata(getarg(0),1);
	if (@GID != 0) goto LStartg;
		mes "[ 普隆德拉王国  公告令 ]";
		mes " ";
		mes "1.";
		switch ( getarg(1) ) {
		case 1:	mes "这里是普隆德拉王国";
			mes "根据修发兹共和国的协定";
			break;
		case 2:	mes "这里是普隆德拉王国";
			mes "根据这里的普隆德拉王国令";
		}
		mes "把这里公布为没有正式所有权的旗帜";
		next;
		mes " ";
		mes "2.";
		mes "战胜守在这里的可怕的考验之后";
		mes "并破坏华丽金属的人";
		mes "会赐予经国王认证的秘密基地所有权";
		close;
LStartg:
		if ((getcharid(2) == @GID) && (getarg(2) == 1)) goto LStartg2;
		mes "[ 普隆德拉王国  公告令 ]";
		mes " ";
		mes "1.";
		switch ( getarg(1) ) {
		case 1:	mes "这里是普隆德拉王国";
			mes "根据修发兹共和国的协定";
			break;
		case 2:	mes "这里是普隆德拉王国";
			mes "根据这里的普隆德拉王国令";
		}
		mes "这里被认定为 ^ff0000 " + getguildname(@GID) + " ^000000 工会的私有物";
		next;
		mes " ";
		mes "2.";
		mes "^ff0000 " + getguildname(@GID) + " ^000000 工会的主人是";
		mes "^ff0000 " + getguildmaster(@GID) + " ^000000 。";
		mes "无论是谁,对这件事情有意见者,";
		mes "请你举起您的剑,提高自己的名誉吧。";
Lclose:
		close;
LStartg2:
		mes "[ 声音 ]";
		mes "勇士啊…";
		mes "要回到您的名誉之地吗?";
		next;
		menu "回到秘密基地",-,"取消",Lclose;
			warp getarg(0),getarg(3),getarg(4);end;
		return;
}
//==============================================================================
//-------------------------------------------------------
//管理人菜单
//callfunc "Steward_menu0","MAP","NAME";
function	script	Steward_menu0	{
	set @GID,getcastledata(getarg(0),1);
	if (@GID == 0) goto LStart;
	if (getcharid(2) != @GID) goto LStart2;
	if (getcharid(0) == getguildmasterid(@GID)) goto LStart3;
	goto LStart2;
LStart:
	mes "[管理人"+getarg(1)+"]";
	mes "我将依据我的命运";
	mes "在等待我的主人。";
	mes "勇士啊…";
	mes "试验一下你的命运吧。";
	close;
LStart2:
	mes "[管理人"+getarg(1)+"]";
	mes "不管你们怎么威胁我";
	mes "我只愿意追随我的主人^ff0000" + getguildmaster(@GID);
	mes "^000000监护人你们在哪里呀!";
	mes "赶快把这个无理的家伙赶走吧!";
	close;
LStart3:
	mes "[管理人"+getarg(1)+"]";
	mes "欢迎光临,我的主人 ^ff0000"+getguildmaster(@GID)+"^000000 先生/小姐。";
	mes "请尽管吩咐,我将忠诚地为您完成任务。";
	next;
	return;
}
//-------------------------------------------------------
//管理人菜单ー1「查看秘密基地状况」(完全) 台词2004/08/05jRO
//callfunc "Steward_menu1","MAP","NAME";
function	script	Steward_menu1	{
	mes "[管理人"+getarg(1)+"]";
	mes "现在向您报告秘密基地的状况。";
	mes " ";
	mes "^0000ff现在商业发展度是"+getcastledata(getarg(0),2)+"。";
	if (getcastledata(getarg(0),4) != 0) mes "- 在过去1天之内,投资了 "+getcastledata(getarg(0),4)+" 次。";
	mes "现在的防御度是"+getcastledata(getarg(0),3)+"。^000000";
	if (getcastledata(getarg(0),5) != 0) mes "^0000ff- 在过去1天之内,投资了 "+getcastledata(getarg(0),5)+" 次。^000000";
	mes " ";
	mes "报告完毕。";
	close;
	return;
}
//-------------------------------------------------------
//管理人菜单ー2「投资商业发展度」(完全) 台词2004/08/25jRO
//callfunc "Steward_menu2","MAP","NAME";
function	script	Steward_menu2	{
	mes "[管理人"+getarg(1)+"]";
	mes "提高商业发展度的话";
	mes "在工会里生产的物品数量会增加";
	mes "为了以后着想的话";
	mes "不能不投资啊。";
	next;
	mes "[管理人"+getarg(1)+"]";
	mes "照原先的方式,一天只能投资一次";
	mes "假如多付一点金钱的话";
	mes "一天可以投资两次。";
	next;
	set @TriggerE,getcastledata(getarg(0),4);
	set @Economy,getcastledata(getarg(0),2);
	if(@Economy == 100) goto L2_error2;
	set @tmp,(@Economy-@TriggerE)/5;
	set @InvestE,5000*(1+(1+@tmp)*@tmp/2)*(1+3*@TriggerE);
	if (@TriggerE == 0) goto L2_1;
	if (@TriggerE == 1) goto L2_2;
		mes "[管理人"+getarg(1)+"]";
		mes "^ff0000可是您已经在今天之内投资了两次";
		mes "再不能投资了。";
		mes "^000000让发展度赶快上升";
		mes "期待着富贵的日子啰。";
		close;
L2_1:
	mes "[管理人"+getarg(1)+"]";
	mes "现在需要的投资金额是";
	mes "^ff0000"+ @InvestE +"^000000 Zeny";
	mes "请问您要投资吗?";
	next;
	menu "对商业发展度投资",L2_1_1,"取消",L2_1_0;
L2_2:
	mes "[管理人"+getarg(1)+"]";
	mes "现在您已经投资了一次";
	mes "还要再投资吗?";
	mes "需要花费 ^ff0000"+ @InvestE +"^000000 Zeny";

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -