本文整理汇总了C#中RunescapeServer.player.Player.getClientIndex方法的典型用法代码示例。如果您正苦于以下问题:C# Player.getClientIndex方法的具体用法?C# Player.getClientIndex怎么用?C# Player.getClientIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RunescapeServer.player.Player
的用法示例。
在下文中一共展示了Player.getClientIndex方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: createdAnimatedArmour
protected static void createdAnimatedArmour(Player p, int index) {
if (p.getTemporaryAttribute("warriorGuildAnimator") == null) {
return;
}
p.setLastAnimation(new Animation(827));
p.setTemporaryAttribute("unmovable", true);
for (int i = 0; i < ARMOUR_SETS[index].Length; i++) {
p.getInventory().deleteItem(ARMOUR_SETS[index][i]);
}
p.getPackets().sendChatboxInterface(211);
p.getPackets().modifyText("You place the armour onto the platform where it", 211, 1);
p.getPackets().modifyText("dissapears...", 211, 2);
int animatorIndex = (int) p.getTemporaryAttribute("warriorGuildAnimator");
Event createAnimatedArmourEvent = new Event(1500);
int createAnimatedArmourCounter = 0;
Npc npc = null;
createAnimatedArmourEvent.setAction(() => {
if (createAnimatedArmourCounter == 0)
{
p.getPackets().sendChatboxInterface(211);
p.getPackets().modifyText("The animator hums, something appears to be working.", 211, 1);
p.getPackets().modifyText("You stand back.", 211, 2);
createAnimatedArmourEvent.setTick(500);
}
else if (createAnimatedArmourCounter == 1)
{
p.getWalkingQueue().forceWalk(0, + 3);
createAnimatedArmourEvent.setTick(2000);
}
else if (createAnimatedArmourCounter == 2)
{
createAnimatedArmourEvent.setTick(500);
Location minCoords = new Location(2849, 3534, 0);
Location maxCoords = new Location(2861, 3545, 0);
npc = new Npc(ANIMATED_ARMOUR[index]);
npc.setMinimumCoords(minCoords);
npc.setMaximumCoords(maxCoords);
npc.setLocation(new Location(ANIMATOR_LOCATIONS[animatorIndex][0], ANIMATOR_LOCATIONS[animatorIndex][1], 0));
npc.setWalkType(WalkType.STATIC);
npc.setForceText("I'm ALIVE!");
npc.setLastAnimation(new Animation(4166));
npc.setEntityFocus(p.getClientIndex());
npc.setOwner(p);
npc.setTarget(p);
p.getPackets().setArrowOnEntity(1, npc.getClientIndex());
Server.getNpcList().Add(npc);
} else {
p.setEntityFocus(npc.getClientIndex());
p.getPackets().softCloseInterfaces();
createAnimatedArmourEvent.stop();
p.removeTemporaryAttribute("unmovable");
npc.getFollow().setFollowing(p);
}
createAnimatedArmourCounter++;
});
Server.registerEvent(createAnimatedArmourEvent);
}
示例2: openCoffin
public static bool openCoffin(Player p, int objectId) {
if (objectId != 6823 && objectId != 6771 && objectId != 6821 && objectId != 6773 && objectId != 6822 && objectId != 6772) {
return false;
}
int cryptIndex = getCryptIndex(p);
if (cryptIndex == -1) {
return false;
}
if (p.getBarrowBrothersKilled(cryptIndex)) {
p.getPackets().sendMessage("You don't find anything.");
return true;
}
if (p.getBarrowTunnel() == cryptIndex){
p.getPackets().modifyText("You find a hidden tunnel, do you want to enter?", 210, 1);
p.getPackets().sendChatboxInterface(210);
p.setTemporaryAttribute("barrowTunnel", 1);
return true;
}
foreach(Npc n in Server.getNpcList()) {
if (n.getId() == BROTHER_ID[cryptIndex]) {
if (n.getOwner().Equals(p)) {
p.getPackets().sendMessage("You don't find anything.");
return true;
}
}
}
Npc npc = new Npc(BROTHER_ID[cryptIndex]);
npc.setLocation(p.getLocation());
npc.setEntityFocus(p.getClientIndex());
npc.setOwner(p);
npc.setTarget(p);
npc.setCombatTurns(npc.getAttackSpeed());
Server.getNpcList().Add(npc);
p.getPackets().setArrowOnEntity(1, npc.getClientIndex());
return true;
}
示例3: doJadAttacks
private static void doJadAttacks(Player p, Npc npc) {
if (npc.getHp() <= (npc.getMaxHp() * 0.50)) {
if (p.getFightCave() != null) {
if (!p.getFightCave().isHealersSpawned())
{
summonJadHealers(p, npc);
p.getFightCave().setHealersSpawned(true);
}
}
}
npc.resetCombatTurns();
npc.setEntityFocus(p.getClientIndex());
switch(misc.random(1)) {
case 0: // Range
npc.setLastAnimation(new Animation(9276));
npc.setLastGraphics(new Graphics(1625));
Event jadRangeAttackEvent = new Event(1600);
int jadRangeAttackStatus = 0;
jadRangeAttackEvent.setAction(() => {
double hit = 0;
PrayerData.PrayerHeadIcon prayerHeadIcon = p.getPrayers().getHeadIcon();
if (jadRangeAttackStatus == 0)
{
jadRangeAttackStatus++;
jadRangeAttackEvent.setTick(1500);
p.setLastGraphics(new Graphics(451));
if (prayerHeadIcon == PrayerData.PrayerHeadIcon.RANGE)
hit = 0;
else
hit = misc.randomDouble(96);
} else {
if (prayerHeadIcon != PrayerData.PrayerHeadIcon.RANGE)
hit = misc.randomDouble(96);
jadRangeAttackEvent.stop();
p.setLastAttacked(Environment.TickCount);
npc.setLastAttack(Environment.TickCount);
p.setAttacker(npc);
if (hit > p.getHp()) {
hit = p.getHp();
}
if (!Location.inFightCave(p.getLocation()) || p.getTeleportTo() != null) {
return;
}
if ((p.getCombatTurns() > 2 || p.getCombatTurns() < 0)) {
p.setLastAnimation(new Animation(p.getDefenceAnimation()));
}
p.hit(hit);
Event animationEvent = new Event(100);
animationEvent.setAction(() => {
animationEvent.stop();
p.setLastGraphics(new Graphics(157, 0, 100));
});
Server.registerEvent(animationEvent);
}
});
Server.registerEvent(jadRangeAttackEvent);
break;
case 1: // Magic
npc.setLastGraphics(new Graphics(1626));
Event jadMagicAttackEvent = new Event(300);
int jadMagicAttackStatus = 0;
jadMagicAttackEvent.setAction(() => {
double hit = 0;
PrayerData.PrayerHeadIcon prayerHeadIcon = p.getPrayers().getHeadIcon();
npc.setLastAnimation(new Animation(9278));
if (jadMagicAttackStatus == 0)
{
jadMagicAttackStatus++;
jadMagicAttackEvent.setTick(1600);
p.getPackets().sendProjectile(npc.getLocation(), p.getLocation(), 32, 1627, 50, 40, 34, 90, p);
} else {
jadMagicAttackEvent.stop();
if (prayerHeadIcon == PrayerData.PrayerHeadIcon.MAGIC)
{
hit = 0;
} else {
hit = misc.randomDouble(96);
}
p.setLastAttacked(Environment.TickCount);
npc.setLastAttack(Environment.TickCount);
p.setAttacker(npc);
if (hit > p.getHp()) {
hit = p.getHp();
}
if (!Location.inFightCave(p.getLocation()) || p.getTeleportTo() != null) {
return;
}
if ((p.getCombatTurns() > 2 || p.getCombatTurns() < 0)) {
p.setLastAnimation(new Animation(p.getDefenceAnimation()));
}
p.hit(hit);
Event animationEvent = new Event(100);
animationEvent.setAction(() => {
animationEvent.stop();
p.setLastGraphics(new Graphics(157, 0, 100));
});
Server.registerEvent(animationEvent);
}
});
//.........这里部分代码省略.........