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
Poison Problem
I try to found the script os poison but have a lot of scripts , can you tell me what script i can paste plz??SMJ wrote:We can't do anything without the source code; can you paste your poison source here?
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
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
What script i need put (ApplyRawDamage()) ??
Thx
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