Jump to content
  • 0

Boss Time Attack


nasagnilac

Question


  • Group:  Members
  • Topic Count:  89
  • Topics Per Day:  0.02
  • Content Count:  232
  • Reputation:   15
  • Joined:  11/02/13
  • Last Seen:  

Hellow guys... Im enchancing the BTA script of Bahmut .. Its already edited as you can see the codes... I just have problem when running the script can you help me find the error?

//===== rAthena Script ======================================= 
//= MVP Time Attack
//===== By: ================================================== 
//= Bahmut 
//= Freecs => http://rathena.org/board/user/949-jin-freecs/
//===== Current Version: ===================================== 
//= 1.0 Initial Release
//============================================================ 

-	script		BTA	-1,{

OnInit:
// ---------------------------------------------------------------------------
// - NPC Command
	bindatcmd "bta","BTA::OnDoBTA",99,99;
	end;

OnDoBTA:
// - NPC Config
// ---------------------------------------------------------------------------
	set .@mapName$,"pvp_2vs2";		// On which map should the event be
	set .@spawnCordX,40;			// X-Cordinate where the mob spawns
	set .@spawnCordY,33;			// Y-Cordinate where the mob spawns
	set .@minGmRank,99;				// Minimal GM level to use this script
	set .@globalAnnounce,0;			// Should the script announce kills global
	set .@MvPList[0],1150,1511,1373,1719,1785,1768;

	if (getgmlevel() < .@minGmRank) end;
		
	if ( compare( .@atcmd_parameters$, "on" ) ) {
	goto OnEnable;
	}else if ( compare( .@atcmd_parameters$, "off" ) ) {
	goto OnDisable;
	}
	end;


// ---------------------------------------------------------------------------
// - End Monster Labels ------------------------------------------------------
// ---------------------------------------------------------------------------
	
	OnEnable:
		if (.@globalAnnounce == 1) {
			announce "Boss Time Attack: We will start in 5",0;
			sleep2 1500;
			announce "Boss Time Attack: 4",0;
			sleep2 1500;
			announce "Boss Time Attack: 3",0;
			sleep2 1500;
			announce "Boss Time Attack: 2",0;
			sleep2 1500;
			announce "Boss Time Attack: 1",0;
			sleep2 1500;
			announce "Boss Time Attack: GO!",0;
			sleep2 1000;
			announce "Boss Time Attack: Moonlight Flower will be summoned.",0;
		} else {
			mapannounce .@mapName$,"Boss Time Attack: We will start in 5",0;
			sleep2 1500;
			mapannounce .@mapName$,"Boss Time Attack: 4",0;
			sleep2 1500;
			mapannounce .@mapName$,"Boss Time Attack: 3",0;
			sleep2 1500;
			mapannounce .@mapName$,"Boss Time Attack: 2",0;
			sleep2 1500;
			mapannounce .@mapName$,"Boss Time Attack: 1",0;
			sleep2 1500;
			mapannounce .@mapName$,"Boss Time Attack: GO!",0;
			sleep2 1500;
			mapannounce .@mapName$,"Boss Time Attack: Moonlight Flower will be summoned.",0;
		}

		sleep2 1000;
		set .MOBStartTick, gettimetick(2);
		set .MOBKillTime, 0;
		set .MOBKillCount, 0;
		set .@i,1;
		goto OnSpawn;
		end;
		
	OnSpawn:
		monster .@mapName$,.@spawnCordX,.@spawnCordY,"+getmonsterinfo(.@MvPList[.@i],0)+","+.@MvPList[.@i]+",1,"BTA::OnBTAKilled";
		end;

	OnBTAKilled:
		set .MOBKillCount, .MOBKillCount+ 1;
		set .@i,.@i + 1;
		if(.MOBKillCount < getarraysize(.@MvPList)){
		goto OnSpawn;
		}else{
		goto OnBTAKilledall;
		}
		end;

	OnBTAKilledall:
		set .MOBKillTime, gettimetick(2) - .MOBStartTick;
		if (.@globalAnnounce == 1) {
		announce "Boss Time Attack: Time " + (.MOBKillTime / 60)+ "min" + (.MOBKillTime % 60) + "sec",0;
		}else{
		mapannounce .@mapName$,"Boss Time Attack: Time " + (.MOBKillTime / 60)+ "min" + (.MOBKillTime % 60) + "sec",0;
		}
		end;
	OnDisable:
		killmonster .@mapName$,"All";
		set .MOBKillTime, gettimetick(2) - .MOBStartTick;
		if (.@globalAnnounce == 1) {
		announce "Boss Time Attack: Concede Time " + (.MOBKillTime / 60)+ "min" + (.MOBKillTime % 60) + "sec",0;
		}else{
		mapannounce .@mapName$,"Boss Time Attack: Concede Time " + (.MOBKillTime / 60)+ "min" + (.MOBKillTime % 60) + "sec",0;
		}
		end;


}


