本文整理汇总了C#中Player.setLastGraphics方法的典型用法代码示例。如果您正苦于以下问题:C# Player.setLastGraphics方法的具体用法?C# Player.setLastGraphics怎么用?C# Player.setLastGraphics使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Player
的用法示例。
在下文中一共展示了Player.setLastGraphics方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: vengeance
private static void vengeance(Player p, int id)
{
if (id == 14) { // Normal vengeance
if (!p.getInventory().hasItemAmount(560, 2) || !p.getInventory().hasItemAmount(557, 10) || !p.getInventory().hasItemAmount(9075, 4)) {
p.getPackets().sendMessage("You do not have enough runes to cast Vengeance!");
return;
}
if (p.hasVengeance()) {
p.getPackets().sendMessage("You have already filled yourself with vengeance.");
return;
} else {
if (Environment.TickCount - p.getLastVengeanceTime() <= 30000)
{
p.getPackets().sendMessage("You cannot cast this spell yet.");
return;
}
}
p.getInventory().deleteItem(560, 2);
p.getInventory().deleteItem(557, 10);
p.getInventory().deleteItem(9075, 4);
p.setLastAnimation(new Animation(4410));
p.setLastGraphics(new Graphics(726, 0, 80));
p.setLastVengeanceTime(Environment.TickCount);
p.setVengeance(true);
}
}
示例2: thieveNpc
private static void thieveNpc(Player p, Npc npc, int index)
{
AreaEvent thieveNpcAreaEvent = new AreaEvent(p, npc.getLocation().getX()-1, npc.getLocation().getY()-1, npc.getLocation().getX()+1, npc.getLocation().getY()+1);
thieveNpcAreaEvent.setAction(() => {
if (!canThieveNpc(p, npc, index)) {
return;
}
p.setFaceLocation(npc.getLocation());
p.setLastAnimation(new Animation(881));
p.getPackets().sendMessage("You attempt to pick the " + NPC_NAMES[index] + " pocket...");
p.setTemporaryAttribute("lastPickPocket", Environment.TickCount);
Event thieveNpcEvent = new Event(1000);
thieveNpcEvent.setAction(() => {
thieveNpcEvent.stop();
if (!p.getLocation().withinDistance(npc.getLocation(), 2)) {
return;
}
if (successfulThieve(p, index, false)) {
int rewardIndex = misc.random(NPC_REWARD[index].Length - 1);
int reward = NPC_REWARD[index][rewardIndex];
int rewardAmount = NPC_REWARD_AMOUNT[index][rewardIndex];
if (index == 7) { // Master farmer.
if (misc.random(15) == 0) {
reward = HERB_SEEDS[misc.random(HERB_SEEDS.Length - 1)];
}
}
p.getSkills().addXp(Skills.SKILL.THIEVING, NPC_XP[index]);
p.getInventory().addItem(reward, rewardAmount);
p.getPackets().sendMessage("You pick the " + NPC_NAMES[index] + " pocket.");
} else {
p.getWalkingQueue().resetWalkingQueue();
p.getPackets().sendMessage("You fail to pick the " + NPC_NAMES[index] + " pocket.");
p.getPackets().sendMessage("You've been stunned!");
npc.setForceText("What do you think you're doing?");
p.setTemporaryAttribute("unmovable", true);
p.setTemporaryAttribute("stunned", true);
p.setLastGraphics(new Graphics(80, 0, 100));
p.setLastAnimation(new Animation(p.getDefenceAnimation()));
p.hit(1);
npc.setFaceLocation(p.getLocation());
Event removeStunEvent = new Event(5000);
removeStunEvent.setAction(() => {
removeStunEvent.stop();
p.removeTemporaryAttribute("unmovable");
p.removeTemporaryAttribute("stunned");
p.setLastGraphics(new Graphics(65535));
});
Server.registerEvent(removeStunEvent);
}
});
Server.registerEvent(thieveNpcEvent);
});
Server.registerCoordinateEvent(thieveNpcAreaEvent);
}
示例3: 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);
}
示例4: homeTeleport
public static void homeTeleport(Player p)
{
if (p.getTemporaryAttribute("teleporting") != null || p.getTemporaryAttribute("homeTeleporting") != null || p.getTemporaryAttribute("unmovable") != null || p.getTemporaryAttribute("cantDoAnything") != null)
{
return;
}
if (Location.inFightPits(p.getLocation()))
{
p.getPackets().sendMessage("You are unable to teleport from the fight pits.");
return;
}
if (Location.inFightCave(p.getLocation()))
{
FightCave.antiTeleportMessage(p);
return;
}
if (p.getTemporaryAttribute("teleblocked") != null)
{
p.getPackets().sendMessage("A magical force prevents you from teleporting!");
return;
}
if (Location.inWilderness(p.getLocation()) && p.getLocation().wildernessLevel() >= 20)
{
p.getPackets().sendMessage("You cannot teleport above level 20 wilderness!");
return;
}
if (p.getDuel() != null)
{
if (p.getDuel().getStatus() < 4)
{
p.getDuel().declineDuel();
}
else if (p.getDuel().getStatus() == 5)
{
p.getPackets().sendMessage("You cannot teleport whilst in a duel.");
return;
}
else if (p.getDuel().getStatus() == 8)
{
if (p.getDuel().getWinner().Equals(p))
{
p.getDuel().recieveWinnings(p);
}
}
}
p.getPackets().closeInterfaces();
p.setTemporaryAttribute("teleporting", true);
p.setTemporaryAttribute("homeTeleporting", true);
p.getWalkingQueue().resetWalkingQueue();
p.getPackets().clearMapFlag();
SkillHandler.resetAllSkills(p);
Event teleportHomeAnimationEvent = new Event(500);
int currentStage = 0;
teleportHomeAnimationEvent.setAction(() =>
{
if (p.getTemporaryAttribute("homeTeleporting") == null)
{
p.setLastAnimation(new Animation(65535, 0));
p.setLastGraphics(new Graphics(65535, 0));
resetTeleport(p);
teleportHomeAnimationEvent.stop();
return;
}
if (currentStage++ >= 16)
{
resetTeleport(p);
p.teleport(new Location(HOME_TELE[0] + Misc.random(HOME_TELE[2]), HOME_TELE[1] + Misc.random(HOME_TELE[3]), 0));
teleportHomeAnimationEvent.stop();
return;
}
p.setLastAnimation(new Animation(HOME_ANIMATIONS[currentStage], 0));
p.setLastGraphics(new Graphics(HOME_GRAPHICS[currentStage], 0));
});
Server.registerEvent(teleportHomeAnimationEvent);
}
示例5: useTeletab
public static bool useTeletab(Player p, int item, int slot)
{
int index = -1;
for (int i = 0; i < TELETABS.Length; i++)
{
if (item == TELETABS[i])
{
index = i;
}
}
if (index == -1)
{
return false;
}
if (p.getTemporaryAttribute("teleporting") != null || p.getTemporaryAttribute("homeTeleporting") != null || p.getTemporaryAttribute("unmovable") != null || p.getTemporaryAttribute("cantDoAnything") != null)
{
return false;
}
if (p.getTemporaryAttribute("teleblocked") != null)
{
p.getPackets().sendMessage("A magical force prevents you from teleporting!");
return false;
}
if (Location.inFightPits(p.getLocation()))
{
p.getPackets().sendMessage("You are unable to teleport from the fight pits.");
return false;
}
if (Location.inFightCave(p.getLocation()))
{
FightCave.antiTeleportMessage(p);
return false;
}
if (Location.inWilderness(p.getLocation()) && p.getLocation().wildernessLevel() >= 20)
{
p.getPackets().sendMessage("You cannot teleport above level 20 wilderness!");
return false;
}
if (p.getDuel() != null)
{
if (p.getDuel().getStatus() < 4)
{
p.getDuel().declineDuel();
}
else if (p.getDuel().getStatus() == 8)
{
if (p.getDuel().getWinner().Equals(p))
{
p.getDuel().recieveWinnings(p);
}
}
}
int x = TELE_X[index] + Misc.random(TELE_EXTRA_X[index]);
int y = TELE_Y[index] + Misc.random(TELE_EXTRA_Y[index]);
p.getPackets().closeInterfaces();
p.getPackets().sendBlankClientScript(1297);
p.getWalkingQueue().resetWalkingQueue();
p.getPackets().clearMapFlag();
SkillHandler.resetAllSkills(p);
if (p.getInventory().deleteItem(item, slot, 1))
{
p.setTemporaryAttribute("unmovable", true);
p.setTemporaryAttribute("teleporting", true);
p.setLastAnimation(new Animation(9597));
p.setLastGraphics(new Graphics(1680, 0, 0));
//p.setLastGraphics(new Graphics(678, 0, 0)); // blue gfx
Event teleportEvent = new Event(900);
int teleportCounter = 0;
teleportEvent.setAction(() =>
{
if (teleportCounter == 0)
{
p.setLastAnimation(new Animation(4071));
teleportCounter++;
}
else
{
p.setLastAnimation(new Animation(65535));
p.removeTemporaryAttribute("unmovable");
p.teleport(new Location(x, y, 0));
resetTeleport(p);
teleportEvent.stop();
}
});
Server.registerEvent(teleportEvent);
return true;
}
return true;
}
示例6: teleport
public static void teleport(Player p, int teleport)
{
if (!canTeleport(p, teleport))
{
//return;
}
if (!deleteRunes(p, TELEPORT_RUNES[teleport], TELEPORT_RUNES_AMOUNT[teleport]))
{
// return;
}
p.removeTemporaryAttribute("lootedBarrowChest"); // so it resets instantly.
p.removeTemporaryAttribute("autoCasting");
p.setTarget(null);
bool ancients = teleport > 6 ? true : false;
int playerMagicSet = p.getMagicType();
bool correctMagicSet = (!ancients && playerMagicSet == 1) || (ancients && playerMagicSet == 2);
if (!correctMagicSet)
{
return;
}
int x = TELE_X[teleport] + Misc.random(TELE_EXTRA_X[teleport]);
int y = TELE_Y[teleport] + Misc.random(TELE_EXTRA_Y[teleport]);
p.getPackets().closeInterfaces();
p.setLastAnimation(new Animation(ancients ? 9599 : 8939, 0));
p.setLastGraphics(new Graphics(ancients ? 1681 : 1576, 0));
p.getPackets().sendBlankClientScript(1297);
p.getWalkingQueue().resetWalkingQueue();
p.getPackets().clearMapFlag();
SkillHandler.resetAllSkills(p);
p.setTemporaryAttribute("teleporting", true);
Event startTeleportEvent = new Event(ancients ? 2750 : 1800);
startTeleportEvent.setAction(() =>
{
p.teleport(new Location(x, y, 0));
if (!ancients)
{
p.setLastAnimation(new Animation(8941, 0));
p.setLastGraphics(new Graphics(1577, 0));
}
Event endTeleportEvent = new Event(ancients ? 500 : 2000);
endTeleportEvent.setAction(() =>
{
p.getSkills().addXp(Skills.SKILL.MAGIC, TELEPORT_XP[teleport]);
resetTeleport(p);
endTeleportEvent.stop();
});
Server.registerEvent(endTeleportEvent);
startTeleportEvent.stop();
});
Server.registerEvent(startTeleportEvent);
}
示例7: teleportToEssMine
public static void teleportToEssMine(Player p, Npc n)
{
if (p.getTemporaryAttribute("unmovable") != null)
{
return;
}
p.setTemporaryAttribute("unmovable", true);
n.setLastGraphics(new Graphics(108));
Event teleportToEssMineEvent = new Event(600);
teleportToEssMineEvent.setAction(() =>
{
int i = 0;
i++;
if (i == 1)
{
p.setLastGraphics(new Graphics(110));
n.setForceText("Senventior disthine molenko!");
}
else if (i == 2)
{
teleportToEssMineEvent.stop();
Event doTeleportToEssMineEvent = new Event(300);
doTeleportToEssMineEvent.setAction(() =>
{
p.teleport(getRandomMineLocation());
p.removeTemporaryAttribute("unmovable");
doTeleportToEssMineEvent.stop();
});
}
});
Server.registerEvent(teleportToEssMineEvent);
}