• 欢迎加入MineBBS QQ讨论群:点击查看所有的官方讨论群
  • 我们将于近期对服务器进行迁移,服务可能中断至多2日。请各位安排好自己的访问计划,造成不便敬请谅解!
  • MineBBS入站考试已经上线!想要成为【正式会员】解锁更多功能吗?快来参与吧!【点我去看】

【YuIo Wiki】Gear 技能!

YuIo_PQ

【Lv:5】

注册
2018/03/17
消息
590
金粒
359,789.44金粒
6月份汉化插件预告-Gears
【插件介绍】
对其他职业系统感到厌倦了?
每个职业都可以设定技能,你可以自定义技能触发方式,例如在手里拿着技能物品、点击其他的玩家,我们称其为"modes"。
每个职业都可以设定其对应的冷却时间,物品, 药水,附魔,指令等等。
所有的职业都需要在配置文件中特别设定,尤其是职业:iceman。
【选择职业】
/gears 查看所有职业
/gear 职业 选择一个职业
【职业列表】
*由于汉化准确性需要,职业名字仅在介绍时候做汉化处理。
杂技演员:
触发模式:左/右点击
自定义冷却时间:是的
自定义停用时间:不
描述:在空中跳高,能够逃离敌人。不会造成坠落伤害。
调酒师:
触发模式:伤害玩家
自定义冷却时间:是的
自定义停用时间:是
说明:给定制秒数带来目标恶心效果。
狂战士:
触发模式:右键单击
习惯冷却:是的
自定义停用时间:是
描述:增加玩家两倍他们自己的尺寸,伤害增加一倍。
冰人:
触发模式:移动
自定义冷却时间:不
自定义停用时间:不
说明:当玩家在水上行走时,创建一个3x1x3的冰路。
磁人:
触发模式:右键单击
自定义冷却时间:是的
自定义停用时间:不
描述:拉出20个区域内的所有玩家,并将其发射到空中造成坠落伤害。
天蝎座:
触发模式:右键单击
自定义冷却时间:是的
自定义停用时间:是的
说明:发射特殊物品,拾取它的玩家将被传送到发射它的玩家。该项目将在自定义秒数后消失。
蜘蛛:
模式:右键单击
自定义冷却时间:是的
自定义停用时间:是的
描述:在玩家正在看的区域生成一个10x2x10的玉米网陷阱。其中的所有玩家都会在自定义秒数内获得毒效。当该技能处于活动状态时,玩家也可以爬上墙壁并像蜘蛛一样滑行。在一个自定义的秒数后,陷阱将慢慢消失,所有块将恢复正常。
交易者:
模式:右键单击
习惯冷却:是的
自定义停用时间:不
说明:不明。(原英文文件内容无法被理解)
雷神:
模式:移动
自定义冷却时间:不
自定义停用时间:不
描述:在玩家正在查看的区块中的10x1x10顶部生成一个10x1x10火层。照明会召唤,其中的所有玩家将被自动点燃数秒。两个层面将在自定义秒数后缓慢消失,并且所有块将恢复正常。

【配置文件选项】
物品:
请参照以下格式
id:damage:amount:display name:enchanments ...

例子(钻石剑/带有附魔锋利1&耐久3):276:0:1:default:对应附魔英文名字:4:对应附魔英文名字:3

其他:如果显示名称设置为“default”,则物品显示名称将被设置为默认的Minecraft名称。

注意:附魔是可选的。

命令:
它与任何控制台命令完全相同,但玩家名称需要被替换为@player,职业名称需要替换为@kit

技能:
效果名称:功放:持续时间以秒为单位
冷却时间和停用时间:
整数(s)后跟每个时间帧的字母(s)。
年= y
周= w
天= d
月= mo
小时= h
分钟= m
秒= s
例如(1分30秒):1m30s
示例(1周和3天):1w3d
示例(1年3个月):1y3mo
冷却时间:能够再次使用套件的时间。
停用时间:使用该功能完成停用时所需的时间和效果。

