this is my entire module script :
#include "wrappers_h"
#include "events_h"
#include "log_h"
#include "utility_h"
#include "ability_h"
#include "combat_h"
#include "2da_data_h"
#include "sys_autoscale_h"
#include "talent_constants_h"
#include "spell_constants_h"
#include "sys_autolevelup_h"
void main()
{
event ev = GetCurrentEvent();
int nEvent = GetEventType(ev);
Log_Events("",ev);
switch (nEvent)
{
case EVENT_TYPE_MODULE_START :
{
object oHero = GetHero();
object oBomb = GetObjectByTag("bomb_chu_call_v1");
UT_AddItemToInventory(R"bomb_chu_call_v1.uti",1);
break;
}
case EVENT_TYPE_MODULE_LOAD :
{
object oHero = GetHero();
object oBomb = GetObjectByTag("bomb_chu_call_v1");
UT_AddItemToInventory(R"bomb_chu_call_v1.uti",1);
break;
}
case EVENT_TYPE_UNIQUE_POWER :
{
int nAbility = GetEventInteger(ev, 0); // [Undocumented]
object oItem = GetEventObject(ev, 0); // [Undocumented]
object oCaster = GetEventObject(ev, 1); // [Undocumented]
object oTarget = GetEventObject(ev, 2); // [Undocumented]
object oRat = GetObjectByTag("bomb_chu_rat_v1");
resource rRat = R"bomb_chu_rat_v1.utc";
location lSummonspot = GetLocation(oCaster);
object oSummon = CreateObject(OBJECT_TYPE_CREATURE,rRat,lSummonspot,"",FALSE);
location lLoc = GetFollowerWouldBeLocation(oSummon);
SetLocation(oSummon,lLoc);
// -----------------------------------------------------------------
// Calculate the level to scale to
// -----------------------------------------------------------------
//float fScale = bMaster? 0.9 : 0.75;
int nLevel = FloatToInt(GetLevel(oCaster) * 0.75);
int nLevelToScale = Max(1,nLevel); //AS_GetCreatureLevelToScale(oSummon,Max(1,GetLevel(oCaster) -1)) + (bMaster?2:0);
int nclass = 0;
// -----------------------------------------------------------------
// Now, we scale the creature.
// 1. Force XP to 0, which triggers a stat reset in AS_Init.
// 2. For animate dead, force a class to be set on the target.
// -----------------------------------------------------------------
SetCreatureProperty(oSummon, PROPERTY_SIMPLE_EXPERIENCE, 0.0f);
// -----------------------------------------------------------------
// Force summon to 'Normal' rank and initialize them with an
// override class
// -----------------------------------------------------------------
SetCreatureRank(oSummon,CREATURE_RANK_CRITTER);
AS_InitCreature(oSummon, nLevelToScale, FALSE, nclass);
// -----------------------------------------------------------------
// Activate the summon and add it to the active party.
// This has to happen AFTER scaling to avoid it being
// rescaled and messed with by Yaron's follower catchup code.
// -----------------------------------------------------------------
WR_SetObjectActive(oSummon, TRUE);
WR_SetFollowerState(oSummon, FOLLOWER_STATE_ACTIVE);
// -----------------------------------------------------------------
// Prevent it from accessing the levelup UI and gaining XP.
// -----------------------------------------------------------------
SetCanLevelUp(oSummon, FALSE);
SetLocalInt (oSummon, CREATURE_REWARD_FLAGS, 1);
effect eSummon = Effect(EFFECT_TYPE_LOCK_CHARACTER);
ApplyEffectOnObject(EFFECT_DURATION_TYPE_PERMANENT, eSummon, oSummon, 0.0, OBJECT_SELF, 0);
break;
}
default:
{break;}
}
}
Modifié par Baracuda6977, 08 février 2010 - 12:09 .





Retour en haut






