Skip to content

Commit c1af55a

Browse files
committed
Adjustments to monster creation
1 parent e292e70 commit c1af55a

File tree

2 files changed

+122
-83
lines changed

2 files changed

+122
-83
lines changed

Zolian.Server.Base/GameScripts/Creations/CreateMonster.cs

Lines changed: 63 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public override Monster Create()
7474
var currentMpMultiplier = 4000;
7575

7676
// Generate multipliers for levels above 249
77-
for (var level = 250; level <= 1000; level += 5)
77+
for (var level = 250; level <= 1200; level += 5)
7878
{
7979
currentHpMultiplier = (int)(currentHpMultiplier * 1.05);
8080
currentMpMultiplier = (int)(currentMpMultiplier * 1.05);
@@ -298,14 +298,47 @@ private static void MonsterSize(Monster obj)
298298
<= 100 => obj.Size = "Colossal",
299299
_ => obj.Size = "Lessor"
300300
},
301+
<= 250 => sizeRand switch
302+
{
303+
<= 7 => obj.Size = "Lessor",
304+
<= 20 => obj.Size = "Small",
305+
<= 35 => obj.Size = "Medium",
306+
<= 50 => obj.Size = "Large",
307+
<= 70 => obj.Size = "Great",
308+
<= 85 => obj.Size = "Colossal",
309+
<= 100 => obj.Size = "Deity",
310+
_ => obj.Size = "Lessor"
311+
},
312+
<= 500 => sizeRand switch
313+
{
314+
<= 5 => obj.Size = "Lessor",
315+
<= 15 => obj.Size = "Small",
316+
<= 30 => obj.Size = "Medium",
317+
<= 55 => obj.Size = "Large",
318+
<= 65 => obj.Size = "Great",
319+
<= 80 => obj.Size = "Colossal",
320+
<= 100 => obj.Size = "Deity",
321+
_ => obj.Size = "Lessor"
322+
},
323+
<= 750 => sizeRand switch
324+
{
325+
<= 3 => obj.Size = "Lessor",
326+
<= 10 => obj.Size = "Small",
327+
<= 20 => obj.Size = "Medium",
328+
<= 30 => obj.Size = "Large",
329+
<= 50 => obj.Size = "Great",
330+
<= 70 => obj.Size = "Colossal",
331+
<= 100 => obj.Size = "Deity",
332+
_ => obj.Size = "Lessor"
333+
},
301334
_ => sizeRand switch
302335
{
303-
<= 10 => obj.Size = "Lessor",
304-
<= 30 => obj.Size = "Small",
305-
<= 50 => obj.Size = "Medium",
306-
<= 70 => obj.Size = "Large",
307-
<= 90 => obj.Size = "Great",
308-
<= 95 => obj.Size = "Colossal",
336+
<= 1 => obj.Size = "Lessor",
337+
<= 5 => obj.Size = "Small",
338+
<= 10 => obj.Size = "Medium",
339+
<= 30 => obj.Size = "Large",
340+
<= 50 => obj.Size = "Great",
341+
<= 70 => obj.Size = "Colossal",
309342
<= 100 => obj.Size = "Deity",
310343
_ => obj.Size = "Lessor"
311344
}
@@ -453,7 +486,7 @@ private static void MonsterExperience(Monster obj)
453486
};
454487

455488
const long startLevel = 200;
456-
const long endLevel = 1000;
489+
const long endLevel = 1200;
457490
// ToDo: Increment this in the future if higher levels need more experience
458491
var stepSize = 5;
459492

@@ -562,7 +595,7 @@ private static void MonsterAbility(Monster obj)
562595
};
563596

564597
const int startLevel = 500;
565-
const int endLevel = 1000;
598+
const int endLevel = 1200;
566599
// ToDo: Increment this in the future if higher levels need more experience
567600
var stepSize = 5;
568601

