mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-23 21:25:52 +12:00
Add Feature pt1
This commit is contained in:
parent
a184e4d735
commit
092534e331
131 changed files with 3113 additions and 1418 deletions
113
HorseIsleServer/LibHISP/Player/Equips/Jewelry.cs
Normal file
113
HorseIsleServer/LibHISP/Player/Equips/Jewelry.cs
Normal file
|
@ -0,0 +1,113 @@
|
|||
using HISP.Game;
|
||||
using HISP.Server;
|
||||
using HISP.Game.Items;
|
||||
|
||||
namespace HISP.Player.Equips
|
||||
{
|
||||
public class Jewelry
|
||||
{
|
||||
|
||||
private int playerId;
|
||||
public Jewelry(int PlayerId)
|
||||
{
|
||||
playerId = PlayerId;
|
||||
if (!Database.HasJewelry(PlayerId))
|
||||
Database.InitJewelry(PlayerId);
|
||||
int itemId = Database.GetJewelrySlot1(PlayerId);
|
||||
if (itemId != 0)
|
||||
slot1 = Item.GetItemById(itemId);
|
||||
|
||||
itemId = Database.GetJewelrySlot2(PlayerId);
|
||||
if (itemId != 0)
|
||||
slot2 = Item.GetItemById(itemId);
|
||||
|
||||
itemId = Database.GetJewelrySlot3(PlayerId);
|
||||
if (itemId != 0)
|
||||
slot3 = Item.GetItemById(itemId);
|
||||
|
||||
itemId = Database.GetJewelrySlot4(PlayerId);
|
||||
if (itemId != 0)
|
||||
slot4 = Item.GetItemById(itemId);
|
||||
|
||||
}
|
||||
public Item.ItemInformation Slot1
|
||||
{
|
||||
get
|
||||
{
|
||||
return slot1;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
slot1 = null;
|
||||
Database.SetJewelrySlot1(playerId, 0);
|
||||
return;
|
||||
}
|
||||
Database.SetJewelrySlot1(playerId, value.Id);
|
||||
slot1 = value;
|
||||
}
|
||||
}
|
||||
public Item.ItemInformation Slot2
|
||||
{
|
||||
get
|
||||
{
|
||||
return slot2;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
slot2 = null;
|
||||
Database.SetJewelrySlot2(playerId, 0);
|
||||
return;
|
||||
}
|
||||
Database.SetJewelrySlot2(playerId, value.Id);
|
||||
slot2 = value;
|
||||
}
|
||||
}
|
||||
public Item.ItemInformation Slot3
|
||||
{
|
||||
get
|
||||
{
|
||||
return slot3;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
slot3 = null;
|
||||
Database.SetJewelrySlot3(playerId, 0);
|
||||
return;
|
||||
}
|
||||
Database.SetJewelrySlot3(playerId, value.Id);
|
||||
slot3 = value;
|
||||
}
|
||||
}
|
||||
public Item.ItemInformation Slot4
|
||||
{
|
||||
get
|
||||
{
|
||||
return slot4;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
slot4 = null;
|
||||
Database.SetJewelrySlot4(playerId, 0);
|
||||
return;
|
||||
}
|
||||
Database.SetJewelrySlot4(playerId, value.Id);
|
||||
slot4 = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private Item.ItemInformation slot1;
|
||||
private Item.ItemInformation slot2;
|
||||
private Item.ItemInformation slot3;
|
||||
private Item.ItemInformation slot4;
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue