anti resskill code

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
westrupp
Adept Poster
Posts: 89
Joined: Wed Aug 01, 2007 3:07 am

anti resskill code

Post by westrupp »

Code: Select all

	var resskill := GetObjProperty(ghost, "resskill");
	if (killer == resskill)
		SetObjProperty( ghost, "killedtimes", 1);
	endif
	var killedtimes := getobjproperty (ghost,"killedtimes");
	if (killedtimes == 1)
		SetObjProperty( ghost, "killedtimes", 2);
	endif
	if (killedtimes == 2)
		SetObjProperty( ghost, "killedtimes", 3);
	endif
	if (killedtimes == 3)
		SetObjProperty( ghost, "killedtimes", 4);
	endif
	if (killedtimes == 4)
		MoveCharacterToLocation( killer, 5304, 1184, 0, 0);
		SendSysMessage( killer, "You have been jailed");
	endif
dont work...i think i dont have correct value for killer
Luth
Former Developer
Posts: 200
Joined: Mon Jan 30, 2006 8:10 am

Re: anti resskill code

Post by Luth »

Code: Select all

	// resskill should be the serial of the last person to kill this character
	var resskill := GetObjProperty(ghost, "resskill");
	if (killer.serial != resskill)
		SetObjProperty( ghost, "resskill", killer.serial);
		SetObjProperty( ghost, "killedtimes", 1);
		return;
	endif

	var killedtimes := CInt(getobjproperty (ghost,"killedtimes"));
	if (killedtimes < 4)
		SetObjProperty( ghost, "killedtimes", killedtimes + 1);
	else
		MoveCharacterToLocation( killer, 5304, 1184, 0, 0);
		SendSysMessage( killer, "You have been jailed");
	endif
This is a cleaner version of your script. I made a few assumptions, but it may fix your problem. :) Here's hoping.
westrupp
Adept Poster
Posts: 89
Joined: Wed Aug 01, 2007 3:07 am

ReadGameClock

Post by westrupp »

Code: Select all


	var acc := playr.acct;

	var penultimopk := GetObjProperty (ghost,"ultimopk"); 
	SetObjProperty( ghost, "penultimopk", penultimopk);
	SetObjProperty( ghost, "ultimopk", plyr.name);

	ReadConfigFile("::npcdesc");
    	FindConfigElem(conf2, "plyr.npctemplate");
	if (plyr.npctemplate)
		SetObjProperty( ghost, "killedtimes", 0);
		EraseObjProperty( ghost, "ultimopk" );
	endif

	
	var killedtimes := CInt(getobjproperty (ghost,"killedtimes")); 
   	if (killedtimes > 4)
       		MoveCharacterToLocation( plyr , 5304, 1184, 0, 0); 
		              acc.setprop("Release", (ReadGameClock() + 345600)); // 4 Days
      		SendSysMessage( plyr , "Jailed by Anti-Resskill System.");
		              SetObjProperty( ghost, "killedtimes", 0); 
   	endif 

	var resskill  := GetObjProperty (ghost,"ultimopk");
	var resskill2 := GetObjProperty (ghost,"penultimopk"); 
	if (resskill != resskill2) 
      		SetObjProperty( ghost, "killedtimes", 0); 
   	endif
 
   	if ((resskill == resskill2) and (killedtimes < 5))
      		SetObjProperty( ghost, "killedtimes", killedtimes + 1); 
	endif

Post Reply