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


C# Player.setTemporaryAttribute方法代码示例

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


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

示例1: castCharge

 public static void castCharge(Player p)
 {
     p.removeTemporaryAttribute("autoCasting");
     if (p.getSkills().getCurLevel(Skills.SKILL.MAGIC) < 80) {
         p.getPackets().sendMessage("You need a Magic level of 80 to cast Charge.");
         return;
     }
     if (!hasRunes(p, CHARGE_RUNES, CHARGE_RUNE_AMOUNT)) {
         p.getPackets().sendMessage("You do not have enough runes to cast Charge.");
         return;
     }
     if (p.getTemporaryAttribute("godCharged") != null) {
         p.getPackets().sendMessage("You have already charged your god spells.");
         return;
     }
     if (hasGodCapeAndStaff(p)) {
         p.getPackets().sendMessage("You must wear a God cape and wield the matching staff to cast Charge.");
         return;
     }
     if (!deleteRunes(p, CHARGE_RUNES, CHARGE_RUNE_AMOUNT)) {
         return;
     }
     p.setTemporaryAttribute("godCharged", true);
     p.setLastGraphics(new Graphics(308, 800, 90));
     p.setLastAnimation(new Animation(811));
     p.getPackets().sendMessage("You feel charged with magical power..");
     int delay = 60000 + misc.random(120000); //60 seconds + possible 120 seconds so, 1 minute to 2 minutes.
     Event removeGodChargeEvent = new Event(delay);
     removeGodChargeEvent.setAction(() => {
         removeGodChargeEvent.stop();
         p.removeTemporaryAttribute("godCharged");
         p.getPackets().sendMessage("Your magical charge fades away.");
     });
     Server.registerEvent(removeGodChargeEvent);
 }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:35,代码来源:MagicCombat.cs

示例2: exitCave

 public static void exitCave(Player p, int objectX, int objectY)
 {
     AreaEvent exitCaveAreaEvent = new AreaEvent(p, objectX, objectY - 1, objectX + 2, objectY - 1);
     exitCaveAreaEvent.setAction(() => {
         p.setTemporaryAttribute("unmovable", true);
         Event teleFromCaveEvent = new Event(600);
         teleFromCaveEvent.setAction(() => {
             teleFromCaveEvent.stop();
             p.getFightCave().teleFromCave(true);
         });
         Server.registerEvent(teleFromCaveEvent);
     });
     Server.registerCoordinateEvent(exitCaveAreaEvent);
 }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:14,代码来源:FightCave.cs

示例3: showCanifisSailorDialogue

        public static void showCanifisSailorDialogue(Player p, int status)
        {
            int newStatus = -1;
            p.getPackets().softCloseInterfaces();
            if (p.getTemporaryAttribute("unmovable") != null) {
                return;
            }
            switch(status) {
                case 280:
                    p.getPackets().sendPlayerHead(64, 2);
                    p.getPackets().modifyText(p.getLoginDetails().getUsername(), 64, 3);
                    p.getPackets().modifyText("Could you take me back to Oo'glog please?", 64, 4);
                    p.getPackets().animateInterface(9827, 64, 2);
                    p.getPackets().sendChatboxInterface2(64);
                    newStatus = 281;
                    break;

                case 281:
                    p.getPackets().sendNPCHead(1304, 241, 2);
                    p.getPackets().modifyText("Sailor", 241, 3);
                    p.getPackets().modifyText("As you wish, i'll fetch the boat.", 241, 4);
                    p.getPackets().animateInterface(9827, 241, 2);
                    p.getPackets().sendChatboxInterface2(241);
                    newStatus = 282;
                    break;

                case 282:
                    travel(p, 0, true);
                    break;
            }
            if (newStatus != -1) {
                p.setTemporaryAttribute("dialogue", newStatus);
            }
        }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:34,代码来源:BoatOptions.cs

示例4: showBentleyDialogue

        public static void showBentleyDialogue(Player p, int status)
        {
            int newStatus = -1;
            p.getPackets().softCloseInterfaces();
            if (p.getTemporaryAttribute("unmovable") != null) {
                return;
            }
            switch(status) {
                case 240:
                    p.getPackets().sendNPCHead(4540, 241, 2);
                    p.getPackets().modifyText("Captain Bentley", 241, 3);
                    p.getPackets().modifyText("Well, hello there " + p.getLoginDetails().getUsername() + ", ready to set sail?", 241, 4);
                    p.getPackets().animateInterface(9827, 241, 2);
                    p.getPackets().sendChatboxInterface2(241);
                    newStatus = 241;
                    break;

                case 241:
                    p.getPackets().modifyText("I'd like to travel to..", 235, 1);
                    p.getPackets().modifyText("Canifis", 235, 2);
                    p.getPackets().modifyText("Waterbirth Isle", 235, 3);
                    p.getPackets().modifyText("Pest Control", 235, 4);
                    p.getPackets().modifyText("Warrior Guild", 235, 5);
                    p.getPackets().modifyText("Fremmenik Shore", 235, 6);
                    p.getPackets().sendChatboxInterface2(235);
                    newStatus = 242;
                    break;

                case 242: // Canifis
                    travel(p, 0, false);
                    break;

                case 243: // Waterbirth isle
                    travel(p, 1, false);
                    break;

                case 244: // Pest control
                    travel(p, 2, false);
                    break;

                case 245: // Warrior guild
                    int attackLevel = p.getSkills().getMaxLevel(Skills.SKILL.ATTACK);
                    int strengthLevel = p.getSkills().getMaxLevel(Skills.SKILL.STRENGTH);
                    bool hasA99 = attackLevel == 99 || strengthLevel == 99;
                    if (((attackLevel + strengthLevel) >= 130) || hasA99) {
                        travel(p, 3, false);
                    } else {
                        p.getPackets().sendNPCHead(4540, 243, 2);
                        p.getPackets().modifyText("Captain Bentley", 243, 3);
                        p.getPackets().modifyText("I'm sorry " + p.getLoginDetails().getUsername() + ", I cannot take you there.", 243, 4);
                        p.getPackets().modifyText("A combined Attack & Strength level of 130 is ", 243, 5);
                        p.getPackets().modifyText("required to use The Warrior Guild.", 243, 6);
                        p.getPackets().animateInterface(9827, 243, 2);
                        p.getPackets().sendChatboxInterface2(243);
                    }
                    break;

                case 246: // Fremmenik shore
                    travel(p, 4, false);
                    break;

            }
            if (newStatus != -1) {
                p.setTemporaryAttribute("dialogue", newStatus);
            }
        }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:66,代码来源:BoatOptions.cs

示例5: teleblockPlayer

 public static void teleblockPlayer(Player killer, Player target)
 {
     int teleblockDelay = 300000;
     if (target.getPrayers().getHeadIcon() == PrayerData.MAGIC) {
         teleblockDelay = 150000;
     }
     target.setTemporaryAttribute("teleblocked", true);
     target.setTeleblockTime(Environment.TickCount + teleblockDelay);
     Event removeTeleBlockEvent = new Event(teleblockDelay);
     removeTeleBlockEvent.setAction(() => {
         removeTeleBlockEvent.stop();
         if (target != null) {
             target.removeTemporaryAttribute("teleblocked");
             target.setTeleblockTime(0);
         }
     });
     Server.registerEvent(removeTeleBlockEvent);
 }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:18,代码来源:MagicCombat.cs

示例6: 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;
             }
         }
     }
 }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:60,代码来源:LaddersAndStairs.cs

示例7: showArnorDialogue

        public static void showArnorDialogue(Player p, int status)
        {
            int newStatus = -1;
            p.getPackets().softCloseInterfaces();
            if (p.getTemporaryAttribute("unmovable") != null) {
                return;
            }
            switch(status) {
                case 370:
                    p.getPackets().sendPlayerHead(64, 2);
                    p.getPackets().modifyText(p.getLoginDetails().getUsername(), 64, 3);
                    p.getPackets().modifyText("Could you take me back to Oo'glog please?", 64, 4);
                    p.getPackets().animateInterface(9827, 64, 2);
                    p.getPackets().sendChatboxInterface2(64);
                    newStatus = 371;
                    break;

                case 371:
                    p.getPackets().sendNPCHead(1361, 241, 2);
                    p.getPackets().modifyText("Arnor", 241, 3);
                    p.getPackets().modifyText("Of course, follow me.", 241, 4);
                    p.getPackets().animateInterface(9827, 241, 2);
                    p.getPackets().sendChatboxInterface2(241);
                    newStatus = 372;
                    break;

                case 372:
                    travel(p, 3, true);
                    break;
            }
            if (newStatus != -1) {
                p.setTemporaryAttribute("dialogue", newStatus);
            }
        }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:34,代码来源:BoatOptions.cs