@@ -807,25 +840,27 @@ private static void MonsterStartingStats(Monster obj)
807840
{ 190, (124, 323) },
808841
{ 194, (126, 330) },
809842
{ 200, (130, 340) },
810-
{ 215, (140, 366)},
811-
{ 230, (150, 391)},
812-
{ 245, (159, 417)},
813-
{ 260, (169, 442)},
814-
{ 275, (179, 468)},
815-
{ 300, (195, 510)},
816-
{ 315, (205, 536)},
817-
{ 330, (215, 561)},
818-
{ 345, (224, 587)},
819-
{ 360, (234, 612)},
820-
{ 375, (244, 638)},
821-
{ 400, (260, 680)},
822-
{ 415, (270, 706)},
823-
{ 430, (280, 731)},
824-
{ 445, (289, 757)},
825-
{ 460, (299, 782)},
826-
{ 475, (309, 808)},
827-
{ 500, (325, 850)},
828-
{ int.MaxValue, (345, 900) }
843+
{ 215, (140, 366) },
844+
{ 230, (150, 391) },
845+
{ 245, (159, 417) },
846+
{ 260, (169, 442) },
847+
{ 275, (179, 468) },
848+
{ 300, (195, 510) },
849+
{ 315, (205, 536) },
850+
{ 330, (215, 561) },
851+
{ 345, (224, 587) },
852+
{ 360, (234, 612) },
853+
{ 375, (244, 638) },
854+
{ 400, (260, 680) },
855+
{ 415, (270, 706) },
856+
{ 430, (280, 731) },
857+
{ 445, (289, 757) },
858+
{ 460, (299, 782) },
859+
{ 475, (309, 808) },
860+
{ 500, (325, 850) },
861+
{ 750, (345, 900) },
862+
{ 950, (365, 950) },
863+
{ 1000, (385, 1000) }
829864
};
830865

831866
var statsToUpdate = new List<Action<int>>

Zolian.Server.Base/GameScripts/Mundanes/Abel/Chromitus.cs

Lines changed: 59 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public override void OnResponse(WorldClient client, ushort responseID, string ar
6969
}
7070
}
7171

