diff --git a/Commands/BloodCommands.cs b/Commands/BloodCommands.cs index a92b849..101b960 100644 --- a/Commands/BloodCommands.cs +++ b/Commands/BloodCommands.cs @@ -15,7 +15,8 @@ public enum BloodType Rogue = 793735874, Brute = 581377887, Scholar = -586506765, - Worker = -540707191 + Worker = -540707191, + Mutant = -2017994753 } [Command("bloodpotion", "bp", description: "Creates a Potion with specified Blood Type, Quality and Value", adminOnly: true)] diff --git a/Commands/SpawnCommands.cs b/Commands/SpawnCommands.cs new file mode 100644 index 0000000..6b5799e --- /dev/null +++ b/Commands/SpawnCommands.cs @@ -0,0 +1,22 @@ +using Unity.Transforms; +using VampireCommandFramework; + +namespace CommunityCommands.Commands; + +internal static class SpawnCommands +{ + [Command("spawnnpc", "spwn", description: "spawnnpc [] - Spawns a modified NPC at your current position.", adminOnly: true)] + public static void CustomSpawnNPC(ChatCommandContext ctx, string name, int count = 1) + { + var em = Helper.Server.EntityManager; + var pos = em.GetComponentData(ctx.Event.SenderCharacterEntity).Position; + + if (!Helper.SpawnAtPosition(ctx.Event.SenderUserEntity, name, count, new(pos.x, pos.z), 1, 2, 1800)) + { + ctx.Reply($"Could not find specified unit: {name}"); + return; + } + + ctx.Reply($"Spawning CustomNPC {name} at your position"); + } +} \ No newline at end of file diff --git a/Database.cs b/Database.cs new file mode 100644 index 0000000..694936d --- /dev/null +++ b/Database.cs @@ -0,0 +1,324 @@ +using ProjectM; +using System.Collections.Generic; + +namespace CommunityCommands; + +public class Database +{ + public static Dictionary database_units = new() + { + { "CHAR_AncientTreant", new PrefabGUID(1843624663) }, + { "CHAR_AncientTreant_Spitter_Summon", new PrefabGUID(457857316) }, + { "CHAR_ArchMage_FlameSphere", new PrefabGUID(2138173476) }, + { "CHAR_ArchMage_Summon", new PrefabGUID(805231073) }, + { "CHAR_ArchMage_VBlood", new PrefabGUID(-2013903325) }, + { "CHAR_Bandit_Bomber", new PrefabGUID(-1128238456) }, + { "CHAR_Bandit_Bomber_Servant", new PrefabGUID(-450600397) }, + { "CHAR_Bandit_Bomber_VBlood", new PrefabGUID(1896428751) }, + { "CHAR_Bandit_Deadeye", new PrefabGUID(-1030822544) }, + { "CHAR_Bandit_Deadeye_Chaosarrow_VBlood", new PrefabGUID(763273073) }, + { "CHAR_Bandit_Deadeye_Frostarrow_VBlood", new PrefabGUID(1124739990) }, + { "CHAR_Bandit_Deadeye_Servant", new PrefabGUID(-2086044081) }, + { "CHAR_Bandit_Foreman_VBlood", new PrefabGUID(2122229952) }, + { "CHAR_Bandit_GraveDigger_VBlood", new PrefabGUID(936169687) }, + { "CHAR_Bandit_Hunter", new PrefabGUID(-1301144178) }, + { "CHAR_Bandit_Hunter_Servant", new PrefabGUID(-370708253) }, + { "CHAR_Bandit_Leader_VBlood", new PrefabGUID(-175381832) }, + { "CHAR_Bandit_Leader_Wolf_Summon", new PrefabGUID(-671059374) }, + { "CHAR_Bandit_Miner_Standard", new PrefabGUID(-2039670689) }, + { "CHAR_Bandit_Miner_Standard_Servant", new PrefabGUID(1112903312) }, + { "CHAR_Bandit_Miner_VBlood", new PrefabGUID(276934707) }, + { "CHAR_Bandit_Mugger", new PrefabGUID(2057508774) }, + { "CHAR_Bandit_Mugger_Servant", new PrefabGUID(1727426580) }, + { "CHAR_Bandit_Prisoner_Villager_Female", new PrefabGUID(1069072707) }, + { "CHAR_Bandit_Prisoner_Villager_Male", new PrefabGUID(286320185) }, + { "CHAR_Bandit_Prisoner_Villager_Male_VBlood", new PrefabGUID(-1620871789) }, + { "CHAR_Bandit_Stalker", new PrefabGUID(-309264723) }, + { "CHAR_Bandit_Stalker_Servant", new PrefabGUID(1453520986) }, + { "CHAR_Bandit_Stalker_VBlood", new PrefabGUID(1106149033) }, + { "CHAR_Bandit_StoneBreaker_VBlood", new PrefabGUID(-2025101517) }, + { "CHAR_Bandit_Thief", new PrefabGUID(923140362) }, + { "CHAR_Bandit_Thief_Servant", new PrefabGUID(-872078546) }, + { "CHAR_Bandit_Thief_VBlood", new PrefabGUID(2139023341) }, + { "CHAR_Bandit_Thug", new PrefabGUID(-301730941) }, + { "CHAR_Bandit_Thug_Servant", new PrefabGUID(1466015976) }, + { "CHAR_Bandit_Tourok_VBlood", new PrefabGUID(-1659822956) }, + { "CHAR_Bandit_Trapper", new PrefabGUID(-589412777) }, + { "CHAR_Bandit_Trapper_Servant", new PrefabGUID(2112911542) }, + { "CHAR_Bandit_Wolf", new PrefabGUID(-1554428547) }, + { "CHAR_Bandit_Woodcutter_Standard", new PrefabGUID(1309418594) }, + { "CHAR_Bandit_Woodcutter_Standard_Servant", new PrefabGUID(51737727) }, + { "CHAR_BatVampire_VBlood", new PrefabGUID(1112948824) }, + { "CHAR_CopperGolem", new PrefabGUID(1107541186) }, + { "CHAR_CreatureSheep_AnimalSheep", new PrefabGUID(-1312962006) }, + { "CHAR_Critter_Bloodmaggot", new PrefabGUID(2054208006) }, + { "CHAR_Critter_Mosquito", new PrefabGUID(-2046154890) }, + { "CHAR_Critter_Rat", new PrefabGUID(-2072914343) }, + { "CHAR_Critter_Silkworm", new PrefabGUID(-1587402408) }, + { "CHAR_Critter_VerminNest_Rat", new PrefabGUID(-372256748) }, + { "CHAR_Cultist_Pyromancer", new PrefabGUID(2055824593) }, + { "CHAR_Cultist_Slicer", new PrefabGUID(1807491570) }, + { "CHAR_Cursed_Bear_Spirit", new PrefabGUID(1105583702) }, + { "CHAR_Cursed_Bear_Standard", new PrefabGUID(-559819989) }, + { "CHAR_Cursed_MonsterToad", new PrefabGUID(575918722) }, + { "CHAR_Cursed_MonsterToad_Minion", new PrefabGUID(-38041784) }, + { "CHAR_Cursed_Mosquito", new PrefabGUID(-744966291) }, + { "CHAR_Cursed_MountainBeast_SpiritDouble", new PrefabGUID(-935560085) }, + { "CHAR_Cursed_MountainBeast_VBlood", new PrefabGUID(-1936575244) }, + { "CHAR_Cursed_Nightlurker", new PrefabGUID(-2046268156) }, + { "CHAR_Cursed_ToadKing_VBlood", new PrefabGUID(-203043163) }, + { "CHAR_Cursed_ToadSpitter", new PrefabGUID(1478790879) }, + { "CHAR_Cursed_Treant_Dark", new PrefabGUID(-1708902190) }, + { "CHAR_Cursed_Witch", new PrefabGUID(-56441915) }, + { "CHAR_Cursed_Witch_VBlood", new PrefabGUID(-910296704) }, + { "CHAR_Cursed_WitheredVampire", new PrefabGUID(-279978174) }, + { "CHAR_Cursed_Wolf", new PrefabGUID(-218175217) }, + { "CHAR_Cursed_Wolf_Spirit", new PrefabGUID(407089231) }, + { "CHAR_Cursed_WormTerror", new PrefabGUID(658578725) }, + { "CHAR_Demon", new PrefabGUID(-978021978) }, + { "CHAR_Farmlands_Cow", new PrefabGUID(721166952) }, + { "CHAR_Farmlands_Farmer", new PrefabGUID(-1342764880) }, + { "CHAR_Farmlands_Farmer_Servant", new PrefabGUID(516718373) }, + { "CHAR_Farmlands_HostileVillager_Female_FryingPan", new PrefabGUID(729746981) }, + { "CHAR_Farmlands_HostileVillager_Female_Pitchfork", new PrefabGUID(1576267559) }, + { "CHAR_Farmlands_HostileVillager_Male_Club", new PrefabGUID(-164116132) }, + { "CHAR_Farmlands_HostileVillager_Male_Shovel", new PrefabGUID(-864975423) }, + { "CHAR_Farmlands_HostileVillager_Male_Torch", new PrefabGUID(-81727312) }, + { "CHAR_Farmlands_HostileVillager_Male_Unarmed", new PrefabGUID(-1353870145) }, + { "CHAR_Farmlands_HostileVillager_Werewolf", new PrefabGUID(-951976780) }, + { "CHAR_Farmlands_Hound_VBlood", new PrefabGUID(-1373413273) }, + { "CHAR_Farmlands_HoundMaster_VBlood", new PrefabGUID(-784265984) }, + { "CHAR_Farmlands_Militia_Summon", new PrefabGUID(-213868361) }, + { "CHAR_Farmlands_Nun", new PrefabGUID(-700632469) }, + { "CHAR_Farmlands_Nun_Servant", new PrefabGUID(-1788957652) }, + { "CHAR_Farmlands_Nun_VBlood", new PrefabGUID(-99012450) }, + { "CHAR_Farmlands_Pig", new PrefabGUID(-1356006948) }, + { "CHAR_Farmlands_Ram", new PrefabGUID(947731555) }, + { "CHAR_Farmlands_Sheep", new PrefabGUID(1012307512) }, + { "CHAR_Farmlands_SheepOld", new PrefabGUID(1635167941) }, + { "CHAR_Farmlands_SmallPig", new PrefabGUID(1420480270) }, + { "CHAR_Farmlands_Villager_Female", new PrefabGUID(525027204) }, + { "CHAR_Farmlands_Villager_Female_Servant", new PrefabGUID(1532829342) }, + { "CHAR_Farmlands_Villager_Female_Sister", new PrefabGUID(1772642154) }, + { "CHAR_Farmlands_Villager_Female_Sister_Servant", new PrefabGUID(-444945115) }, + { "CHAR_Farmlands_Villager_Male", new PrefabGUID(1887807944) }, + { "CHAR_Farmlands_Villager_Male_Servant", new PrefabGUID(1426964824) }, + { "CHAR_Farmlands_Woodcutter_Standard", new PrefabGUID(-893091615) }, + { "CHAR_Farmlands_Woodcutter_Standard_Servant", new PrefabGUID(-1659842473) }, + { "CHAR_Geomancer_Golem_Guardian", new PrefabGUID(-2092246077) }, + { "CHAR_Geomancer_Golem_VBlood", new PrefabGUID(-1317534496) }, + { "CHAR_Geomancer_Human_VBlood", new PrefabGUID(-1065970933) }, + { "CHAR_Ghoul_Unholy_Summon", new PrefabGUID(679136439) }, + { "CHAR_Harpy_Dasher", new PrefabGUID(-1846851895) }, + { "CHAR_Harpy_Dasher_SUMMON", new PrefabGUID(1635780151) }, + { "CHAR_Harpy_FeatherDuster", new PrefabGUID(-1407234470) }, + { "CHAR_Harpy_Matriarch_VBlood", new PrefabGUID(685266977) }, + { "CHAR_Harpy_Scratcher", new PrefabGUID(1462269123) }, + { "CHAR_Harpy_Sorceress", new PrefabGUID(1224283123) }, + { "CHAR_IronGolem", new PrefabGUID(763796308) }, + { "CHAR_Manticore_Flame_UNUSED", new PrefabGUID(-78083191) }, + { "CHAR_Manticore_HomePos", new PrefabGUID(980068444) }, + { "CHAR_Manticore_VBlood", new PrefabGUID(-393555055) }, + { "CHAR_Mantrap_Dull", new PrefabGUID(-878541676) }, + { "CHAR_Mantrap_Nest", new PrefabGUID(2016963774) }, + { "CHAR_Mantrap_PlantMother_Boss", new PrefabGUID(1407911482) }, + { "CHAR_Mantrap_PlantMother_Boss_Summon", new PrefabGUID(1430167878) }, + { "CHAR_Mantrap_Standard", new PrefabGUID(173817657) }, + { "CHAR_Militia_BellRinger", new PrefabGUID(-1670130821) }, + { "CHAR_Militia_BellRinger_Servant", new PrefabGUID(-1433235567) }, + { "CHAR_Militia_BishopOfDunley_VBlood", new PrefabGUID(-680831417) }, + { "CHAR_Militia_Bomber", new PrefabGUID(847893333) }, + { "CHAR_Militia_Bomber_Servant", new PrefabGUID(232701971) }, + { "CHAR_Militia_ConstrainingPole", new PrefabGUID(85290673) }, + { "CHAR_Militia_Crossbow", new PrefabGUID(956965183) }, + { "CHAR_Militia_Crossbow_Servant", new PrefabGUID(1481842114) }, + { "CHAR_Militia_Crossbow_Summon", new PrefabGUID(2036785949) }, + { "CHAR_Militia_Devoted", new PrefabGUID(1660801216) }, + { "CHAR_Militia_Devoted_Servant", new PrefabGUID(-823557242) }, + { "CHAR_Militia_EyeOfGod", new PrefabGUID(-1254618756) }, + { "CHAR_Militia_Guard", new PrefabGUID(1730498275) }, + { "CHAR_Militia_Guard_Servant", new PrefabGUID(-1447279513) }, + { "CHAR_Militia_Guard_Summon", new PrefabGUID(1050151632) }, + { "CHAR_Militia_Guard_VBlood", new PrefabGUID(-29797003) }, + { "CHAR_Militia_Heavy", new PrefabGUID(2005508157) }, + { "CHAR_Militia_Heavy_Servant", new PrefabGUID(-1773935659) }, + { "CHAR_Militia_Hound", new PrefabGUID(-249647316) }, + { "CHAR_Militia_Leader_VBlood", new PrefabGUID(1688478381) }, + { "CHAR_Militia_Light", new PrefabGUID(-63435588) }, + { "CHAR_Militia_Light_Servant", new PrefabGUID(169329980) }, + { "CHAR_Militia_Light_Summon", new PrefabGUID(1772451421) }, + { "CHAR_Militia_Longbowman", new PrefabGUID(203103783) }, + { "CHAR_Militia_Longbowman_LightArrow_Vblood", new PrefabGUID(850622034) }, + { "CHAR_Militia_Longbowman_Servant", new PrefabGUID(-242295780) }, + { "CHAR_Militia_Longbowman_Summon", new PrefabGUID(1083647444) }, + { "CHAR_Militia_Miner_Standard", new PrefabGUID(-1072754152) }, + { "CHAR_Militia_Miner_Standard_Servant", new PrefabGUID(-1363137425) }, + { "CHAR_Militia_Torchbearer", new PrefabGUID(37713289) }, + { "CHAR_Militia_Torchbearer_Servant", new PrefabGUID(986768339) }, + { "CHAR_Moose_VBlood", new PrefabGUID(1730711592) }, + { "CHAR_Paladin_DivineAngel", new PrefabGUID(-1737346940) }, + { "CHAR_Paladin_FallenAngel", new PrefabGUID(-76116724) }, + { "CHAR_Paladin_HomePos", new PrefabGUID(-502558061) }, + { "CHAR_Paladin_VBlood", new PrefabGUID(-740796338) }, + { "CHAR_Pixie", new PrefabGUID(1434914085) }, + { "CHAR_Plantmother", new PrefabGUID(1194309425) }, + { "CHAR_Scarecrow", new PrefabGUID(-1750347680) }, + { "CHAR_Spectral_Assassin", new PrefabGUID(-830249769) }, + { "CHAR_Spectral_Guardian", new PrefabGUID(304726480) }, + { "CHAR_Spectral_SpellSlinger", new PrefabGUID(2065149172) }, + { "CHAR_Spider_Baneling", new PrefabGUID(-764515001) }, + { "CHAR_Spider_Baneling_Summon", new PrefabGUID(-1004061470) }, + { "CHAR_Spider_Broodmother", new PrefabGUID(342127250) }, + { "CHAR_Spider_Melee", new PrefabGUID(2136899683) }, + { "CHAR_Spider_Melee_Summon", new PrefabGUID(2119230788) }, + { "CHAR_Spider_Queen_VBlood", new PrefabGUID(-548489519) }, + { "CHAR_Spider_Range", new PrefabGUID(2103131615) }, + { "CHAR_Spider_Range_Summon", new PrefabGUID(1974733695) }, + { "CHAR_Spiderling", new PrefabGUID(1078424589) }, + { "CHAR_Spiderling_Summon", new PrefabGUID(-18289884) }, + { "CHAR_Spiderling_VerminNest", new PrefabGUID(1767714956) }, + { "CHAR_StoneColossus", new PrefabGUID(-1779340970) }, + { "CHAR_StoneGolem", new PrefabGUID(-779411607) }, + { "CHAR_SUMMON_Wolf", new PrefabGUID(1825512527) }, + { "CHAR_Town_Archer", new PrefabGUID(426583055) }, + { "CHAR_Town_Archer_Servant", new PrefabGUID(-915884427) }, + { "CHAR_Town_Cardinal_VBlood", new PrefabGUID(114912615) }, + { "CHAR_Town_CardinalAide", new PrefabGUID(1745498602) }, + { "CHAR_Town_Cleric", new PrefabGUID(-1464869978) }, + { "CHAR_Town_Cleric_Servant", new PrefabGUID(1218339832) }, + { "CHAR_Town_EnchantedCross", new PrefabGUID(-1449314709) }, + { "CHAR_Town_Footman", new PrefabGUID(2128996433) }, + { "CHAR_Town_Footman_Servant", new PrefabGUID(-1719944550) }, + { "CHAR_Town_Horse", new PrefabGUID(1149585723) }, + { "CHAR_Town_Knight_2H", new PrefabGUID(-930333806) }, + { "CHAR_Town_Knight_2H_Servant", new PrefabGUID(17367048) }, + { "CHAR_Town_Knight_Shield", new PrefabGUID(794228023) }, + { "CHAR_Town_Knight_Shield_Servant", new PrefabGUID(-694328454) }, + { "CHAR_Town_Lightweaver", new PrefabGUID(1185952775) }, + { "CHAR_Town_Lightweaver_Servant", new PrefabGUID(-383158562) }, + { "CHAR_Town_Miner_Standard", new PrefabGUID(924132254) }, + { "CHAR_Town_Miner_Standard_Servant", new PrefabGUID(-1988959460) }, + { "CHAR_Town_Paladin", new PrefabGUID(1728773109) }, + { "CHAR_Town_Paladin_Servant", new PrefabGUID(1649578802) }, + { "CHAR_Town_Priest", new PrefabGUID(1406393857) }, + { "CHAR_Town_Priest_Servant", new PrefabGUID(-1728284448) }, + { "CHAR_Town_Rifleman", new PrefabGUID(1148936156) }, + { "CHAR_Town_Rifleman_Servant", new PrefabGUID(-268935837) }, + { "CHAR_Town_SmiteOrb", new PrefabGUID(1917502536) }, + { "CHAR_Town_Villager_Female", new PrefabGUID(-1224027101) }, + { "CHAR_Town_Villager_Female_Servant", new PrefabGUID(1157537604) }, + { "CHAR_Town_Villager_Male", new PrefabGUID(-2025921616) }, + { "CHAR_Town_Villager_Male_Servant", new PrefabGUID(-1786031969) }, + { "CHAR_Trader_T01", new PrefabGUID(-1168705805) }, + { "CHAR_Trader_T02", new PrefabGUID(-2096362182) }, + { "CHAR_Trader_T03", new PrefabGUID(604519200) }, + { "CHAR_Treant", new PrefabGUID(-1089337069) }, + { "CHAR_Undead_ArmoredSkeletonCrossbow_Dunley", new PrefabGUID(-861407720) }, + { "CHAR_Undead_ArmoredSkeletonCrossbow_Farbane", new PrefabGUID(-195077008) }, + { "CHAR_Undead_Banshee", new PrefabGUID(-1146194149) }, + { "CHAR_Undead_BishopOfDeath_VBlood", new PrefabGUID(577478542) }, + { "CHAR_Undead_BishopOfShadows_VBlood", new PrefabGUID(939467639) }, + { "CHAR_Undead_FeralGhoul", new PrefabGUID(1730616829) }, + { "CHAR_Undead_Ghoul_Armored_Farmlands", new PrefabGUID(2105565286) }, + { "CHAR_Undead_Ghoul_Castle_Tomb", new PrefabGUID(937597711) }, + { "CHAR_Undead_Leader", new PrefabGUID(-1365931036) }, + { "CHAR_Undead_Mage_VBlood", new PrefabGUID(295582261) }, + { "CHAR_Undead_Necromancer", new PrefabGUID(-572568236) }, + { "CHAR_Undead_Priest", new PrefabGUID(-1653554504) }, + { "CHAR_Undead_Priest_VBlood", new PrefabGUID(153390636) }, + { "CHAR_Undead_RottingGhoul", new PrefabGUID(-1722506709) }, + { "CHAR_Undead_ShadowSoldier", new PrefabGUID(678628353) }, + { "CHAR_Undead_Skeleton_Unholy_Summon", new PrefabGUID(1604500740) }, + { "CHAR_Undead_SkeletonCrossbow_Base", new PrefabGUID(597386568) }, + { "CHAR_Undead_SkeletonCrossbow_Farbane_OLD", new PrefabGUID(1250474035) }, + { "CHAR_Undead_SkeletonCrossbow_Graveyard", new PrefabGUID(1395549638) }, + { "CHAR_Undead_SkeletonMage", new PrefabGUID(-1287507270) }, + { "CHAR_Undead_SkeletonSoldier_Armored_Dunley", new PrefabGUID(952695804) }, + { "CHAR_Undead_SkeletonSoldier_Armored_Farbane", new PrefabGUID(-837329073) }, + { "CHAR_Undead_SkeletonSoldier_Base", new PrefabGUID(-603934060) }, + { "CHAR_Undead_SkeletonSoldier_Unholy_Minion", new PrefabGUID(-1779239433) }, + { "CHAR_Undead_SkeletonSoldier_Withered", new PrefabGUID(-1584807109) }, + { "CHAR_Undead_UndyingGhoul", new PrefabGUID(1640311129) }, + { "CHAR_Undead_ZealousCultist_Ghost", new PrefabGUID(128488545) }, + { "CHAR_Undead_ZealousCultist_VBlood", new PrefabGUID(-1208888966) }, + { "CHAR_Unholy_Baneling", new PrefabGUID(-1823987835) }, + { "CHAR_Unholy_FallenAngel", new PrefabGUID(-1928607398) }, + { "CHAR_Unholy_MosquitoBomb", new PrefabGUID(30054246) }, + { "CHAR_Vampire_Withered", new PrefabGUID(-1117581429) }, + { "CHAR_Vampire_WitheredBatMinion", new PrefabGUID(-989999571) }, + { "CHAR_VampireMale", new PrefabGUID(38526109) }, + { "CHAR_Vermin_DireRat_VBlood", new PrefabGUID(-2039908510) }, + { "CHAR_Vermin_GiantRat", new PrefabGUID(-1722278689) }, + { "CHAR_VHunter_Jade_VBlood", new PrefabGUID(-1968372384) }, + { "CHAR_VHunter_Leader_VBlood", new PrefabGUID(-1449631170) }, + { "CHAR_Villager_Tailor_VBlood", new PrefabGUID(-1942352521) }, + { "CHAR_Wendigo_VBlood", new PrefabGUID(24378719) }, + { "CHAR_Werewolf", new PrefabGUID(-1554760905) }, + { "CHAR_WerewolfChieftain_Human", new PrefabGUID(-1505705712) }, + { "CHAR_WerewolfChieftain_ShadowClone", new PrefabGUID(-1699898875) }, + { "CHAR_WerewolfChieftain_VBlood", new PrefabGUID(-1007062401) }, + { "CHAR_Wildlife_Bear_Dire_Vblood", new PrefabGUID(-1391546313) }, + { "CHAR_Wildlife_Bear_Standard", new PrefabGUID(1043643344) }, + { "CHAR_Wildlife_Deer", new PrefabGUID(1897056612) }, + { "CHAR_Wildlife_Moose", new PrefabGUID(-831097925) }, + { "CHAR_Wildlife_Poloma_VBlood", new PrefabGUID(-484556888) }, + { "CHAR_Wildlife_Wolf", new PrefabGUID(-1418430647) }, + { "CHAR_Wildlife_Wolf_VBlood", new PrefabGUID(-1905691330) }, + { "CHAR_Winter_Bear_Standard", new PrefabGUID(2041915372) }, + { "CHAR_Winter_Moose", new PrefabGUID(-1211580130) }, + { "CHAR_Winter_Wolf", new PrefabGUID(134039094) }, + { "CHAR_Winter_Wolf_OLD", new PrefabGUID(1000142548) }, + { "CHAR_Winter_Yeti_VBlood", new PrefabGUID(-1347412392) } + }; + + public static Dictionary database_bosses = new(){ + { "Alpha_Wolf", new PrefabGUID(-1905691330)}, + { "Errol_the_Stonebreaker", new PrefabGUID(-2025101517)}, + { "Keely_the_Frost_Archer", new PrefabGUID(1124739990)}, + { "Rufus_the_Foreman", new PrefabGUID(2122229952)}, + { "Goreswine_the_Ravager", new PrefabGUID(577478542)}, + { "Grayson_the_Armourer", new PrefabGUID(1106149033)}, + { "Putrid_Rat", new PrefabGUID(-2039908510)}, + { "Lidia_the_Chaos_Archer", new PrefabGUID(763273073)}, + { "Clive_the_Firestarter", new PrefabGUID(1896428751)}, + { "Ferocious_Bear", new PrefabGUID(-1391546313)}, + { "Polora_the_Feywalker", new PrefabGUID(-484556888)}, + { "Nicholaus_the_Fallen", new PrefabGUID(153390636)}, + { "Quincey_the_Bandit_King", new PrefabGUID(-1659822956)}, + { "Beatrice_the_Tailor", new PrefabGUID(-1942352521)}, + { "Tristan_the_Vampire_Hunter", new PrefabGUID(-1449631170)}, + { "Kriig_the_Undead_General", new PrefabGUID(-1365931036)}, + { "Christina_the_Sun_Priestess", new PrefabGUID(-99012450)}, + { "Vincent_the_Frostbringer", new PrefabGUID(-29797003)}, + { "Bane_the_Shadowblade", new PrefabGUID(613251918)}, + { "Grethel_the_Glassblower", new PrefabGUID(910988233)}, + { "Leandra_the_Shadow_Priestess", new PrefabGUID(939467639)}, + { "Maja_the_Dark_Savant", new PrefabGUID(1945956671)}, + { "Terah_the_Geomancer", new PrefabGUID(-1065970933)}, + { "Meredith_the_Bright_Archer", new PrefabGUID(850622034)}, + { "Jade_the_Vampire_Hunter", new PrefabGUID(-1968372384)}, + { "Raziel_the_Shepherd", new PrefabGUID(-680831417)}, + { "Frostmaw_the_Mountain_Terror", new PrefabGUID(24378719)}, + { "Octavian_the_Militia_Captain", new PrefabGUID(1688478381)}, + { "Domina_the_Blade_Dancer", new PrefabGUID(-1101874342)}, + { "Angram_the_Purifier", new PrefabGUID(106480588)}, + { "Ziva_the_Engineer", new PrefabGUID(172235178)}, + { "Ungora_the_Spider_Queen", new PrefabGUID(-548489519)}, + { "The_Old_Wanderer", new PrefabGUID(109969450)}, + { "Foulrot_the_Soultaker", new PrefabGUID(-1208888966)}, + { "Willfred_the_Werewolf_Chief", new PrefabGUID(-1007062401)}, + { "The_Duke_of_Balaton", new PrefabGUID(-203043163)}, + { "Cyril_the_Cursed_Smith", new PrefabGUID(326378955)}, + { "Sir_Magnus_the_Overseer", new PrefabGUID(-26105228)}, + { "Mairwyn_the_Elementalist", new PrefabGUID(-2013903325)}, + { "Baron_du_Bouchon_the_Sommelier", new PrefabGUID(192051202)}, + { "Morian_the_Stormwing_Matriarch", new PrefabGUID(685266977)}, + { "Terrorclaw_the_Ogre", new PrefabGUID(-1347412392)}, + { "Azariel_the_Sunbringer", new PrefabGUID(114912615)}, + { "Henry_Blackbrew_the_Doctor", new PrefabGUID(814083983)}, + { "Matka_the_Curse_Weaver", new PrefabGUID(-910296704)}, + { "Voltatia_the_Power_Master", new PrefabGUID(2054432370)}, + { "Nightmarshal_Styx_the_Sunderer", new PrefabGUID(1112948824)}, + { "Solarus_the_Immaculate", new PrefabGUID(-740796338)} + }; +} \ No newline at end of file diff --git a/Helper.cs b/Helper.cs index a44ef37..b585ab5 100644 --- a/Helper.cs +++ b/Helper.cs @@ -1,17 +1,15 @@ using ProjectM; -using ProjectM.Network; -using System; -using System.Runtime.InteropServices; -using Unity.Collections; using Unity.Entities; using UnityEngine; +using Unity.Transforms; +using Unity.Mathematics; namespace CommunityCommands; internal static class Helper { private static World _serverWorld; - + private static Entity empty_entity = new Entity(); public static World Server { get @@ -38,6 +36,23 @@ private static World GetWorld(string name) return null; } + + public static bool SpawnAtPosition(Entity user, string name, int count, float2 position, float minRange = 1, float maxRange = 2, float duration = -1) + { + var isUnitFound = Database.database_units.TryGetValue(name, out var unit); + var isBossFound = Database.database_bosses.TryGetValue(name, out var boss); + + if (!isUnitFound && !isBossFound) + return false; + + var entityToSpawn = isUnitFound ? unit : boss; + + var translation = Server.EntityManager.GetComponentData(user); + var f3pos = new float3(position.x, translation.Value.y, position.y); + Server.GetExistingSystem().SpawnUnit(empty_entity, entityToSpawn, f3pos, count, minRange, maxRange, duration); + return true; + } + public static PrefabGUID GetPrefabGUID(Entity entity) { var entityManager = Server.EntityManager; diff --git a/README.md b/README.md index 334be7e..b11377b 100644 --- a/README.md +++ b/README.md @@ -3,4 +3,5 @@ CommunityCommands is a server modification for V Rising that adds chat commands that are compatbible with [VampireCommandFramework](https://github.com/decaprime/VampireCommandFramework). This is a spirtual successor in the line of ChatCommands by Nopey and RPGMods by Kaltharos. This mod is not a direct fork from that line and will not contain the RPG functionalities. It's purpose is to provide a generic collection of commands for a variety of community server needs. ## Commands -- `.bloodpotion` \ No newline at end of file +- `.bloodpotion` +- `.spawnnpc` \ No newline at end of file