CWO:
hey there CWO, ive checked through the script again and there is 2 callings for setunconscious but im not completely sure if i can add (,ghost) into it: heres the full script that i have (may be different to origional as ive re-written it myself, although word to word just been updated a tiny bit to work with pol 95 and different spacings).
Code: Select all
use uo;
use os;
use util;
// var Includes
include "include/skills";
include "include/poison";
include "include/possess";
include "include/utility";
include "include/dotempmods";
include "include/myutil";
include "include/magic";
// Package Includes
include ":npcs:npcbackpacks";
program CharacterDeath(corpse, ghost)
SysLog(TypeOf(ghost));
SendInstaResDialog (ghost);
EraseAllSkillBonuses (ghost);
CurePoison (ghost);
SetObjProperty (corpse, "ghost_serial", ghost.serial);
DismountGhost(ghost, corpse);
if (ghost.cmdlevel)
if (GetObjProperty (ghost, "possess"))
UnpossessCorpse (ghost, corpse);
endif
return;
else
RevokePrivilege (ghost, "hearghosts");
RevokePrivilege (ghost, "seeghosts");
endif
InitiateDeathSystem(ghost);
Endprogram
//checks for horse, if so dismounts
function DismountGhost (ghost, corpse)
foreach item in EnumerateItemsInContainer (corpse)
if (item.objtype == UOBJ_MOUNT)
Dismount (ghost, item);
endif
endforeach
endfunction
//deathsystem (based on sanctuary)
function InitiateDeathSystem(ghost)
//get the players death history
var deathHistory := GetObjProperty (ghost, "deathHistory");
if (!deathHistory)
deathHistory :=array;
endif
//saves current time
var curTime := ReadGameClock();
//checks if this is their first death, or if their first was before 1 hour ago
if ((!deathHistory[1]) or ((deathHistory[1] + 3600) < curTime))
SetDeathHistory (curTime);
SetUnconscious (-10);
return;
//check if this is their second death
elseif (deathHistory [1] and !deathHistory[2])
SetDeathHistory (deathHistory [1], curTime);
SetUnconscious (-20);
return;
endif
//send message and take skill loss
SendSysMessage (ghost, "You have died, and lost some valuable Knowledge...");
SkillLoss();
//broadcast player death to all online
foreach player in (EnumerateOnlineCharacters())
PlaySoundEffectPrivate (player, 0x101, player);
SendSysMessage (player, ghost.name + "'s death cry is heard throughout the land!", FONT_NORMAL, 48);
endforeach
//resets death history
SetDeathHistory(ghost);
SysLog ("DEATH: " + ghost.name + " [True Death] Time: " + ReadGameClock());
//start the death time for player
Start_Script (":mithril:DeathTimer", ghost);
endfunction
//sets the players death history to the values provided, zero if not
function SetDeathHistory (ghost, firstDeath := 0, secondDeath := 0)
var deathHistory :=array;
deathHistory[1] := firstDeath;
deathHistory[2] := secondDeath;
SetObjProperty (ghost, "deathHistory", deathHistory);
endfunction
//send message, mod stats and start timer for pler being unconscious
function SetUnconscious (statModAmount)
Set_Critical (1);
DoMagicStatMod (ghost, STATMOD_ALL, statModAmount, 360);
if (!SetupUnconsciousPack())
SendSysMessage (ghost, "There was an error creating an unconscious pack for your items");
SendSysMessage (ghost, "Your items will remain on your corpse, but they are lootable!");
endif
Set_Critical (0);
SysLog ("DEATH: " + ghost.name + " [Knockout] Time:" + ReadGameClock());
Start_Script (":Mithril:UnconsciousTimer", ghost);
endfunction
//true death has skill loss!
function SkillLoss()
Set_Critical (1);
for i := 48
if (RandomInt (2))
var attribute := GetAttributeIDBySkillID (i);
var ghostskill := GetAttributeBaseValue (ghost, attribute);
ghostskill := CINT (ghostskill * 0.99);
SetRawSkill (ghost, attribute, BaseToRaw (ghostskill));
endif
endfor
Set_Critical (0)l
endfunction
Function SetupUnconsciousPack()
corpse.name := "the unconscious body of " + ghost.name;
var unconsciousPack;
var ghostBank := FindBankBox (ghost.acctname);
if (ghostBank)
UnconsciousPack := CreateItemInContainer (ghostBank, 0xe75, 1);
else
SysLog ("Can't find " + ghost.name + "'s Bankbox! Making pack in packroom.");
unconsciousPack := CreateItemAtLocation (6049, 2279, 0, 0xe75, 1);
endif
if (!unconsciousPack)
SysLog ("Could not create an unconscious pack for " + ghost.name);
return 0;
endif
unconsciousPack.decayat := 0;
unconsciousPack.name := ghost.name + "'s unconscious pack";
unconsciousInfo["PackSerial"] := unconsciousPack.serial;
SetObjProperty (ghost, "unconsciousInfo", unconsciousInfo);
foreach item in ListRootItemsInContainer (corpse)
MoveItemToContainer (item, unconsciousPack);
endforeach
return1;
endfunction
now then i put ,ghost into the parts SetUnconscious were:
Code: Select all
//checks if this is their first death, or if their first was before 1 hour ago
if ((!deathHistory[1]) or ((deathHistory[1] + 3600) < curTime))
SetDeathHistory (curTime);
SetUnconscious (-10, ghost);
return;
//check if this is their second death
elseif (deathHistory [1] and !deathHistory[2])
SetDeathHistory (deathHistory [1], curTime);
SetUnconscious (-20, ghost);
return;
endif
and
Code: Select all
function SetUnconscious (statModAmount, ghost)
Set_Critical (1);
DoMagicStatMod (ghost, STATMOD_ALL, statModAmount, 360);
if (!SetupUnconsciousPack())
SendSysMessage (ghost, "There was an error creating an unconscious pack for your items");
SendSysMessage (ghost, "Your items will remain on your corpse, but they are lootable!");
endif
Set_Critical (0);
but then i get this error while compiling:
Compiling: D:/shard2/Broken Blade/scripts/misc/chrdeath.src
Function SetUnconscious: Parameter ghost was not passed, and there is no default.
Error compiling statement at D:\shard2\Broken Blade\scripts\misc\chrdeath.src, Line 68
Error in IF statement starting at File: D:\shard2\Broken Blade\scripts\misc\chrdeath.src, Line 66
Error compiling statement at D:\shard2\Broken Blade\scripts\misc\chrdeath.src, Line 66
Error in function 'InitiateDeathSystem', File: D:\shard2\Broken Blade\scripts\misc\chrdeath.src, Line 68
Error in function 'InitiateDeathSystem'.
File: D:\shard2\Broken Blade\scripts\misc\chrdeath.src, Line 68
Yukiko:
yeah that was me, as ive been going through each script ive been writing it back in so i can make sense of what everything does, i changed all the variables for gGhost and gCorpse to just ghost and corpse because it didnt make sense to me haha, although i have changed them back to gGhost and gCorpse and im still getting the exact same error

as you have the scripts you can tell there is no other calling for DoMagicStatMod except for "function setunconscious" in the script and there is no function description of it linked to it
any other ideas on what could be wrong? (thanks for the prompt reply guys!

)