mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-21 20:25:51 +12:00
Add Feature pt1
This commit is contained in:
parent
a184e4d735
commit
092534e331
131 changed files with 3113 additions and 1418 deletions
117
HorseIsleServer/LibHISP/Player/Equips/CompetitionGear.cs
Normal file
117
HorseIsleServer/LibHISP/Player/Equips/CompetitionGear.cs
Normal file
|
@ -0,0 +1,117 @@
|
|||
using HISP.Game;
|
||||
using HISP.Server;
|
||||
using HISP.Game.Items;
|
||||
|
||||
namespace HISP.Player.Equips
|
||||
{
|
||||
public class CompetitionGear
|
||||
{
|
||||
public const int MISC_FLAG_HEAD = 1;
|
||||
public const int MISC_FLAG_BODY = 2;
|
||||
public const int MISC_FLAG_LEGS = 3;
|
||||
public const int MISC_FLAG_FEET = 4;
|
||||
|
||||
private int playerId;
|
||||
public CompetitionGear(int PlayerId)
|
||||
{
|
||||
playerId = PlayerId;
|
||||
if (!Database.HasCompetitionGear(PlayerId))
|
||||
Database.InitCompetitionGear(PlayerId);
|
||||
int itemId = Database.GetCompetitionGearHeadPeice(PlayerId);
|
||||
if (itemId != 0)
|
||||
head = Item.GetItemById(itemId);
|
||||
|
||||
itemId = Database.GetCompetitionGearBodyPeice(PlayerId);
|
||||
if (itemId != 0)
|
||||
body = Item.GetItemById(itemId);
|
||||
|
||||
itemId = Database.GetCompetitionGearLegPeice(PlayerId);
|
||||
if (itemId != 0)
|
||||
legs = Item.GetItemById(itemId);
|
||||
|
||||
itemId = Database.GetCompetitionGearFeetPeice(PlayerId);
|
||||
if (itemId != 0)
|
||||
feet = Item.GetItemById(itemId);
|
||||
|
||||
}
|
||||
public Item.ItemInformation Head
|
||||
{
|
||||
get
|
||||
{
|
||||
return head;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
head = null;
|
||||
Database.SetCompetitionGearHeadPeice(playerId, 0);
|
||||
return;
|
||||
}
|
||||
Database.SetCompetitionGearHeadPeice(playerId, value.Id);
|
||||
head = value;
|
||||
}
|
||||
}
|
||||
public Item.ItemInformation Body
|
||||
{
|
||||
get
|
||||
{
|
||||
return body;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
body = null;
|
||||
Database.SetCompetitionGearBodyPeice(playerId, 0);
|
||||
return;
|
||||
}
|
||||
Database.SetCompetitionGearBodyPeice(playerId, value.Id);
|
||||
body = value;
|
||||
}
|
||||
}
|
||||
public Item.ItemInformation Legs
|
||||
{
|
||||
get
|
||||
{
|
||||
return legs;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
legs = null;
|
||||
Database.SetCompetitionGearLegPeice(playerId, 0);
|
||||
return;
|
||||
}
|
||||
Database.SetCompetitionGearLegPeice(playerId, value.Id);
|
||||
legs = value;
|
||||
}
|
||||
}
|
||||
public Item.ItemInformation Feet
|
||||
{
|
||||
get
|
||||
{
|
||||
return feet;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
feet = null;
|
||||
Database.SetCompetitionGearFeetPeice(playerId, 0);
|
||||
return;
|
||||
}
|
||||
Database.SetCompetitionGearFeetPeice(playerId, value.Id);
|
||||
feet = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private Item.ItemInformation head;
|
||||
private Item.ItemInformation body;
|
||||
private Item.ItemInformation legs;
|
||||
private Item.ItemInformation feet;
|
||||
|
||||
}
|
||||
}
|
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