本文整理汇总了C#中Character.getSkills方法的典型用法代码示例。如果您正苦于以下问题:C# Character.getSkills方法的具体用法?C# Character.getSkills怎么用?C# Character.getSkills使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Character
的用法示例。
在下文中一共展示了Character.getSkills方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getSkillIDFromCast
public int getSkillIDFromCast(Character ch, byte decrypted)
{
int skillIDInt = 0;
int key=(int) decrypted;
if(key <= ch.getSkills().getLearnedSkills().Count){
skillIDInt = ch.getSkills().getLearnedSkills()[key];
}else{
if(decrypted==(byte)0xFF){
if(ch.getEquipment().getEquipments().ContainsKey(7))
skillIDInt = woodenSkills[ch.getcClass()];
else
skillIDInt = knockSkills[ch.getcClass()];
}else{
Console.WriteLine("Cannot cast skill [skill not learned]");
}
}
return skillIDInt;
}
示例2: canLearnSkill
public Boolean canLearnSkill(Character chr, int ID)
{
if(!this.skills.ContainsKey(ID))
{
Console.WriteLine("playa already has dat skill");
return false;
}
SkillData skill = skills[ID];
if(skill.getChClass() != chr.getcClass() && skill.getChClass()!=0){
Console.WriteLine("Cannot learn skill [wrong character class]");
return false;
}
if(skill.getLvl()>chr.getLevel()){
Console.WriteLine("Cannot learn skill [lvl too low]");
return false;
}
if(skill.getFaction()!=0 && skill.getFaction()!=chr.getFaction()){
Console.WriteLine("Cannot learn skill [wrong faction]");
return false;
}
if(skill.getSkillPoints()>chr.getSkillPoints()){
Console.WriteLine("Cannot learn skill [not enough skillpoints]");
return false;
}
if((!chr.getSkills().getLearnedSkills().Contains(skill.getReqSkill1()) && skill.getReqSkill1() != 0) || (!chr.getSkills().getLearnedSkills().Contains(skill.getReqSkill2()) && skill.getReqSkill2() != 0) || (!chr.getSkills().getLearnedSkills().Contains(skill.getReqSkill3()) && skill.getReqSkill3() != 0))
{
Console.WriteLine("Cannot learn skill [you do not have the req skills]");
return false;
}
return true;
}
示例3: 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());
}