72-
private void PopulateMapWithAppropriateMonsters(WorldClient client, Area area)
72+
private static void PopulateMapWithAppropriateMonsters(WorldClient client, Area area)
7373
{
7474
var sprites = new List<int>
7575
{
@@ -99,66 +99,70 @@ private void PopulateMapWithAppropriateMonsters(WorldClient client, Area area)
9999

100100
var monsterTemplates = new List<MonsterTemplate>();
101101

102-
for (var i = 0; i < 10; i++)
102+
try
103103
{
104-
var temp = new MonsterTemplate
104+
for (var i = 0; i < 10; i++)
105105
{
106-
ScriptName = "RiftMob",
107-
BaseName = "Rift Mob",
108-
Name = $"{Random.Shared.NextInt64()}RiftMob",
109-
AreaID = area.ID,
110-
Image = (ushort)sprites.RandomIEnum(),
111-
ElementType = ElementQualifer.Random,
112-
PathQualifer = PathQualifer.Wander,
113-
SpawnType = SpawnQualifer.Random,
114-
SpawnSize = Random.Shared.Next(10, 20),
115-
MoodType = MoodQualifer.Aggressive,
116-
MonsterType = MonsterType.Rift,
117-
MonsterArmorType = MonsterArmorType.Caster,
118-
MonsterRace = Enum.GetValues<MonsterRace>().RandomIEnum(),
119-
IgnoreCollision = false,
120-
Waypoints = [],
121-
MovementSpeed = 1000,
122-
EngagedWalkingSpeed = Random.Shared.Next(800, 1400),
123-
AttackSpeed = Random.Shared.Next(800, 1200),
124-
CastSpeed = Random.Shared.Next(5000, 8000),
125-
LootType = LootQualifer.RandomGold,
126-
Level = (ushort)(client.Aisling.ExpLevel + client.Aisling.AbpLevel + Random.Shared.Next(1, 10)),
127-
SkillScripts = [],
128-
AbilityScripts = [],
129-
SpellScripts = []
130-
};
131-
132-
var randArmor = Random.Shared.Next(0, 1);
133-
temp.MonsterArmorType = randArmor == 0 ? MonsterArmorType.Caster : MonsterArmorType.Tank;
134-
135-
if (temp.OffenseElement == ElementManager.Element.Terror)
136-
temp.OffenseElement = Enum.GetValues<ElementManager.Element>().RandomIEnum();
137-
138-
if (temp.MonsterRace == MonsterRace.Bahamut)
139-
temp.MonsterRace = MonsterRace.Dragon;
140-
141-
if (temp.MonsterRace == MonsterRace.HigherBeing)
142-
temp.MonsterRace = MonsterRace.Aberration;
143-
144-
if (temp.MonsterRace == MonsterRace.LowerBeing)
145-
temp.MonsterRace = MonsterRace.Rodent;
146-
147-
if (temp.MonsterRace.MonsterRaceIsSet(MonsterRace.Aberration))
148-
temp.IgnoreCollision = true;
149-
150-
monsterTemplates.Add(temp);
151-
}
106+
var temp = new MonsterTemplate
107+
{
108+
ScriptName = "RiftMob",
109+
BaseName = "Rift Mob",
110+
Name = $"{Random.Shared.NextInt64()}RiftMob",
111+
AreaID = area.ID,
112+
Image = (ushort)sprites.RandomIEnum(),
113+
ElementType = ElementQualifer.Random,
114+
PathQualifer = PathQualifer.Wander,
115+
SpawnType = SpawnQualifer.Random,
116+
SpawnSize = Random.Shared.Next(10, 20),
117+
MoodType = MoodQualifer.Aggressive,
118+
MonsterType = MonsterType.Rift,
119+
MonsterArmorType = MonsterArmorType.Caster,
120+
MonsterRace = Enum.GetValues<MonsterRace>().RandomIEnum(),
121+
IgnoreCollision = false,
122+
Waypoints = [],
123+
MovementSpeed = 1000,
124+
EngagedWalkingSpeed = Random.Shared.Next(800, 1400),
125+
AttackSpeed = Random.Shared.Next(800, 1200),
126+
CastSpeed = Random.Shared.Next(5000, 8000),
127+
LootType = LootQualifer.RandomGold,
128+
Level = (ushort)(client.Aisling.ExpLevel + client.Aisling.AbpLevel + Random.Shared.Next(1, 10)),
129+
SkillScripts = [],
130+
AbilityScripts = [],
131+
SpellScripts = []
132+
};
133+
134+
var randArmor = Random.Shared.Next(0, 1);
135+
temp.MonsterArmorType = randArmor == 0 ? MonsterArmorType.Caster : MonsterArmorType.Tank;
136+
137+
if (temp.OffenseElement == ElementManager.Element.Terror)
138+
temp.OffenseElement = Enum.GetValues<ElementManager.Element>().RandomIEnum();
139+
140+
if (temp.MonsterRace == MonsterRace.Bahamut)
141+
temp.MonsterRace = MonsterRace.Dragon;
142+
143+
if (temp.MonsterRace == MonsterRace.HigherBeing)
144+
temp.MonsterRace = MonsterRace.Aberration;
145+
146+
if (temp.MonsterRace == MonsterRace.LowerBeing)
147+
temp.MonsterRace = MonsterRace.Rodent;
148+
149+
if (temp.MonsterRace.MonsterRaceIsSet(MonsterRace.Aberration))
150+
temp.IgnoreCollision = true;
151+
152+
monsterTemplates.Add(temp);
153+
}
152154

153-
foreach (var template in monsterTemplates)
154-
{
155-
for (var i = 0; i < template.SpawnSize; i++)
155+
foreach (var template in monsterTemplates)
156156
{
157-
var monster = Monster.Create(template, area);
158-
if (monster == null) continue;
159-
AddObject(monster);
157+
for (var i = 0; i < template.SpawnSize; i++)
158+
{
159+
var monster = Monster.Create(template, area);
160+
if (monster == null) continue;
161+
AddObject(monster);
162+
}
160163
}
161164
}
165+
catch { }
162166
}
163167

164168
private static void PortGroup(WorldClient client, Area map, int rand)

0 commit comments

Comments
 (0)