Poison Problem

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
rbrbrb
New User
Posts: 2
Joined: Mon Jan 15, 2007 5:29 pm

Poison Problem

Post by rbrbrb »

Hello

I have a problem in my shard

The poison remove damage and in some cases the str stay 0 and the char dont die

Can anyone help me to fix it plz?

Sorry my english
SMJ
Grandmaster Poster
Posts: 113
Joined: Wed May 10, 2006 5:15 pm

Post by SMJ »

We can't do anything without the source code; can you paste your poison source here?
User avatar
tekproxy
Forum Regular
Posts: 352
Joined: Thu Apr 06, 2006 5:11 pm

Post by tekproxy »

Poison reduces strength on your shard and you want the character to die at 0 strength? If this is true, you will have to kill the character in the script (ApplyRawDamage()) once the strength is 0.

If you need help with that, post your source.
rbrbrb
New User
Posts: 2
Joined: Mon Jan 15, 2007 5:29 pm

Post by rbrbrb »

SMJ wrote:We can't do anything without the source code; can you paste your poison source here?
I try to found the script os poison but have a lot of scripts , can you tell me what script i can paste plz??

I will post a Code of processpoisonmod.src in the folder \pkg\opt\summoning is that the script?

I work basied in UL scripts

Thx :smile:

tekproxy wrote:Poison reduces strength on your shard and you want the character to die at 0 strength? If this is true, you will have to kill the character in the script (ApplyRawDamage()) once the strength is 0.

If you need help with that, post your source.

Yes :) i want when the strenght is 0 the char die.
What script i need put (ApplyRawDamage()) ??

Thx :smile:

Code: Select all

use uo;
use os;


include "include/spelldata";
include "include/attributes";
include "include/dotempmods";

program processtempmods( parms )
	set_script_option( SCRIPTOPT_CAN_ACCESS_OFFLINE_MOBILES, 1 );

	var who	:= parms[1];
	var plvl	:= parms[2];
	var msg	:= parms[3];
	var serial	:= who.serial;

	plvl := CInt(plvl);
	var protected := PoisonProtected( who, plvl );

	if( protected == IMMUNED )
		return;
	endif

	if( protected == CURSED )
		plvl := plvl + 2;
	endif

	if (plvl < 1)
		return;
	endif

	if ( plvl > 6 )
		plvl := 6;
	endif

	var current := 0;
	set_critical(1);
	var currentmod := GetObjProperty( who, "poison" );

	if( currentmod )
		current := CInt( currentmod[1] );
	else
		currentmod := {};
	endif

	if( plvl < current )
		set_critical(0);
		return;
	endif

	var duration := CInt(29 + ( 20 * plvl ) + 1);
	var newpoisonregenmod := GetPoisonRegenMod( plvl );
	var current_clock := CInt(ReadGameClock());

	if( plvl > current )
		SetHpRegenRate(who , ( CInt(BaseRegenRate(who) + newpoisonregenmod)) * 12 );
	endif

	var mmod := { plvl, CInt(current_clock + duration) };

	if( !current )
		who.poisoned := 1;
		if( msg )
			PrintTextAbovePrivate( who, msg, who );
		endif
		currentmod := mmod;
	else
		AddToPoisonMod( currentmod, mmod );
	endif

	SetObjProperty( who, "poison", currentmod );

	set_critical(0);

	// Edited by Sno, Jan 12 2003.
	// This part replaces "sleep(duration+1)". I *think* there's a problem regen'ing negatively.
 
		sleep(duration);

	if( !who )
		who := SystemFindObjectBySerial( CInt(serial), SYSFIND_SEARCH_OFFLINE_MOBILES );
	endif

	if( who )
		set_critical(1);
		currentmod := GetObjProperty( who, "poison" );

		if( !currentmod )
			set_critical( 0 );
			return;
		endif

		if( ReadGameClock() >= CInt(currentmod[2]) )
			CurePoison( who );
		endif

		set_critical(0);
	endif

endprogram


Thx :smile:
Post Reply