RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

PK Gang

x-ray

Wanderer
PK Gang

Summary:
PK Gang v1.0b

4 riders hunter-killers. One of them is leader, one warrior and two others choosen randomly and can be warrior,archer or mage.

5% chance in one second for leader to choose target player within 200 tiles (you can alter this in hkgang.cs by editing maxRange). After selecting the target, the gang trying to pursuit target. If player is killed the gang will ambush in this place. After some time the gang try to return to the home location. If the Leader dies, all the gang members will lose control. If all members of the gang is dead, the spawner-item removes self.

Tested on RC 1.0.

ps This is my first script for runuo,
feedbacks,suggestions and fixes are strongly welcomed.

History:
1.0b
* small fix according ArteGordon post in this thread

1.0
* fixed crash when [rebuildcategorization used, (thanks to the tbird !)

1.0beta
* for killing member of the gang the recent damager player awarded with justice point(s)

0.95
* removed autodispel from leader, added selective dispel ability with chance calculation.

0.9
* added Archer and Mage PK mobiles
* some mionor changes
* some changes according the posts

0.6
Small fixes according the post of MarkC777 and KillerBeeZ:
* horses now deleted when the gang member rider is killed
* make the script beta36 friendly :)

* changed chance to get magic weapon from the non-leader gang members to 50%
* put waypoint clear procedure at the selfremoving code to ensure waypoint always deleted.

0.5
Initial release


Installation:
Just unzip to the custom folder.

To add it type

[add hkgangspawn

or make hkgangspawn spawns from your favorite spawner.
 

Attachments

  • hkgang.zip
    8.2 KB · Views: 594

Pyro-Tech

Knight
nice script......i personally would disable/remove the auto deletion of spawner though.....could be a nuisance to some admins

but that is just personal taste....good job
 

MarkC777

Wanderer
This scriptpack intrigues the heck out of me, thanks for a great roleplay script!

After reading Pryo's note that the "spawner item" that gets deleted if they're all killed isn't a spawner per se, but the "control" token that checks the state of gang and whatnot. If you set a spawner to spawn these gangs, it would actually spawn the little controllers.

X-Ray, I had a question about the AI_waypoint markers visible to staff at the feet of a selected gang victim. This didn't seem to remove itself in certain cases. Can you explain how that works? Also...I notice the gang's horses linger. Since they're not attached to a spawner, will they go away or roam indefinitely, adding to the mobile count?

Thanks again,
Mark
 

x-ray

Wanderer
Pyro-Tech said:
nice script......i personally would disable/remove the auto deletion of spawner though.....could be a nuisance to some admins

but that is just personal taste....good job

The spawner itself actually don't have any timing procedures for respawn. Thats why i make it selfremoving. You can put it to respawn from the spawner you are using (for example xmlspawner2). So the xmlspawner will control the count of currect gang spawn and respawn time.

X-Ray, I had a question about the AI_waypoint markers visible to staff at the feet of a selected gang victim. This didn't seem to remove itself in certain cases. Can you explain how that works? Also...I notice the gang's horses linger. Since they're not attached to a spawner, will they go away or roam indefinitely, adding to the mobile count?

Sure. The gang in pursuit state create a waypoint at the target location every 10 seconds and assign it to all gang members. This strange you say waypoint sometimes not removed, i will check this out. It always wiped when the new one is created and also when the gang switch from the Pursuit state. Can you give a more detailed information about this ? I mean in wich stage of hkgangspawn (you can see the stage from [props) the waypoint not deleted.
Also i check about the horses. Thanks.
 

MarkC777

Wanderer
Done some additional testing and waypoint marker seems to be working well. I may not have been patient enough for it to remove. But if all gang mobiles die at the same time, could spawner remove itself before the waypoint got removed?

Horse problem solved by adding the following code in HKLeader.cs and HKWarrior.cs above this line:

"public HKWarrior( Serial serial ) : base( serial )".

Code:
		public override bool OnBeforeDeath()
		{
			IMount mount = this.Mount;

			if ( mount != null )
				mount.Rider = null;

			if ( mount is Mobile )
				((Mobile)mount).Delete();

			return base.OnBeforeDeath();
		}

Tested successfully. =)

Mark
 

x-ray

Wanderer
Mark, i dont think removing the horse after the death of the rider is logical step :)
I suggest another way - make the horse owned by the PK and after the PK death the horse will attack agressor, what do you think ? :)
 

