Register for your free account! | Forgot your password?

You last visited: Today at 17:31

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[HELP] Custom AI

Discussion on [HELP] Custom AI within the Shaiya PServer Development forum part of the Shaiya Private Server category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Oct 2018
Posts: 4
Received Thanks: 2
[HELP] Custom AI

Hello everyone, i've started working on some custom lua files, i've followed Nubness Guide released here on epvp and i've tried to make a boss talk, use a skill and spawn some mobs on certain HP % but it doesn't work, i doesn't do anything and yes, i'm sure i add the AI to the monster in both Database and Client, i've tried with both MobSay and MobSayByIndex and yes i edited the sys-uni file or whatever it is called.

This is the script i'm talking about

-- //////////////////////////////////////////////////////////////////////
-- 카일룸 사크라 보스 1차 보스 몬스터_ID-5499 AI 120.Lua ver.090513
-- //////////////////////////////////////////////////////////////////////



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

Mob = LuaMob(CMob)

-- //////////////////////////////////////////////////////////////////
-- 사용자 변수는 여기에 선언합니다.
dwNextCreateTime = 0
bMobSay = 0
bMobCreate = 0
bMobAttack=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 )
if ( dwHPPercent <= 75 ) then
if ( bMobSay < 1) then
Mob:LuaSayByIndex ( 10127, 200.0 )
bMobSay = bMobSay + 1
end
if (bMobAttack <1) then
Mob:LuaAttackAI ( 336 )
bMobAttack=bMobAttack + 1
end
end
if ( dwHPPercent <= 70 ) then
if ( bMobSay < 2) then
Mob:LuaSayByIndex ( 10128, 200.0 )
bMobSay = bMobSay + 1
end
if (bMobAttack <2) then
Mob:LuaAttackAI ( 133 )
bMobAttack=bMobAttack + 1
end
end
if ( dwHPPercent <= 50 ) then
if ( bMobSay < 3) then
Mob:LuaSayByIndex ( 10129, 200.0 )
bMobSay = bMobSay + 1
end
if (bMobAttack <3) then
Mob:LuaAttackAI ( 336 )
bMobAttack=bMobAttack + 1
end
end
if ( dwHPPercent <= 45 ) then
if ( bMobSay < 4) then
Mob:LuaSayByIndex ( 10130, 200.0 )
bMobSay = bMobSay + 1
end
if (bMobAttack <4) then
Mob:LuaAttackAI ( 133 )
bMobAttack=bMobAttack + 1
end
end
if ( dwHPPercent <= 25 ) then
if ( bMobSay < 5) then
Mob:LuaSayByIndex ( 10131, 200.0 )
bMobSay = bMobSay + 1
end
Mob:LuaCreateMob ( 3072, 1, 0.0, 0.0 )
Mob:LuaCreateMob ( 3073, 1, 0.0, 0.0 )
end

end

Hope someone is able to give me some hits about how to solve this annyoing issue because i'm kinda stuck
AdamJansen is offline  
Thanks
1 User
Old 10/29/2018, 01:56   #2
 
elite*gold: 0
Join Date: Aug 2015
Posts: 11
Received Thanks: 1
test changing Mob:LuaSayByIndex for Mob:LuaSay ( ' some phrase', 60.0 )
sinon95 is offline  
Old 10/29/2018, 22:06   #3
 
elite*gold: 0
Join Date: Oct 2018
Posts: 4
Received Thanks: 2
okay, i found the error on that file, it was cause of some extra not needed END. Now i'm experiencing a different issue with another file. This is the error i'm getting into the logs:

.\Data\Lua\140.lua:61: ')' expected near '='

and this is the interested code line:

if ( dwHPPercent = 75 ) then
AdamJansen is offline  
Old 10/31/2018, 02:17   #4
 
Fordmondeo20's Avatar
 
elite*gold: 0
Join Date: Jan 2013
Posts: 72
Received Thanks: 26
LUA don't like any spaces in some situations (or in all situations?).
Type if(dwHPPercent=75) and tell us if it works.
Fordmondeo20 is offline  
Reply


Similar Threads Similar Threads
[CUSTOM SALE] PokeMMO! Custom Bots, Exp Leveling Bot, Shiny Catcher! [CUSTOM SALE]
04/08/2014 - Trading - 90 Replies
Update: 2013-05-20 BOT IS NOW FULLY AIO SUPPORTS ALL LOCATIONS IN POKEMMO!! Auto-leveling bot: Supports PP healing Supports Death pokemon healing Supports death pokemon switching Supports walking to healing Fully flawless & catches shinies!!!
[BETA]Beta-Max Online ~ 120 CAP ~ D13 ~ Custom Events ~ Custom Quests ~ Custom Areas
03/25/2012 - SRO PServer Advertising - 109 Replies
Hello there, I would like to announce the BETA opening of Astro Server, We are here for the community not for competition. We don't care if we are #1 or #1001. The BETA will last one week, to find any small bugs that may still exist. During this time users will receive 5000 Wonga as soon as you register this is part of the BETA test. Also users will be rewarded for helping when we go live, Which you can find more information on this at the forum. Please be aware after the BETA ends...
Beta-Max Online ~ 120 CAP ~ D13 ~ Custom Events ~ Custom Quests ~ Custom Areas
03/19/2012 - SRO PServer Advertising - 6 Replies
Fantastic Server. If reliablility is what you want then Beta-Max is for you. Unique PVP Battles - Pets - Items - Quests - Jobs - Wonga and so much more Server Details: Level Cap: 120 Skill Cap: 120 Chinese Mastery Cap: 360 European Mastery Cap: 240 Item Degree: 13th Degree Active Areas: All (Including Jupiter)



All times are GMT +1. The time now is 17:32.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.