Totem

Here you can post threads requesting help on the official POL Ultima Online Emulator Core 095. Note: Core 095 is no longer officially supported.
Post Reply
lokaum
Novice Poster
Posts: 45
Joined: Mon Dec 25, 2006 6:33 am

Totem

Post by lokaum »

Hi people,

I Have a problem... i create the totem and the elixer..
when I do 2 clicks in totem, my player only do the action that totem's created..
But the totem is not created!

Can anyone help me?
User avatar
ncrsn
Grandmaster Poster
Posts: 255
Joined: Fri Feb 10, 2006 12:15 am

Re: Totem

Post by ncrsn »

To help you, most of us need to see the totem script. If you can show it to us it'd make things so much easier.
lokaum
Novice Poster
Posts: 45
Joined: Mon Dec 25, 2006 6:33 am

Re: Totem

Post by lokaum »

Code: Select all

use uo;
use os;

include "include/client";
include "include/attributes";

program totem(who, totem)

	if(!ReserveItem(totem)) return; endif

	var npctemplate := GetObjProperty(totem,"critter");

	var parms := {};
	parms .+ script := "tamed";
	Detach();

	var it := CreateNpcFromTemplate("totem", who.x -1, who.y+1, who.z, parms);
	if (!it)
		it := CreateNpcFromTemplate("totem", who.x +1, who.y-1, who.z, parms);
		if (!it)
			SendSysMessage(who,"Canceled");
			return;
		endif
	endif
        SetObjProperty( it, "summoned", 1 );
        SetObjProperty( it, "animated", 1 );
	SetObjProperty( it, "totem", totem.objtype );
	SetObjProperty( it, "totemcolor", totem.color );
	SetObjProperty( it, "master", who.serial );
	SetObjProperty( it, "script", it.script );
	it.setmaster( who );
	it.script := "tamed";
	it.name := totem.name;
	it.color := CInt(GetObjProperty( totem, "critcolor" ));
	if ( GetObjProperty(totem,"totemhp") )
		SetHp(it, CInt(GetObjProperty(totem,"totemhp")));
	endif

	PlaySoundEffect( who, SFX_SPELL_DISPEL );
	PlayStationaryEffect( it.x, it.y, it.z, FX_SMOKE, 0xa, 0xa );
	DestroyItem(totem);
	RestartScript(it);

endprogram
All things are OK... but it doesn't work =/
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Re: Totem

Post by CWO »

if the NPC isn't created, where you have

SendSysMessage(who,"Canceled");

change it to

SendSysMessage(who,CStr(it.errortext));

it will tell you why the creation failed.
lokaum
Novice Poster
Posts: 45
Joined: Mon Dec 25, 2006 6:33 am

Re: Totem

Post by lokaum »

The problem is, the script Totem.src don't be executed!

The player only do the action and the effect dispel is showed, because the message Canceled don't be showed...

And now?
Yukiko
Distro Developer
Posts: 2826
Joined: Thu Feb 02, 2006 1:41 pm

Re: Totem

Post by Yukiko »

I don't see any lines that cause a player to perform an action. I gather that drinking the elixir is supposed to summon the NPC. You might try CWO's idea but put the "SendSysMessage(who,CStr(it.errortext));" just before the "PlaySoundEffect( who, SFX_SPELL_DISPEL );" statement. This way if the CreateNPCFrom Template function is returning an error you should get the errortext telling you what it is.
lokaum
Novice Poster
Posts: 45
Joined: Mon Dec 25, 2006 6:33 am

Re: Totem

Post by lokaum »

I Found the problem!!

The NPC template "humuc" did'nt work... but now i fixed it!!

Thanks!!
Post Reply