【开发者文档】
通过以下内容自定义一个自己的技能!
首先添加一个 Gears\Kit\Kit class:
namespace mykitsplugin;
use Gears\Kit\Kit;
class MyCustomKit extends Kit{
}
in the class constructor call the parent constructor with your kit configuration:
namespace mykitsplugin;
use pocketmine\item\Item;
use Gears\Kit\Kit;
class RandomTeleportKit extends Kit{
public function __construct(){
$kitName = "RandomTeleportKit";
$specialItem = Item::get(345, 0, 1); //compass
$items = [
Item::get(276, 0, 1) // diamond sword
]; // generic items
$clickMode = Kit::ALL_CLICK_MODE; // check all click modes in the Kit class
$coolDown = 30; // in seconds
$deactivateTime = -1; // in seconds, not needed in this case

parent::__construct($kitName, $specialItem, $items, $clickMode, $coolDown, $deactivateTime);
}
}
Now add the onUseSpecialItem function:
namespace mykitsplugin;
use pocketmine\item\Item;
use Gears\Kit\Kit;
class RandomTeleportKit extends Kit{
public function __construct(){
$kitName = "RandomTeleportKit";
$specialItem = Item::get(345, 0, 1); //compass
$items = [
Item::get(276, 0, 1) // diamond sword
]; // generic items
$clickMode = Kit::ALL_CLICK_MODE; // check all click modes in the Kit class
$coolDown = 30; // in seconds
$deactivateTime = -1; // in seconds, not needed in this case

parent::__construct($kitName, $specialItem, $items, $clickMode, $coolDown, $deactivateTime);
}

public function onUseSpecialItem(array $data){
}
}
The $data argument is different for each mode, check the plugin kits for examples. Now make sure the string tag named kit_name from the special item is equal to your kits name, check the cooldown, then you can make things work your way.
You can also use $this->getGearsInstance() to get the instance of the plugin's base.
namespace mykitsplugin;
use pocketmine\item\Item;
use pocketmine\math\Vector3;
use pocketmine\nbt\tag\CompoundTag;
use pocketmine\Player;
class RandomTeleportKit extends Kit{
public function __construct(){
$kitName = "RandomTeleportKit";
$specialItem = Item::get(345, 0, 1); //compass
$items = [
Item::get(276, 0, 1) // diamond sword
]; // generic items
$clickMode = Kit::ALL_CLICK_MODE; // check all click modes in the Kit class
$coolDown = 30; // in seconds
$deactivateTime = -1; // in seconds, not needed in this case

parent::__construct($kitName, $specialItem, $items, $clickMode, $coolDown, $deactivateTime);
}

public function onUseSpecialItem(array $data){
$player = $data['Player'];
$item = $data['Item'];

if(($player instanceof Player) and ($item instanceof Item)){
if(!$item->hasCustomBlockData()) return false;

/** @var CompoundTag $data */
$data = $item->getCustomBlockData();

if(!$data->hasTag("kit_name")) return false;
if(strtolower($data->getString("kit_name")) === "randomteleportkit"){
if($this->checkCoolDown($player)){
$randomX = mt_rand(0, 1000);
$randomY = mt_rand(0, 256);
$randomZ = mt_rand(0, 1000);

$v3 = new Vector3($randomX, $randomY, $randomZ);

$safeSpawn = $player->level->getSafeSpawn($v3);

$player->teleport($safeSpawn);
}
}
}

return true;
}
}
Finally register the kit to the kit manager from your plugin, make sure to have the server instance.
$randomTeleportKit = new RandomTeleportKit();
$plugin = $server->getPluginManager()->getPlugin('Gears');
if($plugin !== null){
$plugin->getKitManager()->registerKit($randomTeleportKit);
}
You can also optionally add the following functions to your custom kit:
  • onQuit() called when player quits the server.
  • onDeath() called when player dies.
  • onUnload() called when player unloads the kit.
 
最后编辑:

在线会员

  • 好喝的蓝屏盖
  • 小叶
  • 菖蒲泽漆
  • ljy20150721LJY
  • Regotly
  • moqian
  • XyLuoDYS
  • 珞璃
  • 旭旭宝宝
  • Mirellata
后退
顶部 底部