Merge remote-tracking branch 'sgk/pr2808' into general-devel
This commit is contained in:
commit
ea6a128759
2 changed files with 23 additions and 5 deletions
|
|
@ -3499,8 +3499,7 @@ namespace TShockAPI
|
|||
}
|
||||
|
||||
private static readonly int[] invasions = { -1, -2, -3, -4, -5, -6, -7, -8, -10, -11 };
|
||||
private static readonly int[] pets = { -12, -13, -14 };
|
||||
private static readonly int[] bosses = { 4, 13, 50, 125, 126, 134, 127, 128, 131, 129, 130, 222, 245, 266, 370, 657 };
|
||||
private static readonly int[] pets = { -12, -13, -14, -15 };
|
||||
private static bool HandleSpawnBoss(GetDataHandlerArgs args)
|
||||
{
|
||||
if (args.Player.IsBouncerThrottled())
|
||||
|
|
@ -3511,10 +3510,9 @@ namespace TShockAPI
|
|||
|
||||
var plr = args.Data.ReadInt16();
|
||||
var thingType = args.Data.ReadInt16();
|
||||
NPC npc = new NPC();
|
||||
npc.SetDefaults(thingType);
|
||||
|
||||
if (bosses.Contains(thingType) && !args.Player.HasPermission(Permissions.summonboss))
|
||||
var isKnownBoss = thingType > 0 && thingType < Main.maxNPCTypes && NPCID.Sets.MPAllowedEnemies[thingType];
|
||||
if ((isKnownBoss || thingType == -16) && !args.Player.HasPermission(Permissions.summonboss))
|
||||
{
|
||||
TShock.Log.ConsoleDebug("GetDataHandlers / HandleSpawnBoss rejected boss {0} {1}", args.Player.Name, thingType);
|
||||
args.Player.SendErrorMessage(GetString("You do not have permission to summon bosses."));
|
||||
|
|
@ -3541,6 +3539,18 @@ namespace TShockAPI
|
|||
string thing;
|
||||
switch (thingType)
|
||||
{
|
||||
case -18:
|
||||
thing = GetString("{0} applied traveling merchant's satchel!", args.Player.Name);
|
||||
break;
|
||||
case -17:
|
||||
thing = GetString("{0} applied advanced combat techniques volume 2!", args.Player.Name);
|
||||
break;
|
||||
case -16:
|
||||
thing = GetString("{0} summoned a Mechdusa!", args.Player.Name);
|
||||
break;
|
||||
case -15:
|
||||
thing = GetString("{0} has sent a request to the slime delivery service!", args.Player.Name);
|
||||
break;
|
||||
case -14:
|
||||
thing = GetString("{0} has sent a request to the bunny delivery service!", args.Player.Name);
|
||||
break;
|
||||
|
|
@ -3581,6 +3591,10 @@ namespace TShockAPI
|
|||
thing = GetString("{0} summoned a Goblin Invasion!", args.Player.Name);
|
||||
break;
|
||||
default:
|
||||
if (!isKnownBoss)
|
||||
TShock.Log.ConsoleDebug("GetDataHandlers / HandleSpawnBoss unknown boss {0} summoned by {1}", thingType, args.Player.Name);
|
||||
NPC npc = new NPC();
|
||||
npc.SetDefaults(thingType);
|
||||
thing = GetString("{0} summoned the {1}!", args.Player.Name, npc.FullName);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,10 @@ Use past tense when adding new entries; sign your name off when you add or chang
|
|||
* Bump to Terraria 1.4.4.8 via OTAPI 3.1.18. (@hakusaro, @SignatureBeef)
|
||||
* In this version of Terraria, `Main.maxBuffTypes` and other `maxWhateverTypes` fields have been removed. Their replacements are in `Terraria.ID.whateverID.Count`. TShock calls to these fields have been swapped in order to bring forward compatibility with Terraria 1.4.4.8.
|
||||
* In OTAPI 3.1.17, fixed [the crystal shard not growing](https://github.com/Pryaxis/TShock/issues/2796). (@sgkoishi)
|
||||
* Fixed item giving potentially dropping too many items (@PotatoCider, @punchready)
|
||||
* Excluded GeoIP.dat from release bundle (@SignatureBeef)
|
||||
* Added `TownSlimeRed` to `FishableNpcIDs` list, allowing it to be fished up (@drunderscore)
|
||||
* Added permission for summoning Mechdusa, Deerclops and slime pet (@sgkoishi, #2808)
|
||||
|
||||
## TShock 5.0.0
|
||||
* Reduced load/save console spam. (@SignatureBeef, @YehnBeep)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue