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


C# Player.removeTemporaryAttribute方法代码示例

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


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

示例1: resetAllSkills

 public static void resetAllSkills(Player p)
 {
     Fletching.setFletchItem(p, null);
     Herblore.setHerbloreItem(p, null);
     Cooking.setCookingItem(p, null);
     Mining.resetMining(p);
     Smithing.resetSmithing(p);
     Woodcutting.resetWoodcutting(p);
     Fishing.resetFishing(p);
     Crafting.resetCrafting(p);
     p.removeTemporaryAttribute("harvesting");
 }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:12,代码来源:SkillHandler.cs

示例2: burnBoil

 public static void burnBoil(Player p, int x, int y)
 {
     AreaEvent burnBoilAreaEvent = new AreaEvent(p, x - 1, y - 1, x + 3, y + 2);
     burnBoilAreaEvent.setAction(() =>
     {
         if (!p.getInventory().hasItem(590))
         {
             p.getPackets().sendMessage("You need a tinderbox to get past this obstacle.");
             return;
         }
         p.setFaceLocation(new Location(x + 1, y, 0));
         p.setLastAnimation(new Animation(733));
         p.setTemporaryAttribute("unmovable", true);
         Event burnBoilEvent = new Event(1900);
         burnBoilEvent.setAction(() =>
         {
             int status = 0;
             int[] BOIL = { 7165, 7166, 7167 };
             if (status < 3)
             {
                 p.getPackets().createObject(BOIL[status], new Location(x, y, 0), x == 3060 ? 3 : 1, 10);
             }
             status++;
             if (status == 1)
             {
                 burnBoilEvent.setTick(1300);
             }
             if (status == 3)
             {
                 p.setLastAnimation(new Animation(65535));
                 burnBoilEvent.setTick(1000);
             }
             if (status == 4)
             {
                 burnBoilEvent.stop();
                 teleportPastObstacle(p);
                 p.removeTemporaryAttribute("unmovable");
             }
         });
         Server.registerEvent(burnBoilEvent);
         return;
     });
     Server.registerCoordinateEvent(burnBoilAreaEvent);
 }
开发者ID:ramatronics,项目名称:rsps,代码行数:44,代码来源:AbyssObstacles.cs

示例3: resetAllFletchVariables

 private static void resetAllFletchVariables(Player p)
 {
     p.removeTemporaryAttribute("fletchType");
     p.removeTemporaryAttribute("ammoType");
     p.removeTemporaryAttribute("bowType");
     p.removeTemporaryAttribute("ammoType2");
     p.removeTemporaryAttribute("bowType2");
     p.removeTemporaryAttribute("stringingBow");
     p.removeTemporaryAttribute("boltTips");
 }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:10,代码来源:Fletching.cs

示例4: prospectRock

 public static void prospectRock(Player p, int x, int y, string s)
 {
     if (p.getTemporaryAttribute("unmovable") != null)
     {
         return;
     }
     AreaEvent prospectRockAreaEvent = new AreaEvent(p, x - 1, y - 1, x + 1, y + 1);
     prospectRockAreaEvent.setAction(() =>
     {
         p.getPackets().sendMessage("You examine the rock for ores...");
         p.setTemporaryAttribute("unmovable", true);
         Event prospectResultEvent = new Event(2000);
         prospectResultEvent.setAction(() =>
         {
             p.getPackets().sendMessage("This rock contains " + s + ".");
             p.removeTemporaryAttribute("unmovable");
             prospectResultEvent.stop();
         });
         Server.registerEvent(prospectResultEvent);
     });
     Server.registerCoordinateEvent(prospectRockAreaEvent);
 }
开发者ID:ramatronics,项目名称:rsps,代码行数:22,代码来源:Mining.cs

示例5: setFletchItem

 public static void setFletchItem(Player p, object a)
 {
     if (a == null)
     {
         resetAllFletchVariables(p);
         p.removeTemporaryAttribute("fletchItem");
         return;
     }
     p.setTemporaryAttribute("fletchItem", (object)a);
 }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:10,代码来源:Fletching.cs

