Jump to content
  • 0

Support for Goddameit Custom BG


alternate

Question


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  20
  • Reputation:   2
  • Joined:  06/26/16
  • Last Seen:  

Hi guys, i downloaded and tried to use goddameit's custom bg script and got the map working but the npc doesnt start any new conversation when i click on it.

 

code

//Author-Script		Goddameit	My forum : http://bit.ly/MDuQ9F	
//Author-Map		TrojanWorm
//Version		2012-10-31

//Don't re-release in anywhere and anyway

//////////////////////////////////////////////////////////////////////////

endless_war	mapflag	battleground	2
endless_war,218,86,0	script	#BattleGroundwarpA2	100,{
	end;
OnInit:
	waitingroom "Join Team A(Click)",2,"#BattleGroundwarpA2::OnJoin",1;
	end;
OnJoin:
	if(!$@bg_id_a)
		set $@bg_id_a,waitingroom2bg("endless_war",205,85,"","");
	else
		waitingroom2bg_single($@bg_id_a,"endless_war",205,85,"#BattleGroundwarpA2");
	warpwaitingpc "endless_war",205,85;
	end;
}
endless_war,40,86,0	script	#BattleGroundwarpB2	100,{
	end;
OnInit:
	waitingroom "Join Team B(Click)",2,"#BattleGroundwarpB2::OnJoin",1;
	end;
