Force attack via script, problem with RequestAttack packet

Here you can post threads requesting help on the official POL Ultima Online Emulator Core 098.
Post Reply
User avatar
timginter
Neophyte Poster
Posts: 37
Joined: Tue Apr 22, 2008 6:25 am

Force attack via script, problem with RequestAttack packet

Post by timginter »

Hi.

I'm trying to write a script in which one of the effects is a player going "berserk". I'm trying to force an attack, with no avail, though. I tried tinkering with packet 0x05 (RequestAttack), desperately I even tried to turn the war-mode and try sending a DoubleClick packet - both freeze the client.

Code: Select all

var trg := Target(who);
if( !trg )
	return 0;
elseif( !trg.IsA(POLCLASS_MOBILE) )
	return 0;
elseif( trg.dead )
	return 0;
endif

var hexSerial := Hex(trg.serial);
SendSysMessage(who, "serial: " + hexSerial);

SendPacket(who, "05B700");
Just for the sake of tests I put the serial manually (mob's I was testing it on was 0xB7). I've tried SendPacket(who, "05B7"), SendPacket(who, "0500B7") and SendPacket(who, "05B700"), every version ended with the client frozen. I'm lost.
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Re: Force attack via script, problem with RequestAttack pack

Post by CWO »

You can't do something like that through packets because you'll just confuse the client. This is also a function of the server so packets are entirely useless with this.

Is your server POL098 or newer? Have you tried who.attack_once(trg)?
User avatar
timginter
Neophyte Poster
Posts: 37
Joined: Tue Apr 22, 2008 6:25 am

Re: Force attack via script, problem with RequestAttack pack

Post by timginter »

Yeah, it's POL098
CWO wrote:Have you tried who.attack_once(trg)?
Yes, nothing happened. I tried both with war mode on and off

I thought about setting war-mode, trg as "Last Target" and somehow either make the character "use" last target, force double-click, send "Last Object" or "Attack Last", I'm out of any better ideas ;)
Post Reply