本文整理汇总了C#中Character.getInventory方法的典型用法代码示例。如果您正苦于以下问题:C# Character.getInventory方法的具体用法?C# Character.getInventory怎么用?C# Character.getInventory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Character
的用法示例。
在下文中一共展示了Character.getInventory方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CharacterData
public CharacterData(Character c, Action a)
{
//controlled
scene = c.getScene();
slot = c.getSlot();
world = c.getWorld();
levelUpsAvailable = c.getLevelUpsAvailable();
experience = c.getExperience();
hitDie = c.getHitDie();
//!controlled
expGive = c.getExpGive();
friendly = c.getFriendly();
talk = c.getTalk();
//character
race = c.getRace();
alignment = c.getAlignment();
affiliation = c.getAffiliation();
profession = c.getProfession();
title = c.getTitle();
characterClass1 = c.getCharacterClass1();
characterClass2 = c.getCharacterClass2();
prestigeClass = c.getPrestigeClass();
controlled = c.getControlled();
//entity
name = c.getName();
level1 = c.getLevel1();
level2 = c.getLevel2();
prestigeLevel = c.getPrestigeLevel();
totalLevel = c.getTotalLevel();
strength = c.getStrength();
dexterity = c.getDexterity();
constitution = c.getConstitution();
intelligence = c.getIntelligence();
wisdom = c.getWisdom();
charisma = c.getCharisma();
initiativeBonus = c.getInitiativeBonus();
hostile = c.getHostile();
initSet = c.getInitSet();
turn = c.getTurn();
done = c.getDone();
initiative = c.getInitiative();
basicAttackBonus = c.getBasicAttackBonus();
fortitude = c.getFortitude();
reflex = c.getReflex();
will = c.getWill();
skill = c.getSkill();
feat = c.getFeat();
skillPoints = c.getSkillPoints();
featPoints = c.getFeatPoints();
classSkill = c.getClassSkill();
xLocation = c.getXLocation();
yLocation = c.getYLocation();
xDirection = c.getXDirection();
yDirection = c.getYDirection();
inventory = c.getInventory();
status = c.getStatus();
//attackable
currentHealth = c.getCurrentHealth();
maxHealth = c.getMaxHealth();
armorClass = c.getArmorClass();
prefabName = c.getPrefabName();
//action
standardAction = a.getStandardAction();
moveAction = a.getMoveAction();
freeAction = a.getFreeAction();
swiftAction = a.getSwiftAction();
immediateAction = a.getImmediateAction();
aoo = a.getAoo();
currentSpeed = a.getCurrentSpeed();
maxSpeed = a.getMaxSpeed();
moveLock = a.getMoveLock();
aooProvoked = a.getAooProvoked();
xEnd = a.getXEnd();
yEnd = a.getYEnd();
xDir = a.getXDir();
yDir = a.getYDir();
}
示例2: Start
void Start()
{
c = GetComponent<Character>();
e = c.getInventory().getEquipment();
a = GetComponent<Action>();
}
示例3: createInventories
public static int createInventories(Character chr)
{
Inventory inv = chr.getInventory();
inv.setPages(chr.getInvPages());
List<int> seqhash = new List<int>();
for(int i = 0;i <= 240;i++) seqhash.Add(-1);
inv.saveInv();
inv.setSeqSaved(seqhash);
foreach(int[] entry in NewInventory.Instance.newInventory)
{
chr.getInventory().addItem(entry[0], (short)entry[1], new Item(entry[2], (short)entry[3], ItemDataCache.Instance.getItemData(entry[2]).getTimeToExpire()));
}
chr.getInventory().saveInv();
MySQLTool.SaveInventories(chr);
return 1;
}
示例4: setPlayerPosition
//.........这里部分代码省略.........
for(int i=0;i<120;i++) {
if(chr.getCargo().getSeqSaved()[i] != -1 && chr.getCargo().getCargoSaved()[chr.getCargo().getSeqSaved()[i]] != null) {
op.WriteInt();
op.WriteByte((byte)(chr.getCargo().getSeqSaved()[i] / 100));
op.WriteByte((byte)(chr.getCargo().getSeqSaved()[i] % 100));
Item item = chr.getCargo().getCargoSaved()[chr.getCargo().getSeqSaved()[i]];
op.WriteInt(item.getItemID());
ItemData itemData = ItemDataCache.Instance.getItemData(item.getItemID());
if(itemData.getTimeToExpire() > 0) {
}
op.WriteShort(item.getQuantity());
} else op.WriteZero(12);
} // 38 - 1477
op.Position = 1476;
for(int i=0;i<chr.getCommunity().getFriendsList().Capacity;i++) {
if(chr.getCommunity().getFriendsList().ElementAtOrDefault(i) != null) {
op.WritePaddedString(chr.getCommunity().getFriendsList()[i], 17);
} else op.WriteZero(17);
} // 1476 - 1934
op.WriteRepeatedByte(0x58, 40);
op.Position = 1986;
for(int i = 0;i < chr.getCommunity().getIgnoresList().Capacity;i++) {
if(chr.getCommunity().getIgnoresList().ElementAtOrDefault(i) != null) {
op.WritePaddedString(chr.getCommunity().getIgnoresList()[i], 17);
} else op.WriteZero(17);
} // 1987 - 2157
op.WriteInt(363); // questsy
op.WriteLong();
op.WriteLong(138769276674441706);
op.WriteLong(21692910);
op.WriteShort();
op.WriteShort(1);
op.Position = 2248;
for(byte i=0;i<240;i++) {
if(chr.getInventory().getSeqSaved()[i] != -1 && chr.getInventory().getInvSaved()[chr.getInventory().getSeqSaved()[i]] != null) {
op.WriteShort();
op.WriteByte((byte)(chr.getInventory().getSeqSaved()[i] / 100));
op.WriteByte((byte)(chr.getInventory().getSeqSaved()[i] % 100));
Item item = chr.getInventory().getInvSaved()[chr.getInventory().getSeqSaved()[i]];
op.WriteInt(item.getItemID());
op.WriteInt(item.getQuantity());
} else op.WriteZero(12);
} // 2252 - 5133
op.WriteLong(chr.getCoin());
op.Position = 5140;
for(byte i=0;i<21;i++) {
if(chr.getSkillBar().getSkillBar().ContainsKey(i)) {
int barID = chr.getSkillBar().getSkillBar()[i];
if(barID > 200000000) op.WriteInt(1);
else if(barID > 511) { op.WriteInt(5); barID -= 512; }
else if(barID > 255) { op.WriteInt(6); barID -= 256; }
else {
SkillData skill = SkillDataCache.Instance.getSkill(chr.getSkills().getLearnedSkills().ElementAtOrDefault(barID));
if(skill == null) op.WriteInt(0);
else if(skill.getTypeSpecific() == 6) op.WriteInt(3);
else if(skill.getTypeSpecific() == 7) op.WriteInt(4);
else op.WriteInt(2);
}
op.WriteInt(barID);
} else op.WriteZero(8);
} // 5140 - 5299
op.Position = 5320;
for(int i = 0;i < 60;i++) {
if(chr.getSkills().getLearnedSkills().Count > i && chr.getSkills().getLearnedSkills()[i] != 0) {
op.WriteInt(chr.getSkills().getLearnedSkills()[i]);
op.WriteInt(SkillDataCache.Instance.getSkill(chr.getSkills().getLearnedSkills()[i]).getSkillPoints());
} else op.WriteLong();
} // 5320 - 5799
op.WriteFloat(chr.getPosition()[0]);
op.WriteFloat(chr.getPosition()[1]);
op.WriteInt(0x0c);
op.WriteInt(140338688);
op.WriteInt();
op.WriteShort();
op.WriteShort(10962);
//s3c0nd p4ck3t
op.WriteInt(16);
op.WriteInt(7929861);
op.WriteInt(chr.getuID());
c.WriteRawPacket(op.ToArray());
WMap.Instance.getGrid(chr.getMap()).sendTo3x3AreaSpawn(chr, chr.getArea());
}
示例5: soldItem
public Boolean soldItem(Character buy, long price, byte index, int invSlot, int x, int y, short amount)
{
if(buy.getCoin() - (price * amount) < 0 || owner.getCoin() + (price*amount) > long.MaxValue)
{
Console.WriteLine("Let me show you, where i've been.");
return false;
}
if(!itemsMap.ContainsKey(index))
{
Console.WriteLine("no shit sherlock, item doesn't exist!");
return false;
}
ItemVendor item = itemsMap[index];
if(item == null)
{
Console.WriteLine("Item does not exist!");
return false;
}
if(amount > item.getQuantity())
{
Console.WriteLine("This is not the right amount.");
return false;
}
buy.setCoin(owner.getCoin() - (price * amount));
owner.setCoin(owner.getCoin() + (price * amount));
//when item not deleted
if(item.getQuantity() > 1 && amount != item.getQuantity()) {
item.decrementAmount(amount);
//replace with new values in vendor
itemsMap[index] = item;
}
else {
//remove item vendor
removeItemList(index);
}
//remove/decrement item
owner.getInventory().updateInv();
if(!owner.getInventory().removeItem(invSlot, amount))
{
Console.WriteLine("chuj kurwa");
return false;
}
owner.getInventory().saveInv();
//add item
Item newItem = new Item(item.getItemID(), item.getQuantity());
Console.WriteLine("ItemID: " + newItem.getItemID());
buy.getInventory().updateInv();
if(!buy.getInventory().addItem(y, x, newItem))
{
Console.WriteLine("Something went wrong while adding the item");
return false;
}
buy.getInventory().saveInv();
buy.getAccount().mClient.WriteRawPacket(VendingPackets.buyItemFromVendor(buy, owner, index, invSlot, x, y, amount));
owner.getAccount().mClient.WriteRawPacket(VendingPackets.buyItemFromVendorSecondSite(buy, owner, index, invSlot, x, y, amount));
return true;
}