KillerBeeZ

Knight
x-ray said:
Mark, i dont think removing the horse after the death of the rider is logical step :)
I suggest another way - make the horse owned by the PK and after the PK death the horse will attack agressor, what do you think ? :)

I don't think thats fair

You kill a horse you lose karma so maybe a new horse thats evil and has negative karma, plus making this horse a red will make it auto attack

You will still get players that run from the horse thus they will still add to the mobile count, so I think I'll use the onDeath delete method

as for this being untested on B36, I am using B36 and it only requires a couple minor changes as below

delete this like in HKGang.cs
m.MoveToWorld( loc, Map );

add these in its place

m.Location = loc;
m.Map = Map;

and in HKWarrior remove this

public override void GenerateLoot()
{
}

There, all set for B36
 

x-ray

Wanderer
version 0.6 reposted.

Major changes based on Mark and KillerBeeZ code fixes.
Guys, hope you dont mind :) Thanks for help and testing.
 

MarkC777

Wanderer
Another good addition...

After doing some more testing (I really like this script) I found that these "tracker killers" work like a charm. They can sniff out a player from 200 yards away...the only problem is if you have your PlayerRangeSensitive set to true, the gang will lock onto a player just fine, but won't move because nothing is within the mobiles' range. So I added an override to HKMobile.cs just above this line:

"public override bool AlwaysMurderer{ get{ return true; } }"

Code:
public override bool PlayerRangeSensitive{ get { return false; } }

Now they set their waypoint, and even when nobody's watching, they home in, tracking their target down! woohoo!!

Thanks again,
Mark
 

treforhay

Wanderer
Awesome script

Awesome script, works great. But I was wondering if theres a way to make them actually run at the players instead of the slow trot they do? That and maybe in a future version they could be made a little smarter as far as pathfinding goes? I have them spawning in the woods and sometimes they get stuck behind a bush and tree, so instead of 4 Pk's attacking the player only 1 makes it there :cool:
Otherwise awesome script I'm having lots of fun on unsuspecting players.
 

x-ray

Wanderer
treforhay said:
Awesome script, works great. But I was wondering if theres a way to make them actually run at the players instead of the slow trot they do? That and maybe in a future version they could be made a little smarter as far as pathfinding goes? I have them spawning in the woods and sometimes they get stuck behind a bush and tree, so instead of 4 Pk's attacking the player only 1 makes it there :cool:
Otherwise awesome script I'm having lots of fun on unsuspecting players.

The only way i see to make them run is to introduce new ai and edit a little base scripts.
I dont like to change file in base distribution :) Also writing a new really SMART ai is dillema - you can write smart ai but it can slowdown all your server... But i am certanly think about any futher improvements :)
 

KillerBeeZ

Knight
for the speed

public HKMobile( AIType aiType, FightMode mode ) : base( aiType, mode, 18, 1, 0.1, 0.2 )

try playing with those last 2 numbers til you have it as fast as you want (lower is faster)

Also,

for the AI

you can try 2 things

1) try setting the range lower
2) place the PK Gang in a wide open space (like green acers)
 

x-ray

Wanderer
Version 0.95 reposted.

Removed autodispel from leader, added selective dispel ability with chance calculation.
 

x-ray

Wanderer
Version 1.0beta reposted.
For killing members of the gang the player gain virtue points (justice point(s))

Because of the some variables declared like 'private' in PlayerMobile.cs, havent properties for access them and also i dont like to edit standart distribution ;) the delay between the points gain not implemented.

If you don't need this feature just comment entire function OnDeath() in HKMobile.cs
 
H

hudel

Guest
I'll test the new version on my homeshard... :)
It's very nice. This script is funny for a rp-shard like mine. Thanks for the update. :D
 

Crowley62

Sorceror
Hmm me and my players loved this script but after i put it in if staff said [add the server crashed had to delete it too bad
 
Top