First off, I pretty much know nothing about scripting. So what I am trying to do is spawn additional mobs when my boss creature gets to 1/3 hp and have them attack the player. I tried to do this on my own by opening up chapter 4 of the single player campaign and looking at the Aribeth encounter to see how they got her to stop fighting and talk to the player after she was weakened, and then adapt that to spawning creatures instead. When I looked at the script to add in creatures that is written by Lilac's Script Generator and try to use that in the above mentioned script I can't get it to compile.
This is what I have so far:
void main()
{
int nUser = GetUserDefinedEventNumber();
if (nUser = 1006)
{
int nMaxHP = GetMaxHitPoints();
int nCurrHP = GetCurrentHitPoints();
if((nCurrHP * 3) <= nMaxHP && GetLocalInt(OBJECT_SELF,"walker_do_once") == 0)
{
oTarget = oPC;
ITarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_CREATURE,"testing",ITarget);
oTarget = oSpawn;
SetIsTemporaryEnemy(oPC, oTarget);
AssignCommand(oTarget, ActionAttack(oPC));
oTarget = oPC;
ITarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_CREATURE,"testing",ITarget);
oTarget = oSpawn;
SetIsTemporaryEnemy(oPC, oTarget);
AssignCommand(oTarget, ActionAttack(oPC));
oTarget = oPC;
ITarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_CREATURE,"testing",ITarget);
oTarget = oSpawn;
SetIsTemporaryEnemy(oPC, oTarget);
AssignCommand(oTarget, ActionAttack(oPC));
}
SetLocalInt(OBJECT_SELF,"walker_do_once",1);
}
}
The error is: VARIABLE DEFINED WITHOUT TYPE on line 11 (oTarget = oPC;)
Since I don't know how to write my own scripts and am trying to adapt premade scripts for my own use I'm not sure what to do and I'm guessing that besides something being wrong up there, it could also use some cleaning up. Any help would be greatly appreciated.
Modifié par DM Veil, 22 octobre 2011 - 03:17 .