本文整理汇总了C#中WorldServer.player.Player.getMagicType方法的典型用法代码示例。如果您正苦于以下问题:C# Player.getMagicType方法的具体用法?C# Player.getMagicType怎么用?C# Player.getMagicType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WorldServer.player.Player
的用法示例。
在下文中一共展示了Player.getMagicType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getSpellIndex
public static int getSpellIndex(Player p, int id, bool ancients)
{
if (!ancients) {
if (p.getMagicType() != 1) {
return -1;
}
switch(id) {
case 1: return 0; // Wind strike.
case 4: return 1; // Water strike
case 6: return 2; // Earth strike.
case 8: return 3; // Fire strike.
case 10: return 4; // Wind bolt.
case 14: return 5; // Water bolt.
case 17: return 6; // Earth bolt.
case 20: return 7; // Fire bolt.
case 24: return 8; // Wind blast.
case 27: return 9; // Water blast.
case 33: return 10; // Earth blast.
case 38: return 11; // Fire blast.
case 45: return 12; // Wind wave.
case 48: return 13; // Water wave.
case 52: return 14; // Earth wave.
case 55: return 15; // Fire wave.
case 22: return 32; // Crumble undead.
case 31: return 33; // Slayer dart.
case 12: return 34; // Bind.
case 29: return 35; // Iban blast.
case 30: return 36; // Snare.
case 41: return 37; // Saradomin strike.
case 42: return 38; // Claws of Guthix.
case 43: return 39; // Flames of Zamorak.
case 56: return 40; // Entangle.
case 2: return 41; // Confuse.
case 7: return 42; // Weaken.
case 11: return 43; // Curse.
case 53: return 44; // Enfeeble.
case 57: return 45; // Stun.
case 50: return 46; // Vulnerability.
case 63: return 47; // Teleblock.
}
} else {
if (p.getMagicType() != 2) {
return -1;
}
switch(id) {
case 8: return 16; // Smoke rush.
case 12: return 17; // Shadow rush.
case 4: return 18; // Blood rush.
case 0: return 19; // Ice rush.
case 10: return 20; // Smoke burst.
case 14: return 21; // Shadow burst.
case 6: return 22; // Blood burst.
case 2: return 23; // Ice burst.
case 9: return 24; // Smoke blitz.
case 13: return 25; // Shadow blitz.
case 5: return 26; // Blood blitz.
case 1: return 27; // Ice blitz.
case 11: return 28; // Smoke barrage.
case 15: return 29; // Shadow barrage.
case 7: return 30; // Blood barrage.
case 3: return 31; // Ice barrage.
case 16: return 48; // Miasmic rush.
case 18: return 49; // Miasmic burst.
case 17: return 50; // Miasmic blitz.
case 19: return 51; // Miasmic barrage.
}
}
return -1;
}
示例2: configureSelectSpellInterface
public static void configureSelectSpellInterface(Player p)
{
p.removeTemporaryAttribute("autoCasting");
if (p.getMagicType() == 1) {
if (p.getEquipment().getItemInSlot(ItemData.EQUIP.WEAPON) == 4170)
{ // Slayer staff.
p.getPackets().sendTab(83, 310);
return;
}
else if (p.getEquipment().getItemInSlot(ItemData.EQUIP.WEAPON) == 8841)
{ // Void knight mace.
p.getPackets().sendTab(83, 406);
return;
} else {
p.getPackets().sendTab(83, 319);
}
} else if (p.getMagicType() == 2) {
if (p.getEquipment().getItemInSlot(ItemData.EQUIP.WEAPON) == 4675)
{ // Ancient staff.
p.getPackets().sendTab(83, 388);
} else {
p.getPackets().sendMessage("You cannot autocast Ancient Magic with this staff.");
}
}
}