--[[作者信息:
Auto Learn SKills (升级自动学习技能)
作者QQ:247321453
作者Email:247321453@qq.com
修改日期:2014-3-12
功能:在玩家升级时,自动学习相应等级的技能(可以连续升级)
]]--
print(">>Script: Auto Learn SKills.") --CLASS 职业
local CLASS_WARRIOR = --战士
local CLASS_PALADIN = --圣骑士
local CLASS_HUNTER = --猎人
local CLASS_ROGUE = --盗贼
local CLASS_PRIEST = --牧师
local CLASS_DEATH_KNIGHT = --死亡骑士
local CLASS_SHAMAN = --萨满
local CLASS_MAGE = --法师
local CLASS_WARLOCK = --术士
local CLASS_DRUID = --德鲁伊 --[[
--任务技能
--战士 2458,71,20252,18499
--术士 688,697,712 691 23161
--猎人 883 982 1515 2641 5149 6991
--圣骑士 23214 7328 13819 34767
--盗贼 8681 2842
--德鲁伊 768 9634 1066 40120 783 6807
--死亡骑士 52382
--31700内域飞行 40
--44140全地图飞行
]]-- local SKILL={--技能表
[CLASS_WARRIOR]={--战士
[]={},
[]={},
[]={,},
[]={,},
[]={ },
[]={,,},
[]={,,},
[]={,},
[]={,,},
[]={,},
[]={,,,},
[]={,},
[]={,,,},
[]={,},
[]={,},
[]={,,, },
[]={,, , },
[]={,, },
[]={},
[]={,,},
[]={,,,,},
[]={},
[]={,},
[]={,},
[]={,,,},
[]={,,},
[]={},
[]={,,,},
[]={,},
[]={},
[]={,,,,,},
[]={},
[]={},
[]={},
[]={},
[]={},
[]={,},
[]={},
[]={,,},
[]={,},
[]={,,,,},
[]={,},
[]={,},
[]={,},
[]={,},
[]={,},
[]={,},
[]={},
[]={,},
[]={,},
[]={,,,,},
}, [CLASS_PALADIN]={--圣骑士
[]={,,},
[]={,},
[]={,},
[]={,,},
[]={,},
[]={ },
[]={,,},
[]={,,},
[]={},
[]={,,,,,, },
[]={,,,},
[]={,,,,},
[]={,,},
[]={,,},
[]={,,,,,},
[]={,},
[]={,,},
[]={,,,},
[]={,,},
[]={,,,, ,},
[]={,,},
[]={,,,},
[]={,,},
[]={,},
[]={,,,,},
[]={,,,,},
[]={,,,},
[]={,},
[]={},
[]={,,,,,,,,,,,,,},
[]={,},
[]={},
[]={,},
[]={,},
[]={,,},
[]={,},
[]={,,,,,,},
[]={,,},
[]={,},
[]={,,},
[]={,,},
[]={,,},
[]={,},
[]={,,},
[]={,,},
[]={,,,,,},
[]={,,,,},
}, [CLASS_HUNTER]={--猎人
[]={},
[]={,},
[]={,},
[]={,},
[]={,,, ,,,,,,},
[]={,,,},
[]={,,},
[]={,,,},
[]={,,,},
[]={,,,,,},
[]={,},
[]={,,},
[]={,,,},
[]={,,,},
[]={,,,,},
[]={,,},
[]={,},
[]={,,,},
[]={},
[]={,,,,,},
[]={,},
[]={,,,},
[]={,,},
[]={,},
[]={,,,},
[]={,},
[]={,},
[]={,,},
[]={,,,,},
[]={,,,,,,,},
[]={},
[]={},
[]={},
[]={},
[]={},
[]={,,},
[]={,,,},
[]={},
[]={,},
[]={,,,},
[]={},
[]={,},
[]={,,,},
[]={,},
[]={,},
[]={,,},
[]={},
[]={,},
[]={,,,,,,,},
}, [CLASS_DRUID]={--德鲁伊
[]={,},
[]={,, },
[]={,,, },
[]={},
[]={,,,,, },
[]={,,},
[]={,,,},
[]={,,, },
[]={,,,,,,},
[]={,,,,,,,},
[]={,,,,},
[]={,,,,,,},
[]={,,,},
[]={,,,,,,,},
[]={,,,,,,},
[]={,,,,},
[]={,,,,,,},
[]={,,,,,},
[]={,,,,,,,},
[]={,,,,,,,,,,,},
[]={,,,},
[]={,,,,,},
[]={,,,,,,},
[]={,,,,,,},
[]={,,,,,,,},
[]={,,,,},
[]={,,,,,,},
[]={,,},
[]={,,,,,,,},
[]={,,,,,,,,,,,,,,},
[]={,},
[]={,,},
[]={,,},
[]={,,,},
[]={,},
[]={,,},
[]={,,},
[]={,},
[]={,,,,,},
[]={,,,,,,,, },
[]={,,,,},
[]={,,,,},
[]={,,},
[]={,,,},
[]={,,,,},
[]={},
[]={,,,},
[]={,,,,},
[]={,,,,,},
[]={,,,,,,,,,,,},
},
[CLASS_WARLOCK]={--术士
[]={,},
[]={,},
[]={,},
[]={,, },
[]={,,,},
[]={,,},
[]={,},
[]={,},
[]={,,},
[]={,,,,,,, ,},
[]={,,,},
[]={,,,},
[]={,,,},
[]={,,,,},
[]={ },
[]={,,,,,},
[]={,,,},
[]={,,,},
[]={,,,,},
[]={,,},
[]={,,,, },
[]={,,,,},
[]={,,,},
[]={,,,,,},
[]={,,,},
[]={,,,,,},
[]={,,,,},
[]={,,,},
[]={,,,},
[]={,,,,,},
[]={,,,,,,,,,},
[]={},
[]={,,},
[]={,},
[]={,},
[]={,,},
[]={,,},
[]={,,,,},
[]={,,,,,,},
[]={,,,,,,},
[]={,},
[]={,,,},
[]={,,},
[]={,,,,},
[]={,,,},
[]={,,},
[]={,},
[]={,,,,,},
[]={,,,,,},
[]={,,,,,,,,,,,},
},
[CLASS_MAGE]={--法师
[]={},
[]={,},
[]={,,},
[]={,,},
[]={,,},
[]={,,,},
[]={,,,},
[]={,},
[]={,,},
[]={,,,,,,,,},
[]={,,,,},
[]={,,,,},
[]={,,},
[]={,,,,},
[]={,,,,,,,},
[]={,,,,},
[]={,,},
[]={,,,},
[]={,,,},
[]={,,,,,,,},
[]={,,,,,},
[]={,,},
[]={,,,},
[]={,,,,},
[]={,,,,},
[]={,,,,},
[]={,,,,},
[]={,,,,},
[]={,,,},
[]={,,,,,,,,,,,},
[]={},
[]={,,},
[]={,,},
[]={,},
[]={,,},
[]={,},
[]={,},
[]={,,,},
[]={,,,,,},
[]={,,,,,,,,,,,,},
[]={,,},
[]={,,},
[]={,},
[]={,,},
[]={,,,,},
[]={,,},
[]={,},
[]={,,,},
[]={,,,,,,,,},
[]={,,,,,,,,,},
}, [CLASS_PRIEST]={--牧师
[]={,,},
[]={,},
[]={,},
[]={,,,},
[]={,,},
[]={,,,},
[]={,},
[]={,,},
[]={,,,,,,,,},
[]={,,,,},
[]={,,,},
[]={,,},
[]={,,,,},
[]={,,,,,,,},
[]={,,},
[]={,,,,},
[]={,,,,,},
[]={,,},
[]={,,,,,},
[]={,,,,},
[]={,,,,},
[]={,,,},
[]={,,,},
[]={,,,,,},
[]={,,,},
[]={,,},
[]={,,,,},
[]={,,,},
[]={,,,,,,,,,,,,,},
[]={,},
[]={},
[]={,},
[]={},
[]={,,},
[]={,},
[]={},
[]={,,,,,,},
[]={,,},
[]={,,,,,,,,,},
[]={},
[]={,},
[]={,,},
[]={,,},
[]={,,,,,},
[]={,},
[]={,},
[]={,,,},
[]={,,,,},
[]={,,,,,,,,,,,},
}, [CLASS_SHAMAN]={--萨满
[]={,},
[]={},
[]={,},
[]={,,,,},
[]={,,},
[]={,,,},
[]={,},
[]={,,,,},
[]={,,,,},
[]={,,,,},
[]={,},
[]={,,,,,,},
[]={,,,,},
[]={,,,,,,,},
[]={,,,,,,,,},
[]={,,,,,,},
[]={,,},
[]={,,,,,},
[]={,,,,,,},
[]={,,,,,,,,},
[]={},
[]={,},
[]={,,},
[]={,,,,},
[]={,,,,,,,,},
[]={,,,,},
[]={,,,},
[]={,},
[]={},
[]={,,,,,,},
[]={,,,,},
[]={,,,,,,,,,},
[]={,},
[]={,},
[]={,,},
[]={,},
[]={,,},
[]={,,},
[]={,,,},
[]={,,,,},
[]={,,,,},
[]={,,,,,},
[]={,,,,,,},
[]={},
[]={,,},
[]={,,},
[]={,,,,,,,,,,},
[]={,,,,,},
[]={},
[]={,,},
[]={,},
[]={,,,,,,,,,,,,,,,,,,,},
}, [CLASS_ROGUE]={--盗贼
[]={,,},
[]={,},
[]={,},
[]={,,},
[]={,},
[]={,,},
[]={,,},
[]={},
[]={,,},
[]={,,,},
[]={,},
[]={,},
[]={,,,},
[]={,,,},
[]={},
[]={,,},
[]={,},
[]={,},
[]={,,},
[]={,,},
[]={,},
[]={,},
[]={,},
[]={,,},
[]={,,},
[]={,},
[]={},
[]={,},
[]={,,,,},
[]={},
[]={,,},
[]={,,},
[]={,},
[]={,},
[]={},
[]={,,,,},
[]={},
[]={},
[]={},
[]={,,},
[]={,,},
[]={,},
[]={},
[]={,},
[]={,,,,,},
},
[CLASS_DEATH_KNIGHT]={--死亡骑士
[]={,,,},
[]={,},
[]={,},
[]={,},
[]={,},
[]={,,},
[]={,},
[]={},
[]={,},
[]={,,},
[]={,},
[]={,,,},
[]={,},
[]={},
[]={,,},
[]={,},
[]={,,},
[]={},
[]={,,,},
[]={},
[]={,},
[]={},
[]={,,,,,},
}, } function SKILL.AutoLearn(event, player, oldLevel)
local Pclass = player:GetClass()--得到职业号
local level = player:GetLevel()--得到当前等级
local ClassSkills = SKILL[Pclass]--该职业的该等级技能表
if(ClassSkills)then--该职业技能表存在
for i=oldLevel+,level do --从旧等级到现在等级
local LevelSkills = ClassSkills[i] or {}--该职业技能表存在?存在就获取该等级技能表,不存在就为空
for k, v in pairs(LevelSkills) do --k=1,开始把每个技能读出来赋值为v
player:LearnSpell(v) --学习每个技能
end
end
end
end --PLAYER_EVENT_ON_LEVEL_CHANGE = 13 -- (event, player, oldLevel)
RegisterPlayerEvent(, SKILL.AutoLearn)--玩家升级时

