Skip to content

Commit f87001f

Browse files
committed
Added enable/disable collision & modify catalog value command. Deprecated "addalltalent" in flavor of "selectalltalent" command
1 parent 7024abb commit f87001f

File tree

5 files changed

+534
-24
lines changed

5 files changed

+534
-24
lines changed

(10)trymemode.stormmap/base.stormdata/Modules/LibPlayers.galaxy

Lines changed: 173 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ trigger libPLYR_gt_SetMasteryRing;
4343
trigger libPLYR_gt_OverrideRespawnTime;
4444
trigger libPLYR_gt_SetOverlay;
4545
trigger libPLYR_gt_ResetOverlay;
46-
trigger libPLYR_gt_GetCatalog;
47-
trigger libPLYR_gt_ModifyCatalog;
46+
trigger libPLYR_gt_GetCatalogReference;
47+
trigger libPLYR_gt_ModifyCatalogReference;
48+
trigger libPLYR_gt_ModifyCatalogValue;
4849
trigger libPLYR_gt_GrantXPtoPlayer;
4950
trigger libPLYR_gt_ToggleAI;
5051
trigger libPLYR_gt_EnableAI;
@@ -1097,9 +1098,9 @@ void libPLYR_gt_ResetOverlay_Init () {
10971098
}
10981099

