[Tutorial] How to create Custom Monster AI

10/28/2017 14:19 killer2p#31
Quote:
Mob:LuaSay( 'test ' .. bCharName .. ', are you afraid to die?', 20.0 )'
change the english to russian
10/28/2017 16:44 mr.hellraven#32
hieroglyphs show symbolic when you use Russian
10/28/2017 17:38 Velocity.#33
Quote:
Originally Posted by mr.hellraven View Post
hieroglyphs show symbolic when you use Russian
if it won't show up in game then i dont believe you can do it without modifying the game to allow russian characters, but then again i have never tried.
10/28/2017 18:49 ukrainec705#34
Quote:
Originally Posted by mr.hellraven View Post
bCharID = Mob:LuaGetMinAggro()
bCharName = Mob:LuaGetName( bCharID )
Mob:LuaSay( 'test ' .. bCharName .. ', are you afraid to die?', 20.0 )'

how to make them speak Russian ?!
Используй ID строки из файла sysmsg-uni.txt вместо прямого текста.

Use ID string in sysmsg-uni.txt.
11/11/2019 10:19 LibPor22#35
Is there any solution to detect the character class using lua ?:thinking:
04/21/2020 01:09 DarKTaloco#36
hello, i have a question and i can't solve it, i want the boss to generate a wav file when i have 50% hp someone could help me please
04/27/2020 16:56 LibPor22#37
Quote:
Originally Posted by DarKTaloco View Post
hello, i have a question and i can't solve it, i want the boss to generate a wav file when i have 50% hp someone could help me please
If by "generate" you mean to play a certain file, it's simple:

Code:
function WhileCombat(dwTime, dwHPPercent, dwAttackedCount )
        if ( dwHPPercent == 50 ) then
        Mob:LuaSayByVoice('YOUR_FILE_NAME.wav', 1000)
        end
end
I don't know yet what values you have on your server but in case the hp jumps from 51 to 49 then the mob won't play it so you will need a statement that will play the file when the mob has the hp lower than 50% just one time:

EX:

Code:
local SwM1 = 0 -- add this at the beginning of your lua file
Code:
    -- 50
    if ( dwHPPercent <= 50) then
    if ( SwM1 == 0) then
        Mob:LuaSayByVoice('YOUR_FILE_NAME.wav', 1000)
        SwM1 = 1
    end
    end
If you followed nubness guide, then you will be good to go, this guy has a talent when it comes to explaining stuff.
04/28/2020 01:03 sominus#38
And if it still doesn't play, try make the sound the same format shaiya client has:
22050Hz mono 16 bits
10/25/2022 01:59 IamOdin#39
Can someone explain to me that mobs are not removed??


-- //////////////////////////////////////////////////////////////////////
-- 카일룸 사크라 보스 2차_분신 소환되기전 몬스터_ID-2470 AI 117.Lua ver.090113
-- //////////////////////////////////////////////////////////////////////



-- //////////////////////////////////////////////////////////////////////

Mob = LuaMob(CMob)

-- //////////////////////////////////////////////////////////////////
-- 사용자 변수는 여기에 선언합니다.

dwNextCreateTime = 0
bMobSay = 0
bMobCreate = 0

-- //////////////////////////////////////////////////////////////////
-- 사용자 함수는 여기에 선언합니다.



-- //////////////////////////////////////////////////////////////////
function Init()

end

-- //////////////////////////////////////////////////////////////////
function OnAttacked( dwTime, dwCharID )

end

-- //////////////////////////////////////////////////////////////////
function OnAttackable( dwTime, dwCharID )

end

-- //////////////////////////////////////////////////////////////////
function OnNormalReset( dwTime )

end

-- //////////////////////////////////////////////////////////////////
function OnDeath( dwTime, dwAttackedCount )
Mob:LuaDeleteMob ( 1968, 5, 0.0, 0.0)
end

-- //////////////////////////////////////////////////////////////////
function OnReturnHome( dwTime, dwAttackedCount )

end

-- //////////////////////////////////////////////////////////////////
function OnMoveEnd( dwTime )

end

-- //////////////////////////////////////////////////////////////////
function WhileCombat( dwTime, dwHPPercent, dwAttackedCount )

-- 체력이 50% 가 될때 메세지를 출력 후 1초뒤 몬스터 소환
if ( dwHPPercent <= 90 ) then
if ( bMobSay == 0 ) then
-- 몬스터 생성시간은 메세지 출력 1초 후
dwNextCreateTime = dwTime + 1000
-- 메세지 출력
Mob:LuaSayByIndex ( 12000, 500.0 )
bMobSay = bMobSay + 1
end
if ( dwTime >= dwNextCreateTime ) and ( bMobCreate == 0 ) then
-- 몬스터 생성 2마리 소환
Mob:LuaCreateMob ( 1968, 1, 0.0, 0.0 )
Mob:LuaCreateMob ( 1968, 4, 0.0, 0.0 )

bMobCreate = bMobCreate + 1
end
if ( bMobCreate >= 1 ) then
Mob:LuaDeleteMob ( 1968, 5, 0.0, 0.0)
end
end
end
10/26/2022 18:36 Kavin14#40
I got complete .lua files from OS with AI for dimension crack bosses,

the point is you nd to take deep thinking of how to create a new custom one

, I believe no one is gonna share this for you.
05/24/2023 21:54 MorningstarV#41
Quote:
Originally Posted by Banhammer881 View Post
- i want to add boxes that spawn when kimu at 75% hp.
- kimu AI was 3 in db, changed it to 110.
- named my lua in PSM_Client\Bin\Data\Lua to 110.lua
- restarted server, updated monster.sdata, unicodetxt...
Nothing happens when killing kimu.

Code:
-- //////////////////////////////////////////////////////////////////////
-- Д«АП·л »зЕ©¶у єёЅє 2Вч_єРЅЕ јТИЇµЗ±вАь ёуЅєЕН_ID-835 AI 110.Lua  ver.090113
-- //////////////////////////////////////////////////////////////////////



-- //////////////////////////////////////////////////////////////////////

Mob = LuaMob(CMob)

-- //////////////////////////////////////////////////////////////////
-- 사용자 변수는 여기에 선언합니다.


-- //////////////////////////////////////////////////////////////////
-- 사용자 함수는 여기에 선언합니다.

dwNextCreateTime = 0
bMobSay	= 0
bMobCreate = 0

function Init()
end

function OnAttacked( dwTime, dwCharID )
end

function OnAttackable( dwTime, dwCharID )
end

function OnNormalReset( dwTime )
end

function OnDeath( dwTime, dwAttackedCount )
end

function OnReturnHome( dwTime, dwAttackedCount )
end

function OnMoveEnd( dwTime )
end

function WhileCombat( dwTime, dwHPPercent, dwAttackedCount )
end

if ( dwHPPercent <= 75 ) then
if ( bMobSay < 2) then
        Mob:LuaSayByIndex ( 11006, 200.0 )
        bMobSay = bMobSay + 1
end
        Mob:LuaCreateMob ( 2385, 10, 0.0, 0.0 )
end
add me in discord Morningstar#0836