Page 1 of 1

tractor

Posted: Wed Aug 08, 2012 2:27 pm
by doghusky1990
Hi I could us a little advice.
I got tractor to smi-work, but the player warps to hp after the initial warp to caster.
This is what I got do far

Code: Select all

-----------------------------------------
-- Spell: tractor
-----------------------------------------

require("scripts/globals/status");

-----------------------------------------
-- OnSpellCast
-----------------------------------------

function onSpellCast(caster,target,spell)
	hp = target:getHP(); -- get targets hp
	
	if(hp==0) then     -- target is dead
		zone = caster:getZone();
		targetX = caster:getXPos();
		targetY = caster:getYPos();
		targetZ = caster:getZPos();
		target:setPos(targetX,targetY,targetZ,0,zone);
	else               -- target is not dead
		printf("Player named %s is not dead!",target);
	end
end;
Like i said, it warps the player to the caster(player is still laying on the ground). Then almost immediately the player is warped to their homepoint, is there anyway to fix this?

Re: tractor

Posted: Wed Aug 08, 2012 2:45 pm
by PrBlahBlahtson
I'm not sure how to explain it in clear terms. Words are failing me for some reason. So instead, illustrate with examples.

Kill your noob. Logout, shutdown, close the client, whatever. Log in. You're homepointed.
Kill your noob. @bring the noob (capitalization matters) to your GM. You're homepointed.

The problem is very likely in the core, and not with your code. It doesn't like moving dead people.

Re: tractor

Posted: Wed Aug 08, 2012 2:52 pm
by doghusky1990
You explained it perfectly, and what you explained made perfect sense.
Thank you for explaining it.

Re: tractor

Posted: Wed Aug 08, 2012 3:28 pm
by bluekirby0
Yes, the issue with tractor is because of a bug we've been working on for a while. While that script looks like it would work perfectly, that other bug prevents it from working.