Enable pirate support.

This commit is contained in:
Zack Piispanen 2013-10-02 21:38:50 -04:00
parent 991e8a4c0a
commit 4221fe4a69

View file

@ -3146,7 +3146,7 @@ namespace TShockAPI
private static bool HandleSpawnBoss(GetDataHandlerArgs args) private static bool HandleSpawnBoss(GetDataHandlerArgs args)
{ {
var spawnboss = false; var spawnboss = false;
var invasion = -1; var invasion = false;
var plr = args.Data.ReadInt32(); var plr = args.Data.ReadInt32();
var Type = args.Data.ReadInt32(); var Type = args.Data.ReadInt32();
NPC npc = new NPC(); NPC npc = new NPC();
@ -3157,10 +3157,9 @@ namespace TShockAPI
switch (Type) switch (Type)
{ {
case -1: case -1:
invasion = 1;
break;
case -2: case -2:
invasion = 2; case -3:
invasion = true;
break; break;
} }
} }
@ -3169,12 +3168,12 @@ namespace TShockAPI
args.Player.SendMessage("You don't have permission to summon a boss.", Color.Red); args.Player.SendMessage("You don't have permission to summon a boss.", Color.Red);
return true; return true;
} }
if (invasion != -1 && !args.Player.Group.HasPermission(Permissions.startinvasion)) if (invasion && !args.Player.Group.HasPermission(Permissions.startinvasion))
{ {
args.Player.SendMessage("You don't have permission to start an invasion.", Color.Red); args.Player.SendMessage("You don't have permission to start an invasion.", Color.Red);
return true; return true;
} }
if (!spawnboss && invasion == -1) if (!spawnboss && !invasion)
return true; return true;
if (plr != args.Player.Index) if (plr != args.Player.Index)
return true; return true;
@ -3182,6 +3181,9 @@ namespace TShockAPI
string boss; string boss;
switch (Type) switch (Type)
{ {
case -3:
boss = "the pirates";
break;
case -2: case -2:
boss = "the Snow Legion"; boss = "the Snow Legion";
break; break;