本文整理汇总了C#中WorldObject.setSecondForm方法的典型用法代码示例。如果您正苦于以下问题:C# WorldObject.setSecondForm方法的具体用法?C# WorldObject.setSecondForm怎么用?C# WorldObject.setSecondForm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WorldObject
的用法示例。
在下文中一共展示了WorldObject.setSecondForm方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: activateObelisk
private static void activateObelisk(int index) {
if (obeliskActivated[index])
return;
Location[] obeliskLocations = getLocations(index);
for (int i = 0; i < 4; i++) {
WorldObject obj = new WorldObject(OBELISK_ID[index], ACTIVATED_ID, obeliskLocations[i], 0, 10);
obj.setSecondForm(true);
Server.getGlobalObjects().add(obj);
foreach(Player p in Server.getPlayerList()) {
p.getPackets().createObject(ACTIVATED_ID, obeliskLocations[i], 0, 10);
}
}
obeliskActivated[index] = true;
Event activateObeliskEvent = new Event(4000 + (misc.random(4)) * 1000);
activateObeliskEvent.setAction(() => {
activateObeliskEvent.stop();
int randomOb = index;
while(randomOb == index) {
// While loop so if the random one is the same one, it picks a new one
randomOb = misc.random(OBELISK_ID.Length);
}
int random = randomOb;
foreach(Player p in Server.getPlayerList()) {
if (p != null) {
if (p.getLocation().inArea(OBELISK_LOCATIONS[index][0] - 2, OBELISK_LOCATIONS[index][1] - 2, OBELISK_LOCATIONS[index][0] + 2, OBELISK_LOCATIONS[index][1] + 2)) {
// TODO get the big purple graphic
p.setLastGraphics(new Graphics(1690));
p.setLastAnimation(new Animation(8939));
Player p2 = p;
Event obeliskTeleportEvent = new Event(1200);
obeliskTeleportEvent.setAction(() => {
obeliskTeleportEvent.stop();
p2.teleport(new Location((OBELISK_LOCATIONS[random][0] - 1) + misc.random(2), (OBELISK_LOCATIONS[random][1] - 1) + misc.random(2), 0));
Event obeliskAnimationEvent = new Event(500);
obeliskAnimationEvent.setAction(() => {
obeliskAnimationEvent.stop();
p2.setLastAnimation(new Animation(8941));
});
Server.registerEvent(obeliskAnimationEvent);
});
Server.registerEvent(obeliskTeleportEvent);
}
}
}
for (int i = 0; i < 4; i++) {
WorldObject obj = Server.getGlobalObjects().getObject(OBELISK_ID[index], obeliskLocations[i]);
Server.getGlobalObjects().restoreObject(obj);
}
obeliskActivated[index] = false;
});
}