diff --git a/.github/workflows/squadmaker.yml b/.github/workflows/squadmaker.yml
new file mode 100644
index 0000000..695b2e6
--- /dev/null
+++ b/.github/workflows/squadmaker.yml
@@ -0,0 +1,27 @@
+name: AFKManager
+
+on:
+ push:
+ branches:
+ - main
+ paths:
+ - '.github/workflows/squadmaker.yml'
+ - 'src/utils/*'
+ - 'src/squadmaker/*'
+
+jobs:
+ build:
+ name: Build
+ runs-on: windows-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+ - name: Installing Python
+ run: |
+ pip install --upgrade pip
+ pip install -r requirements.txt
+ - name: Release
+ env:
+ TOKEN: ${{ secrets.TOKEN }}
+ BOT: ${{ secrets.BOT }}
+ run: python3 build.py squadmaker true true
diff --git a/docs/index.html b/docs/index.html
index 196f4e9..f188d28 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -211,6 +211,7 @@
|
|
+ |
|
|
|
@@ -219,11 +220,21 @@
SwapWeapons |
|
+ |
Github |
|
❌ |
+
+ MonsterSpawnAlert |
+ |
+ |
+ Github |
+ |
+ ❌ |
+
+
diff --git a/docs/translations.json b/docs/translations.json
index 0c40b16..f1f5a67 100644
--- a/docs/translations.json
+++ b/docs/translations.json
@@ -21,6 +21,11 @@
"Key": "Key",
"Value": "Value",
"Type": "Type",
+ "CustomEntity": "Custom Entity",
+ "Squadmakerfn": "squadmaker Function",
+ "trigger_scriptfnth": "trigger_script Think Function",
+ "trigger_scriptfnus": "trigger_script Use Function",
+ "gamemode": "Game mode",
"AdminLevel": "Admin Level",
"None": "None",
"Administrator": "Administrator",
@@ -118,7 +123,8 @@
"SwapWeapons_Classes": "List of weapon classes",
"SwapWeapons_ClassesMap": "Same as \"Classes\" but overrides it completelly if the current map name is this class name",
"SwapWeapons_Classnames": "classname of weapons that can not be equiped at the same time",
-
+ "MonsterSpawnAlert_Description": "Makes the spawned monster be aware of position and target a random player",
+
"TranslatedBy": ""
}
}
\ No newline at end of file
diff --git a/src/squadmaker/MonsterSpawnAlert.as b/src/squadmaker/MonsterSpawnAlert.as
new file mode 100644
index 0000000..20c172f
--- /dev/null
+++ b/src/squadmaker/MonsterSpawnAlert.as
@@ -0,0 +1,28 @@
+void MonsterSpawnAlert( CBaseMonster@ pSquadmaker, CBaseEntity@ pMonster )
+{
+ if( pMonster is null || !pMonster.IsMonster() )
+ return;
+
+ CBaseMonster@ monster = cast( pMonster );
+
+ if( monster is null )
+ return;
+
+ array index;
+
+ for( int i = 1; i <= g_Engine.maxClients; i++ )
+ {
+ CBasePlayer@ pPlayer = g_PlayerFuncs.FindPlayerByIndex( i );
+
+ if( pPlayer !is null && pPlayer.IsConnected() && pPlayer.IsAlive() )
+ index.insertLast(i);
+ }
+
+ if( index.length() > 0 )
+ {
+ CBasePlayer@ pPlayer = g_PlayerFuncs.FindPlayerByIndex( index[ Math.RandomLong( 0, index.length() - 1 ) ] );
+
+ if( pPlayer !is null )
+ monster.PushEnemy( pPlayer, pPlayer.pev.origin );
+ }
+}
diff --git a/src/squadmaker/changelog.md b/src/squadmaker/changelog.md
new file mode 100644
index 0000000..54d9b8e
--- /dev/null
+++ b/src/squadmaker/changelog.md
@@ -0,0 +1,9 @@
+latest 11/06/24
+
+First released MonsterSpawnAlert
+
+Call "MonsterSpawnAlert" in your squadmaker's "AngelScript Function Name" to make a monster target to a random player
+
+---
+
+
diff --git a/src/squadmaker/squadmaker.res b/src/squadmaker/squadmaker.res
new file mode 100644
index 0000000..3cd5939
--- /dev/null
+++ b/src/squadmaker/squadmaker.res
@@ -0,0 +1,2 @@
+"path" "scripts/maps/yourmodfolder/"
+"squadmaker/MonsterSpawnAlert.as"