72 lines
2.3 KiB
Plaintext
72 lines
2.3 KiB
Plaintext
|
//::///////////////////////////////////////////////
|
||
|
//:: Name ra_wererat_att1
|
||
|
//:: Copyright (c) 2021 Project RATDOG
|
||
|
//:://////////////////////////////////////////////
|
||
|
/*
|
||
|
Wererat onAttack script. Changes from Dire
|
||
|
Rat for into Hybrid form.
|
||
|
*/
|
||
|
//:://////////////////////////////////////////////
|
||
|
//:: Created By: Jaysyn
|
||
|
//:: Created On: 2021-10-02
|
||
|
//:://////////////////////////////////////////////
|
||
|
|
||
|
#include "nw_i0_generic"
|
||
|
void main()
|
||
|
{
|
||
|
|
||
|
object oAttacker = GetLastHostileActor();
|
||
|
|
||
|
// if (!GetIsPC(oAttacker)) return; // Removed for testing.
|
||
|
|
||
|
object oRat;
|
||
|
oRat = OBJECT_SELF;
|
||
|
int iType = GetLocalInt(oRat, "WERERAT_TYPE");
|
||
|
|
||
|
//Visual effects can't be applied to waypoints, so if it is a WP
|
||
|
//the VFX will be applied to the WP's location instead
|
||
|
|
||
|
int nInt;
|
||
|
nInt = GetObjectType(oRat);
|
||
|
|
||
|
if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SMOKE_PUFF), oRat);
|
||
|
else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SMOKE_PUFF), GetLocation(oRat));
|
||
|
|
||
|
//Visual effects can't be applied to waypoints, so if it is a WP
|
||
|
//the VFX will be applied to the WP's location instead
|
||
|
|
||
|
nInt = GetObjectType(oRat);
|
||
|
|
||
|
if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_CHUNK_RED_MEDIUM), oRat);
|
||
|
else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_CHUNK_RED_MEDIUM), GetLocation(oRat));
|
||
|
|
||
|
//Visual effects can't be applied to waypoints, so if it is a WP
|
||
|
//the VFX will be applied to the WP's location instead
|
||
|
|
||
|
nInt = GetObjectType(oRat);
|
||
|
|
||
|
if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_UNLOAD_MODEL), oRat);
|
||
|
else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_UNLOAD_MODEL), GetLocation(oRat));
|
||
|
|
||
|
object oSpawn;
|
||
|
object oTarget;
|
||
|
object oHybrid;
|
||
|
location lTarget;
|
||
|
oTarget = GetNearestObjectByTag("RA_WERERAT001"); // Gets location of wererat in animal form.
|
||
|
|
||
|
lTarget = GetLocation(oTarget);
|
||
|
|
||
|
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ra_wererat003", lTarget); // Spawns wererat in hybrid form.
|
||
|
|
||
|
oHybrid = oSpawn;
|
||
|
|
||
|
SetIsTemporaryEnemy(oAttacker, oHybrid);
|
||
|
|
||
|
AssignCommand(oHybrid, ActionAttack(oAttacker));
|
||
|
|
||
|
AssignCommand(oHybrid, DetermineCombatRound(oAttacker));
|
||
|
|
||
|
DestroyObject(oRat, 0.1f);
|
||
|
|
||
|
}
|