1. 当前位置:网站首页 > 游戏娱乐 > 手机游戏

《传奇世界》手游修改教程之道士BB召唤【转载】

道士控制自己技能召唤的宝宝,服务端/data/sbin/resource/script/system/skill


打开SkillScript.lua


--新的道士宝宝召唤机制
SkillScript.newCallPet = function(host, monsterID, skillCfg)
print("SkillScript.newCallPet "..skillCfg.skillID.." "..monsterID)
--如果有宝宝,先删掉
local oldPetID = host:getPetID()
--创建添加宝宝
local scene = host:getScene()
local monster = g_entityFct:createMonster(monsterID)
if monster and scene then
--设置宝宝增加的属性
--每点道术上限对宝宝的加成
local eHp = skillCfg.EHP or 0    --生命
local eMinAtk = skillCfg.EMinAtk or 0--攻击下限
local eMaxAtk = skillCfg.EMaxAtk or 0--攻击上限
local eMinDef = skillCfg.EMinDef or 0--防御下限
local eMaxDef = skillCfg.EMaxDef or 0--防御上限
local eMinMDef = skillCfg.EMinMDef or 0--魔防下限
local eMaxMDef = skillCfg.EMaxMDef or 0--魔防上限
--print('SkillScript.newCallPet',skillCfg.skillID,monsterID,eHp,eMinAtk,eMaxAtk,eMinDef,eMaxDef,eMinMDef,eMaxMDef)
--玩家道术上限
local dtMax = host:getMaxDT()
--增加的属性值
local addHp = dtMax*eHp    --生命
local addMinAtk = dtMax*eMinAtk--攻击下限
local addMaxAtk = dtMax*eMaxAtk--攻击上限
local addMinDef = dtMax*eMinDef--防御下限
local addMaxDef = dtMax*eMaxDef--防御上限
local addMinMDef = dtMax*eMinMDef--魔防下限
local addMaxMDef = dtMax*eMaxMDef--魔防上限
monster:setMaxHP(monster:getMaxHP() + addHp)
monster:setMinAT(monster:getMinAT() + addMinAtk)
monster:setMaxAT(monster:getMaxAT() + addMaxAtk)
monster:setMinDF(monster:getMinDF() + addMinDef)
monster:setMaxDF(monster:getMaxDF() + addMaxDef)
monster:setMinMF(monster:getMinMF() + addMinMDef)
monster:setMaxMF(monster:getMaxMF() + addMaxMDef)
--monster:setMoveSpeed(120)
monster:setCampID(host:getCampID())
monster:setHP(monster:getMaxHP())
monster:setHost(host:getID())
local pos = host:getPosition()
host:setPetID(monster:getID())
name = monster:getName()
monster:setName(host:getName()..'的'..name)
scene:attachEntity(monster:getID(), pos.x + 1, pos.y + 1)
--元神与骷髅不冲突的逻辑  add by 9851320
if oldPetID > 0 then
local oldPet = g_entityMgr:getMonster(oldPetID)
if oldPet then
if oldPet:getName() == name then
g_entityMgr:destoryEntity(oldPetID)
end
end
end
else
print("cannot create monster or get scene")
end
end


本文由网上采集发布,不代表我们立场,转载联系作者并注明出处:https://47.101.32.47/wenku/txtlist_i130v.html

联系我们

在线咨询:点击这里给我发消息

微信号:76891828

工作日:9:30-18:30,节假日休息