tractor

Post Reply
doghusky1990
Posts: 56
Joined: Wed Aug 01, 2012 2:26 pm

tractor

Post by doghusky1990 » Wed Aug 08, 2012 2:27 pm

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?

PrBlahBlahtson
Developer
Posts: 539
Joined: Sun Jul 22, 2012 12:17 am

Re: tractor

Post by PrBlahBlahtson » Wed Aug 08, 2012 2:45 pm

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.

doghusky1990
Posts: 56
Joined: Wed Aug 01, 2012 2:26 pm

Re: tractor

Post by doghusky1990 » Wed Aug 08, 2012 2:52 pm

You explained it perfectly, and what you explained made perfect sense.
Thank you for explaining it.

bluekirby0
Developer
Posts: 707
Joined: Sun Jul 22, 2012 12:11 am

Re: tractor

Post by bluekirby0 » Wed Aug 08, 2012 3:28 pm

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.

Post Reply