Quote:
Originally posted by Obsidian the Black:
Ohh and the spell script doesnt seem it will be accepted. Heres what i put in it:
object oPC = GetLastSpellCaster();
object oCowledWizardWarning = GetObjectByTag("cowledwizard");
object oCowledWizardJail = GetObjectByTag("cowledwizard");
int nSpellsCast = GetLocalInt(OBJECT_SELF, "SPELLSCAST");
int nTimesWarned = GetLocalInt(OBJECT_SELF, "TIMESWARNED");
object WPJail = GetObjectByTag("WP_jail");
void main()
{
if ((GetIsPC(oPC))!&(GetItemPossessedBy(oPC, "magicpermit)))
{
SetLocalLocation(oPC, (GetLocation(oPC)));
CreateObjectAtLocation(oCowledWizardWarning, (GetLocalLocation(oPC)));
ActionSpeakString("This is your first warning. Do not cast magic within the city without a permit. If you do so again, we will be forced to take you to jail!") // or a dialogue start
SetLocalInt(oPC, "nTimesWarned", 1);
DeleteLocalLocation(); //not sure if you have to give a name for this
}
if ((GetIsPC(oPC))&&(nTimesWarned == 1)!&(GetItemPossessedBy(oPC, "magicpermit)))
{
SetLocalLocation(oPC, (GetLocalLocation(oPC));
CreateObjectAtLocation(oCowledWizardJail, (GetLocalLocation(oPC));
ActionSpeakString("That is it, we warned you once. Now come with us...");
ActionJumpToObject("WPJail); // maybe you have to give the creature which
//jumps to that location
DeleteLocalLocation();
SetLocalInt(OBJECT_SELF, "nTimesWarned", 0); // so the pc can start casting
//again and still be arrested
}
}
Is all this correct? Becuase it didnt like this line... if ((GetIsPC(oPC))!&(GetItemPossessedBy(oPC, "magicpermit)))
|
if ((GetIsPC(oPC))&&(GetItemPossessedBy(oPC, "magicpermit")!=TRUE))
does this work, i'm not sure if i used enough brackets and if they're on the right place (the ones between maficpermit and TRUE).
Also there isn't an onspellcast event so it could be you have to put in ints to see how many spells are cast. i think the onheartbeat script will infinitely loop no matter what ints will be used. maybe someone else knows a good event to put it under (might be with triggers) if i find something i'll post it
[ 01-26-2003, 11:39 AM: Message edited by: philip ]