示例8: showSquireDialogue

        public static void showSquireDialogue(Player p, int status)
        {
            int newStatus = -1;
            p.getPackets().softCloseInterfaces();
            if (p.getTemporaryAttribute("unmovable") != null) {
                return;
            }
            switch(status) {
                case 340:
                    p.getPackets().sendPlayerHead(64, 2);
                    p.getPackets().modifyText(p.getLoginDetails().getUsername(), 64, 3);
                    p.getPackets().modifyText("Could you take me back to Oo'glog please?", 64, 4);
                    p.getPackets().animateInterface(9827, 64, 2);
                    p.getPackets().sendChatboxInterface2(64);
                    newStatus = 341;
                    break;

                case 341:
                    p.getPackets().sendNPCHead(3781, 241, 2);
                    p.getPackets().modifyText("Squire", 241, 3);
                    p.getPackets().modifyText("Certainly! Please visit Pest Control again soon.", 241, 4);
                    p.getPackets().animateInterface(9827, 241, 2);
                    p.getPackets().sendChatboxInterface2(241);
                    newStatus = 342;
                    break;

                case 342:
                    travel(p, 2, true);
                    break;
            }
            if (newStatus != -1) {
                p.setTemporaryAttribute("dialogue", newStatus);
            }
        }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:34,代码来源:BoatOptions.cs

示例9: 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;
 }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:37,代码来源:Barrows.cs

示例10: showBobDialogue


//.........这里部分代码省略.........
                            p.getPackets().sendChatboxInterface2(241);
                            break;
                        } else if (p.getInventory().deleteItem(995, (int)DATA[index][2])) {
                            p.getInventory().replaceSingleItem((int)DATA[index][1], (int)DATA[index][0]);
                            p.getPackets().sendNPCHead(BOB_ID, 241, 2);
                            p.getPackets().modifyText("Bob", 241, 3);
                            p.getPackets().modifyText("There you go, happy doing business with you!", 241, 4);
                            p.getPackets().animateInterface(9827, 241, 2);
                            p.getPackets().sendChatboxInterface2(241);
                            p.getPackets().sendMessage("You pay Bob his fee and he repairs your " + (string)DATA[index][3] + ".");
                            break;
                        }
                    }
                    break;

                case 105:
                    p.getPackets().sendPlayerHead(64, 2);
                    p.getPackets().modifyText(p.getLoginDetails().getUsername(), 64, 3);
                    p.getPackets().modifyText("On second thoughts, no thanks.", 64, 4);
                    p.getPackets().animateInterface(9827, 64, 2);
                    p.getPackets().sendChatboxInterface2(64);
                    newStatus = 106;
                    break;

                case 106:
                    p.getPackets().sendNPCHead(BOB_ID, 241, 2);
                    p.getPackets().modifyText("Bob", 241, 3);
                    p.getPackets().modifyText("Ok, but don't expect my prices to change anytime soon!", 241, 4);
                    p.getPackets().animateInterface(9827, 241, 2);
                    p.getPackets().sendChatboxInterface2(241);
                    break;

                case 107:
                    p.getPackets().sendNPCHead(BOB_ID, 241, 2);
                    p.getPackets().modifyText("Bob", 241, 3);
                    p.getPackets().modifyText("Hello there " + p.getLoginDetails().getUsername() + ", what can i do for you?", 241, 4);
                    p.getPackets().animateInterface(9827, 241, 2);
                    p.getPackets().sendChatboxInterface2(241);
                    newStatus = 108;
                    break;

                case 108:
                    p.getPackets().modifyText("Could you please repair my Barrow item?", 230, 2);
                    p.getPackets().modifyText("I'm interested in buying an axe.", 230, 3);
                    p.getPackets().modifyText("Nevermind.", 230, 4);
                    p.getPackets().sendChatboxInterface2(230);
                    newStatus = 109;
                    break;

                case 109:
                    p.getPackets().sendPlayerHead(64, 2);
                    p.getPackets().modifyText(p.getLoginDetails().getUsername(), 64, 3);
                    p.getPackets().modifyText("Could you please repair my Barrow item?", 64, 4);
                    p.getPackets().animateInterface(9827, 64, 2);
                    p.getPackets().sendChatboxInterface2(64);
                    newStatus = 110;
                    break;

                case 110:
                    p.getPackets().sendNPCHead(BOB_ID, 241, 2);
                    p.getPackets().modifyText("Bob", 241, 3);
                    p.getPackets().modifyText("Certainly! Show me the item and i'll see what i can do.", 241, 4);
                    p.getPackets().animateInterface(9827, 241, 2);
                    p.getPackets().sendChatboxInterface2(241);
                    break;

                case 111:
                    p.getPackets().sendPlayerHead(64, 2);
                    p.getPackets().modifyText(p.getLoginDetails().getUsername(), 64, 3);
                    p.getPackets().modifyText("I'm interested in buying an axe.", 64, 4);
                    p.getPackets().animateInterface(9827, 64, 2);
                    p.getPackets().sendChatboxInterface2(64);
                    newStatus = 112;
                    break;

                case 112:
                    p.getPackets().sendNPCHead(BOB_ID, 241, 2);
                    p.getPackets().modifyText("Bob", 241, 3);
                    p.getPackets().modifyText("What a coincidence! Axes are my speciality!", 241, 4);
                    p.getPackets().animateInterface(9827, 241, 2);
                    p.getPackets().sendChatboxInterface2(241);
                    newStatus = 113;
                    break;

                case 113:
                    //TODO open bob's shop
                    break;

                case 114:
                    p.getPackets().sendPlayerHead(64, 2);
                    p.getPackets().modifyText(p.getLoginDetails().getUsername(), 64, 3);
                    p.getPackets().modifyText("Nevermind.", 64, 4);
                    p.getPackets().animateInterface(9827, 64, 2);
                    p.getPackets().sendChatboxInterface2(64);
                    break;
            }
            if (newStatus != -1) {
                p.setTemporaryAttribute("dialogue", newStatus);
            }
        }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:101,代码来源:BrokenBarrows.cs

