本文整理匯總了C#中RS2.Server.player.Player.getFightCave方法的典型用法代碼示例。如果您正苦於以下問題:C# Player.getFightCave方法的具體用法?C# Player.getFightCave怎麽用?C# Player.getFightCave使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類RS2.Server.player.Player
的用法示例。
在下文中一共展示了Player.getFightCave方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: 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);
}
示例2: doJadAttacks
private static void doJadAttacks(Player p, Npc npc)
{
if (npc.getHp() <= (npc.getMaxHp() * 0.50))
{
if (p.getFightCave() != null)
{
if (!p.getFightCave().isHealersSpawned())
{
summonJadHealers(p, npc);
p.getFightCave().setHealersSpawned(true);
}
}
}
npc.resetCombatTurns();
npc.setEntityFocus(p.getClientIndex());
switch (Misc.random(1))
{
case 0: // Range
npc.setLastAnimation(new Animation(9276));
npc.setLastGraphics(new Graphics(1625));
Event jadRangeAttackEvent = new Event(1600);
int jadRangeAttackStatus = 0;
jadRangeAttackEvent.setAction(() =>
{
int hit = 0;
int prayer = p.getPrayers().getHeadIcon();
if (jadRangeAttackStatus == 0)
{
jadRangeAttackStatus++;
jadRangeAttackEvent.setTick(1500);
p.setLastGraphics(new Graphics(451));
if (prayer == PrayerData.RANGE)
{
hit = 0;
}
else
{
hit = Misc.random(96);
}
}
else
{
if (prayer != PrayerData.RANGE)
{
hit = Misc.random(96);
}
jadRangeAttackEvent.stop();
p.setLastAttacked(Environment.TickCount);
npc.setLastAttack(Environment.TickCount);
p.setAttacker(npc);
if (hit > p.getHp())
{
hit = p.getHp();
}
if (!Location.inFightCave(p.getLocation()) || p.getTeleportTo() != null)
{
return;
}
if ((p.getCombatTurns() > 2 || p.getCombatTurns() < 0))
{
p.setLastAnimation(new Animation(p.getDefenceAnimation()));
}
p.hit(hit);
Event animationEvent = new Event(100);
animationEvent.setAction(() =>
{
animationEvent.stop();
p.setLastGraphics(new Graphics(157, 0, 100));
});
Server.registerEvent(animationEvent);
}
});
Server.registerEvent(jadRangeAttackEvent);
break;
case 1: // Magic
npc.setLastGraphics(new Graphics(1626));
Event jadMagicAttackEvent = new Event(300);
int jadMagicAttackStatus = 0;
jadMagicAttackEvent.setAction(() =>
{
int hit = 0;
int prayer = p.getPrayers().getHeadIcon();
npc.setLastAnimation(new Animation(9278));
if (jadMagicAttackStatus == 0)
{
jadMagicAttackStatus++;
jadMagicAttackEvent.setTick(1600);
p.getPackets().sendProjectile(npc.getLocation(), p.getLocation(), 32, 1627, 50, 40, 34, 90, p);
}
else
{
jadMagicAttackEvent.stop();
if (prayer == PrayerData.MAGIC)
{
hit = 0;
}
else
{
hit = Misc.random(96);
//.........這裏部分代碼省略.........
示例3: unregister
/**
* Unregister a player.
* @param p as Player
*/
public static void unregister(Player p)
{
if (p.getTrade() != null)
{
p.getTrade().decline();
p.setTrade(null);
}
minigames.getFightPits().removeWaitingPlayer(p);
minigames.getFightPits().removePlayingPlayer(p);
if (p.getTemporaryAttribute("cantDoAnything") != null && Location.inFightPits(p.getLocation()))
{
minigames.getFightPits().useOrb(p, 5);
return;
}
if (Location.inFightPits(p.getLocation()))
{
Server.getMinigames().getFightPits().teleportToWaitingRoom(p, false);
return;
}
if (p.getFightCave() != null)
{
if (!p.getFightCave().isGamePaused())
{
p.getFightCave().teleFromCave(true);
return;
}
else
{
p.setLocation(new Location(2439, 5169, 0));
}
}
if (!Combat.isXSecondsSinceCombat(p, p.getLastAttacked(), 10000) || p.isDead() || p.getTemporaryAttribute("unmovable") != null)
{
return;
}
if (p.getDuel() != null)
{
if (p.getDuel().getStatus() == 8)
{
if (p.getDuel().getWinner().Equals(p))
{
p.getDuel().recieveWinnings(p);
}
}
else
{
if (p.getDuel().getStatus() == 5 || p.getDuel().getStatus() == 6)
{
p.getDuel().finishDuel(true, true);
}
}
}
removeAllPlayersNPCs(p);
foreach (Player p2 in players)
{
if (p == p2) continue;
//Remove me from anyone who has Seen me.. or attempting to see me (new players).
if (p2.getLocalEnvironment().getSeenPlayers().Contains(p) || p2.getLocalEnvironment().getNewPlayers().Contains(p))
p2.getLocalEnvironment().getRemovedPlayers().Add(p);
}
clanManager.leaveChannel(p);
loginHandler.addSavePlayer(p);
players.Remove(p);
p.getFriends().unregistered();
Console.WriteLine("Unregistered " + p.getLoginDetails().getUsername() + " [online = " + players.Count + "]");
}