Trouble with Chrdeath.src
Posted: Wed Jan 18, 2012 5:42 pm
hey guys, ive been setting up the old Sanctuary scripts to work and chrdeath is the only one im having trouble with, ive been thinking about how to fix this for 2 days now and trying different things but i just cant get around it
the code im having trouble with is:
DoMagicStatMod is comming up with an error stating that " (ghost, STATMOD_ALL, statmodamount, 360); " is not being declared. ive looked through all scripts and there is no .inc for domagicstatmod
there is no other definition for dostatmod in any of the include files, although i have found an actual script for domagicstatmod.src:
^^^(this script is not being used for chrdeath, its just something i found in the sanctuary files under magic effects)
im not that great a scriptor yet so any help at all would be much appreciated
the code im having trouble with is:
Code: Select all
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);
endfunctionCode: Select all
Compiling: D:/shard2/Broken Blade/scripts/misc/chrdeath.src
Variable ghost has not been declared on line 110.
Error compiling statement at D:\shard2\Broken Blade\scripts\misc\chrdeath.src, Line 110
Error in function 'SetUnconscious', File: D:\shard2\Broken Blade\scripts\misc\chrdeath.src, Line 110
Error in function 'SetUnconscious'.
File: D:\shard2\Broken Blade\scripts\misc\chrdeath.src, Line 110
Code: Select all
program do_spell_statmod (parms)
var cast_on := parms [1];
var mod_type := parms[2];
var mod_amount := parms[3];
var duration := parms[4];
if (!cast_on or !mod_type or !mod_amount or !duration)
return;
endif
case (mod_type)
STATMOD_PARALYZE:
if (cast_on.cmdlevel or cast_on.enable ("invul"))
return;
endif
if (GetObjProperty (cast_on, "prot_paralyze_potion") )
SendSysMessage (cast_on, "You've been protected from being paralyzed!");
sleepms (100);
EraseObjProperty (cast_on, "prot_paralyze_potion");
return;
endif
DoTempMod (cast_on, "p", mod_amount, duration);
STATMOD_STR:
if (mod_amount < 0)
DoTempMod (cast_on, "cstr", mod_amount, duration);
else
DoTempMod (cast_on, "str", mod_amount, duration);
endif
STATMOD_INT:
if (mod_amount < 0)
DoTempMod (cast_on, "cint", mod_amount, duration);
else
DoTempMod (cast_on, "int", mod_amount, duration);
endif
STATMOD_DEX:
if (mod_amount < 0)
DoTempMod (cast_on, "cdex", mod_amount, duration);
else
DoTempMod (cast_on, "dex", mod_amount, duration);
endif
STATMOD_ALL:
if (mod_amount < 0)
DoTempMod (cast_on, "call", mod_amount, duration);
else
DoTempMod (cast_on, "all", mod_amount, duration);
endif
STATMOD_AR:
if (mod_amount < 0)
DoTempMod (cast_on, "car", mod_amount, duration);
else
DoTempMod (cast_on, "ar", mod_amount, duration);
endif
STATMOD_INCOGNITO:
DoIncognitoStuff (cast_on, duration);
default:
Syslog ("Tried to do an invalid statmod!");
endcase;
endprogramim not that great a scriptor yet so any help at all would be much appreciated