Jump to content
  • 0

Orc Face + Dual IP


cahadeyelo

Question


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  170
  • Reputation:   1
  • Joined:  11/13/14
  • Last Seen:  

can you help me guys how this script will prevent the killer and the victim to get the Karma & Fame point(s) if they have the same ip address.
 

-	script	orc_face	-1,{

OnInit:
	setitemscript 601,"{ if ( [email protected]<script data-cfhash='f9e31' type="text/javascript">/*  */</script>_face ) itemskill \"AL_TELEPORT\",1; }";
	setitemscript 602,"{ if ( [email protected]/*  */_face ) itemskill \"AL_TELEPORT\",3; }";
	end;

OnPCKillEvent:
	if( baselevel < 175 ) { end; }
	if( killedrid == getcharid(3) ) { end; }
	if( getstatus( SC_ORCISH ) ) { end; }
	set FAMEPOINTS,FAMEPOINTS + 1;
	dispbottom "Gained : "+ 1 +" Point(s). Total : "+ FAMEPOINTS +" Fame Point(s).";
	.@origin = getcharid(3);
	attachrid( killedrid );
	if ( !getstatus( SC_ORCISH ) ) {
		attachrid( .@origin );
		@orc_face++;
		sc_start SC_ORCISH,60000,10;
	}
	end;
	
OnPCDieEvent:
	@orc_face = 0;
	sc_end SC_ORCISH;
	if( killerrid == getcharid(3) ) { end; }
	if( killerrid > 2999999 ) { end; }
	if( killerrid == NULL ) { end; }
	if( baselevel < 175 ) { end; }
	set KARMAPOINTS,KARMAPOINTS + 1;
	dispbottom "Gained : "+ 1 +" Point(s). Total : "+ KARMAPOINTS +" Karma Point(s).";
	end;
}

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  1096
  • Reputation:   345
  • Joined:  02/26/12
  • Last Seen:  

something like this (i have rewrite your functions, sorry about it)

OnPCDieEvent:
	@orc_face = 0;
	sc_end SC_ORCISH;
	
	if( killerrid == getcharid(3) || killerrid > 2999999 || killerrid == NULL || baselevel < 175 )
		end;

	// Now we checking ip of our killer and killed via getcharip(), name2rid convert killedrid to name.
	if( getcharip() == getcharip(name2rid(killedrid)) )
		end;	

	set KARMAPOINTS,KARMAPOINTS + 1;
	dispbottom "Gained : "+ 1 +" Point(s). Total : "+ KARMAPOINTS +" Karma Point(s).";
	end;


// killedrid - the died guy
// by default we are attached to guy WHO KILL
// so we should for checking IP check IP address of the guy WHO died.
OnPCKillEvent:
	// Your default checks
	if( baselevel < 175 || killedrid == getcharid(3) || getstatus(SC_ORCISH) )
		end;

	// Now we checking ip of our killer and killed via getcharip(), name2rid convert killedrid to name.
	if( getcharip() == getcharip(name2rid(killedrid)) )
		end;

	// the same logic like in your example, but without "attach command" and jumping between players.
	if( !getstatus(SC_ORCISH,0,getcharid(0,rid2name(killedrid))) )
	{
		sc_start SC_ORCISH,60000,10,10000,SCSTART_NOTICKDEF,killedrid;
		set @orc_face, @orc_face + 1, getcharid(0,rid2name(killedrid));
	}

	set KARMAPOINTS,KARMAPOINTS + 1;
	dispbottom "Gained : "+ 1 +" Point(s). Total : "+ KARMAPOINTS +" Karma Point(s).";
	end;
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  170
  • Reputation:   1
  • Joined:  11/13/14
  • Last Seen:  

i tried your codes, now it gives me error on line 10 and 20

-	script	orc_face	-1,{

OnInit:
	setitemscript 601,"{ if ( !@orc_face ) itemskill \"AL_TELEPORT\",1; }";
	setitemscript 602,"{ if ( !@orc_face ) itemskill \"AL_TELEPORT\",3; }";
	end;

OnPCKillEvent:
	if( baselevel < 175 || killedrid == getcharid(3) || getstatus( SC_ORCISH ) ) { end; }
	if( getcharip() == getcharip(name2rid(killedrid)) ) { end; }
	if( !getstatus(SC_ORCISH,0,getcharid(0,rid2name(killedrid))) ) { sc_start SC_ORCISH,60000,10,10000,SCSTART_NOTICKDEF,killedrid; set @orc_face, @orc_face + 1, getcharid(0,rid2name(killedrid)); }
	set FAMEPOINTS,FAMEPOINTS + 1;
	dispbottom "Gained : "+ 1 +" Point(s). Total : "+ FAMEPOINTS +" Fame Point(s).";
	end;
	
OnPCDieEvent:
	@orc_face = 0;
	sc_end SC_ORCISH;
	if( baselevel < 175 || killerrid == getcharid(3) || killerrid > 2999999 || killerrid == NULL ) { end; }
	if( getcharip() == getcharip(name2rid(killedrid)) ) { end; }
	set KARMAPOINTS,KARMAPOINTS + 1;
	dispbottom "Gained : "+ 1 +" Point(s). Total : "+ KARMAPOINTS +" Karma Point(s).";
	end;
}

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