示例6: cancelAutoCast

 public static void cancelAutoCast(Player p, bool cancelCast)
 {
     if (cancelCast)
     {
         p.getEquipment().setWeapon();
         //p.getPackets().sendConfig(43, 0);
         resetSpellIcon(p);
         p.removeTemporaryAttribute("autoCastSpell");
         p.removeTemporaryAttribute("autoCastAncients");
         p.getPackets().showChildInterface(90, 83, true);
         p.getPackets().modifyText("Spell", 90, 11);
         return;
     }
     if (p.getTemporaryAttribute("autoCastSpell") != null)
     {
         setAutoCastSpell(p, (int)p.getTemporaryAttribute("autoCastSpell2"), (int)p.getTemporaryAttribute("autoCastSpell"), (bool)(p.getTemporaryAttribute("autoCastAncients") != null ? true : false));
     }
     else
     {
         //p.getPackets().sendConfig(43, 0);
         resetSpellIcon(p);
         p.getEquipment().setWeapon();
         p.getPackets().showChildInterface(90, 83, true);
         p.getPackets().modifyText("Spell", 90, 11);
         p.removeTemporaryAttribute("autoCastSpell");
         p.removeTemporaryAttribute("autoCastAncients");
         p.removeTemporaryAttribute("autoCastSpell2");
     }
 }
开发者ID:ramatronics,项目名称:rsps,代码行数:29,代码来源:MagicData.cs

示例7: lightFire

        private static void lightFire(Player p, int logIndex, bool colouredFire, int slot)
        {
            //if (!World.getInstance().getObjectLocations().tileAvailable(new Location(p.getLocation().getX() - 1, p.getLocation().getY(), p.getLocation().getZ()))) {
                //return;
            //}
            // TODO clip this
            p.getPackets().closeInterfaces();
            int log = colouredFire ? COLOURED_LOGS[logIndex] : LOGS[logIndex];

            if (!canMakeFire(p, logIndex, colouredFire))
                return;

            if (slot != -1) {
                //item in inventory wasn't a log (you may have swapped it/banked it quickly).
                if(!p.getInventory().deleteItem(log, slot, 1))
                    return;

                Server.getGroundItems().newEntityDrop(new GroundItem(log, 1, (Location)p.getLocation().Clone(), p));
            } else { //light fire using logs already placed on ground.
                //check if there is a log on the ground in our current location, if not we can't make fire.
                GroundItem gi = Server.getGroundItems().itemExists(p.getLocation(), log);
                if (gi == null)
                    return; //so we quit here.
            }

            int delay = getDelay(p, logIndex);
            p.getWalkingQueue().resetWalkingQueue();
            p.getPackets().clearMapFlag();
            if (delay == START_DELAY)
                p.setLastAnimation(new Animation(733));
            p.getPackets().sendMessage("You attempt to light the logs.");
            ushort fireObject = colouredFire ? COLOURED_FIRES[logIndex] : FIRE_OBJECT;
            p.setTemporaryAttribute("unmovable", true);
            Event lightFireEvent = new Event(delay);
            lightFireEvent.setAction(() => {
                lightFireEvent.stop();
                p.setTemporaryAttribute("lastFiremake", Environment.TickCount);
                p.setLastAnimation(new Animation(65535));
                p.getWalkingQueue().forceWalk(-1, 0);
                Event finishFireEvent = new Event(1000);
                finishFireEvent.setAction(() => {
                    finishFireEvent.stop();
                    Location fireLocation = new Location((p.getLocation().getX() + 1), p.getLocation().getY(), p.getLocation().getZ());
                    if (Server.getGroundItems().deleteItem(log, fireLocation)) {
                        p.getPackets().sendMessage("The fire catches and the logs begin to burn.");
                        p.setFaceLocation(fireLocation);
                        p.getSkills().addXp(Skills.SKILL.FIREMAKING, FIRE_XP[logIndex]);
                        Server.getGlobalObjects().newFire(p, fireObject, fireLocation);
                    }
                    p.removeTemporaryAttribute("unmovable");
                });
                Server.registerEvent(finishFireEvent);
            });
            Server.registerEvent(lightFireEvent);
        }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:55,代码来源:Firemaking.cs