AutoLearnSkills.lua --升级自动学习技能的更多相关文章

  1. Bolt XML和JQBolt Lua代码自动补全插件配置教程

    Bolt没有提供官方IDE,缺少强大的代码提示和自动补全,Notepad++写起界面和脚本来比较费劲. Notepad++有个QuickText插件,支持多语言的自动补全,进行简单的配置就可以支持Bo ...

  2. java+redis+lua生成自动增长的ID序列号

    1.编写lua脚本用于生成主键ID序列号,内容如下 local key = tostring(KEYS[1]); local count = tonumber(KEYS[2]); local date ...

  3. Unity3D热更新之LuaFramework篇[07]--怎么让unity对象绑定Lua脚本

    前言 在上一篇文章 Unity3D热更新之LuaFramework篇[06]--Lua中是怎么实现脚本生命周期的 中,我分析了由LuaBehaviour来实现lua脚本生命周期的方法. 但在实际使用中 ...

  4. Lua table之弱引用

    Lua采用了基于垃圾收集的内存管理机制,因此对于程序员来说,在很多时候内存问题都将不再困扰他们.然而任何垃圾收集器都不是万能的,在有些特殊情况下,垃圾收集器是无法准确的判断是否应该将当前对象清理.这样 ...

  5. Programming in Lua读书笔记

         Lua的长处之一就是可以通过新类型和函数来扩展其功能.动态类型检查最大限度允许多态出现,并自动简化调用内存管理的接口,因为这样不需要关心谁来分配内存谁来释放内存,也不必担心数据溢出.高级函数 ...

  6. Lua与C的交互

    Lua 与 C 的交互 Lua是一个嵌入式的语言,它不仅可以是一个独立运行的程序,也可以是一个用来嵌入其它应用的程序库. C API是一个C代码与Lua进行交互的函数集,它由以下几部分构成: 1.  ...

  7. Lua弱引用table

    弱引用table 与python等脚本语言类似地,Lua也采用了自动内存管理(Garbage Collection),一个程序只需创建对象,而无需删除对象.通过使用垃圾收集机制,Lua会自动删除过期对 ...

  8. lua 环境揭秘

    什么是环境? http://www.lua.org/manual/5.1/manual.html#2.9 Besides metatables, objects of types thread, fu ...

  9. [lua]lua简介

    在这篇文章中,我想向大家介绍如何进行Lua程序设计.我假设大家都学过至少一门编程语言,比如Basic或C,特别是C.因为Lua的最大用途是在宿主程序中作为脚本使用的. Lua 的语法比较简单,学习起来 ...

