Jump to content
  • 0

GVG SPECTATOR REQUEST THAT'S WORKING


Emonizer08

Question


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  45
  • Reputation:   2
  • Joined:  07/28/14
  • Last Seen:  

good day im requesting a GVG SPECTATOR THAT'S WORKING 

this one its not working. the .patch file 

prontera,153,178,4 script GvGPvP Watcher 414,{
    if ( select ( "go to pvp", "spectator" ) == 1 )
        warp "pvp_y_2-1",0,0;
    else {
        pcblockchat getcharid(3), 1;
        pcblockattack getcharid(3), 1;
        setoption 0x40, 1;
        warp "pvp_y_2-1",0,0;
    }    
    end;
OnPCLogoutEvent:
    setoption 0x40, 0;
    end;
}
pvp_y_2-1    mapflag    pvp

pcblockattack_pcblockchat_20140107.patch

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  477
  • Reputation:   269
  • Joined:  06/13/17
  • Last Seen:  

The patch still using Session Data instead of Unit Data. it's not updated.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  45
  • Reputation:   2
  • Joined:  07/28/14
  • Last Seen:  

so there's no fix to it? we need to wait for someone to update it?

Link to comment
Share on other sites

  • 0

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

yeah its too old, needs a complete revamp ...

 src/custom/script.inc     | 20 ++++++++++++++++++++
 src/custom/script_def.inc |  3 +++
 src/map/clif.cpp          |  2 +-
 src/map/pc.cpp            |  2 +-
 src/map/pc.hpp            |  2 ++
 5 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/src/custom/script.inc b/src/custom/script.inc
index 839b990cb..0e8751707 100644
--- a/src/custom/script.inc
+++ b/src/custom/script.inc
@@ -17,3 +17,23 @@
 //	script_pushint(st,1);
 //	return 0;
 //}
+
+BUILDIN_FUNC(pcblockchat) {
+	struct map_session_data *sd = map_id2sd( script_getnum(st,2) );
+	if ( !sd ) {
+		ShowWarning( "buildin_pcblockchat: Couldn't find RID '%d'\n", script_getnum(st,2) );
+		return SCRIPT_CMD_FAILURE;
+	}
+	sd->state.blockedchat = script_getnum(st,3) > 0;
+	return SCRIPT_CMD_SUCCESS;
+}
+
+BUILDIN_FUNC(pcblockattack) {
+	struct map_session_data *sd = map_id2sd( script_getnum(st,2) );
+	if ( !sd ) {
+		ShowWarning( "buildin_pcblockattack: Couldn't find RID '%d'\n", script_getnum(st,2) );
+		return SCRIPT_CMD_FAILURE;
+	}
+	sd->state.blockedattack = script_getnum(st,3) > 0;
+	return SCRIPT_CMD_SUCCESS;
+}
diff --git a/src/custom/script_def.inc b/src/custom/script_def.inc
index 886399273..63e683e82 100644
--- a/src/custom/script_def.inc
+++ b/src/custom/script_def.inc
@@ -9,3 +9,6 @@
  **/
 
 //BUILDIN_DEF(example,""),
+
+BUILDIN_DEF(pcblockchat,"ii"),
+BUILDIN_DEF(pcblockattack,"ii"),
diff --git a/src/map/clif.cpp b/src/map/clif.cpp
index 72a596a25..d8631a6fc 100644
--- a/src/map/clif.cpp
+++ b/src/map/clif.cpp
@@ -10110,7 +10110,7 @@ static bool clif_process_message(struct map_session_data* sd, bool whisperFormat
 	if( is_atcommand( fd, sd, out_message, 1 )  )
 		return false;
 
-	if (sd->sc.cant.chat)
+	if (sd->sc.cant.chat || sd->state.blockedchat)
 		return false; //no "chatting" while muted.
 
 	if( battle_config.min_chat_delay ) { //[Skotlex]
diff --git a/src/map/pc.cpp b/src/map/pc.cpp
index 5aace7ecb..7a9bce86e 100755
--- a/src/map/pc.cpp
+++ b/src/map/pc.cpp
@@ -9106,7 +9106,7 @@ bool pc_candrop(struct map_session_data *sd, struct item *item)
 bool pc_can_attack( struct map_session_data *sd, int target_id ) {
 	nullpo_retr(false, sd);
 
-	if( pc_is90overweight(sd) || pc_isridingwug(sd) )
+	if( pc_is90overweight(sd) || pc_isridingwug(sd) || sd->state.blockedattack )
 		return false;
 
 	if( sd->sc.data[SC_BASILICA] ||
diff --git a/src/map/pc.hpp b/src/map/pc.hpp
index ea5465bc8..9bcc01a88 100644
--- a/src/map/pc.hpp
+++ b/src/map/pc.hpp
@@ -256,6 +256,8 @@ struct map_session_data {
 		unsigned int night :1; //Holds whether or not the player currently has the SI_NIGHT effect on. [Skotlex]
 		unsigned int using_fake_npc :1;
 		unsigned int rewarp :1; //Signals that a player should warp as soon as he is done loading a map. [Skotlex]
+		unsigned int blockedattack : 1;
+		unsigned int blockedchat : 1;
 		unsigned int killer : 1;
 		unsigned int killable : 1;
 		unsigned int doridori : 1;
prontera,153,178,4	script	GvGPvP Watcher	414,{
	if ( select ( "go to pvp", "spectator" ) == 2 ) {
		pcblockchat getcharid(3), true;
		pcblockattack getcharid(3), true;
		pcblockskill getcharid(3), true;
		setoption Option_Invisible, true;
	}    
	warp "pvp_y_2-1",0,0;
	end;
OnPCLogoutEvent:
	setoption Option_Invisible, false;
	end;
}
pvp_y_2-1	mapflag	pvp
pvp_y_2-1	mapflag	nowarp
pvp_y_2-1	mapflag	nowarpto
pvp_y_2-1	mapflag	nosave	SavePoint

 

btw rathena developer still didn't do anything about that pull request ...
https://github.com/rathena/rathena/pull/3209

 

Edited by AnnieRuru
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  45
  • Reputation:   2
  • Joined:  07/28/14
  • Last Seen:  

annie how about the cell block if someone hide on that cell then the player cant forward because there's a invi player there.

BTW its working. emotion is my probleim can emote inside the map i wonder how to disabled it.

Cell Block Also can forward.

Edited by Emonizer08
wrong
Link to comment
Share on other sites

  • 0

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

1. cell blocking ... already said there ..
https://rathena.org/board/topic/118069-war-event-watcher-request/?do=findComment&comment=356824
change "official_cell_stack_limit" then "@reloadbattleconf"

2. for emotion ... not going to do this openly ...

want to start concentrate more on hercules ... so hope you can get someone else to help, or buy this mod

 

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...