mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-23 21:25:52 +12:00
Implement water ballon game.
This commit is contained in:
parent
79b4b76c5d
commit
c8d6ec630a
4 changed files with 50 additions and 49 deletions
|
@ -93,21 +93,8 @@ namespace HISP.Server
|
|||
Database.SetStartTime(-1);
|
||||
World.StartDate = -1;
|
||||
|
||||
int[] allUsers = Database.GetUsers(); // This is slow af, but we only have to do it once ..
|
||||
foreach (int userid in allUsers)
|
||||
{
|
||||
Logger.DebugPrint("Adding Birthday Token to userid: " + userid.ToString());
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
ItemInstance itm = new ItemInstance(Item.BirthdayToken);
|
||||
|
||||
if(IsUserOnline(userid))
|
||||
GetUserById(userid).Inventory.AddWithoutDatabase(itm);
|
||||
|
||||
Database.AddItemToInventory(userid, itm);
|
||||
}
|
||||
}
|
||||
|
||||
AddItemToAllUsersEvenOffline(Item.BirthdayToken, 10);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -7517,6 +7504,23 @@ namespace HISP.Server
|
|||
/*
|
||||
* Other...
|
||||
*/
|
||||
|
||||
public static void AddItemToAllUsersEvenOffline(int itemId, int itemCount)
|
||||
{
|
||||
int[] allUsers = Database.GetUsers();
|
||||
foreach (int userid in allUsers)
|
||||
{
|
||||
for (int i = 0; i < itemCount; i++)
|
||||
{
|
||||
ItemInstance itm = new ItemInstance(itemId);
|
||||
|
||||
if (GameServer.IsUserOnline(userid))
|
||||
GameServer.GetUserById(userid).Inventory.AddWithoutDatabase(itm);
|
||||
|
||||
Database.AddItemToInventory(userid, itm);
|
||||
}
|
||||
}
|
||||
}
|
||||
public static void StartRidingHorse(GameClient sender, int horseRandomId)
|
||||
{
|
||||
HorseInstance horseMountInst = sender.LoggedinUser.HorseInventory.GetHorseById(horseRandomId);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue