hello everyone
I'm in need of a bit of help again with a boss script. (dragon encounter)
how would i turn a placeable into a creature (boss) when the placeable is used, then have the boss
disappear (EffectDisappear) once it's hp has been reduced by half? Also, i'm trying to make the placeable return to
it's original spot (after a delay) after the boss has tucked tail.
thanks!
Boss (Dragon Encounter)
#1
Posté 04 juillet 2015 - 01:53
#2
Posté 04 juillet 2015 - 03:07
how would i turn a placeable into a creature (boss) when the placeable is used
Make a USABLE placeable object with script attached to ON USE - when fires
// NOT TESTED - by GM_ODA 20150704
void main()
{
location lHere = GetLocation(OBJECT_SELF);
object oDragon = CreateObject(OBJECT_TYPE_CREATURE,"dragon_resref_here",lHere);
SetLocalLocation(oDragon,"lHere",lHere);
SetLocalString((oDragon,"Object4Remake",GetResRef(OBJECT_SELF));
DestroyObject(OBJECT_SELF,0.2f);// assumes this object is NOT PLOT
}
replace the "dragon_resref_here" with your own dragon's resref (in double quotes).
then have the boss
disappear (EffectDisappear) once it's hp has been reduced by half?
For this you'll need to edit your module's 'on_damaged' script to detect the dragon as the target of damage and do a simple query comparing the dragon's HP after damage to what you know it's 'half HP' value to be, when this condition is met fire a script to remove the dragon or destroy it with any VFX you choose, and then...
Also, i'm trying to make the placeable return to
it's original spot (after a delay) after the boss has tucked tail.
the same script should end with ...
location lHere = GetLocalLocation(OBJECT_SELF,"lHere"); string sMakeMe = GetLocalString(OBJECT_SELF,"Object4Remake"); CreateObject(OBJECT_TYPE_PLACEABLE,sMakeMe,lHere);
Hope this helps.
#3
Posté 04 juillet 2015 - 04:26
thanks! 1st script works, dragon appears (actually more like descends with EffectAppear, awesome). i don't know how to begin with the on_damaged event of the dragon in order to detect an hp reduction, should i try to edit the default, or create a new script?
#4
Posté 04 juillet 2015 - 05:37
tried this bit and it compiles but doesn't seem to work...
int iHP = GetHitDice(oMe);
int iDetectHP = 500;
if (iHP >= iDetectHP)
#5
Posté 04 juillet 2015 - 06:33
iHP >= iDetectHP should be iHP <= iDetectHP
#6
Posté 04 juillet 2015 - 06:45
thanks werelynx but i got it working with GetPercentageHPLoss... but for some reason after the dragon escapes/new placeable gets created when used the new placeable doesn't get deleted but a dragon appears, if clicked a second time placeable gets deleted and another dragon appears. so it's working but a bit buggy...
can anyone help further please? thank you
this is what i have in the default on_damaged;
void main()
{
object oDamager = GetLastDamager();
object oMe=OBJECT_SELF;
location lHere = GetLocalLocation(OBJECT_SELF,"lHere");
string sMakeMe = GetLocalString(OBJECT_SELF,"Object4Remake");
effect eVanish = EffectDisappear();
int nHPBefore;
if(GetPercentageHPLoss(OBJECT_SELF)<25)
{
//ActionSpeakString("HELP! I am wounded!");
CreateObject(OBJECT_TYPE_PLACEABLE,sMakeMe,lHere);
DelayCommand(1.0, ApplyEffectToObject (DURATION_TYPE_TEMPORARY, eVanish, oMe));
}
#7
Posté 05 juillet 2015 - 12:25
i got it working. instead of deleting and creating a placeable, i set and delete an int on the placeable so it can only be used every 5 minutes. it's not as immersive as a vanishing/reappearing dragon statue but it's a lot less complicated 'cause 'createobject' can't be used with a delay apparently.
thanks everyone.
#8
Posté 05 juillet 2015 - 09:27
i've been fooling around with this script in the onenter of a trigger; but it's only working the first time a PC activates it, enemy doesn't appear again after this ---> DelayCommand(120.0, SetLocalInt(oPC, "Anti_Spawn", 0));
void CommandMonster(object oMonster, object oPC)
{
AssignCommand(oMonster, ActionMoveToObject(oPC, TRUE, 7.0f));
AssignCommand(oMonster, ActionDoCommand(PlayVoiceChat(VOICE_CHAT_BATTLECRY1, OBJECT_SELF)));
AssignCommand(oMonster, ActionDoCommand(ActionPlayAnimation(ANIMATION_FIREFORGET_TAUNT)));
AssignCommand(oMonster, ActionDoCommand(ActionAttack(oPC, FALSE)));
}
/*void DestroyMonster(object oMonster)
{
effect eDeath = EffectVisualEffect(VFX_IMP_PULSE_NEGATIVE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oMonster);
DestroyObject(oMonster, 0.01f);
} */
////////////////////////////////////////////////////////////
// The Main script
////////////////////////////////////////////////////////////
void main()
{
object oPC = GetEnteringObject();
//location lLocation = GetLocation(GetWaypointByTag("Jumpbosz1fl"));
if (!GetIsPC(oPC)) return;
else if (GetLocalInt(oPC, "Anti_Spawn")) return;
else
{
SetLocalInt(oPC, "Anti_Spawn", 1);
object oNest = GetWaypointByTag("bos_supz1fl");
location lNest = GetLocation(oNest);
object oMonster = CreateObject(OBJECT_TYPE_CREATURE, "bos_fmeph1",lNest);
CommandMonster(oMonster, oPC);
//AssignCommand(oPC, ActionJumpToLocation(lLocation));
//DelayCommand(120.0f, DestroyMonster(oMonster));
DelayCommand(120.0, SetLocalInt(oPC, "Anti_Spawn", 0));
}
also curious about how i could make the enemy spawn a random chance.
thanks for any help





Retour en haut