示例11: talkToBob

 public static void talkToBob(Player p, Npc npc, int item, int option)
 {
     p.setEntityFocus(npc.getClientIndex());
     AreaEvent talkToBobAreaEvent = new AreaEvent(p, npc.getLocation().getX() - 1, npc.getLocation().getY() - 1, npc.getLocation().getX() + 1, npc.getLocation().getY() + 1);
     talkToBobAreaEvent.setAction(() => {
         npc.setFaceLocation(p.getLocation());
         p.setFaceLocation(npc.getLocation());
         p.setEntityFocus(65535);
         if (option == 0) { // use item on bob
             if (item > 0) {
                 p.setTemporaryAttribute("bobsAxesBarrowItem", item);
                 showBobDialogue(p, 101);
             }
         } else if (option == 1) { // talk
             showBobDialogue(p, 107);
         } else if (option == 2) { // trade
             p.setShopSession(new ShopSession(p, 4));
         }
     });
     Server.registerCoordinateEvent(talkToBobAreaEvent);
 }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:21,代码来源:BrokenBarrows.cs

示例12: showAliDialogue

        public static void showAliDialogue(Player p, int status)
        {
            int newStatus = -1;
            p.getPackets().softCloseInterfaces();
            if (p.getTemporaryAttribute("unmovable") != null) {
                return;
            }
            switch(status) {
                case 205:
                    p.getPackets().sendNPCHead(1862, 241, 2);
                    p.getPackets().modifyText("Ali Morissane", 241, 3);
                    p.getPackets().modifyText("Would you like to go back to Lletya?", 241, 4);
                    p.getPackets().animateInterface(9827, 241, 2);
                    p.getPackets().sendChatboxInterface2(241);
                    newStatus = 206;
                    break;

                case 206:
                    p.getPackets().sendChatboxInterface2(228);
                    p.getPackets().modifyText("Yes please, let's go", 228, 2);
                    p.getPackets().modifyText("Not yet", 228, 3);
                    newStatus = 207;
                    break;

                case 207:
                    p.getPackets().sendPlayerHead(64, 2);
                    p.getPackets().modifyText(p.getLoginDetails().getUsername(), 64, 3);
                    p.getPackets().modifyText("Yes please, let's go.", 64, 4);
                    p.getPackets().animateInterface(9827, 64, 2);
                    p.getPackets().sendChatboxInterface2(64);
                    newStatus = 208;
                    break;

                case 208:
                    p.getPackets().sendNPCHead(1862, 241, 2);
                    p.getPackets().modifyText("Ali Morissane", 241, 3);
                    p.getPackets().modifyText("Very well.", 241, 4);
                    p.getPackets().animateInterface(9827, 241, 2);
                    p.getPackets().sendChatboxInterface2(241);
                    newStatus = 209;
                    break;

                case 209:
                    p.setTemporaryAttribute("unmovable", true);
                    p.getPackets().displayInterface(120);
                    p.getPackets().sendMessage("Your camel trots off slowly out of the desert..");
                    Event moveBackToLletyaEvent = new Event(2000);
                    int moveBackToLletyaCounter = 0;
                    moveBackToLletyaEvent.setAction(() => {
                        if (moveBackToLletyaCounter == 0)
                        {
                            moveBackToLletyaCounter++;
                            moveBackToLletyaEvent.setTick(600);
                            p.teleport(new Location(2340, 3799, 0));
                        } else {
                            moveBackToLletyaEvent.stop();
                            p.removeTemporaryAttribute("unmovable");
                            p.getPackets().sendMessage("..You and Ali are back in Lletya.");
                            p.getPackets().closeInterfaces();
                        }
                    });
                    Server.registerEvent(moveBackToLletyaEvent);
                    break;

                case 210:
                    p.getPackets().sendPlayerHead(64, 2);
                    p.getPackets().modifyText(p.getLoginDetails().getUsername(), 64, 3);
                    p.getPackets().modifyText("Not yet.", 64, 4);
                    p.getPackets().animateInterface(9827, 64, 2);
                    p.getPackets().sendChatboxInterface2(64);
                    newStatus = 211;
                    break;

                case 211:
                    p.getPackets().sendNPCHead(1862, 241, 2);
                    p.getPackets().modifyText("Ali Morissane", 241, 3);
                    p.getPackets().modifyText("No problem, I will be here when you decide to leave.", 241, 4);
                    p.getPackets().animateInterface(9827, 241, 2);
                    p.getPackets().sendChatboxInterface2(241);
                    break;

            }
            if (newStatus != -1) {
                p.setTemporaryAttribute("dialogue", newStatus);
            }
        }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:86,代码来源:AlKharid.cs

