当前位置: 首页>>代码示例>>C#>>正文


C# Player.isDead方法代码示例

本文整理汇总了C#中RunescapeServer.player.Player.isDead方法的典型用法代码示例。如果您正苦于以下问题:C# Player.isDead方法的具体用法?C# Player.isDead怎么用?C# Player.isDead使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RunescapeServer.player.Player的用法示例。


在下文中一共展示了Player.isDead方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: handleFirstClickNPC

	    private void handleFirstClickNPC(Player player, Packet packet) {
		    int npcIndex = packet.readLEShortA();
		    if (npcIndex < 0 || npcIndex > Constants.MAX_NPCS || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null) {
			    return;
		    }
            Npc npc = Server.getNpcList()[npcIndex];
            if (npc == null || npc.isDestroyed())
            {
                return;
            }
            Console.WriteLine("First click NPC " + npc.getId());
		    SkillHandler.resetAllSkills(player);
		    Combat.newAttack(player, npc);
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:14,代码来源:NPCInteract.cs

示例2: handleSecondClickNPC

	    private void handleSecondClickNPC(Player player, Packet packet) {
		    int npcIndex = packet.readLEShort();
		    if (npcIndex < 0 || npcIndex > Constants.MAX_NPCS || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null) {
			    return;
		    }
		    Npc npc = Server.getNpcList()[npcIndex];
		    if (npc == null || npc.isDestroyed()) {
			    return;
		    }
		    Console.WriteLine("Second click NPC " + npc.getId());
            player.setFaceLocation(npc.getLocation());
		    SkillHandler.resetAllSkills(player);
		    if (Fishing.wantToFish(player, npc, false)) {
			    return;
		    } else if (Slayer.talkToMaster(player, npc)) {
			    return;
		    } else if (AgilityArena.dialogue(player, npc, false)) {
			    return;
		    } else if (TzHaar.interactTzhaarNPC(player, npc, 1)) {
			    return;
		    } else if (WarriorGuild.talkToWarriorGuildNPC(player, npc, 1)) {
			    return;
		    } else if (BoatOptions.interactWithBoatNPC(player, npc)) {
			    return;
		    }
		    switch(npc.getId()) {
			    case 519: // Bob
				    BrokenBarrows.talkToBob(player, npc, -1, 1);
				    break;
				
			    case 553: // Aubury
				    HomeArea.interactWithAubury(player, npc, 1);
				    break;
				
			    case 1862: // Ali morisanne
				    if (npc.getLocation().inArea(2319, 3177, 2321, 3182)) { // Home Ali
					    HomeArea.interactWithAliMorissaae(player, npc);
					    break;
				    } else if (npc.getLocation().inArea(3311, 3198, 3316, 3199)) { // Al Kharid Ali
					    AlKharid.interactWithAliMorissaae(player, npc);
					    break;
				    }
				    break;
		    }
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:45,代码来源:NPCInteract.cs

示例3: handleFifthClickObject

 private void handleFifthClickObject(Player player, Packet packet)
 {
     short id = packet.readLEShortA();
     short x = packet.readLEShortA();
     short y = packet.readLEShortA();
     if (player.getTemporaryAttribute("unmovable") != null)
     {
         return;
     }
     if (x < 1000 || id < 0 || y < 1000 || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null)
     {
         return;
     }
     SkillHandler.resetAllSkills(player);
     player.getPackets().closeInterfaces();
     player.setFaceLocation(new Location(x, y, player.getLocation().getZ()));
     Console.WriteLine("Fifth object click = " + id + " " + x + " " + y);
     switch (id)
     {
         case 28089: // GE desk
             Server.getGrandExchange().clickDesk(player, x, y, 5);
             break;
     }
 }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:24,代码来源:ObjectInteract.cs

示例4: handleClickOne

	    private void handleClickOne(Player player, Packet packet) {
		    int slot = packet.readShortA();
		    int item = packet.readUShort();
		    int childId = packet.readUShort();
		    int interfaceId = packet.readUShort();
		    if (slot < 0 || slot > 28 || player.isDead()) {
			    return;
		    }
            Console.WriteLine("Click One Slot = " + slot);
		    player.getPackets().closeInterfaces();
		    Console.WriteLine("InterfaceOption 1: interfaceId: " + interfaceId);
		    switch(interfaceId) {
			    case 387: // Unequip item
				    if (slot < 14 && player.getEquipment().getItemInSlot((ItemData.EQUIP)slot) == item) {
                        player.getEquipment().unequipItem((ItemData.EQUIP)slot);
				    }
				    break;
		    }
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:19,代码来源:InterfaceOptions.cs

示例5: handleMagicOnNPC

	    private void handleMagicOnNPC(Player player, Packet packet) {
		    int childId = packet.readLEShort();
		    int interfaceId = packet.readLEShort();
		    int junk = packet.readShortA();
	        int npcIndex = packet.readLEShortA();
		    if (npcIndex < 0 || npcIndex > Constants.MAX_NPCS || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null) {
			    return;
		    }
		    Npc npc = Server.getNpcList()[npcIndex];
		    if (npc == null || npc.isDestroyed()) {
			    return;
		    }
		    SkillHandler.resetAllSkills(player);
		    player.setTarget(npc);
		    MagicCombat.newMagicAttack(player, npc, childId, interfaceId == 193);
		    Console.WriteLine(childId);
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:17,代码来源:NPCInteract.cs

示例6: handleFourthClickNPC

	    private void handleFourthClickNPC(Player player, Packet packet) {
		    int npcIndex = packet.readUShort();
		    if (npcIndex < 0 || npcIndex > Constants.MAX_NPCS || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null) {
			    return;
		    }
		    Npc npc = Server.getNpcList()[npcIndex];
		    if (npc == null || npc.isDestroyed()) {
			    return;
		    }
		    Console.WriteLine("Fourth click NPC " + npc.getId());
		    SkillHandler.resetAllSkills(player);
		    if (Slayer.openSlayerShop(player, npc)) {
			    return;
		    }
		    switch(npc.getId()) {
			    case 553: // Aubury
				    HomeArea.interactWithAubury(player, npc, 3);
				    break;
		    }
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:20,代码来源:NPCInteract.cs

示例7: handleEquipItem

	    private void handleEquipItem(Player player, Packet packet) {
		    int item = packet.readLEShort();
		    int slot = packet.readShortA();
		    int interfaceId = packet.readInt();
		    if (slot > 28 || slot < 0 || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null) {
			    return;
		    }
		    SkillHandler.resetAllSkills(player);
		    if (player.getInventory().getItemInSlot(slot) == item) {
			    //player.getPackets().closeInterfaces();
			    if (RuneCraft.emptyPouch(player, (RuneCraftData.POUCHES)player.getInventory().getItemInSlot(slot))) {
				    return;
			    }
			    player.getEquipment().equipItem(player.getInventory().getItemInSlot(slot), slot);
		    }
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:16,代码来源:ItemInteract.cs

示例8: handleRightClickOne

	    private void handleRightClickOne(Player player, Packet packet) {
		    int childId = packet.readLEShort();
		    int interfaceId = packet.readLEShort();
		    int item = packet.readLEShortA();
		    int slot = packet.readLEShortA();
		    if (slot > 28 || slot < 0 || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null) {
			    return;
		    }
		    SkillHandler.resetAllSkills(player);
		    if (player.getInventory().getItemInSlot(slot) == item) {
			    player.getPackets().closeInterfaces();
			    if (interfaceId == 149 && childId == 0) {
				    if (Herblore.emptyPotion(player, player.getInventory().getItemInSlot(slot), slot)) {
					    return;
				    } else if (JewelleryTeleport.useJewellery(player, player.getInventory().getItemInSlot(slot), slot, false)) {
					    return;
				    }
			    }
		    }
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:20,代码来源:ItemInteract.cs

示例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)) {
//.........这里部分代码省略.........
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:101,代码来源:FightCave.cs

示例10: drinkPotion

	    private static void drinkPotion(Player p, int i, int j, int slot) {
		    //TODO antipoisons/antifire
		    int lastPotion = -1;
		    int delay = 500;
		    long lastDrink = 0;
		    if (p.isDead() || p.getTemporaryAttribute("willDie") != null) {
			    return;
		    }
		    if (p.getDuel() != null) {
			    if (p.getDuel().ruleEnabled(DuelSession.RULE.NO_DRINKS))  {
				    p.getPackets().sendMessage("Drinks have been disabled for this duel!");
				    return;
			    }
		    }
		    if (p.getTemporaryAttribute("lastDrankPotion") != null) {
			    lastPotion = (int) p.getTemporaryAttribute("lastDrankPotion");
		    }
		    if (p.getTemporaryAttribute("drinkPotionTimer") != null) {
			    lastDrink = (int) p.getTemporaryAttribute("drinkPotionTimer");
		    }
		    int time = (j == lastPotion) ? 1000 : 500;
		    if (Environment.TickCount - lastDrink < time) {
			    return;
		    }
		    p.getPackets().closeInterfaces();
		    p.setTemporaryAttribute("drinkPotionTimer", Environment.TickCount);
		    p.setTemporaryAttribute("lastDrankPotion", j);
		    p.setTarget(null);
		    p.resetCombatTurns();
		    p.setEntityFocus(65535);
		    p.removeTemporaryAttribute("autoCasting");

            Event drinkPotionEvent = new Event(delay);
            drinkPotionEvent.setAction(() => {		
				drinkPotionEvent.stop();
				if (p.isDead() || p.getSkills().getCurLevel(Skills.SKILL.HITPOINTS) <= 0) {
					return;
				}
                int item = i != 0 && POTIONS[i - 1][j] != -1 ? POTIONS[i - 1][j] : 229;
				if (!p.getInventory().replaceItemSlot(POTIONS[i][j],  item, slot)) {
					return;
				}
                string drinkPotion = ItemData.forId(POTIONS[0][j]).getName().Replace("(", "").Replace(")", "").Replace("3", "").Replace("2", "").Replace("1", "").ToLower();
                p.getPackets().sendMessage("You drink some of your " + drinkPotion + ".");
                p.getPackets().sendMessage("You have " + (i == 0 ? "no" : i.ToString()) + " doses of potion left.");
				switch(j) {
					case 0: //Attack potion [+3 and 10% of max attack]
						statBoost(p, Skills.SKILL.ATTACK, 0.10, 3, false); 
                        break;
					case 1: //Antipoison potion
						p.setPoisonAmount(0);
						break;
						
					case 2: //Strength potion [+3 and 10% of max strength]
						statBoost(p, Skills.SKILL.STRENGTH, 0.10, 3, false);
						break;
						
					case 3: //Restore potion [restores randomly between 10-39 points]
                        restorePotion(p, Skills.SKILL.DEFENCE, 10, 39);
                        restorePotion(p, Skills.SKILL.ATTACK, 10, 39);
                        restorePotion(p, Skills.SKILL.STRENGTH, 10, 39);
                        restorePotion(p, Skills.SKILL.RANGE, 10, 39);
                        restorePotion(p, Skills.SKILL.HITPOINTS, 10, 39);
						break;
						
					case 4: //Energy potion [restores 20% energy]
                        double newEnergy = p.getRunEnergy() * 0.20;
                        p.setRunEnergy(((p.getRunEnergy() + (int)newEnergy >= 100) ? 100 : (p.getRunEnergy() + (int)newEnergy)));
						break;
						
					case 5: //Defence potion [Should be +3 and 10% of max defence]
                        statBoost(p, Skills.SKILL.DEFENCE, 0.10, 3, false);
						break;
						
					case 6: //Agility potion [restores 2 or 3 agility points]
                        int newAgility = misc.random(2, 3) + p.getSkills().getCurLevel(Skills.SKILL.AGILITY);
                        if (newAgility < p.getSkills().getMaxLevel(Skills.SKILL.AGILITY))
                            p.getSkills().setCurLevel(Skills.SKILL.AGILITY, newAgility);
						break;
						
					case 7: //Combat potion [Should be 10% of attack+strength and +3 to each].
                        statBoost(p, Skills.SKILL.ATTACK, 0.10, 3, false);
                        statBoost(p, Skills.SKILL.STRENGTH, 0.10, 3, false);
						break;
						
					case 8: //Prayer potion, [heals 7-31, formula = 7+floor(prayerlevel/4)]
                        int newPrayer = 7 + (int)Math.Floor((double)(p.getSkills().getMaxLevel(Skills.SKILL.PRAYER) / 4)) + p.getSkills().getCurLevel(Skills.SKILL.PRAYER);
                        if (newPrayer < p.getSkills().getCurLevel(Skills.SKILL.PRAYER))
                            p.getSkills().setCurLevel(Skills.SKILL.PRAYER, newPrayer);
                        checkOverdose(p, Skills.SKILL.PRAYER);
						break;
						
					case 9: //Summoning potion [25% of players summoning + 7]
                        int newSummoning = (7 + (int)((double)p.getSkills().getMaxLevel(Skills.SKILL.SUMMONING) * 0.25)) + p.getSkills().getCurLevel(Skills.SKILL.SUMMONING);
                        if (newSummoning < p.getSkills().getCurLevel(Skills.SKILL.SUMMONING))
                            p.getSkills().setCurLevel(Skills.SKILL.SUMMONING, newSummoning);

                        statBoost(p, Skills.SKILL.STRENGTH, 0.10, 3, false);
						break;
						
//.........这里部分代码省略.........
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:101,代码来源:Consumables.cs

示例11: eatFood

	    private static void eatFood(Player p, int i, int j, int slot) {
            //delay at which you eat food 0.5 seconds (half a second per eat).
		    int delay = 500;
            //If you are dead or yourHp is zero (this should be enough), also if variable is set to die from next attack
            if (p.isDead() || p.getHp() <= 0 || p.getTemporaryAttribute("willDie") != null)
			    return;

            //Last time you ate timer was previously set.
		    if (p.getTemporaryAttribute("eatFoodTimer") != null) {
                //Check if the timer has passed the time of 1.2 seconds
			    if (Environment.TickCount - (int) p.getTemporaryAttribute("eatFoodTimer") < 1200) {
				    return;
			    }
		    }
            //if you are in a duel
		    if (p.getDuel() != null) {
                //dueling with No Food rule enabled
			    if (p.getDuel().ruleEnabled(DuelSession.RULE.NO_FOOD))  {
				    p.getPackets().sendMessage("Food has been disabled for this duel!");
				    return;
			    }
		    }
            //Set timer right now because you are eating some food.
		    p.setTemporaryAttribute("eatFoodTimer", Environment.TickCount);
            //while you are eating the target you are attacking gets reset.
		    p.setTarget(null);
		    p.resetCombatTurns();
		    p.setEntityFocus(65535);
		    p.getPackets().closeInterfaces();
		    p.removeTemporaryAttribute("autoCasting");

            //start eating the food at delay which is 0.5 of a second / half a second.
            Event eatFoodEvent = new Event(delay);
            eatFoodEvent.setAction(() => {
                //make the food eating event stop after this time.
				eatFoodEvent.stop();
                //if you are dead or your hp is zero aka dead.
				if (p.isDead() || p.getHp() <= 0) {
					return;
				}
				int newHealth = p.getSkills().getCurLevel(Skills.SKILL.HITPOINTS) + FOOD_HEAL[j];
                int item = i != 2 && FOOD[i + 1][j] != -1 ? FOOD[i + 1][j] : -1;
                if (!p.getInventory().replaceItemSlot(FOOD[i][j], item, slot))
                {
					return;
				}
                p.getPackets().sendMessage("You eat the " + ItemData.forId(FOOD[i][j]).getName().ToLower() + ".");
				p.getSkills().setCurLevel(Skills.SKILL.HITPOINTS, newHealth > p.getSkills().getMaxLevel(Skills.SKILL.HITPOINTS) ? p.getSkills().getMaxLevel(Skills.SKILL.HITPOINTS) : newHealth);
				p.setLastAnimation(new Animation(829));
				p.getPackets().sendSkillLevel(Skills.SKILL.HITPOINTS);
		    });
            Server.registerEvent(eatFoodEvent);
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:53,代码来源:Consumables.cs

示例12: handleAttackPlayer

	    private void handleAttackPlayer(Player player, Packet packet) {
		    int index = packet.readLEShortA();
		    if(index < 0 || index >= Constants.MAX_PLAYERS || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null) {
			    return;
		    }
		    SkillHandler.resetAllSkills(player);
		    Player p2 = Server.getPlayerList()[index];
		    if (p2 == null)
			    return;

		    player.setFaceLocation(p2.getLocation());
		    player.getPackets().closeInterfaces();
		    if (Location.atDuelArena(player.getLocation())) {
			    if(player.getDuel() != null) {
				    if (player.getDuel().getStatus() < 4) {
					    player.getDuel().declineDuel();
					    return;
				    } else if (player.getDuel().getStatus() == 5 && player.getDuel().getPlayer2().Equals(p2)) {
					    player.getPackets().sendMessage("The duel has not yet started!");
					    return;
				    } else if ((player.getDuel().getStatus() == 5 || player.getDuel().getStatus() == 6) && !player.getDuel().getPlayer2().Equals(p2)) {
					    return;
				    } else if (player.getDuel().getStatus() == 6) {
					    Combat.newAttack(player, p2);
					    return;
				    }
			    }
			    if (!player.getLocation().withinDistance(p2.getLocation(), 1)) {
				    int x = p2.getLocation().getX();
				    int y = p2.getLocation().getY();
                    AreaEvent attackAreaEvent = new AreaEvent(player, x-1, y-1, x+1, y+1);
				    attackAreaEvent.setAction(() => {
                        player.getWalkingQueue().resetWalkingQueue();
						player.getPackets().clearMapFlag();
						if (p2.getGESession() != null || (p2.getDuel() != null && !p2.getDuel().getPlayer2().Equals(player)) || p2.getTrade() != null || p2.getShopSession() != null || p2.getBank().isBanking()) {
                            player.getPackets().sendMessage("That player is busy at the moment.");
							return;
						}
						if (p2.wantsToDuel(player)) {
							p2.setFaceLocation(player.getLocation());
							player.getPackets().closeInterfaces();
							p2.getPackets().closeInterfaces();
							player.setDuelSession(new DuelSession(player, p2));
							p2.setDuelSession(new DuelSession(p2, player));
							return;
						}
						player.setFaceLocation(p2.getLocation());
						p2.getPackets().sendMessage(player.getLoginDetails().getUsername() + ":duelstake:");
						player.getPackets().sendMessage("Sending duel request...");
						player.newDuelRequest(p2);
				    });
                    Server.registerCoordinateEvent(attackAreaEvent);
				    return;
			    }
			    if (p2.getGESession() != null || (p2.getDuel() != null && !p2.getDuel().getPlayer2().Equals(player)) || p2.getTrade() != null || p2.getShopSession() != null || p2.getBank().isBanking()) {
				    player.getPackets().sendMessage("That player is busy at the moment.");
				    return;
			    }
			    if (p2.wantsToDuel(player)) {
				    player.getPackets().closeInterfaces();
				    p2.getPackets().closeInterfaces();
				    p2.setFaceLocation(player.getLocation());
				    player.setDuelSession(new DuelSession(player, p2));
				    p2.setDuelSession(new DuelSession(p2, player));
				    return;
			    }
			    player.newDuelRequest(p2);
			    p2.getPackets().sendMessage(player.getLoginDetails().getUsername() + ":duelstake:");
			    player.getPackets().sendMessage("Sending duel request...");
			    return;
		    }
		    Combat.newAttack(player, p2);
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:73,代码来源:PlayerInteract.cs

示例13: handleMagicOnPlayer

	    private void handleMagicOnPlayer(Player player, Packet packet) {
		    int junk = packet.readShortA();
		    int id = packet.readLEShort();
		    int interfaceId = packet.readLEShort();
		    int index = packet.readLEShortA();
		    if(index < 0 || index >= Constants.MAX_PLAYERS || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null) {
			    return;
		    }
		    SkillHandler.resetAllSkills(player);
		    Player p2 = Server.getPlayerList()[index];
		    if (p2 == null) {
			    return;
		    }
            player.getPackets().closeInterfaces();
		    player.setTarget(p2);
		    MagicCombat.newMagicAttack(player, p2, id,  interfaceId == 193);
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:17,代码来源:PlayerInteract.cs

示例14: handleTradePlayer

	    private void handleTradePlayer(Player player, Packet packet) {
		    int index = packet.readLEShortA();
		    if(index < 0 || index >= Constants.MAX_PLAYERS || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null) {
			    return;
		    }
		    SkillHandler.resetAllSkills(player);
		    Player p2 = Server.getPlayerList()[index];
		    if (p2 == null) {
			    return;
		    }
		    player.setFaceLocation(p2.getLocation());
		    if(player.getTrade() != null) {
			    player.getTrade().decline();
			    return;
		    }
		    player.getPackets().closeInterfaces();
		    if (!player.getLocation().withinDistance(p2.getLocation(), 1)) {
			    int x = p2.getLocation().getX();
			    int y = p2.getLocation().getY();
                AreaEvent tradePlayerAreaEvent = new AreaEvent(player, x-1, y-1, x+1, y+1);
                tradePlayerAreaEvent.setAction(() => {
                    player.getWalkingQueue().resetWalkingQueue();
                    player.getPackets().clearMapFlag();
				    if (p2.getGESession() != null || p2.getTrade() != null || p2.getDuel() != null || p2.getShopSession() != null || p2.getBank().isBanking()) {
                        player.getPackets().sendMessage("That player is busy at the moment.");
					    return;
				    }
				    if (p2.wantsToTrade(player)) {
                        player.getPackets().closeInterfaces();
                        p2.getPackets().closeInterfaces();
					    p2.setFaceLocation(player.getLocation());
					    player.setTrade(new TradeSession(player, p2));
					    p2.setTrade(new TradeSession(p2, player));
					    return;
				    }
				    player.setFaceLocation(p2.getLocation());
                    p2.getPackets().sendMessage(player.getLoginDetails().getUsername() + ":tradereq:");
                    player.getPackets().sendMessage("Sending trade offer...");
				    player.newTradeRequest(p2);
			    });
                Server.registerCoordinateEvent(tradePlayerAreaEvent);
			    return;
		    }
		    if (p2.getGESession() != null || p2.getTrade() != null || p2.getDuel() != null || p2.getShopSession() != null || p2.getBank().isBanking()) {
			    player.getPackets().sendMessage("That player is busy at the moment.");
			    return;
		    }
		    if (p2.wantsToTrade(player)) {
                player.getPackets().closeInterfaces();
                p2.getPackets().closeInterfaces();
			    p2.setFaceLocation(player.getLocation());
			    player.setTrade(new TradeSession(player, p2));
			    p2.setTrade(new TradeSession(p2, player));
			    return;
		    }
		    player.newTradeRequest(p2);
            p2.getPackets().sendMessage(player.getLoginDetails().getUsername() + ":tradereq:");
            player.getPackets().sendMessage("Sending trade offer...");
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:59,代码来源:PlayerInteract.cs

示例15: handleFollowPlayer

	    private void handleFollowPlayer(Player player, Packet packet) {
		    int index = packet.readLEShortA();
		    if(index < 0 || index >= Constants.MAX_PLAYERS || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null) {
			    return;
		    }
		    SkillHandler.resetAllSkills(player);
		    Player p2 = Server.getPlayerList()[index];
		    if (p2 == null) {
			    return;
		    }
		    player.getFollow().setFollowing(p2);
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:12,代码来源:PlayerInteract.cs


注:本文中的RunescapeServer.player.Player.isDead方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。