Unable to find Maud's original post but here is some more from the above referenced thread.
And here is another post by Maeglin from that same thread. Posted: Tue Jun 29, 2004 1:24 am :
I have been able to decipher Anarchic's code, and make it some more usefull form:
//---------------------------------------
use uo;
var whos;
program sfxhue(who, text)
whos := who;
text := SplitWords(text);
if(!text)
return;
endif
var cel := Target(who);
var cel2 := Target(who);
var type := text[1];
if(!type)
type := "0";
endif
var effect := cint(text[2]);
if(!effect)
effect := 0;
endif
var speed := cint(text[3]);
if(!speed)
speed := 0;
endif
var duration := cint(text[4]);
if(!duration)
duration := 0;
endif
var fix := text[5];
if(!fix)
fix := "0";
endif
var explo := text[6];
if(!explo)
explo := "0";
endif
var color := cint(text[7]);
if(!color)
color := 0;
endif
var render := text[8];
if(!render)
render := "0";
endif
PlayEffectHuefx(cel,cel2,type,effect,speed,duration,fix,explo,color,render);
endprogram
function PlayEffectHuefx(source,dest,type,effect,speed,duration,fix,explo,color,render)
var packetString := "C0"+fixdpacketlength(type, 1)+fixPacketLength(hex(source.serial),4)+fixPacketLength(hex(dest.serial),4)
+effect+fixPacketLength(hex(source.x),2)+fixPacketLength(hex(source.y),2)+fixPacketLength(hex(source.z),1)
+fixPacketLength(hex(dest.x),2)+fixPacketLength(hex(dest.y),2)+fixPacketLength(hex(dest.z),1)
+fixPacketLength(hex(speed),1)+fixPacketLength(hex(duration),1)
+"0000"+fixdpacketlength(fix, 1)+fixdpacketlength(explo, 1)+fixPacketLength(hex(color),4)+fixdpacketlength(render, 1);
foreach mobile in ListObjectsInBox(source.x-20,source.y-20,source.z-120,source.x+20,source.y+20,source.z+120)
if (mobile.ip)
sendsysmessage(whos, packetstring);
sendPacket(mobile,packetString);
endif
endforeach
endfunction
function fixpacketlength(text, length)
var dlugosc := len(text) - 2;
var pocz := 3;
length := length * 2;
text := text[pocz, dlugosc];
while(dlugosc < length)
text := "0" + text;
dlugosc := len(text);
endwhile
return text;
endfunction
function fixdpacketlength(text, length)
var dlugosc := len(text);
var pocz := 1;
length := length * 2;
text := text[pocz, dlugosc];
while(dlugosc < length)
text := "0" + text;
dlugosc := len(text);
endwhile
return text;
endfunction
//-----------------------------------------
I did this program only to test this function, it now can make a lightningbolt effect, sometimes make an explosion, but still doesn't work like it's supposed to. Someone can take it from here and maybe make it work ;]
This was posted by Damnation. Posted: Tue Jun 29, 2004 1:37 am :
Code: Select all
function PlayStationaryParticleEffect( source, zmod, effect, exploeffect:=0, particle, speed, duration:=0,
explode:=0, hue:=0,trans:=0, layer := "0xFF")
var packetString := "C7";
packetString := packetString + "02";
packetString := packetString + fixPacketLength(source.serial,4);
packetString := packetString + fixPacketLength(hex(0),4);
packetString := packetString + fixPacketLength(hex(effect),2);
packetString := packetString + fixPacketLength(hex(source.x),2);
packetString := packetString + fixPacketLength(hex(source.y),2);
packetString := packetString + fixPacketLength(hex((source.z+zmod)),1);
packetString := packetString + fixPacketLength(hex(0),5);
packetString := packetString + fixPacketLength(hex(speed),1); // Speed of Animation
packetString := packetString + fixPacketLength(hex(duration),1); // Duration
packetString := packetString + "000000"; // This is in place of the
// Unknown and Fixed Direction portion
packetString := packetString + fixPacketLength(hex(explode),1); // Explode
packetString := packetString + fixPacketLength(hex(hue),4); // Color
packetString := packetString + fixPacketLength(hex(trans),4); // Transparency Level
packetString := packetString + fixPacketLength(hex(particle),2); // effect (see particleffect subdir!)
packetString := packetString + fixPacketLength(hex(exploeffect),2); // Explode Effect ID
// additional effect #, only used for moving effects, 0 otherwise
// and since this is the non-moving type, tis 0 here.
packetString := packetString + "0000";
packetString := packetString + fixPacketLength(source.serial,4);
// layer (of the character, e.g left hand, right hand, 0-4, 0xff: moving effect or target is no char)
packetString := packetString + fixPacketLength(layer,2);
packetString := packetString + "0000";
foreach chr in ListMobilesNearLocation( source.x, source.y, source.z, 16 );
SendPacket( chr, packetString );
endforeach
endfunction
Hope this helps.