示例13: setAutoCastSpell

 public static void setAutoCastSpell(Player p, int spell, int spellIndex, bool ancients)
 {
     p.getPackets().modifyText(AUTOCAST_NAME[spell], 90, 11);
     p.getPackets().showChildInterface(90, 83, false);
     p.getPackets().showChildInterface(90, AUTOCAST_CONFIG[spell], true);
     p.getPackets().sendConfig(43, 3);
     p.getPackets().sendTab(83, 90);
     p.getPackets().modifyText(p.getEquipment().getSlot(ItemData.EQUIP.WEAPON).getDefinition().getName(), 90, 0);
     p.setTemporaryAttribute("autoCastSpell", spellIndex);
     p.setTemporaryAttribute("autoCastSpell2", spell);
     if (ancients) {
         p.setTemporaryAttribute("autoCastAncients", ancients);
     } else {
         p.removeTemporaryAttribute("autoCastAncients");
     }
 }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:16,代码来源:MagicData.cs

示例14: updateVariables

        /*
         * NOTE: Anything that goes in here and varies between HD and LD,
         * reset the variable in ActionSender.configureGameScreen
         */
        public void updateVariables(Player p)
        {
            int currentLevel = p.getLocation().wildernessLevel();
            if (currentLevel != -1)
            { //Is in wilderness.
                int lastWildLevel = (p.getTemporaryAttribute("wildLvl") == null) ? -1 : (int)p.getTemporaryAttribute("wildLvl");

                if (currentLevel != lastWildLevel)
                {
                    if (currentLevel > 0)
                    {
                        p.setTemporaryAttribute("wildLvl", currentLevel);
                        if (p.getTemporaryAttribute("inWild") == null)
                        {
                            p.getPackets().sendPlayerOption("Attack", 1, 1);
                            p.getPackets().sendOverlay(381);
                            p.setTemporaryAttribute("inWild", true);
                        }
                    }
                    else
                    {
                        if (p.getTemporaryAttribute("inWild") != null)
                        {
                            p.getPackets().sendPlayerOption("null", 1, 1);
                            p.getPackets().sendRemoveOverlay();
                            p.removeTemporaryAttribute("wildLvl");
                            p.removeTemporaryAttribute("inWild");
                        }
                    }
                }
            }
            if (Location.inMultiCombat(p.getLocation()))
            {
                if (p.getTemporaryAttribute("inMulti") == null)
                {
                    p.getPackets().displayMultiIcon();
                    p.setTemporaryAttribute("inMulti", true);
                }
            }
            else
            {
                if (p.getTemporaryAttribute("inMulti") != null)
                {
                    p.getPackets().removeMultiIcon();
                    p.removeTemporaryAttribute("inMulti");
                }
            }
            if (Location.atDuelArena(p.getLocation()))
            {
                if (p.getDuel() != null)
                {
                    if (p.getDuel().getStatus() == 5 || p.getDuel().getStatus() == 6)
                    {
                        p.getPackets().sendPlayerOption("Fight", 1, 1);
                    }
                }
                if (p.getTemporaryAttribute("challengeUpdate") != null)
                {
                    p.getPackets().sendPlayerOption("Challenge", 1, 0);
                    p.removeTemporaryAttribute("challengeUpdate");
                }
                if (p.getTemporaryAttribute("atDuelArea") == null)
                {
                    p.getPackets().sendPlayerOption("Challenge", 1, 0);
                    p.getPackets().sendOverlay(638);
                    p.setTemporaryAttribute("atDuelArea", true);
                }
            }
            else
            {
                if (p.getTemporaryAttribute("atDuelArea") != null)
                {
                    p.getPackets().sendPlayerOption("null", 1, 0);
                    p.getPackets().sendRemoveOverlay();
                    p.removeTemporaryAttribute("atDuelArea");
                }
            }
            if (Location.atBarrows(p.getLocation()))
            {
                if (p.getTemporaryAttribute("atBarrows") == null)
                {
                    p.getPackets().sendOverlay(24);
                    p.getPackets().setMinimapStatus(2);
                    p.getPackets().sendConfig(452, 2652256); // doors
                    if (p.getTemporaryAttribute("betweenDoors") == null)
                    {
                        if (Barrows.betweenDoors(p))
                        {
                            p.setTemporaryAttribute("betweenDoors", true);
                            p.getPackets().sendConfig(1270, 1);
                        }
                    }
                    p.getPackets().modifyText("Kill Count: " + p.getBarrowKillCount(), 24, 0);
                    p.setTemporaryAttribute("atBarrows", true);
                    Barrows.prayerDrainEvent(p);
                    bool allBrothersKilled = true;
//.........这里部分代码省略.........
开发者ID:Krill156,项目名称:SharpEMU,代码行数:101,代码来源:AreaVariables.cs

示例15: showCaptainBarnabyDialogue

        public static void showCaptainBarnabyDialogue(Player p, int status)
        {
            int newStatus = -1;
            p.getPackets().softCloseInterfaces();
            if (p.getTemporaryAttribute("unmovable") != null) {
                return;
            }
            switch(status) {
                case 410:
                    p.getPackets().sendPlayerHead(64, 2);
                    p.getPackets().modifyText(p.getLoginDetails().getUsername(), 64, 3);
                    p.getPackets().modifyText("Could you take me back to Oo'glog please?", 64, 4);
                    p.getPackets().animateInterface(9827, 64, 2);
                    p.getPackets().sendChatboxInterface2(64);
                    newStatus = 411;
                    break;

                case 411:
                    p.getPackets().sendNPCHead(4962, 241, 2);
                    p.getPackets().modifyText("Captain Barnaby", 241, 3);
                    p.getPackets().modifyText("Yes! it's freezing here, let's go!", 241, 4);
                    p.getPackets().animateInterface(9827, 241, 2);
                    p.getPackets().sendChatboxInterface2(241);
                    newStatus = 412;
                    break;

                case 412:
                    travel(p, 4, true);
                    break;
            }
            if (newStatus != -1) {
                p.setTemporaryAttribute("dialogue", newStatus);
            }
        }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:34,代码来源:BoatOptions.cs


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