10991100
//--------------------------------------------------------------------------------------------------
1100-
// Trigger: Get Catalog
1101+
// Trigger: Get Catalog Reference
11011102
//--------------------------------------------------------------------------------------------------
1102-
bool libPLYR_gt_GetCatalog_Func (bool testConds, bool runActions) {
1103+
bool libPLYR_gt_GetCatalogReference_Func (bool testConds, bool runActions) {
11031104
// Variable Declarations
11041105
int lv_player;
11051106
string lv_value;
@@ -1144,16 +1145,16 @@ bool libPLYR_gt_GetCatalog_Func (bool testConds, bool runActions) {
11441145
}
11451146

11461147
//--------------------------------------------------------------------------------------------------
1147-
void libPLYR_gt_GetCatalog_Init () {
1148-
libPLYR_gt_GetCatalog = TriggerCreate("libPLYR_gt_GetCatalog_Func");
1149-
TriggerAddEventChatMessage(libPLYR_gt_GetCatalog, c_playerAny, "gcl", false);
1150-
TriggerAddEventChatMessage(libPLYR_gt_GetCatalog, c_playerAny, "getcatalog", false);
1148+
void libPLYR_gt_GetCatalogReference_Init () {
1149+
libPLYR_gt_GetCatalogReference = TriggerCreate("libPLYR_gt_GetCatalogReference_Func");
1150+
TriggerAddEventChatMessage(libPLYR_gt_GetCatalogReference, c_playerAny, "gcl", false);
1151+
TriggerAddEventChatMessage(libPLYR_gt_GetCatalogReference, c_playerAny, "getcatalog", false);
11511152
}
11521153

11531154
//--------------------------------------------------------------------------------------------------
1154-
// Trigger: Modify Catalog
1155+
// Trigger: Modify Catalog Reference
11551156
//--------------------------------------------------------------------------------------------------
1156-
bool libPLYR_gt_ModifyCatalog_Func (bool testConds, bool runActions) {
1157+
bool libPLYR_gt_ModifyCatalogReference_Func (bool testConds, bool runActions) {
11571158
// Variable Declarations
11581159
int lv_player;
11591160
string lv_originalValue;
@@ -1181,7 +1182,7 @@ bool libPLYR_gt_ModifyCatalog_Func (bool testConds, bool runActions) {
11811182
}
11821183

11831184
if (((StringWord(EventChatMessage(false), 2) == null) || (StringWord(EventChatMessage(false), 3) == null))) {
1184-
UIDisplayMessage(PlayerGroupAll(), c_messageAreaDebug, StringToText("Usage: <mcl|mosifycatalog> <CatalogReference> <Value> [PlayerID]"));
1185+
UIDisplayMessage(PlayerGroupAll(), c_messageAreaDebug, StringToText("Usage: <mcl|modifycatalog> <CatalogReference> <Value> [PlayerID]"));
11851186
}
11861187
else {
11871188
if (((StringWord(EventChatMessage(false), 4) != null) && (StringToInt(StringWord(EventChatMessage(false), 4)) > 0))) {
@@ -1214,10 +1215,164 @@ bool libPLYR_gt_ModifyCatalog_Func (bool testConds, bool runActions) {
12141215
}
12151216

12161217
//--------------------------------------------------------------------------------------------------
1217-
void libPLYR_gt_ModifyCatalog_Init () {
1218-
libPLYR_gt_ModifyCatalog = TriggerCreate("libPLYR_gt_ModifyCatalog_Func");
1219-
TriggerAddEventChatMessage(libPLYR_gt_ModifyCatalog, c_playerAny, "mcl", false);
1220-
TriggerAddEventChatMessage(libPLYR_gt_ModifyCatalog, c_playerAny, "modifycatalog", false);
1218+
void libPLYR_gt_ModifyCatalogReference_Init () {
1219+
libPLYR_gt_ModifyCatalogReference = TriggerCreate("libPLYR_gt_ModifyCatalogReference_Func");
1220+
TriggerAddEventChatMessage(libPLYR_gt_ModifyCatalogReference, c_playerAny, "mcl", false);
1221+
TriggerAddEventChatMessage(libPLYR_gt_ModifyCatalogReference, c_playerAny, "modifycatalog", false);
1222+
}
1223+
1224+
//--------------------------------------------------------------------------------------------------
1225+
// Trigger: Modify Catalog Value
1226+
//--------------------------------------------------------------------------------------------------
1227+
bool libPLYR_gt_ModifyCatalogValue_Func (bool testConds, bool runActions) {
1228+
// Variable Declarations
1229+
int lv_player;
1230+
int lv_catalogType;
1231+
string lv_catalogField;
1232+
string lv_catalogEntry;
1233+
string lv_value;
1234+
string lv__catalogTypeLower;
1235+
1236+
// Automatic Variable Declarations
1237+
// Variable Initialization
1238+
lv_player = EventPlayer();
1239+
lv_catalogType = c_gameCatalogAbil;
1240+
lv_value = "";
1241+
lv__catalogTypeLower = "";
1242+
1243+
// Conditions
1244+
if (testConds) {
1245+
if (!(((StringWord(EventChatMessage(false), 1) == "mcv") || (StringWord(EventChatMessage(false), 1) == "modifycatalogvalue")))) {
1246+
return false;
1247+
}
1248+
}
1249+
1250+
// Actions
1251+
if (!runActions) {
1252+
return true;
1253+
}
1254+
1255+
if (((StringWord(EventChatMessage(false), 2) == null) || (StringWord(EventChatMessage(false), 3) == null) || (StringWord(EventChatMessage(false), 4) == null) || (StringWord(EventChatMessage(false), 5) == null))) {
1256+
UIDisplayMessage(PlayerGroupAll(), c_messageAreaDebug, StringToText("Usage: <mcv|modifycatalogvalue> <CatalogType> <CatalogEntry> <CatalogField> <Value> [PlayerID]"));
1257+
return true;
1258+
}
1259+
1260+
if (((StringWord(EventChatMessage(false), 6) != null) && (StringToInt(StringWord(EventChatMessage(false), 6)) > 0))) {
1261+
lv_player = StringToInt(StringWord(EventChatMessage(false), 4));
1262+
}
1263+
1264+
lv__catalogTypeLower = StringCase(StringWord(EventChatMessage(false), 2), false);
1265+
lv_catalogEntry = StringWord(EventChatMessage(false), 3);
1266+
lv_catalogField = StringWord(EventChatMessage(false), 4);
1267+
lv_value = StringWord(EventChatMessage(false), 5);
1268+
// Mass generated from mods/core.stormmod/base.stormdata/GameData. Its a bit different from SC2.
1269+
if (lv__catalogTypeLower == "abil") { lv_catalogType = c_gameCatalogAbil; }
1270+
else if (lv__catalogTypeLower == "accumulator") { lv_catalogType = c_gameCatalogAccumulator; }
1271+
else if (lv__catalogTypeLower == "achievement") { lv_catalogType = c_gameCatalogAchievement; }
1272+
else if (lv__catalogTypeLower == "achievementterm") { lv_catalogType = c_gameCatalogAchievementTerm; }
1273+
else if (lv__catalogTypeLower == "actor") { lv_catalogType = c_gameCatalogActor; }
1274+
else if (lv__catalogTypeLower == "actorsupport") { lv_catalogType = c_gameCatalogActorSupport; }
1275+
else if (lv__catalogTypeLower == "alert") { lv_catalogType = c_gameCatalogAlert; }
1276+
else if (lv__catalogTypeLower == "announcement") { lv_catalogType = c_gameCatalogAnnouncement; }
1277+
else if (lv__catalogTypeLower == "announcerpack") { lv_catalogType = c_gameCatalogAnnouncerPack; }
1278+
else if (lv__catalogTypeLower == "armor") { lv_catalogType = c_gameCatalogArmor; }
1279+
else if (lv__catalogTypeLower == "attachmethod") { lv_catalogType = c_gameCatalogAttachMethod; }
1280+
else if (lv__catalogTypeLower == "banner") { lv_catalogType = c_gameCatalogBanner; }
1281+
else if (lv__catalogTypeLower == "beam") { lv_catalogType = c_gameCatalogBeam; }
1282+
else if (lv__catalogTypeLower == "behavior") { lv_catalogType = c_gameCatalogBehavior; }
1283+
else if (lv__catalogTypeLower == "boost") { lv_catalogType = c_gameCatalogBoost; }
1284+
else if (lv__catalogTypeLower == "bundle") { lv_catalogType = c_gameCatalogBundle; }
1285+
else if (lv__catalogTypeLower == "button") { lv_catalogType = c_gameCatalogButton; }
1286+
else if (lv__catalogTypeLower == "camera") { lv_catalogType = c_gameCatalogCamera; }
1287+
else if (lv__catalogTypeLower == "character") { lv_catalogType = c_gameCatalogCharacter; }
1288+
else if (lv__catalogTypeLower == "cliff") { lv_catalogType = c_gameCatalogCliff; }
1289+
else if (lv__catalogTypeLower == "cliffmesh") { lv_catalogType = c_gameCatalogCliffMesh; }
1290+
else if (lv__catalogTypeLower == "collectioncategory") { lv_catalogType = c_gameCatalogCollectionCategory; }
1291+
else if (lv__catalogTypeLower == "colorspec") { lv_catalogType = c_gameCatalogColorSpec; }
1292+
else if (lv__catalogTypeLower == "colorstyle") { lv_catalogType = c_gameCatalogColorStyle; }
1293+
else if (lv__catalogTypeLower == "config") { lv_catalogType = c_gameCatalogConfig; }
1294+
else if (lv__catalogTypeLower == "conversation") { lv_catalogType = c_gameCatalogConversation; }
1295+
else if (lv__catalogTypeLower == "conversationstate") { lv_catalogType = c_gameCatalogConversationState; }
1296+
else if (lv__catalogTypeLower == "cursor") { lv_catalogType = c_gameCatalogCursor; }
1297+
else if (lv__catalogTypeLower == "dsp") { lv_catalogType = c_gameCatalogDSP; }
1298+
else if (lv__catalogTypeLower == "effect") { lv_catalogType = c_gameCatalogEffect; }
1299+
else if (lv__catalogTypeLower == "emoticon") { lv_catalogType = c_gameCatalogEmoticon; }
1300+
else if (lv__catalogTypeLower == "emoticonpack") { lv_catalogType = c_gameCatalogEmoticonPack; }
1301+
else if (lv__catalogTypeLower == "error") { lv_catalogType = c_gameCatalogError; }
1302+
else if (lv__catalogTypeLower == "footprint") { lv_catalogType = c_gameCatalogFootprint; }
1303+
else if (lv__catalogTypeLower == "fow") { lv_catalogType = c_gameCatalogFoW; }
1304+
else if (lv__catalogTypeLower == "game") { lv_catalogType = c_gameCatalogGame; }
1305+
else if (lv__catalogTypeLower == "gamequestui") { lv_catalogType = c_gameCatalogGameQuestUI; }
1306+
else if (lv__catalogTypeLower == "gameui") { lv_catalogType = c_gameCatalogGameUI; }
1307+
else if (lv__catalogTypeLower == "gempack") { lv_catalogType = c_gameCatalogGemPack; }
1308+
else if (lv__catalogTypeLower == "goal") { lv_catalogType = c_gameCatalogGoal; }
1309+
else if (lv__catalogTypeLower == "hero") { lv_catalogType = c_gameCatalogHero; }
1310+
else if (lv__catalogTypeLower == "heromastery") { lv_catalogType = c_gameCatalogHeroMastery; }
1311+
else if (lv__catalogTypeLower == "herorole") { lv_catalogType = c_gameCatalogHeroRole; }
1312+
// else if (lv__catalogTypeLower == "itemclass") { lv_catalogType = c_gameCatalogItemClass; } // TODO: Why crash??
1313+
// else if (lv__catalogTypeLower == "itemcontainer") { lv_catalogType = c_gameCatalogItemContainer; } // TODO: Why crash??
1314+
else if (lv__catalogTypeLower == "kinetic") { lv_catalogType = c_gameCatalogKinetic; }
1315+
else if (lv__catalogTypeLower == "lensflareset") { lv_catalogType = c_gameCatalogLensFlareSet; }
1316+
else if (lv__catalogTypeLower == "light") { lv_catalogType = c_gameCatalogLight; }
1317+
else if (lv__catalogTypeLower == "lootchest") { lv_catalogType = c_gameCatalogLootChest; }
1318+
else if (lv__catalogTypeLower == "map") { lv_catalogType = c_gameCatalogMap; }
1319+
else if (lv__catalogTypeLower == "model") { lv_catalogType = c_gameCatalogModel; }
1320+
else if (lv__catalogTypeLower == "mount") { lv_catalogType = c_gameCatalogMount; }
1321+
else if (lv__catalogTypeLower == "mover") { lv_catalogType = c_gameCatalogMover; }
1322+
else if (lv__catalogTypeLower == "physicsmaterial") { lv_catalogType = c_gameCatalogPhysicsMaterial; }
1323+
else if (lv__catalogTypeLower == "ping") { lv_catalogType = c_gameCatalogPing; }
1324+
else if (lv__catalogTypeLower == "portraitpack") { lv_catalogType = c_gameCatalogPortraitPack; }
1325+
else if (lv__catalogTypeLower == "preload") { lv_catalogType = c_gameCatalogPreload; }
1326+
else if (lv__catalogTypeLower == "productset") { lv_catalogType = c_gameCatalogProductSet; }
1327+
else if (lv__catalogTypeLower == "race") { lv_catalogType = c_gameCatalogRace; }
1328+
else if (lv__catalogTypeLower == "requirement") { lv_catalogType = c_gameCatalogRequirement; }
1329+
else if (lv__catalogTypeLower == "requirementnode") { lv_catalogType = c_gameCatalogRequirementNode; }
1330+
else if (lv__catalogTypeLower == "reverb") { lv_catalogType = c_gameCatalogReverb; }
1331+
else if (lv__catalogTypeLower == "reward") { lv_catalogType = c_gameCatalogReward; }
1332+
else if (lv__catalogTypeLower == "scoreresult") { lv_catalogType = c_gameCatalogScoreResult; }
1333+
else if (lv__catalogTypeLower == "scorevalue") { lv_catalogType = c_gameCatalogScoreValue; }
1334+
else if (lv__catalogTypeLower == "shape") { lv_catalogType = c_gameCatalogShape; }
1335+
else if (lv__catalogTypeLower == "skin") { lv_catalogType = c_gameCatalogSkin; }
1336+
else if (lv__catalogTypeLower == "sound") { lv_catalogType = c_gameCatalogSound; }
1337+
else if (lv__catalogTypeLower == "soundexclusivity") { lv_catalogType = c_gameCatalogSoundExclusivity; }
1338+
else if (lv__catalogTypeLower == "soundmixsnapshot") { lv_catalogType = c_gameCatalogSoundMixSnapshot; }
1339+
else if (lv__catalogTypeLower == "soundtrack") { lv_catalogType = c_gameCatalogSoundtrack; }
1340+
else if (lv__catalogTypeLower == "spray") { lv_catalogType = c_gameCatalogSpray; }
1341+
else if (lv__catalogTypeLower == "stat") { lv_catalogType = c_gameCatalogStat; }
1342+
else if (lv__catalogTypeLower == "talent") { lv_catalogType = c_gameCatalogTalent; }
1343+
else if (lv__catalogTypeLower == "talentprofile") { lv_catalogType = c_gameCatalogTalentProfile; }
1344+
else if (lv__catalogTypeLower == "targetsort") { lv_catalogType = c_gameCatalogTargetSort; }
1345+
else if (lv__catalogTypeLower == "terrain") { lv_catalogType = c_gameCatalogTerrain; }
1346+
else if (lv__catalogTypeLower == "terrainobject") { lv_catalogType = c_gameCatalogTerrainObject; }
1347+
else if (lv__catalogTypeLower == "terraintex") { lv_catalogType = c_gameCatalogTerrainTex; }
1348+
else if (lv__catalogTypeLower == "texture") { lv_catalogType = c_gameCatalogTexture; }
1349+
else if (lv__catalogTypeLower == "texturesheet") { lv_catalogType = c_gameCatalogTextureSheet; }
1350+
else if (lv__catalogTypeLower == "tile") { lv_catalogType = c_gameCatalogTile; }
1351+
else if (lv__catalogTypeLower == "trophy") { lv_catalogType = c_gameCatalogTrophy; }
1352+
else if (lv__catalogTypeLower == "turret") { lv_catalogType = c_gameCatalogTurret; }
1353+
else if (lv__catalogTypeLower == "typedescription") { lv_catalogType = c_gameCatalogTypeDescription; }
1354+
else if (lv__catalogTypeLower == "unit") { lv_catalogType = c_gameCatalogUnit; }
1355+
else if (lv__catalogTypeLower == "upgrade") { lv_catalogType = c_gameCatalogUpgrade; }
1356+
else if (lv__catalogTypeLower == "user") { lv_catalogType = c_gameCatalogUser; }
1357+
else if (lv__catalogTypeLower == "validator") { lv_catalogType = c_gameCatalogValidator; }
1358+
else if (lv__catalogTypeLower == "vodefinition") { lv_catalogType = c_gameCatalogVODefinition; }
1359+
else if (lv__catalogTypeLower == "voiceline") { lv_catalogType = c_gameCatalogVoiceLine; }
1360+
else if (lv__catalogTypeLower == "voiceover") { lv_catalogType = c_gameCatalogVoiceOver; }
1361+
else if (lv__catalogTypeLower == "water") { lv_catalogType = c_gameCatalogWater; }
1362+
else if (lv__catalogTypeLower == "weapon") { lv_catalogType = c_gameCatalogWeapon; }
1363+
else {
1364+
UIDisplayMessage(PlayerGroupAll(), c_messageAreaDebug, StringToText("Invalid Catalog Type"));
1365+
return true;
1366+
}
1367+
CatalogFieldValueSet(lv_catalogType, lv_catalogEntry, lv_catalogField, EventPlayer(), lv_value);
1368+
return true;
1369+
}
1370+
1371+
//--------------------------------------------------------------------------------------------------
1372+
void libPLYR_gt_ModifyCatalogValue_Init () {
1373+
libPLYR_gt_ModifyCatalogValue = TriggerCreate("libPLYR_gt_ModifyCatalogValue_Func");
1374+
TriggerAddEventChatMessage(libPLYR_gt_ModifyCatalogValue, c_playerAny, "mcv", false);
1375+
TriggerAddEventChatMessage(libPLYR_gt_ModifyCatalogValue, c_playerAny, "modifycatalogvalue", false);
12211376
}
12221377

12231378
//--------------------------------------------------------------------------------------------------
@@ -1521,8 +1676,9 @@ void libPLYR_InitTriggers () {
15211676
libPLYR_gt_OverrideRespawnTime_Init();
15221677
libPLYR_gt_SetOverlay_Init();
15231678
libPLYR_gt_ResetOverlay_Init();
1524-
libPLYR_gt_GetCatalog_Init();
1525-
libPLYR_gt_ModifyCatalog_Init();
1679+
libPLYR_gt_GetCatalogReference_Init();
1680+
libPLYR_gt_ModifyCatalogReference_Init();
1681+
libPLYR_gt_ModifyCatalogValue_Init();
15261682
libPLYR_gt_GrantXPtoPlayer_Init();
15271683
libPLYR_gt_ToggleAI_Init();
15281684
libPLYR_gt_EnableAI_Init();

0 commit comments

Comments
 (0)