魔力宝贝

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz

[GA] NewbieBless.lua--天使庇护

[复制链接]
发表于 前天 02:18 | 显示全部楼层 |阅读模式
Delegate.RegDelBattleOverEvent("NewbieBless_BattleOver");

--战斗结束全局事件
function NewbieBless_BattleOver(_battle)

        for i=0,9 do
                local player = Battle.GetPlayer(_battle,i);
                if(player>-1 and Char.GetData(player,%对象_等级%)<=20 and Char.GetData(player,%对象_血%)<Char.GetData(player,%对象_最大血%))then
                        Char.SetData(player,%对象_血%,Char.GetData(player,%对象_最大血%));
                        --Char.SetData(player,%对象_魔%,Char.GetData(player,%对象_最大魔%));
                        NLG.UpChar(player);
                        NLG.SystemMessage(player,"[天使庇护]"..Char.GetData(player,%对象_名字%).."受到了天使的祝福,生命值恢复全满.");
                end
                if(player>-1 and Char.GetData(player,%对象_战死%)==0 and Char.GetData(player,%对象_获得经验%)>1 and Battle.GetGainMode(_battle)==%战奖_普通% and Battle.GetType(_battle)==%战斗_普通%)then
                        local battlePrize = math.random(1,100);
                        if(battlePrize >=80 and battlePrize<=82 )then
                                --Char.SetData(player,%对象_获得经验%,Char.GetData(player,%对象_获得经验%)*103/100);
                                --NLG.UpChar(player);
                                --NLG.SystemMessage(player,"[战神庇护]"..Char.GetData(player,%对象_名字%).."受到了战神的祝福,本场战斗经验值增加3%.");
                        elseif(battlePrize >=97 and battlePrize<=99 )then
                                --Char.SetData(player,%对象_获得经验%,Char.GetData(player,%对象_获得经验%)*106/100);
                                --NLG.UpChar(player);
                                --NLG.SystemMessage(player,"[战神庇护]"..Char.GetData(player,%对象_名字%).."受到了战神的祝福,本场战斗经验值增加6%.");
                        elseif(battlePrize >=1 and battlePrize<=2 )then
                                local battlePrizeGold = math.random(50,500);
                                --Char.AddGold(player,battlePrizeGold);
                                --NLG.SystemMessage(player,"[财神庇护]"..Char.GetData(player,%对象_名字%).."受到了财神的祝福,战斗获得"..battlePrizeGold.."金钱奖励.");
                        elseif(battlePrize >=9 and battlePrize<=12 )then
                                --Char.SetData(player,%对象_获得经验%,Char.GetData(player,%对象_获得经验%)*97/100);
                                --NLG.UpChar(player);
                                --NLG.SystemMessage(player,"[衰神庇护]"..Char.GetData(player,%对象_名字%).."受到了衰神的诅咒,本场战斗所得经验降低3%.");
                        end
                end
        end

        return 1;
end


回复

使用道具 举报

Archiver|魔力研究社

GMT+8, 2025-5-12 18:26 , Processed in 0.105143 second(s), 23 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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