Poison.. Bug?

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
Poi
Grandmaster Poster
Posts: 298
Joined: Fri Apr 14, 2006 9:36 am

Poison.. Bug?

Post by Poi »

When someone dies by poison, they remain poisoned.. is there a way to fix this?(Poisoned while dead so when they res they die again)
Damien
Adept Poster
Posts: 82
Joined: Sat Apr 15, 2006 11:50 am

Post by Damien »

I dont really know but this is worth a try:

Go into Scripts/misc/chrdeath.src
And add the line who.SetPoison( 0 );

Its worth a try...
Poi
Grandmaster Poster
Posts: 298
Joined: Fri Apr 14, 2006 9:36 am

Post by Poi »

NEvermind, i found the problem...
In the script it says " // ghost.SetPoisoned(0); " Notice it has the two //'s by default


Well that didn't work... Any one else know why?
DeiviD
Expert Poster
Posts: 79
Joined: Mon Jun 19, 2006 4:48 pm

Post by DeiviD »

thats not how you set someone unpoisoned

open your cure spell to know how to do it ;) prolly by erasing the props poisonstamp, poisonlevel and... i think thats all
Poi
Grandmaster Poster
Posts: 298
Joined: Fri Apr 14, 2006 9:36 am

Post by Poi »

Well i looked at cure and didnt really see what un poisones them.. but so far my chrdeath is this and it doesnt work:
use uo;
use os;
use util;

include "include/NPCBackpacks";
include "include/attributes";
include "include/statMod";
include "include/noto";
include "include/reportMurder";

program chrdeath(corpse,ghost,who)
EraseObjProperty(ghost, "IsMeditating");
ghost.SetPoisoned(0);
who.SetPoisoned(0);
var killer := GetObjProperty(ghost, "LastHit");
if(killer != error)
AdjustNoto((SystemFindObjectBySerial(killer[2], SYSFIND_SEARCH_OFFLINE_MOBILES)), ghost);
endif
var fame := CInt(GetObjProperty(ghost, "Fame"));
fame := (fame - CInt(fame / 20));
SetObjProperty(ghost, "Fame", fame);
SetObjProperty(corpse,"serial", ghost.serial);
dismount(ghost, corpse);
CheckForAutoRes(ghost, corpse);
var corpsenamearray := SplitWords(corpse.name);
var corpsenamearraylen := len(corpsenamearray);
var x, corpsename := "";
for (x := 4; x <= corpsenamearraylen; x := x + 1)
corpsename := corpsename + " " + corpsenamearray[x];
endfor
if(len(ghost.reportables)>0)
SendReportGump(ghost);
endif
endprogram

function CheckForAutoRes(who, corpse)
if(CInt(GetObjProperty(corpse, "AutoRes")) == 1)
Resurrect(who);
SetHp(who, GetMaxHP(who));
SetMana(who, GetMaxMana(who));
SetStamina(who, GetMaxStamina(who));
var itemlist := {};
var mypack := who.backpack;
if(!mypack)
return;
endif
foreach thing in EnumerateItemsInContainer(corpse)
if(thing.container == corpse)
if(!EquipItem(who, thing))
MoveItemToContainer(thing, mypack);
endif
endif
endforeach
endif
endfunction

function dismount(me,corpse)
var mount := GetEquipmentByLayer( corpse, 25 );
foreach item in EnumerateItemsInContainer(corpse)
if (item.objtype == 0xf021)
mount := item;
break;
endif
endforeach
if (!mount)
return;
endif
var animal := SystemFindObjectBySerial(CInt(GetObjProperty(mount,"serial")));
animal.facing := corpse.facing;
EraseObjProperty(animal, "mounted");
EraseObjProperty(animal, "mounted_on");
MoveCharacterToLocation( animal, corpse.x, corpse.y, corpse.z, MOVECHAR_FORCELOCATION);
DestroyItem(mount);
endfunction
Post Reply