OnJoin:
	if(!$@bg_id_
		set $@bg_id_b,waitingroom2bg("endless_war",53,85,"","");
	else
	waitingroom2bg_single($@bg_id_b,"endless_war",53,85,"#BattleGroundwarpB2");
	warpwaitingpc "endless_war",53,85;
	end;
}
endless_war,165,86,0	script	#BattleGroundwarpA1	45,2,2,{
	warp "endless_war",161,86;
	end;
}
endless_war,90,86,0	script	#BattleGroundwarpB1	45,2,2,{
	warp "endless_war",94,86;
	end;
}
prontera,150,180,4	script	Battle Ground	100,{
	if(.status==2)
	{
		mes "Game is running.";
		close;
	}
	if(.status==1)
	{
		if(.playernm>=128)
		{
			mes "Sorry, full";
			close;
		}
		select("Join");
		if(!.playerid[1])
		{
			//callsub OnEndd;
			initnpctimer;
		}
		set .playernm,.playernm+1;
		set .playerid[.playernm],getcharid(0);
		mes "Complete";
		close;
	}
	end;
OnClock0100:
OnClock0300:
OnClock0500:
OnClock0700:
OnClock0900:
OnClock1100:
OnClock1300:
OnClock1500:
OnClock1700:
OnClock1900:
OnClock2100:
OnClock2300:
	callsub OnActive;
	end;
OnActive:
	callsub OnEndd;
	set .status,1;
	Announce "[Battle Ground]:Someone active the game! Go to prontera,150,180 and join us!",0;
	end;
OnTimer60000:
	if(.playernm<=32)
	{
		Announce "[Battle Ground]:Sorry, player amount isn't enough",0;
		callsub OnEndd;
		end;
	}
	Announce "[Battle Ground]:Event is ready!",0;
	for(set .@i,1;.@i<=.playernm;set .@i,.@i+1)
	{
		if(.@i%2==0)
			warpchar "endless_war",218,86,.playerid[.@i];
		else
			warpchar "endless_war",40,86,.playerid[.@i];
	}
	callsub OnEnab2;
	end;
OnTimer90000:
	set .status,2;
	Announce "[Battle Ground]:Go!",0;
	bg_monster $@bg_id_a,"endless_war",128,120,"A",1907,"Battle Ground::OnAdestory";
	bg_monster $@bg_id_b,"endless_war",127,46,"B",1907,"Battle Ground::OnBdestory";
	callsub OnEnab1;
	end;
OnTimer190000:
	if(.point[1]>.point[2])
	{
		Announce "[Battle Ground]:Team A Win!",0;
	}else if(.point[2]>.point[1])
	{
		Announce "[Battle Ground]:Team B Win!",0;
	}else
	{
		Announce "[Battle Ground]:Draw!",0;
	}
	sleep2 3000;
	callsub OnEndd;	
	end;
OnBdestory:
	set .point[1],.point[1]+5;
	set .point[2],.point[2]-3;
	bg_updatescore "endless_war",.point[1],.point[2];
	detachrid;
	sleep2 10000;
	bg_monster $@bg_id_b,"endless_war",127,46,"B",1907,"Battle Ground::OnBdestory";
	end;
OnAdestory:
	set .point[2],.point[2]+5;
	set .point[1],.point[1]-3;
	bg_updatescore "endless_war",.point[1],.point[2];
	detachrid;
	sleep2 10000;
	bg_monster $@bg_id_a,"endless_war",128,120,"A",1907,"Battle Ground::OnAdestory";
	end;
OnEndd:
	set .status,0;
	bg_destroy $@bg_id_a;
	bg_destroy $@bg_id_b;
	set $@bg_id_a,0;
	set $@bg_id_b,0;
	setarray .point[1],0,0;
	killmonsterall "endless_war";
	bg_updatescore "endless_war",.point[1],.point[2];
	deletearray .playerid[0],128;
	mapwarp "endless_war","prontera",150,180;
	callsub OnDisa;
	return;
OnEnab1:
	enablenpc "#BattleGroundwarpA1";
	enablenpc "#BattleGroundwarpB1";
	return;
OnEnab2:
	enablenpc "#BattleGroundwarpA2";
	enablenpc "#BattleGroundwarpB2";
	return;
OnDisa:
	disablenpc "#BattleGroundwarpA1";
	disablenpc "#BattleGroundwarpB1";
	disablenpc "#BattleGroundwarpA2";
	disablenpc "#BattleGroundwarpB2";
	return;
OnInit:
	sleep2 10000;
	setwall "endless_war",218,87,1,1,0,"BattleGroundwarpA21";
	setwall "endless_war",219,87,1,1,0,"BattleGroundwarpA22";
	setwall "endless_war",219,86,1,1,0,"BattleGroundwarpA23";
	setwall "endless_war",219,85,1,1,0,"BattleGroundwarpA24";
	setwall "endless_war",218,85,1,1,0,"BattleGroundwarpA25";
	setwall "endless_war",217,85,1,1,0,"BattleGroundwarpA26";
	setwall "endless_war",217,86,1,1,0,"BattleGroundwarpA27";
	setwall "endless_war",217,87,1,1,0,"BattleGroundwarpA28";
	setwall "endless_war",40,87,1,1,0,"BattleGroundwarpB21";
	setwall "endless_war",41,87,1,1,0,"BattleGroundwarpB22";
	setwall "endless_war",41,86,1,1,0,"BattleGroundwarpB23";
	setwall "endless_war",41,85,1,1,0,"BattleGroundwarpB24";
	setwall "endless_war",40,85,1,1,0,"BattleGroundwarpB25";
	setwall "endless_war",39,85,1,1,0,"BattleGroundwarpB26";
	setwall "endless_war",39,86,1,1,0,"BattleGroundwarpB27";
	setwall "endless_war",39,87,1,1,0,"BattleGroundwarpB28";
	callsub OnEndd;
	end;
OnPCKillEvent:
	if(strcharinfo(3)=="endless_war" && $@bg_id_a && $@bg_id_
	{
		if(getcharid(4) == $@bg_id_a)
		{
			set .point[1],.point[1]+1;
		}else
			set .point[2],.point[2]+1;
		bg_updatescore "endless_war",.point[1],.point[2];
	}
	end;
}

i suppose the problem may be on this part 

prontera,150,180,4	script	Battle Ground	100,{
	if(.status==2)
	{
		mes "Game is running.";
		close;
	}
	if(.status==1)
	{
		if(.playernm>=128)
		{
			mes "Sorry, full";
			close;
		}
		select("Join");
		if(!.playerid[1])
		{
			//callsub OnEndd;
			initnpctimer;
		}
		set .playernm,.playernm+1;
		set .playerid[.playernm],getcharid(0);
		mes "Complete";
		close;
	}
Edited by alternate
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  92
  • Reputation:   17
  • Joined:  08/11/12
  • Last Seen:  

@alternate

 

Hello buddy, how are you? Your problem have no relation with that part of the script that you have mentioned. While talking to the NPC if the variable .status have not been yet initialized you will find the scenario that you're now.

Now, take a look at this:
 

OnClock0100:
OnClock0300:
OnClock0500:
OnClock0700:
OnClock0900:
OnClock1100:
OnClock1300:
OnClock1500:
OnClock1700:
OnClock1900:
OnClock2100:
OnClock2300:
	callsub OnActive;
	end;
OnActive:
	callsub OnEndd;
	set .status,1;
	Announce "[Battle Ground]:Someone active the game! Go to prontera,150,180 and join us!",0;
	end;

As you can see in the above part of the same script, there are lots of OnClock Events that when triggered starts the execution of the OnActive Sub. In the OnActive Sub, as you can see, the value of the .status variable is set to 1 and then the event is started and the NPC will be available for clicking etc...

I don't see anything wrong with this script except by the fact that it needs an extra check to see if the event is available (.status != 0) or not (.status == 0).
 

C ya!

Edited by _Okuz_
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  20
  • Reputation:   2
  • Joined:  06/26/16
  • Last Seen:  

Alright! thanks for the explanation _Okuz_

 

i got it! now i got something else to report

 

 

as i iniciate the game, the points are alright but when i break any stone the counter at the corner of the window disappears

 

any thoughts? 

 

@edit

maybe its an hexed bug?

post-40087-0-80977700-1467844313_thumb.jpg

Edited by alternate
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  92
  • Reputation:   17
  • Joined:  08/11/12
  • Last Seen:  

Hmm I don't think this issue has been caused by the script itself. When playing battlegrounds there is only one command to update scores, bg_updatescore.
 

*bg_updatescore "<map name>",<Guillaume Score>,<Croix Score>;


This command will force the update of the displayed scoreboard.
It is only usable when the map is defined as a Type 2 Battleground:
mapflag    <map name>    battleground    2

 

According to this command description, you must have the battleground 2 flag enabled on the target map. As you can see the first command that we find is the battleground 2 flag so I guess this can be an hexed or packet issue maybe.

 Are you able to test another hexed?

Edited by _Okuz_
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...