Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function script is_party_leader {
- if ( !getcharid(1) )
- return False;
- if ( getcharid(0) == getpartyleader(getcharid(1),2) )
- return True;
- else
- return False;
- }
- function script F_instanceinfo {
- disable_items;
- .@cooldown = getd("cooldown"+getarg(8))-gettimetick(2)+getarg(7);
- .@Hertired = (.@cooldown/3600)%60;
- .@Mintired = (.@cooldown/60)%60;
- .@Sectired = .@cooldown%60;
- if ( !getcharid(1) ){
- mes "["+getarg(0)+"]";
- mes "需要組隊才能與我對話。";
- end;
- }
- mes "["+getarg(0)+"]";
- mes "- 副本名稱 : "+getarg(1)+"";
- if ( getarg(3) != 185 ) mes "- 等級限制 : "+getarg(2)+" ~ "+getarg(3)+" 等間可進入.";
- if ( getarg(3) == 185 ) mes "- 等級限制 : "+getarg(2)+" 等以上可進入.";
- if ( getarg(4)+getarg(5) > 2 ) mes "- 組隊人數 : "+getarg(4)+" ~ "+getarg(5)+" 人間可申請.";
- if ( getarg(4)+getarg(5) <= 2 ) mes "- 組隊人數 : 僅 "+getarg(4)+" 人可申請.";
- if ( ( getarg(6) % 60 ) == 0 ) mes "- 挑戰時間 : "+((getarg(6)/60)/60)+" 小時";
- if ( ( getarg(6) % 60 ) != 0 ) mes "- 挑戰時間 : "+((getarg(6)/60)/60)+" 小時 "+(getarg(6)%60)+" 分";
- if ( ( getarg(7) % 60 ) == 0 ) mes "- 冷卻時間 : "+((getarg(7)/60)/60)+" 小時";
- if ( ( getarg(7) % 60 ) != 0 ) mes "- 冷卻時間 : "+((getarg(7)/60)/60)+" 小時 "+(getarg(7)%60)+" 分";
- if ( .@cooldown > 0 ) mes "- 剩餘冷卻時間 : "+.@Hertired+"時"+.@Mintired+"分"+.@Sectired+"秒";
- return;
- }
- function script F_instancemenu {
- disable_items;
- .@inst_id = instance_id(1);
- if ( is_party_leader(getcharid(1)) ){
- switch(select((.@inst_id?"":"> 創建"+getarg(1)+"副本"),(!.@inst_id?"":"> 進入"+getarg(1)+"副本"),(!.@inst_id?"":"> 銷毀副本"),"> 取消對話")){
- case 1:
- return 1;
- case 2:
- return 2;
- case 3:
- return 3;
- case 4:
- end;
- }
- return 0;
- } else {
- switch(select((!.@inst_id?"":"> 進入"+getarg(1)+"副本"),"> 取消對話")){
- case 1:
- return 2;
- case 2:
- end;
- }
- }
- return 0;
- }
- function script F_instancecreat {
- disable_items;
- if(instance_create(getarg(1)) < 0) {
- message strcharinfo(0),""+getarg(1)+"副本創建失敗!";
- end;
- }
- 'ins_name$ = getarg(1);
- 'party_id = getcharid(1);
- deletearray 'Ip_Reward$;
- deletearray 'Ip_Reward2$;
- end;
- }
- function script F_instancequest {
- disable_items;
- if ( getarg(0) == "吉芬魔法大賽" ){
- for(set .@i,9284; .@i <= 9307; set .@i,.@i+1)
- if(checkquest(.@i) > -1) erasequest .@i;
- }
- if ( getarg(0) == "古代的克雷斯特漢姆古城" || getarg(0) == "古代的克雷斯特漢姆(困難)" ){
- if (checkquest(12318) > -1) erasequest 12318;
- if (checkquest(12319) > -1) erasequest 12319;
- if (checkquest(12318) == -1) setquest 12318;
- if (checkquest(12319) == -1) setquest 12319;
- }
- return;
- }
- function script F_instancenter {
- disable_items;
- // 冷卻計算
- .@cooldown = getd("cooldown"+getarg(4))-gettimetick(2)+getarg(5);
- .@Hertired = (.@cooldown/3600)%60;
- .@Mintired = (.@cooldown/60)%60;
- .@Sectired = .@cooldown%60;
- if ( 'ClearInatance ){
- mes "["+getarg(0)+"]";
- mes "副本已經完成, 不可以在進入。";
- end;
- }
- if( gettimetick(2) - getd("cooldown"+getarg(4)) < .@cooldown || .@cooldown > 0 ){;
- mes "["+getarg(0)+"]";
- mes "‧ 剩餘冷卻時間 : "+.@Hertired+"時"+.@Mintired+"分"+.@Sectired+"秒";
- end;
- }
- // 副本進入
- switch(instance_enter(getarg(1))) {
- case 2: message strcharinfo(0),""+getarg(1)+"副本數據不存在!"; break;
- case 1: message strcharinfo(0),"請先申請副本!"; break;
- case 3: message strcharinfo(0),"副本場地已滿或副本數據不存在!"; break;
- default:
- // 冷卻設置
- setd("cooldown"+getarg(4)),gettimetick(2);
- // 賦予任務
- F_instancequest(getarg(1));
- break;
- }
- end;
- }
- function script F_instancedestroy {
- disable_items;
- if ( instance_id() ) instance_destroy;
- return;
- }
- function script F_GetInstancePrize {
- disable_items;
- if( !instance_id() )
- end;
- if( getarg(1) != getcharid(1) )
- return;
- setarray .@in$,"魔物終結塔","封印的神殿","獸人的記憶","尼德霍格的巢穴","排水溝(簡單)","排水溝(困難)","章魚洞穴","噩夢死神","寶箱巨鱷","食月暴龍湖","古代的克雷斯特漢姆古城","驚駭森靈巢穴","中央實驗室","劍士之途";
- setarray .@item_id,501,501;
- setarray .@item_cnt,1,2;
- query_sql("SELECT `last_ip` FROM `login` WHERE `account_id` = '"+getcharid(3)+"'",.@Last_ip$);
- for ( .@i = 0; .@i < getarraysize('Ip_Reward$); .@i++ )
- if ( 'Ip_Reward$[.@i] == .@Last_ip$ )
- .@index = 1;
- for ( .@i = 0; .@i < getarraysize('Ip_Reward2$); .@i++ )
- if ( 'Ip_Reward2$[.@i] == .@Last_ip$ )
- .@index2 = 1;
- if ( !.@index || !.@index2 ){
- 'Reward$[getarraysize('Reward$)] = strcharinfo(0);
- if ( !.@index )
- 'Ip_Reward$[getarraysize('Ip_Reward$)] = .@Last_ip$;
- else
- 'Ip_Reward2$[getarraysize('Ip_Reward2$)] = .@Last_ip$;
- for ( .@i = 0; .@i < getarraysize(.@in$); .@i++ )
- if ( .@in$[.@i] == 'ins_name$ )
- .@idx = .@i;
- if ( .@item_id[.@idx] && .@item_cnt[.@idx] ){
- getitem .@item_id[.@idx],.@item_cnt[.@idx];
- dispbottom "[ 副本公告 ] 恭喜你通過了 "+.@in$[.@idx]+"副本, 獲得了 "+getitemname(.@item_id[.@idx])+"。",0xFFFAFA;
- }
- return;
- } else
- dispbottom "[ 副本公告 ] 檢測到 "+.@Last_ip$+" 與隊伍內有位成員一致, 故將您傳出副本。",0xFFFAFA;
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement