Jump to content
  • 0

Question

Posted
	if (!mobcount(strnpcinfo(2),"Agit#"+strnpcinfo(2)+"::OnAgitBreak")) {
		monster strnpcinfo(2),.@emproom[0],.@emproom[1],"Emperium",1288,1,"Agit#"+strnpcinfo(2)+"::OnAgitBreak";
	}
	end;

// The Emperium has been broken.
OnAgitBreak:
	set .@GID,getcharid(2);
	// Show and log error if an unguilded player breaks the Emperium. (Should NEVER happen)
	if (.@GID <= 0) {
		set .@notice$,"Character "+strcharinfo(0)+" ("+getcharid(0)+") broke the Emperium in Castle: "+strnpcinfo(2)+" while guildless. No data will be saved and Emperium respawned.";
 		logmes .@notice$; debugmes .@notice$;
		donpcevent "Agit#"+strnpcinfo(2)+"::OnStartArena";
		end;
	}
	// Adjust Economy Invest Level for Castle
	set .@Economy,GetCastleData(strnpcinfo(2),2) - 5;
	if (.@Economy < 0) set .@Economy, 0;
	SetCastleData strnpcinfo(2), 2, .@Economy;
	// Adjust Defense Invest Level for Castle
	set .@Defence,GetCastleData(strnpcinfo(2),3) - 5;
	if (.@Defence < 0) set .@Defence, 0;
	SetCastleData strnpcinfo(2), 3, .@Defence;

	// Set new Castle Occupant
	SetCastleData strnpcinfo(2),1, .@GID;

	// Announce that the Emperium is destroyed, and respawn all but new castle-occupants.
	mapannounce strnpcinfo(2),"The emperium has been destroyed.",bc_map|bc_woe,"0x00CCFF",FW_NORMAL,12;
	MapRespawnGuildID strnpcinfo(2),.@GID,6;

	// Refresh castle data, disable Kafra and reset Invest information.
	donpcevent strnpcinfo(0)+"::OnRecvCastle";
	disablenpc "Kafra Staff#"+strnpcinfo(2);
	for( set .@i, 4; .@i <= 9; set .@i, .@i+1 ) {
		SetCastleData strnpcinfo(2), .@i, 0;
	}
	// Erase Guardian Database information if the new owners do not have Guardian Research.
	if( getgdskilllv(.@GID,10002) == 0 ) {
		for( set .@i, 10; .@i <= 17; set .@i, .@i+1 ) {
			SetCastleData strnpcinfo(2), .@i, 0;
		}
	}
	// Respawn the Emperium, and display new owners.
	sleep 500; // Slow down script execution slightly.
	if( agitcheck() )
		donpcevent "Agit#"+strnpcinfo(2)+"::OnStartArena";
	sleep 7000;
	announce "The [" + getcastlename(strnpcinfo(2)) + "] castle has been conquered by the [" + getguildName(.@GID) + "] guild.",bc_all|bc_woe;
	//announce "Character "+strcharinfo(0)+" ("+getcharid(0)+") broke the Emperium.",bc_all|bc_woe; (THIS PART!!!!)
	end;

Hi everyone, I need help with this. All I'm trying is to, when someone break the emperium during WoE it also announces the character names of whoever broke it. 

announce "Character "+strcharinfo(0)+" ("+getcharid(0)+") broke the Emperium.",bc_all|bc_woe;

this line at the very end that I've commented out because did not work. I got the error of "script_rid2sd: fatal error ! player not attached! I do understand the error, however I don't know how to make it work. I tried to copy it from the other line above which is similar. I hope someone can help me and Thank you!. 

2 answers to this question

Recommended Posts

  • 0
Posted
trunk/npc/guild/agit_template.txt

Replace this line:
mapannounce strnpcinfo(2),"The emperium has been destroyed.",bc_map|bc_woe,"0x00CCFF",FW_NORMAL,12;

With this:
mapannounce strnpcinfo(2),"The emperium has been destroyed by " + strcharinfo(0),bc_map|bc_woe,"0x00CCFF",FW_NORMAL,12; 

====================================================
Find : 
// Respawn the Emperium, and display new owners.

Add before the line : 

set .@breaker$, strcharinfo(0);

Find : 
 
end;

// War of Emperium has ended.

Add before the line : 

announce "The [" + getcastlename(strnpcinfo(2)) + "] castle has been conquered by [ "+.@breaker$+" ] of the [" + getguildName(.@GID) + "] guild.",bc_all;

here..

  • Upvote 2
  • Love 1

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...