随机推荐

  1. POJ 题目1141 Brackets Sequence(区间DP记录路径)

    Brackets Sequence Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 27793   Accepted: 788 ...

  2. 基本矩阵运算的Java实现

      一: 矩阵的加法与减法 规则:矩阵的加法与减法要求两个矩阵的行列完全相等,方可以完成两个矩阵的之间的运算. 举例说明如下 二:矩阵的乘法 规则:矩阵的乘法要求两个矩阵符合A(mx k),  B( ...

  3. CenOS 6.5下安装docker(转)

    2014-12-15 10:23 blessed24 To be Done的博客 字号:T | T 最近在自己的centos上搭建了一个Docker,顺便将一些常用操作记录下. AD:51CTO网+ ...

  4. vmware虚拟机网络自动断开的问题

    最近搭建一个集群环境,因此用vmware安装了几台虚拟机,系统是centos7.2. 但是发现网络总是不经意间自动断开,重启网络(service network restart)恢复. 虚拟机网络类型 ...

  5. HTML5 拖动

    触发的事件有:dragstart事件.drag事件和dragend事件. 按下鼠标键并开始移动鼠标的时候,会在被拖拽的元素上触发dragstart事件.这时候光标变成”不能放”符号(圆环中有一条反斜线 ...

  6. ERROR 1872 (HY000): Slave failed to initialize relay log info structure from the repository

    salve复制线程停止,尝试start slave 时报ERROR 1872错误mysql> system perror 1872 MySQL error code 1872 (ER_SLAVE ...

  7. JSON入门学习

    JSON是一种与开发语言无关的轻量级的数据格式(JavaScript Object Notation) 优点:易于阅读和编写,易于程序解析和生产 JSON数据格式中没有日期及时间的数据格式的.一般直接 ...

  8. 有关attribute和property,以及各自对select中option的影响

    这个问题老生常谈,但是直到现在我依旧时常会把它搞混.下面列一些各自的特性.   attribute property 设置方法 option.setAttribute('selected', true ...

  9. C++线程中packaged_tack

    packaged_tack<>函数是一个你可以先定义好任务的类型,但是不想马上启动.函数可以在你想要启动任务是启动,你只需要调用你声明的函数就可以. #include <future ...

  10. django进行model字段的自定义

    相信大家一定有web应用被攻击的经历,数据库安全是一个网站的必须课.django有很好的orm,但sql注入,或其他方式的攻击都是无法完全屏蔽的. 所以一般数据库都会对用户数据,如text类型的数据进 ...