GithubHelp home page GithubHelp logo

zhangshangxin / mhwluascript Goto Github PK

View Code? Open in Web Editor NEW

This project forked from halcyonalcedo/mhwluascript

0.0 0.0 0.0 3 MB

使用lua制作MHWmod的dll模板

License: GNU General Public License v2.0

C++ 74.65% C 25.04% Lua 0.15% Assembly 0.15%

mhwluascript's Introduction

MHWLua脚本载入Mod

可用于载入Lua脚本来控制游戏行为,初始化完成后将加载Monster Hunter World\nativePC\LuaScript中的全部lua文件并运行其中的run函数。

示例

示例脚本为榴弹袭击脚本,可在使用动作决胜姿势2时对目视方向释放最少8发榴弹袭击

function run ()
	local x,y,z = Game_Player_GetPlayerCollimatorCoordinate()
	local wpType = Game_Player_Weapon_GetWeaponType()
	local wpId = Game_Player_Weapon_GetWeaponId()
	if Game_Player_GetPlayerActionId() == 12390
	then
		System_Chronoscope_AddChronoscope(1,'PreLaunchAction')
	end
	if System_Chronoscope_CheckChronoscope('PreLaunchAction')
	then
		Game_Player_Weapon_ChangeWeapons(12,30)
		Game_Player_RunFsmAction(3,11)
		System_Chronoscope_AddChronoscope(0.05,'LaunchAction')
	end
	if System_Chronoscope_CheckChronoscope('LaunchAction')
	then
		local monsterList = Game_Monster_GetAllMonsterCoordinatesInTargetPointRange(x,y,z,0,8000)
		if #monsterList < 8 then
			for i=0,8 - #monsterList,1 do
				Game_Player_CreateWeaponProjectiles(
					13,
					x,y+1500,z,
					x + Lua_Math_Rander(-500,500) ,y + Lua_Math_Rander(0,500) ,z + Lua_Math_Rander(-500,500)
				)
			end
		end
		for _, monster in pairs(monsterList) do
			Game_Player_CreateWeaponProjectiles(
				13,
				x,y+1500,z,
				monster.X + Lua_Math_Rander(-150,150) ,monster.Y + Lua_Math_Rander(-150,150) ,monster.Z + Lua_Math_Rander(-150,150)
			)
		end
		Game_Player_Weapon_ChangeWeapons(wpType,wpId)
		Game_Player_RunFsmAction(1,6)
	end
end

API说明

LuaApi调用请参考https://docs.alcedogroup.com/

mhwluascript's People

Contributors

halcyonalcedo avatar ooomu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.