示例8: mineRock

 public static void mineRock(Player p, int x, int y)
 {
     AreaEvent mineRockAreaEvent = new AreaEvent(p, x-1, y-1, x +3, y+1);
     mineRockAreaEvent.setAction(() => {
         if (!Mining.hasPickaxe(p)) {
             p.getPackets().sendMessage("You need a pickaxe to get past this obstacle.");
             return;
         }
         p.getWalkingQueue().resetWalkingQueue();
         p.setFaceLocation(new Location(x + 1, y, 0));
         p.setLastAnimation(new Animation(Mining.getPickaxeAnimation(p)));
         p.setTemporaryAttribute("unmovable", true);
         Event mineRockEvent = new Event(1900);
         mineRockEvent.setAction(() => {
             int status = 0;
             int[] ROCKS = {7158, 7159, 7160};
             if (status < 3) {
                 p.getPackets().createObject(ROCKS[status], new Location(x, y, 0), 0, 10);
             }
             status++;
             if (status == 1) {
                 mineRockEvent.setTick(1300);
             }
             if (status == 3) {
                 p.setLastAnimation(new Animation(65535));
                 mineRockEvent.setTick(800);
             }
             if (status == 4) {
                 mineRockEvent.stop();
                 teleportPastObstacle(p);
                 p.removeTemporaryAttribute("unmovable");
             }
         });
         Server.registerEvent(mineRockEvent);
         return;
     });
     Server.registerCoordinateEvent(mineRockAreaEvent);
 }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:38,代码来源:AbyssObstacles.cs

示例9: useAgilityTunnel

 public static void useAgilityTunnel(Player p, int x, int y)
 {
     AreaEvent useAgilityTunnelAreaEvent = new AreaEvent(p, x-2, y-2, y+2, y+2);
     useAgilityTunnelAreaEvent.setAction(() => {
         p.getWalkingQueue().resetWalkingQueue();
         p.setLastAnimation(new Animation(844));
         p.setTemporaryAttribute("unmovable", true);
         p.setFaceLocation(new Location(x, y, 0));
         Event useAgilityTunnelEvent = new Event(1000);
         useAgilityTunnelEvent.setAction(() => {
             p.getPackets().sendMessage("You squeeze through the gap.");
             teleportPastObstacle(p);
             p.removeTemporaryAttribute("unmovable");
             useAgilityTunnelEvent.stop();
         });
         Server.registerEvent(useAgilityTunnelEvent);
         return;
     });
     Server.registerCoordinateEvent(useAgilityTunnelAreaEvent);
 }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:20,代码来源:AbyssObstacles.cs

示例10: resetSmithing

 public static void resetSmithing(Player p)
 {
     p.removeTemporaryAttribute("smithingItem");
     p.removeTemporaryAttribute("smithingBarType");
 }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:5,代码来源:Smithing.cs

示例11: setHerbloreItem

 public static void setHerbloreItem(Player p, object a)
 {
     if (a == null) {
         resetAllHerbloreVariables(p);
         p.removeTemporaryAttribute("herbloreItem");
         return;
     }
     p.setTemporaryAttribute("herbloreItem", (object) a);
 }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:9,代码来源:Herblore.cs

示例12: 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;
 }
开发者ID:ramatronics,项目名称:rsps,代码行数:89,代码来源:Teleport.cs

示例13: resetTeleport

 public static void resetTeleport(Player p)
 {
     p.removeTemporaryAttribute("teleporting");
     p.removeTemporaryAttribute("homeTeleporting");
 }
开发者ID:ramatronics,项目名称:rsps,代码行数:5,代码来源:Teleport.cs

示例14: 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);
 }
开发者ID:ramatronics,项目名称:rsps,代码行数:51,代码来源:Teleport.cs

示例15: 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:ramatronics,项目名称:rsps,代码行数:19,代码来源:MagicData.cs


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