pvp_2vs2	mapflag	monster_noteleport
pvp_2vs2	mapflag	nobranch
pvp_2vs2	mapflag	noreturn
pvp_2vs2	mapflag	noteleport
pvp_2vs2	mapflag	nomemo
pvp_2vs2	mapflag	nowarpto
pvp_2vs2	mapflag	nowarp

Link to comment
Share on other sites

4 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  127
  • Topics Per Day:  0.03
  • Content Count:  1445
  • Reputation:   164
  • Joined:  08/17/13
  • Last Seen:  

what's the error that your emulator shows? ss?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

there's quite a few errors in the script

 

script error on npc/custom1/zzz.txt line 26
    parse_line: expected ';'
    21 :        set .@mapName$,"pvp_2vs2";              // On which map should the event be
    22 :        set .@spawnCordX,40;                    // X-Cordinate where the mob spawns
    23 :        set .@spawnCordY,33;                    // Y-Cordinate where the mob spawns
    24 :        set .@minGmRank,99;                             // Minimal GM level to use this script
    25 :        set .@globalAnnounce,0;                 // Should the script announce kills global
*   26 :        set .@MvPList[0],1150','1511,1373,1719,1785,1768;
    27 :
    28 :        if (getgmlevel() < .@minGmRank) end;
    29 :
    30 :        if ( compare( .@atcmd_parameters$, "on" ) ) {
    31 :        goto OnEnable;
[Warning]: Unexpected type for argument 5. Expected number.
[Debug]: Data: string value="+.@MvPList[.@i]+"
[Debug]: Function: monster
[Debug]: Source (NPC): BTA (invisible/not on a map)
[Warning]: buildin_monster: Attempted to spawn non-existing monster class 0
also, your variable usage pretty much mess up

OnDoBTA:
// - NPC Config
// ---------------------------------------------------------------------------
	set .@mapName$,"pvp_2vs2";		// On which map should the event be
	set .@spawnCordX,40;			// X-Cordinate where the mob spawns
	set .@spawnCordY,33;			// Y-Cordinate where the mob spawns
.....
	end;
.....
	OnSpawn:
		monster .@mapName$,.@spawnCordX,.@spawnCordY,"+getmonsterinfo(.@MvPList[.@i],0)+","+.@MvPList[.@i]+",1,"BTA::OnBTAKilled";
I'm sure the .@mapName$ here will be an empty string ...

well since you posted in scripting support, I guess this is your script ?

this script quite mess up though

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  89
  • Topics Per Day:  0.02
  • Content Count:  232
  • Reputation:   15
  • Joined:  11/02/13
  • Last Seen:  

I script it but the ideas come first from bahmut.


I already the fixed the errors

I forgot to set this into array..

set .@MvPList[0],1150','1511,1373,1719,1785,1768;

Here is the fix script but there is an another problem when I kill moonlight flower as the first mvp.. the second mvp dont appear is this part is correct?

	OnBTAKilled:
		set .MOBKillCount, .MOBKillCount + 1;
		set .@i,.@i + 1;
		if(.MOBKillCount < getarraysize(.@MvPList)){
		goto OnSpawn;
		}else{
		goto OnBTAKilledall;
		}
		end;

-	script	BTA	-1,{

OnInit:
// ---------------------------------------------------------------------------
// - NPC Command
	bindatcmd "bta","BTA::OnDoBTA",99,99;
	end;

OnDoBTA:
// - NPC Config
// ---------------------------------------------------------------------------
	set .@mapName$,"pvp_2vs2";		// On which map should the event be
	set .@spawnCordX,40;			// X-Cordinate where the mob spawns
	set .@spawnCordY,33;			// Y-Cordinate where the mob spawns
	set .@minGmRank,99;				// Minimal GM level to use this script
	set .@globalAnnounce,0;			// Should the script announce kills global
	setarray .@MvPList[0],1150,1511,1373,1719,1785,1768;
	
	if (getgmlevel() < .@minGmRank) end;
		
	if ( compare( .@atcmd_parameters$, "on" ) ) {
	goto OnEnable;
	}else if ( compare( .@atcmd_parameters$, "off" ) ) {
	goto OnDisable;
	}
	end;


// ---------------------------------------------------------------------------
// - End Monster Labels ------------------------------------------------------
// ---------------------------------------------------------------------------
	
	OnEnable:
		if (.@globalAnnounce == 1) {
			announce "Boss Time Attack: We will start in 5",0;
			sleep2 1500;
			announce "Boss Time Attack: 4",0;
			sleep2 1500;
			announce "Boss Time Attack: 3",0;
			sleep2 1500;
			announce "Boss Time Attack: 2",0;
			sleep2 1500;
			announce "Boss Time Attack: 1",0;
			sleep2 1500;
			announce "Boss Time Attack: GO!",0;
			sleep2 1000;

		} else {
			mapannounce .@mapName$,"Boss Time Attack: We will start in 5",0;
			sleep2 1500;
			mapannounce .@mapName$,"Boss Time Attack: 4",0;
			sleep2 1500;
			mapannounce .@mapName$,"Boss Time Attack: 3",0;
			sleep2 1500;
			mapannounce .@mapName$,"Boss Time Attack: 2",0;
			sleep2 1500;
			mapannounce .@mapName$,"Boss Time Attack: 1",0;
			sleep2 1500;
			mapannounce .@mapName$,"Boss Time Attack: GO!",0;
			sleep2 1500;

		}

		sleep2 1000;
		set .MOBStartTick, gettimetick(2);
		set .MOBKillTime, 0;
		set .MOBKillCount, 0;
		set .@i,0;
		goto OnSpawn;
		end;
		
	OnSpawn:
		if (.@globalAnnounce == 1) {
		announce "Boss Time Attack: "+getmonsterinfo(.@MvPList[.@i],0)+" will be summoned.",0;
	      } else {
		mapannounce .@mapName$,"Boss Time Attack: "+getmonsterinfo(.@MvPList[.@i],0)+" will be summoned.",0;
		}
		monster .@mapName$,.@spawnCordX,.@spawnCordY,getmonsterinfo(.@MvPList[.@i],0),.@MvPList[.@i],1,"BTA::OnBTAKilled";
		end;

	OnBTAKilled:
		set .MOBKillCount, .MOBKillCount + 1;
		set .@i,.@i + 1;
		if(.MOBKillCount < getarraysize(.@MvPList)){
		goto OnSpawn;
		}else{
		goto OnBTAKilledall;
		}
		end;

	OnBTAKilledall:
		set .MOBKillTime, gettimetick(2) - .MOBStartTick;
		if (.@globalAnnounce == 1) {
		announce "Boss Time Attack: Time " + (.MOBKillTime / 60)+ "min" + (.MOBKillTime % 60) + "sec",0;
		}else{
		mapannounce .@mapName$,"Boss Time Attack: Time " + (.MOBKillTime / 60)+ "min" + (.MOBKillTime % 60) + "sec",0;
		}
		end;
	OnDisable:
		killmonster .@mapName$,"All";
		set .MOBKillTime, gettimetick(2) - .MOBStartTick;
		if (.@globalAnnounce == 1) {
		announce "Boss Time Attack: Concede Time " + (.MOBKillTime / 60)+ "min" + (.MOBKillTime % 60) + "sec",0;
		}else{
		mapannounce .@mapName$,"Boss Time Attack: Party Concede",0;
		}
		end;


}


pvp_2vs2	mapflag	monster_noteleport
pvp_2vs2	mapflag	nobranch
pvp_2vs2	mapflag	noreturn
pvp_2vs2	mapflag	noteleport
pvp_2vs2	mapflag	nomemo
pvp_2vs2	mapflag	nowarpto
pvp_2vs2	mapflag	nowarp

Edited by gmprestige
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

like I said previously

 

also, your variable usage pretty much mess up

OnDoBTA:
// - NPC Config
// ---------------------------------------------------------------------------
	set .@mapName$,"pvp_2vs2";		// On which map should the event be
	set .@spawnCordX,40;			// X-Cordinate where the mob spawns
	set .@spawnCordY,33;			// Y-Cordinate where the mob spawns
.....
	end;
.....
	OnSpawn:
		monster .@mapName$,.@spawnCordX,.@spawnCordY,"+getmonsterinfo(.@MvPList[.@i],0)+","+.@MvPList[.@i]+",1,"BTA::OnBTAKilled";
I'm sure the .@mapName$ here will be an empty string ...
the reason why it can spawn on 1st one, because your script uses *goto

*goto script command can carry the scope variable over

but after it hits *end; then the scope variable vanish

after you summon your 1st mvp, the .@mapname$ variable still persist with *goto script command

but when you want to summon your 2nd mvp, the .@mapname$ variable already gone

because you trigger it with the monster's event label, which is "BTA::OnBTAKilled"

within those line where it trigger OnBTAKilled: until goto OnSpawn: label, you didn't set your .@mapname$ variable back

 

[Debug]: mapindex_name2id: Map "" not found in index list!
you have to change .@mapname$ into .mapname$

to make this variable exist throughout the script

Edited by AnnieRuru
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...