|
@@ -23,7 +23,7 @@ function NPCModule(NPC, Spawn)
|
|
Regen(NPC, Spawn) -- Sets NPC's health and/or power regeneration rates or disables regeneration entirely.
|
|
Regen(NPC, Spawn) -- Sets NPC's health and/or power regeneration rates or disables regeneration entirely.
|
|
HealthPower(NPC, Spawn) -- Calculates NPC's based on level and difficulty.
|
|
HealthPower(NPC, Spawn) -- Calculates NPC's based on level and difficulty.
|
|
--Heroic(NPC, Spawn) -- Detects if an NPC should be flagged as heroic and sets the heroic flag accordingly.
|
|
--Heroic(NPC, Spawn) -- Detects if an NPC should be flagged as heroic and sets the heroic flag accordingly.
|
|
- AddTimer(NPC, 25, "Heroic")
|
|
|
|
|
|
+ AddTimer(NPC, 25, "Heroic") -- Applies heroic flag immediately after spawn in accordance with the way the server loads spawns.
|
|
AddTimer(NPC, 1000, "Heroic") -- Redundant heroic check to compensate for server lag when using developer commands to reload spawns.
|
|
AddTimer(NPC, 1000, "Heroic") -- Redundant heroic check to compensate for server lag when using developer commands to reload spawns.
|
|
|
|
|
|
end
|
|
end
|
|
@@ -371,10 +371,12 @@ function HealthPower(NPC, Spawn)
|
|
pw = 900 * PWMod * GlobalPowerMod -- temp values
|
|
pw = 900 * PWMod * GlobalPowerMod -- temp values
|
|
end
|
|
end
|
|
|
|
|
|
- SetMaxHP(NPC, math.floor(hp))
|
|
|
|
|
|
+ ModifyMaxHP(NPC, math.floor(hp))
|
|
ModifyHP(NPC, math.floor(hp))
|
|
ModifyHP(NPC, math.floor(hp))
|
|
- SetMaxPower(NPC, math.floor(pw))
|
|
|
|
- ModifyPower(NPC, math.floor(pw))
|
|
|
|
|
|
+ ModifyMaxPower(NPC, math.floor(pw))
|
|
|
|
+ ModifyPower(NPC, math.floor(hp))
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
end
|
|
end
|
|
|
|
|
|
@@ -611,13 +613,11 @@ end
|
|
function Deathfist(NPC, Spawn)
|
|
function Deathfist(NPC, Spawn)
|
|
SpawnSet(NPC,"model_type",137)
|
|
SpawnSet(NPC,"model_type",137)
|
|
SpawnSet(NPC, "race", 20)
|
|
SpawnSet(NPC, "race", 20)
|
|
- SpawnSet(NPC, "faction", 119)
|
|
|
|
end
|
|
end
|
|
|
|
|
|
function Bloodskull(NPC, Spawn)
|
|
function Bloodskull(NPC, Spawn)
|
|
SpawnSet(NPC,"model_type",137)
|
|
SpawnSet(NPC,"model_type",137)
|
|
SpawnSet(NPC, "race", 20)
|
|
SpawnSet(NPC, "race", 20)
|
|
- SpawnSet(NPC, "faction", 120)
|
|
|
|
SpawnSet(NPC, "skin_color", "50 60 50")
|
|
SpawnSet(NPC, "skin_color", "50 60 50")
|
|
SpawnSet(NPC, "eye_color", "98 63 28")
|
|
SpawnSet(NPC, "eye_color", "98 63 28")
|
|
end
|
|
end
|
|
@@ -625,7 +625,6 @@ end
|
|
function Brokentusk(NPC, Spawn)
|
|
function Brokentusk(NPC, Spawn)
|
|
SpawnSet(NPC,"model_type",137)
|
|
SpawnSet(NPC,"model_type",137)
|
|
SpawnSet(NPC, "race", 20)
|
|
SpawnSet(NPC, "race", 20)
|
|
- SpawnSet(NPC, "faction", 367)
|
|
|
|
SpawnSet(NPC, "skin_color", "110 75 75")
|
|
SpawnSet(NPC, "skin_color", "110 75 75")
|
|
SpawnSet(NPC, "eye_color", "98 63 28")
|
|
SpawnSet(NPC, "eye_color", "98 63 28")
|
|
end
|
|
end
|
|
@@ -633,7 +632,6 @@ end
|
|
function Lonetusk(NPC, Spawn)
|
|
function Lonetusk(NPC, Spawn)
|
|
SpawnSet(NPC,"model_type",137)
|
|
SpawnSet(NPC,"model_type",137)
|
|
SpawnSet(NPC, "race", 20)
|
|
SpawnSet(NPC, "race", 20)
|
|
- SpawnSet(NPC, "faction", 366)
|
|
|
|
SpawnSet(NPC, "skin_color", "92 52 52")
|
|
SpawnSet(NPC, "skin_color", "92 52 52")
|
|
SpawnSet(NPC, "eye_color", "98 63 28")
|
|
SpawnSet(NPC, "eye_color", "98 63 28")
|
|
end
|
|
end
|
|
@@ -641,7 +639,6 @@ end
|
|
function Ree(NPC, Spawn)
|
|
function Ree(NPC, Spawn)
|
|
SpawnSet(NPC,"model_type",137)
|
|
SpawnSet(NPC,"model_type",137)
|
|
SpawnSet(NPC, "race", 20)
|
|
SpawnSet(NPC, "race", 20)
|
|
- SpawnSet(NPC, "faction", 121)
|
|
|
|
end
|
|
end
|
|
|
|
|
|
-- DoF compatible hair functions
|
|
-- DoF compatible hair functions
|
|
@@ -1008,16 +1005,48 @@ function MovementMod(NPC, Spawn, NegDist, PosDist, Speed, MinDly, MaxDly)
|
|
|
|
|
|
end
|
|
end
|
|
|
|
|
|
--- Automatically enforce level uniformity in multi-spawn encounters
|
|
|
|
-function Encounters(NPC, Spawn)
|
|
|
|
- local group = GetGroup(NPC)
|
|
|
|
|
|
+-- Automatically calculate hit points, power, and regeneration for named NPCs
|
|
|
|
+function Named(NPC, Spawn)
|
|
|
|
+ level = GetLevel(NPC)
|
|
|
|
+ difficulty = GetDifficulty(NPC)
|
|
|
|
+ NamedMod = 1.5
|
|
|
|
+ HealthPower(NPC)
|
|
|
|
|
|
- if group ~= nil then
|
|
|
|
- for k,v in ipairs(group) do
|
|
|
|
- GroupLevel= GetLevel(v)
|
|
|
|
- Level = GroupLevel
|
|
|
|
- SpawnSet(NPC, "level", GroupLevel)
|
|
|
|
- end
|
|
|
|
|
|
+ ModifyMaxHP(NPC, math.floor(hp * NamedMod))
|
|
|
|
+ ModifyHP(NPC, math.floor(hp * NamedMod))
|
|
|
|
+ ModifyMaxPower(NPC, math.floor(pw * NamedMod))
|
|
|
|
+ ModifyPower(NPC, math.floor(hp * NamedMod))
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ SetInfoStructUInt(NPC, "hp_regen_override", 1)
|
|
|
|
+ SetInfoStructSInt(NPC, "hp_regen", (level * 2) + (difficulty * 2))
|
|
|
|
+ SetInfoStructUInt(NPC, "pw_regen_override", 1)
|
|
|
|
+ SetInfoStructSInt(NPC, "pw_regen", (level * 2) + (difficulty * 2))
|
|
|
|
+end
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+-- Social Aggro by Faction- IN PROGRESS, DO NOT USE
|
|
|
|
+function Social(NPC, Spawn)
|
|
|
|
+ MyFaction = GetFactionID(NPC)
|
|
|
|
+ SocialRadius = GetAggroRadius(NPC) * 2
|
|
|
|
+ SetPlayerProximityFunction(NPC, SocialRadius, "CheckCombat")
|
|
|
|
+end
|
|
|
|
+
|
|
|
|
+function CheckCombat(NPC, Spawn)
|
|
|
|
+ Say(NPC, "Checking for combat.")
|
|
|
|
+ if IsInCombat(Spawn) then
|
|
|
|
+ Say(NPC, "You're in combat!")
|
|
|
|
+ SocialAggro(NPC, Spawn)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
|
|
|
|
+function SocialAggro(NPC, Spawn)
|
|
|
|
+ local MobAssist = GetTarget(Spawn)
|
|
|
|
+ local AssistFaction = GetFactionID(MobAssist)
|
|
|
|
+ if MyFaction == AssistFaction then
|
|
|
|
+ Attack(NPC, Spawn)
|
|
|
|
+ end
|
|
|
|
+end
|
|
|
|
+
|
|
|
|
+
|