 |
 |
 |
 |
|
 |
 |
|
 |
 |
|
 |
 |
|
 |
 |
|
 |
 |
|
 |
 |
|
 |
 |
|
 |
 |
|
 |
 |
|
 |
 |
|
 |
 |
|
 |
 |
| Author |
Message |
OldnGrey
Joined: 04 Feb 2006 Posts: 523
|
Posted: Wed Oct 31, 2007 10:54 pm Post subject: |
|
|
This is a working dot command example of the packet. Something like this has been done in another topic, but for some reason I had trouble with it. Several versions of the DF packet have been published but to get it working was a little trial and error.
All this does is turn on and off the STRENGTH icon and tooltips on the buff/debuff gump.
(Must be v5 client or later. Bring up the status gump and click the button on there)
It will count down every 5 seconds.
In theory this is easily wrapped into timedScripts.inc to control the gump and actually do the buff. I am still have problems with logon/logoff with that though.
.dfpacket 1
turns it on
.dfpacket 0
turns it off
| Code: | // Manually turns on and off the STRENGTH icon in the buff/debuff gump.
// Use:
// .dfpacket 1 to show
// .dfpacket 0 to remove
use uo;
use os;
use polsys;
program DFPacket(mobile, show)
if ( show )
show := CInt(show);
else
show := 0;
endif
var icon := 1047;
var cliloc1 := 1015014;
var cliloc2 := 1060485;
var duration := 20;
var str := " +20"; // the space at the start is important. Use cliloc parm rules for multiple parameters
// define the offsets to make it easier
var OFFSET_SERIAL := 3;
var OFFSET_ICONNUMBER1 := 7;
var OFFSET_SHOW1 := 9;
var OFFSET_ICONNUMBER2 := 15;
var OFFSET_SHOW2 := 17;
var OFFSET_TIME := 23;
var OFFSET_CLILOC1 := 28;
var OFFSET_CLILOC2 := 32;
var OFFSET_CLILOC2PARMS := 42;
// var BLANK_CLILOC := 1005007; // a cliloc number with blank text
// var ERROR_CLILOC := 500267; // an cliloc showing an error
var packet := CreatePacket(0xDF, MSGLEN_VARIABLE);
packet.setint32(OFFSET_SERIAL, mobile.serial);
packet.setint16(OFFSET_ICONNUMBER1, icon);
packet.setint16(OFFSET_SHOW1, show);
if ( show )
packet.setint16(OFFSET_ICONNUMBER2, icon);
packet.setint16(OFFSET_SHOW2, show);
packet.setint16(OFFSET_TIME, duration);
packet.setint32(OFFSET_CLILOC1, cliloc1);
packet.setint32(OFFSET_CLILOC2, cliloc2);
packet.SetUnicodeStringFlipped(OFFSET_CLILOC2PARMS, CAscZ(str), 1);
var Length_ID := packet.GetSize();
packet.setint16(Length_ID, 0x1);
endif
packet.sendpacket(mobile);
endprogram |
|
|
 |
|
|
 |
 |
|