本文整理匯總了C#中RS2.Server.player.Player.setTemporaryAttribute方法的典型用法代碼示例。如果您正苦於以下問題:C# Player.setTemporaryAttribute方法的具體用法?C# Player.setTemporaryAttribute怎麽用?C# Player.setTemporaryAttribute使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類RS2.Server.player.Player
的用法示例。
在下文中一共展示了Player.setTemporaryAttribute方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: displayWildernessLeverOptions
public static void displayWildernessLeverOptions(Player p, int leverIndex)
{
int dialogueIndex = 140 + leverIndex;
p.setTemporaryAttribute("dialogue", dialogueIndex);
string option1 = leverIndex == 0 ? "Edgeville" : "Home";
p.getPackets().modifyText(option1, 230, 2);
p.getPackets().modifyText("Mage bank", 230, 3);
p.getPackets().modifyText("Nowhere", 230, 4);
p.getPackets().sendChatboxInterface2(230);
}
示例2: display
public static void display(Player player, int buttonId)
{
int j = 0;
for (int i = 125; i < 149; i++)
{
if (buttonId == i)
{
int skillFlashFlags = (int)(player.getTemporaryAttribute("skillFlashFlags") == null ? 0 : (int)player.getTemporaryAttribute("skillFlashFlags"));
if ((skillFlashFlags & getSkillFlashingIcon(j)) == getSkillFlashingIcon(j))
{
skillFlashFlags &= ~getSkillFlashingIcon(j); //turn off this skill icon flashing animation bit.
player.getPackets().sendConfig(1179, skillFlashFlags); //stop flashing the skill you clicked on, if it was flashing.
player.setTemporaryAttribute("skillFlashFlags", skillFlashFlags); //update the variable for remaining flashing skill icons.
}
player.getPackets().displayInterface(499);
player.getPackets().sendConfig(965, MENU_ID[j]);
player.setTemporaryAttribute("SkillMenu", (int)MENU_ID[j]);
break;
}
j++;
}
}
示例3: 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);
}
示例4: getHairStyle
private static int getHairStyle(Player p, bool decrease)
{
int oldHair = p.getAppearance().getLook(0);
int newHair = oldHair;
if (p.getTemporaryAttribute("hairToggle") == null)
{
p.setTemporaryAttribute("hairToggle", 0);
return 0;
}
newHair = (int)p.getTemporaryAttribute("hairToggle");
newHair = decrease ? -1 : +1;
if (newHair == 11)
{
newHair = 186;//
}
else if (newHair == 12)
{
newHair = 188;//
}
else if (newHair == 13)
{
newHair = 190;//
}
else if (newHair == 14)
{
newHair = 192;//
}
else if (newHair == 15)
{
newHair = 194;//
}
else if (newHair == 16)
{
newHair = 196; //
}
else if (newHair == 17)
{
//17 to 25 dump from rs
}
p.setTemporaryAttribute("hairToggle", newHair);
return newHair;
}
示例5: crossDitch
public static void crossDitch(Player p, int x, int y)
{
if (p.getTemporaryAttribute("unmovable") != null)
{
return;
}
AreaEvent crossDitchAreaEvent = new AreaEvent(p, x, y - 1, x, y + 2);
crossDitchAreaEvent.setAction(() =>
{
p.getPackets().closeInterfaces();
p.getWalkingQueue().resetWalkingQueue();
p.setTemporaryAttribute("unmovable", true);
int newY = p.getLocation().getY() >= 3523 ? p.getLocation().getY() - 3 : p.getLocation().getY() + 3;
int dir = newY == 3 ? 0 : 4;
Location faceLocation = new Location(p.getLocation().getX(), dir == 3 ? 3523 : 3520, 0);
p.setFaceLocation(faceLocation);
Event crossDitchMoveEvent = new Event(500);
crossDitchMoveEvent.setAction(() =>
{
crossDitchMoveEvent.stop();
p.setLastAnimation(new Animation(6132));
int regionX = p.getUpdateFlags().getLastRegion().getRegionX();
int regionY = p.getUpdateFlags().getLastRegion().getRegionY();
int lX = (p.getLocation().getX() - ((regionX - 6) * 8));
int lY = (p.getLocation().getY() - ((regionY - 6) * 8));
ForceMovement movement = new ForceMovement(lX, lY, lX, newY, 33, 60, dir);
p.setForceMovement(movement);
p.setFaceLocation(new Location(x, y, 0));
Event crossDitchTeleportEvent = new Event(1250);
crossDitchTeleportEvent.setAction(() =>
{
crossDitchTeleportEvent.stop();
int playerY = p.getLocation().getY();
int nY = playerY >= 3523 ? 3520 : 3523;
p.teleport(new Location(p.getLocation().getX(), nY, 0));
p.removeTemporaryAttribute("unmovable");
});
Server.registerEvent(crossDitchTeleportEvent);
});
Server.registerEvent(crossDitchMoveEvent);
});
Server.registerCoordinateEvent(crossDitchAreaEvent);
}
示例6: 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);
}
示例7: doObstacle
public static void doObstacle(Player p, int index)
{
if (p.getTemporaryAttribute("unmovable") != null)
{
return;
}
switch (index)
{
case 0: // 3 planks, northern (east side)
case 1: // 3 planks, middle (east side)
case 2: // 3 planks, southern (east side)
case 3: // 3 planks, northern (west side)
case 4: // 3 planks, middle (west side)
case 5: // 3 planks, southern (west side)
int logXCoord = index <= 2 ? (int)AGILITY_ARENA_OBJECTS[index][1] + 1 : (int)AGILITY_ARENA_OBJECTS[index][1] - 1;
int logDirectionX = index <= 2 ? -7 : +7;
CoordinateEvent plankObstaclesCoordinateEvent = new CoordinateEvent(p, new Location(logXCoord, (int)AGILITY_ARENA_OBJECTS[index][2], 3));
plankObstaclesCoordinateEvent.setAction(() =>
{
bool running = p.getWalkingQueue().isRunToggled();
p.getWalkingQueue().setRunToggled(false);
p.getWalkingQueue().resetWalkingQueue();
p.getPackets().clearMapFlag();
p.setTemporaryAttribute("unmovable", true);
p.getAppearance().setWalkAnimation(155);
p.getUpdateFlags().setAppearanceUpdateRequired(true);
p.getWalkingQueue().forceWalk(logDirectionX, 0);
Event plankObstaclesEvent = new Event(4300);
plankObstaclesEvent.setAction(() =>
{
plankObstaclesEvent.stop();
p.removeTemporaryAttribute("unmovable");
p.getAppearance().setWalkAnimation(-1);
p.getUpdateFlags().setAppearanceUpdateRequired(true);
p.getSkills().addXp(Skills.SKILL.AGILITY, (double)AGILITY_ARENA_OBJECTS[index][3]);
p.getWalkingQueue().setRunToggled(running);
});
Server.registerEvent(plankObstaclesEvent);
});
Server.registerCoordinateEvent(plankObstaclesCoordinateEvent);
break;
case 6: //Handholds obstacle east of planks.
case 7: //Handholds obstacle west of planks.
int handHoldsDirectionX = 1;
int handHoldsDirectionY = 1;
if (index == 6)
{
handHoldsDirectionX = -1;
handHoldsDirectionY = +1;
}
else if (index == 7)
{
handHoldsDirectionX = +1;
handHoldsDirectionY = -1;
}
CoordinateEvent handholdsObstacleCoordinateEvent = new CoordinateEvent(p, new Location((int)AGILITY_ARENA_OBJECTS[index][1], (int)AGILITY_ARENA_OBJECTS[index][2], 3));
handholdsObstacleCoordinateEvent.setAction(() =>
{
bool running = p.getWalkingQueue().isRunToggled();
p.getWalkingQueue().setRunToggled(false);
p.getWalkingQueue().resetWalkingQueue();
p.getPackets().clearMapFlag();
p.setTemporaryAttribute("unmovable", true);
p.setLastAnimation(new Animation(1121));
p.setFaceLocation(new Location(p.getLocation().getX(), p.getLocation().getY() + handHoldsDirectionY, 3));
Event handholdsObstaclesEvent = new Event(700);
int handholdsObstaclesCounter = 0;
handholdsObstaclesEvent.setAction(() =>
{
p.setLastAnimation(new Animation(1122));
int regionX = p.getUpdateFlags().getLastRegion().getRegionX();
int regionY = p.getUpdateFlags().getLastRegion().getRegionY();
int lX = (p.getLocation().getX() - ((regionX - 6) * 8));
int lY = (p.getLocation().getY() - ((regionY - 6) * 8));
p.setForceMovement(new ForceMovement(lX, lY, lX + handHoldsDirectionX, lY, 0, 5, 0));
if (handholdsObstaclesCounter++ >= 7)
{
p.setLastAnimation(new Animation(65535));
handholdsObstaclesEvent.stop();
p.removeTemporaryAttribute("unmovable");
p.getSkills().addXp(Skills.SKILL.AGILITY, (double)AGILITY_ARENA_OBJECTS[index][3]);
p.getWalkingQueue().setRunToggled(running);
return;
}
Event teleportEvent = new Event(500);
teleportEvent.setAction(() =>
{
teleportEvent.stop();
p.teleport(new Location(p.getLocation().getX() + handHoldsDirectionX, p.getLocation().getY(), 3));
});
Server.registerEvent(teleportEvent);
});
Server.registerEvent(handholdsObstaclesEvent);
});
Server.registerCoordinateEvent(handholdsObstacleCoordinateEvent);
break;
}
}
示例8: 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;
//.........這裏部分代碼省略.........
示例9: openTunnelDoor
public static bool openTunnelDoor(Player player, int doorId, int x, int y)
{
if (doorId < 6716 || (doorId > 6731 && doorId < 6735) || doorId > 6750)
{
return false;
}
int index = getDoorIndex(doorId, x, y);
int index2 = getOtherDoor(x, y); // index of the door next to the one you clicked.
if (index == -1 || index2 == -1)
{
return false;
}
bool betweenDoors = player.getTemporaryAttribute("betweenDoors") != null;
Location clickedDoor = new Location(DOOR_LOCATION[index][0], DOOR_LOCATION[index][1], 0);
Location otherDoor = new Location(DOOR_LOCATION[index2][0], DOOR_LOCATION[index2][1], 0);
int openDoorId = DOOR_OPEN_DIRECTION[index][0];
int openDoorId2 = DOOR_OPEN_DIRECTION[index2][0];
int openDirection = DOOR_OPEN_DIRECTION[index][2];
int newX = openDirection == 1 ? x + 1 : openDirection == 2 ? x : openDirection == 3 ? x - 1 : openDirection == 4 ? x : x;
int newY = openDirection == 1 ? y : openDirection == 2 ? y + 1 : openDirection == 3 ? y : openDirection == 4 ? y - 1 : y;
int newX2 = openDirection == 1 ? DOOR_LOCATION[index2][0] + 1 : openDirection == 2 ? DOOR_LOCATION[index2][0] : openDirection == 3 ? DOOR_LOCATION[index2][0] - 1 : openDirection == 4 ? DOOR_LOCATION[index2][0] : DOOR_LOCATION[index2][0];
int newY2 = openDirection == 1 ? DOOR_LOCATION[index2][1] : openDirection == 2 ? DOOR_LOCATION[index2][1] + 1 : openDirection == 3 ? DOOR_LOCATION[index2][1] : openDirection == 4 ? DOOR_LOCATION[index2][1] - 1 : DOOR_LOCATION[index2][1];
int[] doorStandCoordinates = getDoorCoordinates(player, index, index2, betweenDoors);
int[] walkDirections = getWalkDirections(player, index, index2, betweenDoors);
player.setFaceLocation(clickedDoor);
AreaEvent doorsWalkAreaEvent = new AreaEvent(player, doorStandCoordinates[0], doorStandCoordinates[1], doorStandCoordinates[2] + 1, doorStandCoordinates[3] + 1);
doorsWalkAreaEvent.setAction(() =>
{
player.setTemporaryAttribute("unmovable", true);
Event forceWalkDoorEvent = new Event(800);
forceWalkDoorEvent.setAction(() =>
{
player.getWalkingQueue().resetWalkingQueue();
foreach (Player p in Server.getPlayerList())
{ //change door for all logged in players? uhh what?
p.getPackets().removeObject(clickedDoor, openDoorId == 6713 ? 4 : 3, 0);
p.getPackets().removeObject(otherDoor, openDoorId2 == 6732 ? 3 : 4, 0);
p.getPackets().createObject(openDoorId, new Location(newX, newY, 0), DOOR_OPEN_DIRECTION[index][1], 0);
p.getPackets().createObject(openDoorId2, new Location(newX2, newY2, 0), DOOR_OPEN_DIRECTION[index2][1], 0);
}
player.getWalkingQueue().forceWalk(walkDirections[0], walkDirections[1]);
forceWalkDoorEvent.stop();
});
Server.registerEvent(forceWalkDoorEvent);
Event betweenDoorsEvent = new Event(betweenDoors ? 2200 : 1900);
betweenDoorsEvent.setAction(() =>
{
int face = openDirection == 3 ? 0 : openDirection == 4 ? 3 : openDirection == 2 ? 1 : 2;
foreach (Player p in Server.getPlayerList())
{
p.getPackets().removeObject(new Location(newX, newY, 0), openDoorId == 6713 ? 4 : 3, 0);
p.getPackets().removeObject(new Location(newX2, newY2, 0), openDoorId2 == 6732 ? 3 : 4, 0);
p.getPackets().createObject(DOORS[index], clickedDoor, face, 0);
p.getPackets().createObject(DOORS[index2], otherDoor, face, 0);
}
player.removeTemporaryAttribute("unmovable");
if (!betweenDoors)
{
player.getPackets().sendConfig(1270, 1);
player.setTemporaryAttribute("betweenDoors", true);
}
else
{
player.getPackets().sendConfig(1270, 0);
player.removeTemporaryAttribute("betweenDoors");
}
betweenDoorsEvent.stop();
});
Server.registerEvent(betweenDoorsEvent);
});
Server.registerCoordinateEvent(doorsWalkAreaEvent);
return true;
}
示例10: useJewellery
public static bool useJewellery(Player p, int item, int slot, bool wearingItem)
{
if (item == 1704 || item == 10362)
{ // Blank amulets
p.getPackets().sendMessage("This amulet has no charges remaining.");
return true;
}
if (p.getTemporaryAttribute("unmovable") != null || p.getTemporaryAttribute("cantDoAnything") != null)
{
return true;
}
int index = getItemIndex(item);
if (index == -1)
{
return false;
}
string s = index == 2 ? "ring" : "amulet";
p.getPackets().sendMessage("You rub the " + s + "...");
p.getPackets().closeInterfaces();
int interfaceId = index == 2 ? 230 : 235;
int j = 2;
p.getPackets().modifyText("Teleport to where?", interfaceId, 1);
for (int i = 0; i < LOCATIONS[index].Length; i++)
{
p.getPackets().modifyText(LOCATIONS[index][i], interfaceId, (i + j));
}
if (index == 2)
{
p.getPackets().sendChatboxInterface2(interfaceId);
}
else
{
p.getPackets().sendChatboxInterface2(interfaceId);
}
JewellerySlot js = new JewelleryTeleport.JewellerySlot(index, slot, wearingItem);
p.setTemporaryAttribute("jewelleryTeleport", js);
return true;
}
示例11: 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);
}
示例12: 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);
}
示例13: handleClickFive
private void handleClickFive(Player player, Packet packet)
{
int interfaceId = packet.readUShort();
int child = packet.readUShort();
int slot = packet.readUShort();
Console.WriteLine("InterfaceOption 5: interfaceId: " + interfaceId);
switch (interfaceId)
{
case 763: // Bank inventory - X.
player.getPackets().displayEnterAmount();
player.setTemporaryAttribute("interfaceVariable", new EnterVariable(interfaceId, slot));
break;
case 762: // Bank - X.
player.getPackets().displayEnterAmount();
player.setTemporaryAttribute("interfaceVariable", new EnterVariable(interfaceId, slot));
break;
case 336: // Trade inventory - trade X.
player.getPackets().displayEnterAmount();
player.setTemporaryAttribute("interfaceVariable", new EnterVariable(interfaceId, slot));
break;
case 335: // Trade interface - remove X.
player.getPackets().displayEnterAmount();
player.setTemporaryAttribute("interfaceVariable", new EnterVariable(interfaceId, slot));
break;
case 631: // Duel interface - remove All
if (player.getDuel() != null)
{
player.getPackets().displayEnterAmount();
player.setTemporaryAttribute("interfaceVariable", new EnterVariable(interfaceId, slot));
break;
}
break;
case 620: // Shop - buy X/buy 50.
if (player.getShopSession().isInMainStock())
{
player.getPackets().displayEnterAmount();
player.setTemporaryAttribute("interfaceVariable", new EnterVariable(interfaceId, slot));
}
else
{
player.getShopSession().buyItem(slot, 50);
}
break;
case 621: // Shop - Sell 50.
player.getShopSession().sellItem(slot, 50);
break;
case 590: // Clan chat setup
Clan clan = Server.getClanManager().getClanByOwner(player.getLoginDetails().getUsername());
if (clan == null)
{
player.getPackets().sendMessage("Please create your clan chat before changing settings.");
break;
}
switch (child)
{
case 23: // "Who can enter chat" - sergeant.
clan.setEnterRights(Clan.ClanRank.SERGEANT);
player.getPackets().modifyText(clan.getRankString(clan.getEnterRights()), 590, 23);
break;
case 24: // "Who can talk in chat" - sergeant.
clan.setTalkRights(Clan.ClanRank.SERGEANT);
player.getPackets().modifyText(clan.getRankString(clan.getTalkRights()), 590, 24);
break;
case 25: // // "Who can kick in chat" - sergeant.
clan.setKickRights(Clan.ClanRank.SERGEANT);
player.getPackets().modifyText(clan.getRankString(clan.getKickRights()), 590, 25);
break;
case 26: // "Who can share loot" - sergeant.
clan.setLootRights(Clan.ClanRank.SERGEANT);
player.getPackets().modifyText(clan.getRankString(clan.getLootRights()), 590, 26);
break;
}
break;
}
}
示例14: talkToKamfreena
public static void talkToKamfreena(Player p, int status)
{
int newStatus = -1;
p.getPackets().softCloseInterfaces();
switch (status)
{
case 77:
p.getPackets().sendNPCHead(4289, 241, 2);
p.getPackets().modifyText("Kamfreena", 241, 3);
p.getPackets().modifyText("Hello! Can I help you?.", 241, 4);
p.getPackets().animateInterface(9827, 241, 2);
p.getPackets().sendChatboxInterface2(241);
newStatus = 78;
break;
case 78:
p.getPackets().modifyText("I'd like to kill some Cyclops please.", 228, 2);
p.getPackets().modifyText("Never mind, sorry to bother you.", 228, 3);
p.getPackets().sendChatboxInterface(228);
newStatus = 79;
break;
case 79:
p.getPackets().sendPlayerHead(64, 2);
p.getPackets().modifyText(p.getLoginDetails().getUsername(), 64, 3);
p.getPackets().modifyText("I'd like to kill some Cyclops please.", 64, 4);
p.getPackets().animateInterface(9827, 64, 2);
p.getPackets().sendChatboxInterface2(64);
newStatus = 81;
break;
case 80:
p.getPackets().sendPlayerHead(64, 2);
p.getPackets().modifyText(p.getLoginDetails().getUsername(), 64, 3);
p.getPackets().modifyText("Never mind, sorry to bother you.", 64, 4);
p.getPackets().animateInterface(9827, 64, 2);
p.getPackets().sendChatboxInterface2(64);
break;
case 81:
if (!p.getInventory().hasItemAmount(8851, 100))
{
p.getPackets().sendNPCHead(4289, 242, 2);
p.getPackets().modifyText("Kamfreena", 242, 3);
p.getPackets().modifyText("You require a minimum of 100 tokens in order", 242, 4);
p.getPackets().modifyText("to be able to enter the Cyclops' room.", 242, 5);
p.getPackets().animateInterface(9827, 242, 2);
p.getPackets().sendChatboxInterface2(242);
break;
}
else
{
int currentDefenderStatus = getDefenderStatus(p);
int lastDefenderStatus = p.getDefenderWave();
p.setDefenderWave(currentDefenderStatus);
string s = currentDefenderStatus != lastDefenderStatus ? " now " : " ";
p.getPackets().sendNPCHead(4289, 242, 2);
p.getPackets().modifyText("Kamfreena", 242, 3);
p.getPackets().modifyText("Very well. The Cyclops will" + s + "drop:", 242, 4);
p.getPackets().modifyText(ItemData.forId(DEFENDERS[currentDefenderStatus]).getName() + ".", 242, 5);
p.getPackets().animateInterface(9827, 242, 2);
p.getPackets().sendChatboxInterface2(242);
newStatus = 82;
}
break;
case 82:
if (p.getDefenderWave() < 6)
{
p.getPackets().sendNPCHead(4289, 242, 2);
p.getPackets().modifyText("Kamfreena", 242, 3);
p.getPackets().modifyText("Be sure to speak to me once you have retrieved one", 242, 4);
p.getPackets().modifyText("if you wish to advance!", 242, 5);
p.getPackets().animateInterface(9827, 242, 2);
p.getPackets().sendChatboxInterface2(242);
}
else
{
p.getPackets().sendNPCHead(4289, 242, 2);
p.getPackets().modifyText("Kamfreena", 242, 3);
p.getPackets().modifyText("Since Rune is the highest Defender available, you don't", 242, 4);
p.getPackets().modifyText("need to speak to me once you have retrieved one.", 242, 5);
p.getPackets().animateInterface(9827, 242, 2);
p.getPackets().sendChatboxInterface2(242);
}
break;
}
if (newStatus != -1)
{
p.setTemporaryAttribute("dialogue", newStatus);
}
}
示例15: doDialogue
//.........這裏部分代碼省略.........
p.getPackets().modifyText("What is this place?", 232, 2);
p.getPackets().modifyText("What do you do?", 232, 3);
p.getPackets().modifyText("I'd like to trade in my tickets, please.", 232, 4);
p.getPackets().modifyText("See you later.", 232, 5);
newStatus = 46;
break;
case 46:
p.getPackets().sendNPCHead(1055, 241, 2);
p.getPackets().modifyText("Pirate Jackie the Fruit", 241, 3);
p.getPackets().modifyText("Welcome to the Brimhaven Agility Arena!", 241, 4);
p.getPackets().animateInterface(9827, 241, 2);
p.getPackets().sendChatboxInterface2(241);
newStatus = 47;
break;
case 47:
p.getPackets().sendNPCHead(1055, 242, 2);
p.getPackets().modifyText("Pirate Jackie the Fruit", 242, 3);
p.getPackets().modifyText("If ye want to know more, talk to Cap'n Izzy, after", 242, 4);
p.getPackets().modifyText("all... he did find it!", 242, 5);
p.getPackets().animateInterface(9827, 242, 2);
p.getPackets().sendChatboxInterface2(242);
newStatus = 45;
break;
case 48:
p.getPackets().sendPlayerHead(64, 2);
p.getPackets().modifyText(p.getLoginDetails().getUsername(), 64, 3);
p.getPackets().modifyText("What do you do?", 64, 4);
p.getPackets().animateInterface(9827, 64, 2);
p.getPackets().sendChatboxInterface2(64);
newStatus = 49;
break;
case 49:
p.getPackets().sendNPCHead(1055, 244, 2);
p.getPackets().modifyText("Pirate Jackie the Fruit", 244, 3);
p.getPackets().modifyText("I be the jack o' tickets. I exchange the tickets ye", 244, 4);
p.getPackets().modifyText("Collect in the Agility arena for more stuff. Ye can", 244, 5);
p.getPackets().modifyText("obtain more Agility experience or items ye won't", 244, 6);
p.getPackets().modifyText("find anywhere else!", 244, 7);
p.getPackets().animateInterface(9827, 244, 2);
p.getPackets().sendChatboxInterface2(244);
newStatus = 50;
break;
case 50:
p.getPackets().sendPlayerHead(64, 2);
p.getPackets().modifyText(p.getLoginDetails().getUsername(), 64, 3);
p.getPackets().modifyText("Sounds good!", 64, 4);
p.getPackets().animateInterface(9827, 64, 2);
p.getPackets().sendChatboxInterface2(64);
newStatus = 45;
break;
case 51:
p.getPackets().sendPlayerHead(64, 2);
p.getPackets().modifyText(p.getLoginDetails().getUsername(), 64, 3);
p.getPackets().modifyText("I'd like to trade in my tickets, please.", 64, 4);
p.getPackets().animateInterface(9827, 64, 2);
p.getPackets().sendChatboxInterface2(64);
newStatus = 52;
break;
case 52:
p.getPackets().sendNPCHead(1055, 241, 2);
p.getPackets().modifyText("Pirate Jackie the Fruit", 241, 3);
p.getPackets().modifyText("Aye, ye be on the right track.", 241, 4);
p.getPackets().animateInterface(9827, 241, 2);
p.getPackets().sendChatboxInterface2(241);
newStatus = 53;
break;
case 53:
p.getPackets().displayInterface(6);
break;
case 54:
p.getPackets().sendPlayerHead(64, 2);
p.getPackets().modifyText(p.getLoginDetails().getUsername(), 64, 3);
p.getPackets().modifyText("See you later.", 64, 4);
p.getPackets().animateInterface(9827, 64, 2);
p.getPackets().sendChatboxInterface2(64);
newStatus = 55;
break;
case 55:
p.getPackets().sendNPCHead(1055, 241, 2);
p.getPackets().modifyText("Pirate Jackie the Fruit", 241, 3);
p.getPackets().modifyText("Goodbye.", 241, 4);
p.getPackets().animateInterface(9827, 241, 2);
p.getPackets().sendChatboxInterface2(241);
break;
}
if (newStatus != -1)
{
p.setTemporaryAttribute("dialogue", newStatus);
}
}