本文整理汇总了C#中RunescapeServer.player.Player.setLastGraphics方法的典型用法代码示例。如果您正苦于以下问题:C# Player.setLastGraphics方法的具体用法?C# Player.setLastGraphics怎么用?C# Player.setLastGraphics使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RunescapeServer.player.Player
的用法示例。
在下文中一共展示了Player.setLastGraphics方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: execute
public void execute(Player player, string[] arguments) {
if (arguments.Length == 0)
{
player.getPackets().sendMessage("[Graphic command]: ::gfx gfx_number");
return;
}
int gfxId = 0;
if (!int.TryParse(arguments[0], out gfxId))
gfxId = 0;
player.setLastGraphics(new Graphics(gfxId, 0, 100));
}
示例2: leverTeleport
public static void leverTeleport(Player p, int option) {
p.getPackets().closeInterfaces();
Location teleLocation = new Location(LEVER_COORDINATES[option][0], LEVER_COORDINATES[option][1], LEVER_COORDINATES[option][2]);
Event leverTeleportEvent = new Event(200);
leverTeleportEvent.setAction(() => {
leverTeleportEvent.stop();
if (p.getTemporaryAttribute("teleblocked") != null) {
p.getPackets().sendMessage("A magical force prevents you from teleporting!");
return;
} else if ((p.getTemporaryAttribute("teleporting") != null )) {
return;
}
p.setLastAnimation(new Animation(2140));
p.getPackets().closeInterfaces();
p.setTemporaryAttribute("teleporting", true);
p.getWalkingQueue().resetWalkingQueue();
p.getPackets().clearMapFlag();
SkillHandler.resetAllSkills(p);
Event levelTeleportStartEvent = new Event(700);
levelTeleportStartEvent.setAction(() => {
levelTeleportStartEvent.stop();
p.setLastAnimation(new Animation(8939, 0));
p.setLastGraphics(new Graphics(1576, 0));
Event levelTeleportFinishEvent = new Event(1800);
levelTeleportFinishEvent.setAction(() => {
levelTeleportFinishEvent.stop();
p.teleport(teleLocation);
p.setLastAnimation(new Animation(8941, 0));
p.setLastGraphics(new Graphics(1577, 0));
Teleport.resetTeleport(p);
});
Server.registerEvent(levelTeleportFinishEvent);
});
Server.registerEvent(levelTeleportStartEvent);
});
Server.registerEvent(leverTeleportEvent);
}
示例3: emote
//.........这里部分代码省略.........
skill = Skills.SKILL.HERBLORE;
skillcapeAnimation = 4969;
skillcapeGraphic = 835;
break;
/*
* Agility cape.
*/
case 9771:
case 9772:
skill = Skills.SKILL.AGILITY;
skillcapeAnimation = 4977;
skillcapeGraphic = 830;
break;
/*
* Thieving cape.
*/
case 9777:
case 9778:
skill = Skills.SKILL.THIEVING;
skillcapeAnimation = 4965;
skillcapeGraphic = 826;
break;
/*
* Slayer cape.
*/
case 9786:
case 9787:
skill = Skills.SKILL.SLAYER;
skillcapeAnimation = 4937;//need animation
skillcapeGraphic = 812;//need graphic
break;
/*
* Farming cape.
*/
case 9810:
case 9811:
skill = Skills.SKILL.FARMING;
skillcapeAnimation = 4963;
skillcapeGraphic = 825;
break;
/*
* Runecraft cape.
*/
case 9765:
case 9766:
skill = Skills.SKILL.RUNECRAFTING;
skillcapeAnimation = 4947;
skillcapeGraphic = 817;
break;
/*
* Hunter's cape
*/
case 9948:
case 9949:
skill = Skills.SKILL.HUNTER;
skillcapeAnimation = 5158;
skillcapeGraphic = 907;
break;
/*
* Construct. cape.
*/
case 9789:
case 9790:
skill = Skills.SKILL.CONSTRUCTION;
skillcapeAnimation = 4953;
skillcapeGraphic = 820;
break;
/*
* Summoning cape.
*/
case 12169:
case 12170:
skill = Skills.SKILL.SUMMONING;
skillcapeAnimation = 8525;
skillcapeGraphic = 1515;
break;
/*
* Quest cape.
*/
case 9813:
skillcapeAnimation = 4945;
skillcapeGraphic = 816;
player.setLastAnimation(new Animation(skillcapeAnimation));
player.setLastGraphics(new Graphics(skillcapeGraphic));
return true;
default:
didEmote = false;
break;
}
if (player.getSkills().getMaxLevel(skill) == 99)
{
player.setLastAnimation(new Animation(skillcapeAnimation));
player.setLastGraphics(new Graphics(skillcapeGraphic));
}
else
{
didEmote = false;
}
return didEmote;
}
示例4: doRedemption
private void doRedemption(Player p) {
p.setLastGraphics(new Graphics(437));
if (lastAttacker == null) {
return;
}
if (lastAttacker.isDead() || !lastAttacker.isVisible() || lastAttacker.isDestroyed()) {
return;
}
Location l = p.getLocation();
double maxHit = p.getSkills().getMaxLevel(Skills.SKILL.PRAYER) * 0.25;
if (lastAttacker.getLocation().inArea(l.getX() - 1, l.getY() - 1, l.getX() + 1, l.getY() + 1)) {
double damage = misc.randomDouble(maxHit);
if (damage > lastAttacker.getHp()) {
damage = lastAttacker.getHp();
}
lastAttacker.hit(damage);
}
p.getSkills().setCurLevel(Skills.SKILL.PRAYER, 0);
p.getPackets().sendSkillLevel(Skills.SKILL.PRAYER);
}
示例5: teleport
public static bool teleport(Player p, int opt, JewellerySlot js) {
if (js == null) {
return false;
}
if (js.index == -1 || js.index > 3 || opt > 6) {
return false;
}
if (!canTeleport(p, js)) {
p.getPackets().closeInterfaces();
return true;
}
if ((js.index == 2 && opt == 4) || (js.index != 2 && opt == 6)) {
p.getPackets().sendMessage("You stay where you are.");
p.getPackets().closeInterfaces();
return true;
}
opt -= 2; // Used to get the 'index' from the button id.
p.setLastGraphics(new Graphics(1684));
p.setLastAnimation(new Animation(9603));
p.getWalkingQueue().resetWalkingQueue();
p.getPackets().clearMapFlag();
p.setTemporaryAttribute("teleporting", true);
p.setTemporaryAttribute("unmovable", true);
p.removeTemporaryAttribute("autoCasting");
p.removeTemporaryAttribute("lootedBarrowChest");
p.setTarget(null);
changeJewellery(p, js);
int option = opt;
p.getPackets().closeInterfaces();
Event teleportEvent = new Event(2000);
teleportEvent.setAction(() => {
teleportEvent.stop();
p.teleport(new Location(TELEPORT_COORDINATES[js.index][option][0], TELEPORT_COORDINATES[js.index][option][1], 0));
p.setLastAnimation(new Animation(65535));
Teleport.resetTeleport(p);
p.removeTemporaryAttribute("unmovable");
});
Server.registerEvent(teleportEvent);
return true;
}
示例6: levelUp
public static void levelUp(Player player, SKILL skill)
{
int skillIndex = Convert.ToInt32(skill);
String s = "<br><br><br>";
String s1 = "<br><br><br><br>";
if (player.getTemporaryAttribute("teleporting") == null)
{
player.setLastGraphics(new Graphics(199, 0, 100));
}
int skillFlashFlags = (int)(player.getTemporaryAttribute("skillFlashFlags") == null ? 0 : (int)player.getTemporaryAttribute("skillFlashFlags"));
skillFlashFlags |= SKILL_FLASH_BITMASKS[skillIndex];
player.setTemporaryAttribute("skillFlashFlags", skillFlashFlags);
player.getPackets().sendMessage("You've just advanced a " + SKILL_NAME[skillIndex] + " level! You have reached level " + player.getSkills().getMaxLevel(skillIndex) + ".");
player.getPackets().modifyText(s + "Congratulations, you have just advanced a " + SKILL_NAME[skillIndex] + " level!", 740, 0);
player.getPackets().modifyText(s1 + "You have now reached level " + player.getSkills().getMaxLevel(skillIndex) + ".", 740, 1);
player.getPackets().modifyText("", 740, 2);
player.getPackets().sendConfig(1179, SKILL_ICON_BITMASKS[skillIndex] | skillFlashFlags); //start flashing appropriate skill icons
player.getPackets().sendChatboxInterface2(740);
player.getUpdateFlags().setAppearanceUpdateRequired(true);
}
示例7: useLever
public static void useLever(Player p, int id, Location leverLocation)
{
if (p.getTemporaryAttribute("teleporting") != null)
{
return;
}
foreach (LoadedLaddersAndStairs.Lever lever in LoadedLaddersAndStairs.levers)
{
if (lever.getId() == id)
{
if (lever.getLeverLocation().Equals(leverLocation))
{
LoadedLaddersAndStairs.Lever l = lever;
//TODO when in use it cant be used (in use = lever is facing down)
CoordinateEvent useLeverCoordinateEvent = new CoordinateEvent(p, l.getLeverLocation());
useLeverCoordinateEvent.setAction(() =>
{
p.setFaceLocation(l.getFaceLocation());
if (p.getTemporaryAttribute("teleblocked") != null)
{
p.getPackets().sendMessage("A magical force prevents you from teleporting!");
return;
}
else if ((p.getTemporaryAttribute("teleporting") != null))
{
return;
}
p.setLastAnimation(new Animation(2140));
p.getPackets().closeInterfaces();
p.setTemporaryAttribute("teleporting", true);
p.getWalkingQueue().resetWalkingQueue();
p.getPackets().clearMapFlag();
SkillHandler.resetAllSkills(p);
l.setInUse(true);
Event useLeverEvent = new Event(700);
useLeverEvent.setAction(() =>
{
useLeverEvent.stop();
p.setLastAnimation(new Animation(8939, 0));
p.setLastGraphics(new Graphics(1576, 0));
l.setInUse(false);
Event setLeverTeleportEvent = new Event(1800);
setLeverTeleportEvent.setAction(() =>
{
setLeverTeleportEvent.stop();
p.teleport(l.getTeleLocation());
p.setLastAnimation(new Animation(8941, 0));
p.setLastGraphics(new Graphics(1577, 0));
Teleport.resetTeleport(p);
});
Server.registerEvent(setLeverTeleportEvent);
});
Server.registerEvent(useLeverEvent);
});
Server.registerCoordinateEvent(useLeverCoordinateEvent);
break;
}
}
}
}
示例8: emote
/**
* Handles a player emote: does the appropriate animation.
* @param player
* @param buttonId
* @return
*/
public static bool emote(Player player, int buttonId)
{
if (buttonId == 2)
{
player.setLastAnimation(new Animation(855, 0));
}
else if (buttonId == 3)
{
player.setLastAnimation(new Animation(856, 0));
}
else if (buttonId == 4)
{
player.setLastAnimation(new Animation(858, 0));
}
else if (buttonId == 5)
{
player.setLastAnimation(new Animation(859, 0));
}
else if (buttonId == 6)
{
player.setLastAnimation(new Animation(857, 0));
}
else if (buttonId == 7)
{
player.setLastAnimation(new Animation(863, 0));
}
else if (buttonId == 8)
{
player.setLastAnimation(new Animation(2113, 0));
}
else if (buttonId == 9)
{
player.setLastAnimation(new Animation(862, 0));
}
else if (buttonId == 10)
{
player.setLastAnimation(new Animation(864, 0));
}
else if (buttonId == 11)
{
player.setLastAnimation(new Animation(861, 0));
}
else if (buttonId == 12)
{
player.setLastAnimation(new Animation(2109, 0));
}
else if (buttonId == 13)
{
player.setLastAnimation(new Animation(2111, 0));
}
else if (buttonId == 14)
{
player.setLastAnimation(new Animation(866, 0));
}
else if (buttonId == 15)
{
player.setLastAnimation(new Animation(2106, 0));
}
else if (buttonId == 16)
{
player.setLastAnimation(new Animation(2107, 0));
}
else if (buttonId == 17)
{
player.setLastAnimation(new Animation(2108, 0));
}
else if (buttonId == 18)
{
player.setLastAnimation(new Animation(860, 0));
}
else if (buttonId == 19)
{
player.setLastAnimation(new Animation(0x558, 0));
player.setLastGraphics(new Graphics(574, 0));
}
else if (buttonId == 20)
{
player.setLastAnimation(new Animation(2105, 0));
}
else if (buttonId == 21)
{
player.setLastAnimation(new Animation(2110, 0));
}
else if (buttonId == 22)
{
player.setLastAnimation(new Animation(865, 0));
}
else if (buttonId == 23)
{
player.setLastAnimation(new Animation(2112, 0));
}
else if (buttonId == 24)
{
player.setLastAnimation(new Animation(0x84F, 0));
//.........这里部分代码省略.........
示例9: fightCaveAttacks
public static void fightCaveAttacks(Npc npc, Player p) {
if (npc.isDead() || npc.isDestroyed() || p.isDead() || p.isDestroyed() || p.isDead() || !Location.inFightCave(p.getLocation()) || p.getTeleportTo() != null) {
return;
}
double damage = misc.randomDouble(npc.getMaxHit());
PrayerData.PrayerHeadIcon prayerHeadIcon = p.getPrayers().getHeadIcon();
int hitDelay = npc.getHitDelay();
int animation = npc.getAttackAnimation();
switch(npc.getId()) {
case 2734: // Tz-Kih (lvl 22)
case 2735:
if (prayerHeadIcon == PrayerData.PrayerHeadIcon.MELEE)
{
damage = 0;
}
break;
case 2739: // Tz-Xil (lvl 90)
case 2740:
if (prayerHeadIcon == PrayerData.PrayerHeadIcon.RANGE)
{
damage = 0;
}
p.getPackets().sendProjectile(npc.getLocation(), p.getLocation(), 32, 1616, 50, 40, 34, 50, p);
break;
case 2741: // Yt-MejKot (lvl 180)
case 2742:
if (prayerHeadIcon == PrayerData.PrayerHeadIcon.MELEE)
{
damage = 0;
}
// TODO healing
break;
case 2743: // Ket-Zek (lvl 360)
case 2744:
if (!p.getLocation().withinDistance(npc.getLocation(), 2)) {
hitDelay = 1600;
animation = 9266;
npc.setLastGraphics(new Graphics(1622));
damage = misc.randomDouble(49);
if (prayerHeadIcon == PrayerData.PrayerHeadIcon.MAGIC)
{
damage = 0;
}
Event sendProjectileToNpc = new Event(300);
sendProjectileToNpc.setAction(() => {
sendProjectileToNpc.stop();
p.getPackets().sendProjectile(npc.getLocation(), p.getLocation(), 32, 1623, 50, 40, 34, 80, p);
});
Server.registerEvent(sendProjectileToNpc);
} else {
damage = misc.randomDouble(64);
if (prayerHeadIcon == PrayerData.PrayerHeadIcon.MELEE)
{
damage = 0;
}
}
break;
case 2745: // TzTok Jad (lvl 702)
doJadAttacks(p, npc);
break;
}
if (npc.getId() == 2745){
return;
}
if (animation != 65535) {
npc.setLastAnimation(new Animation(animation));
}
p.setLastAttacked(Environment.TickCount);
npc.setLastAttack(Environment.TickCount);
p.setAttacker(npc);
npc.resetCombatTurns();
if (damage > p.getHp()) {
damage = p.getHp();
}
int npcId = npc.getId();
Event losePrayerFightingEvent = new Event(hitDelay);
losePrayerFightingEvent.setAction(() => {
losePrayerFightingEvent.stop();
if (!Location.inFightCave(p.getLocation()) || p.getTeleportTo() != null) {
return;
}
if (npcId == 2734 || npcId == 2735) {
int prayerLevel = p.getSkills().getCurLevel(Skills.SKILL.PRAYER);
int newPrayerLevel = prayerLevel -= (int)(damage + 1);
if (newPrayerLevel <= 0) {
newPrayerLevel = 0;
}
p.getSkills().setCurLevel(Skills.SKILL.PRAYER, newPrayerLevel);
p.getPackets().sendSkillLevel(Skills.SKILL.PRAYER);
} else if (npcId == 2743 || npcId == 2744) {
if (misc.random(1) == 0) {
p.setLastGraphics(new Graphics(1624, 0));
}
}
if ((p.getCombatTurns() > 2 || p.getCombatTurns() < 0)) {
//.........这里部分代码省略.........
示例10: 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);
}
});
//.........这里部分代码省略.........