Lua接口/服务端/LuaFnSetSceneWeather:修订间差异
来自天龙知识库
跳到导航跳到搜索
整理当前服务端 Lua 接口:注册名称、参数、返回值与调用说明 |
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例 |
||
| (未显示2个用户的4个中间版本) | |||
| 第1行: | 第1行: | ||
__NOTOC__ | __NOTOC__ | ||
<div class="lua-reference | <div class="lua-reference"> | ||
[[首页|首页]] · [[Lua接口/服务端函数索引|服务端接口]] · [[Lua接口/服务端函数索引/场景与副本|场景与副本]] · [[Lua接口/服务端调用约定|调用约定]] | [[首页|首页]] · [[Lua接口/服务端函数索引|服务端接口]] · [[Lua接口/服务端函数索引/场景与副本|场景与副本]] · [[Lua接口/服务端调用约定|调用约定]] | ||
<div | <div class="lua-lead lua-rule">设置场景天气及其剩余持续时间(毫秒)。</div> | ||
== Lua 调用 == | == Lua 调用 == | ||
<pre | <pre>LuaFnSetSceneWeather(sceneId, weather, leftTime)</pre> | ||
服务端脚本中共出现 8 处调用,实参个数出现过:3 个(8 处)。 | |||
实现位于 <code>LuaFnTbl_Scene.h</code>。 | |||
== 参数 == | == 参数 == | ||
{| class="wikitable | {| class="wikitable" | ||
! scope="col" | ! scope="col" class="lua-w11" | 序号 | ||
! scope="col" | ! scope="col" class="lua-w36" | 参数 / 类型 | ||
! scope="col | ! scope="col" | 说明 | ||
|- | |- | ||
| 1 | |||
| <code>sceneId</code><br /><span class="lua-muted"><code>number</code></span> | |||
| | | 当前调用所在的场景 ID。<br /><span class="lua-muted">脚本中的实参:<code>sceneId</code>(8 处)</span> | ||
|- | |- | ||
| 2 | |||
| <code>weather</code><br /><span class="lua-muted"><code>number</code></span> | |||
| | | 天气编号。<br /><span class="lua-muted">脚本中的实参:<code>19</code>、<code>3</code>、<code>curItem.effect</code></span> | ||
|- | |- | ||
| 3 | |||
| <code>leftTime</code><br /><span class="lua-muted"><code>number</code></span> | |||
| | | 剩余时间。<br /><span class="lua-muted">脚本中的实参:<code>15000</code>(2 处)、<code>39*60*1000</code>、<code>5*60*1000</code></span> | ||
|} | |} | ||
| 第30行: | 第34行: | ||
无返回值。赋值接收时得到 nil;这与返回数字 0 不同。 | 无返回值。赋值接收时得到 nil;这与返回数字 0 不同。 | ||
< | == 脚本中的调用 == | ||
以下是服务端脚本里的真实调用点,按实参形态去重后列出 8 条。这些调用取自随包发布的脚本,可用于确认参数顺序与实际传入的值;它们不代表该写法在当前版本仍然有效。 | |||
<pre>-- event/huodong/eShengShou_Contest.lua | |||
LuaFnSetSceneWeather(sceneId, 3, 5*60*1000) | |||
-- event/piaomiaofeng/ai_liqiushui.lua | |||
LuaFnSetSceneWeather(sceneId, x402269_SkillB_WeatherTbl[JianWuType], 15000) | |||
-- event/piaomiaofengsmall/ai_liqiushui_small.lua | |||
LuaFnSetSceneWeather(sceneId, x402282_SkillB_WeatherTbl[JianWuType], 15000) | |||
-- event/weather/changeweather.lua | |||
LuaFnSetSceneWeather(sceneId, x820001_WeatherEffect[1], x820001_WeatherTime[1]* 1000) | |||
-- event/weather/changeweather.lua | |||
LuaFnSetSceneWeather(sceneId, x820001_WeatherEffect[2], x820001_WeatherTime[2] * 1000) | |||
-- event/weather/changeweather.lua | |||
LuaFnSetSceneWeather(sceneId, x820001_WeatherEffect[3], x820001_WeatherTime[3] * 1000) | |||
-- event/xinshengshoushan/entercopyScene.lua | |||
LuaFnSetSceneWeather(sceneId, 19, 39*60*1000) | |||
-- obj/commonitem/weather.lua | |||
LuaFnSetSceneWeather(sceneId, curItem.effect, curItem.time * 1000)</pre> | |||
</div> | </div> | ||
2026年9月20日 (日) 00:12的最新版本
设置场景天气及其剩余持续时间(毫秒)。
Lua 调用
LuaFnSetSceneWeather(sceneId, weather, leftTime)
服务端脚本中共出现 8 处调用,实参个数出现过:3 个(8 处)。
实现位于 LuaFnTbl_Scene.h。
参数
| 序号 | 参数 / 类型 | 说明 |
|---|---|---|
| 1 | sceneIdnumber
|
当前调用所在的场景 ID。 脚本中的实参: sceneId(8 处)
|
| 2 | weathernumber
|
天气编号。 脚本中的实参: 19、3、curItem.effect
|
| 3 | leftTimenumber
|
剩余时间。 脚本中的实参: 15000(2 处)、39*60*1000、5*60*1000
|
返回值
无返回值。赋值接收时得到 nil;这与返回数字 0 不同。
脚本中的调用
以下是服务端脚本里的真实调用点,按实参形态去重后列出 8 条。这些调用取自随包发布的脚本,可用于确认参数顺序与实际传入的值;它们不代表该写法在当前版本仍然有效。
-- event/huodong/eShengShou_Contest.lua LuaFnSetSceneWeather(sceneId, 3, 5*60*1000) -- event/piaomiaofeng/ai_liqiushui.lua LuaFnSetSceneWeather(sceneId, x402269_SkillB_WeatherTbl[JianWuType], 15000) -- event/piaomiaofengsmall/ai_liqiushui_small.lua LuaFnSetSceneWeather(sceneId, x402282_SkillB_WeatherTbl[JianWuType], 15000) -- event/weather/changeweather.lua LuaFnSetSceneWeather(sceneId, x820001_WeatherEffect[1], x820001_WeatherTime[1]* 1000) -- event/weather/changeweather.lua LuaFnSetSceneWeather(sceneId, x820001_WeatherEffect[2], x820001_WeatherTime[2] * 1000) -- event/weather/changeweather.lua LuaFnSetSceneWeather(sceneId, x820001_WeatherEffect[3], x820001_WeatherTime[3] * 1000) -- event/xinshengshoushan/entercopyScene.lua LuaFnSetSceneWeather(sceneId, 19, 39*60*1000) -- obj/commonitem/weather.lua LuaFnSetSceneWeather(sceneId, curItem.effect, curItem.time * 1000)