zoukankan      html  css  js  c++  java
  • T端升级宝石

     1、 首先你需要导入一个SQL,那个就是宝石的SQL。这个就是你将在游戏里面使用的宝石,增加了脚本的 INSERT INTO `item_template` VALUES (90001, 0, 0, 0, 'Level Token', 46787, 6, 0, 0, 1, 0, 0, 0, -1, -1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1000, 0, 0, 18282, 0, 0, 0, 8000, 0, -1, 0, 0, NULL, 0, -1, 0, -1, 0, 0, NULL, 0, -1, 0, -1, 0, 0, NULL, 0, -1, 0, -1, 0, 0, NULL, 0, -1, 0, -1, 0, '|cff00FF00Use: Level Up|r', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 'item_level', 0, 0, 0, 0, 0, -4);
     脚本名称是'item_level
     2、给你的代码库增加一个脚本
    
    /*
    
      _______        _         ______                 
    
    |__   __|      | |       |  ____|                
    
        | | __ _ ___| |_ _   _| |__   _ __ ___  _   _ 
    
        | |/ _` / __| __| | | |  __| | '_ ` _ | | | |
    
        | | (_| \__  |_| |_| | |____| | | | | | |_| |
    
        |_|\__,_|___/\__|\__, |______|_| |_| |_|\__,_|
    
                          __/ |                       
    
                         |___/        
    
                         
    
    Script Made By Sinistah
    
    Special Thanks To LilleCarl For The Code Snippet
    
     
    
    Legend
    
    ------
    
    item_id = the item id of the item ur using. 
    
    max_lvl = the max lvl the script will allow players to use the item. 
    
    lvl = how many levels the item will grant upon used
    
    */
    
    #include "ScriptPCH.h"
    
     
    
    enum
    
    {
    
    item_id = 90001,
    
    max_lvl = 80,
    
    lvl = 1
    
    };
    
     
    
    class item_level : public ItemScript
    
    {
    
    public:
    
        item_level() : ItemScript("item_level") { }
    
     
    
        bool OnUse(Player* player, Item* item, const SpellCastTargets &)
    
        {
    
            if(player->IsBattlegroundOrArena() || player->isInCombat() || player->isInFlight())
    
            {
    
                player->GetSession()->SendNotification("You Cant Use This Right Now!");
    
                return false;
    
            }
    
            if(player->getLevel() == max_lvl)
    
            {
    
                player->GetSession()->SendNotification("You are already max level.");
    
                return false;
    
            }
    
            player->SetLevel(player->getLevel() == max_lvl ? max_lvl : player->getLevel() + lvl);
    
            player->DestroyItemCount(item_id, 1, true);
    
            player->GetSession()->SendNotification("You have used one level coin.");
    
            return true;
    
            }
    
    };
    
     
    
    void AddSC_item_level()
    
    {
    
        new item_level();
    
    }
    
     ok,你编译成功后,运行服务端,就可以测试了
  • 相关阅读:
    光纤收发器的连接及收发器指示灯故障诊断
    Keepalive介绍及工作原理
    RabbitMQ消息队列集群配置-1
    python2 centos7 安装mysql-python库
    etcd服务的安装与配置 yum安装新版本
    ETCD集群安装配置及简单应用 老版本
    查看mysql 最大连接数,连接线程数
    TCP连接状态详解及TIME_WAIT过多的解决方法
    Linux 进程打开最大文件连接数Too many open files
    redis 连接数 修改
  • 原文地址:https://www.cnblogs.com/needly/p/3751492.html
Copyright © 2011-2022 走看看