Page 1 of 1

Help with summoning.

Posted: Sun Sep 07, 2008 4:44 am
by The_Visitor
Hello I have a problem with ppl summoning stuff inside ppls houses when they are standing outside the house.

Code: Select all

include "include/spelldata";
include "include/client";

program summon_air( parms )

	var circle := 8;
	var caster;
	var cast_loc;
	var fromhit;

	if (parms[1] == "#MOB")
		caster := parms[2];
		cast_loc := parms[3];
		if (parms[4])
			circle := parms[4];
		endif
		if (parms[5])
			fromhit := parms[5];
		endif

	else
		caster := parms;
		cast_loc := TargetCoordinates( caster );
		if (!cast_loc)
			return;
		if(cast_loc.multi)
		SendSysMessage( caster, "You cant summon there");
		return;
		endif
	endif
	SummonCreature( caster, "airelemental", cast_loc );

endprogram
Like you can see I have added if(cast_loc.multi) but it dosent do anything.
Anyone have a clue what I can do to cancel the target if they are trying to summon inside the house from the outside?

Re: Help with summoning.

Posted: Sun Sep 07, 2008 4:55 am
by ncrsn
TargetCoordinates() does not return multi info.

You have to work around it using the x, y and z members it does have - one way could be using GetStandingHeight (http://docs.polserver.com/pol097/single ... e=uoem.xml).

Re: Help with summoning.

Posted: Sun Sep 07, 2008 6:53 am
by The_Visitor
Thx that did the trick :)