I've been working on this dumb thing for about two hours now and I cannot for the life of me figure out why the gani isn't getting the param containing the angle data. There does not appear to be any syntax errors with the gani script.
Here's the class:
PHP Code:
function oncreated(){
join("systemfunctions");
attr[2] = this.dmg;
attr[1] = this.ang*100;
attr[3] = this.from;
attr[4] = this.fromguild;
attr[5] = this.fromgroup;
attr[6] = this.fromlvl;
this.timeleft = 0.5;
onHitNPCs();
setTimer(0.5);
}
function onTimeout() {
this.lifetime++;
if (level.pos("gmap") < 0) {
if (x <= 0 || x >= 64 || y <= 0 || y >= 64) {
destroy();
}
}
for (temp.n: findareanpcs(x-7,y-7,14,14)) {
if (temp.n.attr[6] != NULL && this.hashit.index(temp.n) < 0) {
for (temp.a = 0; temp.a < 4; temp.a++) {
if (this.hashit.index(temp.n.attr[6]) < 0) {
temp.dist = GetDist(temp.n,temp.a);
if (dist <= 5) {
temp.n.trigger("ActionDamage", this.dmg * .6,{{"mdmg"},{"magic","water"},{"nomiss"}},attr[7],attr[6],attr[5],save[2]);
this.hashit.add(temp.n.attr[6]);
}
}
}
}
}
x += (cos(attr[1]/100) * 1.25)*10;
y -= (sin(attr[1]/100) * 1.25)*10;
if (this.lifetime >= 4) destroy();
setTimer(.5);
}
function GetDist(target, temp.a) {
return ((target.x - (this.x + cos(attr[1]/100) * 1.25 * temp.a*2.5))^2 + (target.y - (this.y - sin(attr[1]/100) * 1.25 * temp.a*2.5))^2)^.5
}
function onHitNPCs(){
for (n: findareanpcs(x-2,y-2,4,4)) {
n.trigger("ActionDamage",this.dmg,""/*{{"nomiss"}}*/,this.from,this.fromguild,this.fromgroup,this.fromlvl);
}
}
//#CLIENTSIDE
function onCreated(){
setTimer(0.05);
}
function onTimeout(){
showani(201,this.x,this.y,0,"zod-projectile-harpoon",attr[1]/100);
x += cos(attr[1]/100) * 1.25; //1.25
y -= sin(attr[1]/100) * 1.25;
temp.len = ((player.x - x)^2 + (player.y - y)^2)^.5; //2,2,.5
if (temp.len <= 4) {
if (!this.hashit) {
findweapon("-System").trigger("ActionDamage",attr[8],{{"mdmg"},{"magic","water"},{"frozenlance"},{"nomiss"}},attr[7],attr[6],attr[5],save[2]);
this.hashit = true;
}
}
//if (player.x in |x-2,x+2| && player.y in |y-2,y+2|) {
// if(player.account != attr[3]){
// findweapon("-System").trigger("ActionDamage",attr[2]/10,""/*{{"nomiss"}}*/,attr[3],attr[4],attr[5],attr[6]);
// }
//}
//play("axe.wav");
setTimer(0.05);
}
And the gani:
PHP Code:
SCRIPT
function onCreated(){
with (findimg(200))
{
spin = degtorad(0);
rotation = degtorad(0);
with (emitter)
{
delaymin = 0;
delaymax = 0;
nrofparticles = 1;
emitautomatically = true;
autorotation = false;
firstinfront = true;
emissionoffset = {0,0,0};
attachposition = true;
checkbelowterrain = false;
continueafterdestroy = false;
attachtoowner = true;
maxparticles = 1;
particleTypes = 1;
// Harpoon
with (particles[0])
{
image = "zodiac_harpoon.png";
zoom = 2;
red = 1;
green = 1;
blue = 1;
alpha = 1;
mode = 1;
lifetime = 1;
angle = degtorad(0);
zangle = degtorad(0);
speed = 0;
rotation = degtorad(params[0]);
spin = degtorad(0);
partx = 0;
party = 0;
partw = 0;
parth = 0;
stretchx = 1;
stretchy = 1;
sound = "";
layer = 2;
}
}
}
with (findimg(201))
{
spin = degtorad(0);
rotation = degtorad(0);
with (emitter)
{
delaymin = 0;
delaymax = 0;
nrofparticles = 1;
emitautomatically = true;
autorotation = false;
firstinfront = true;
emissionoffset = {0.5,0.5,0};
attachposition = false;
checkbelowterrain = false;
continueafterdestroy = false;
attachtoowner = true;
maxparticles = 100000;
particleTypes = 1;
// Rope
with (particles[0])
{
image = "zodiac_harpoonrope.png";
zoom = 2;
red = 1;
green = 1;
blue = 1;
alpha = 1;
mode = 1;
lifetime = 5;
angle = degtorad(32);
zangle = degtorad(0);
speed = 0;
rotation = degtorad(0);
spin = degtorad(0);
partx = 0;
party = 0;
partw = 0;
parth = 0;
stretchx = 1;
stretchy = 1;
sound = "";
layer = 2;
}
addlocalmodifier("once", 0, 0, "rotation", "replace", degtorad(0), degtorad(360)); // Random Rotation
}
}
}
SCRIPTEND
In addition, I recently learned that you can do stuff like player.chat = whatever within gani scripts. But for some reason it's not working with this script. And earlier it was working like a this.chat instead. (I've taken it out of the posted script)
So what the hell is going on?
