石器时代LA官方

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 8406|回复: 2

[Ab Lua] 仿某服经验收集丹

[复制链接]

1万

主题

491

回帖

3万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
35504
石币
24669
发表于 2013-7-16 22:54:44 | 显示全部楼层 |阅读模式
这个LUA原本的功能是 人物满级以后 挂机可以收集经验
由于我手上的端 没有相应的接口 所以不能接收满级后怪物给予的经验值


itemExp.lua --道具LUA


function Exp(itemindex, charaindex, toindex, haveitemindex)
local itemExp=other.atoi(item.getChar(itemindex,"字段"))
char.setInt(toindex,"当前经验",char.getInt(toindex,"当前经验")+itemExp)
char.DelItem(charaindex, haveitemindex)
end

function main()
item.addLUAListFunction( "ITEM_Exp", "Exp", "")
end



battlefinishfunction.lua --战斗结束LUA

function BattleFinishFunction( charaindex, battletime, battleturn, battletype )

local itemindex=checkItem(charaindex,30733)
if itemindex>-1 then
local getExp=char.getWorkInt(charaindex,"获得经验")

local serverExp=2
local playExp=char.getWorkInt(charaindex, "经验加成")/100
if playExp==0 then
playExp=1
end
local itemExp=other.atoi(item.getChar(itemindex,"字段"))
if itemExp<100000000 then
getExp=getExp*serverExp*playExp
itemExp=itemExp+getExp
if itemExp>100000000 then
itemExp=100000000
end
item.setChar(itemindex,"字段",itemExp)
item.setChar(itemindex,"说明","当前储存经验为:"..itemExp)
item.UpdataItemOne(charaindex, itemindex)
end
end

end

function checkItem(charaindex,itemid)
for i=9,23 do
local itemindex=char.getItemIndex(charaindex,i)

if itemindex>-1 then
if item.getInt(itemindex,0)== itemid then
return itemindex
end
end
end
return -1
end
回复

使用道具 举报

0

主题

4

回帖

8

积分

新手上路

Rank: 1

积分
8
石币
4
发表于 2014-3-17 00:28:44 | 显示全部楼层
好东西支持支持
回复 支持 反对

使用道具 举报

7

主题

18

回帖

25

积分

新手上路

Rank: 1

积分
25
石币
0
发表于 2024-2-12 20:21:00 | 显示全部楼层
研究下,如果能用应该就能实现共享经验了。。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|石器时代LA官方

GMT+8, 2024-4-28 17:39 , Processed in 0.119755 second(s), 25 queries .

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表