Here I added a check for an int on the placeables called "COLOR_GLOW". The numbers go from 0 to 6. So place any of those numbers on your placeable as a int local, and they should glow the appropriate color.
void main()
{
object oPC = GetEnteringObject();
if (!GetIsPC(oPC)) return;
int nGlow, nColor;
object oObject = GetFirstObjectInArea(OBJECT_SELF);
while(oObject != OBJECT_INVALID)
{
if(GetTag(oObject) == "glow_item" && GetLocalInt(oObject,"GLOW") == 0)
{
nColor = GetLocalInt(oObject, "COLOR_GLOW");
switch(nColor)
{
case 0://glow blue
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectVisualEffect(VFX_DUR_GLOW_BLUE),oObject);
SetLocalInt(oObject,"GLOW",1);
break;
case 1://glow green
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectVisualEffect(VFX_DUR_GLOW_GREEN),oObject);
SetLocalInt(oObject,"GLOW",1);
break;
case 2://glow orange
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectVisualEffect(VFX_DUR_GLOW_ORANGE),oObject);
SetLocalInt(oObject,"GLOW",1);
break;
case 3://glow purple
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectVisualEffect(VFX_DUR_GLOW_PURPLE),oObject);
SetLocalInt(oObject,"GLOW",1);
break;
case 4://glow red
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectVisualEffect(VFX_DUR_GLOW_RED),oObject);
SetLocalInt(oObject,"GLOW",1);
break;
case 5://glow white
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectVisualEffect(VFX_DUR_GLOW_WHITE),oObject);
SetLocalInt(oObject,"GLOW",1);
break;
case 6://glow yellow
ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectVisualEffect(VFX_DUR_GLOW_YELLOW),oObject);
SetLocalInt(oObject,"GLOW",1);
break;
default:
break;
}
}
oObject = GetNextObjectInArea(OBJECT_SELF);
}
}
Modifié par Baragg, 12 décembre 2010 - 01:56 .