|
You last visited: Today at 19:05
Advertisement
[QUESTION] Lua Differences
Discussion on [QUESTION] Lua Differences within the Shaiya PServer Development forum part of the Shaiya Private Server category.
05/23/2017, 21:54
|
#1
|
elite*gold: 0
Join Date: Mar 2011
Posts: 28
Received Thanks: 24
|
[QUESTION] Lua Differences
I've been messing around with a lua files a little bit and I've noticed that some server files have an alternative version(2011 edited, instead of 2009) of 116 and 117.
116 (2009)
Code:
-- //////////////////////////////////////////////////////////////////////
-- Caelum Sacra 2nd Boss_Alter Ego Mechanisms Before Summoning Monsters_ID-2470 AI 117.Lua ver.090113
-- //////////////////////////////////////////////////////////////////////
-- //////////////////////////////////////////////////////////////////////
Mob = LuaMob(CMob)
-- //////////////////////////////////////////////////////////////////
-- User variables are declared here.
dwNextCreateTime = 0
bMobSay = 0
bMobCreate = 0
-- //////////////////////////////////////////////////////////////////
-- User functions are declared here.
-- //////////////////////////////////////////////////////////////////
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 )
-- When the HP reaches 50%, send a message and summon a monster 1 second later
if ( dwHPPercent <= 50 ) then
if ( bMobSay == 0 ) then
-- Monster generation time is 1 sec after message output
dwNextCreateTime = dwTime + 1000
-- Message output
Mob:LuaSayByIndex ( 6403, 200.0 )
bMobSay = bMobSay + 1
end
if ( dwTime >= dwNextCreateTime ) and ( bMobCreate == 0 ) then
-- Summons 2 monsters
Mob:LuaCreateMob ( 2472, 1, 0.0, 0.0 )
Mob:LuaCreateMob ( 2473, 2, 0.0, 0.0 )
bMobCreate = bMobCreate + 1
end
if ( bMobCreate >= 1 ) then
Mob:LuaDeleteMob ( 2470, 1, 0.0, 0.0)
end
end
end
117 (2009)
Code:
-- //////////////////////////////////////////////////////////////////////
-- Caelum Sacra 2nd Boss_Alter Ego Summoned After Real Boss Monster_ID-2472 AI 118.Lua ver.090113
-- //////////////////////////////////////////////////////////////////////
-- //////////////////////////////////////////////////////////////////////
Mob = LuaMob(CMob)
-- //////////////////////////////////////////////////////////////////
-- User variables are declared here.
dwNextAttackTime = 0
bMobSay = 0
-- //////////////////////////////////////////////////////////////////
-- User functions are declared here.
-- //////////////////////////////////////////////////////////////////
function Init()
end
-- //////////////////////////////////////////////////////////////////
function OnAttacked( dwTime, dwCharID )
end
-- //////////////////////////////////////////////////////////////////
function OnAttackable( dwTime, dwCharID )
end
-- //////////////////////////////////////////////////////////////////
function OnNormalReset( dwTime )
dwNextAttackTime = 0
bMobSay = 0
end
-- //////////////////////////////////////////////////////////////////
function OnDeath( dwTime, dwAttackedCount )
Mob:LuaDeleteMob ( 2473, 2, 0.0, 0.0)
end
-- //////////////////////////////////////////////////////////////////
function OnReturnHome( dwTime, dwAttackedCount )
end
-- //////////////////////////////////////////////////////////////////
function OnMoveEnd( dwTime )
end
-- //////////////////////////////////////////////////////////////////
function WhileCombat( dwTime, dwHPPercent, dwAttackedCount )
if ( dwHPPercent <= 30 ) then
if ( bMobSay == 0 ) then
Mob:LuaSayByIndex ( 6404, 200.0 )
bMobSay = bMobSay + 1
dwNextAttackTime = dwTime + 3000
end
if( dwNextAttackTime <= dwTime ) then
Mob:LuaAttackAI ( 337 )
dwNextAttackTime = dwTime + 3000
end
end
end
Now on the 2011 edited version of these lua files you can see that the difference is in this little bit of code
116 (2011)
Code:
if ( dwTime >= dwNextCreateTime ) and ( bMobCreate == 0 ) then
-- Summons 2 monsters
dwMobUID1 = Mob:LuaCreateMob ( 2472, 1, 0.0, 0.0 )
-- Temporary Prescription(Mob Unique ID And if there is no unique ID, try again.)
if ( dwMobUID1 == 0 ) then
dwMobUID2 = Mob:LuaCreateMob ( 2472, 1, 0.0, 0.0 )
if ( dwMobUID2 == 0 ) then
Mob:LuaCreateMob ( 2472, 1, 0.0, 0.0 )
end
end
Mob:LuaCreateMob ( 2473, 2, 0.0, 0.0 )
bMobCreate = bMobCreate + 1
end
if ( bMobCreate >= 1 ) then
Mob:LuaDeleteMob ( 2470, 0, 0.0, 0.0, 500.0)
end
117 (2011)
Code:
function OnDeath( dwTime, dwAttackedCount )
Mob:LuaDeleteMob ( 2473, 0, 0.0, 0.0, 500.0)
end
I'm guessing the purpose of the added if statement for the modified 116 version is for error checking, so I brushed that off. However, I can't seem to find out why they changed the values passed into the LuaDeleteMob from:
Code:
Mob:LuaDeleteMob ( 2470, 1, 0.0, 0.0)
to
Code:
Mob:LuaDeleteMob ( 2470, 0, 0.0, 0.0, 500.0)
I checked Nubness' Lua post but it doesn't give any insight into what parameter it accepts. However, it seems like it was changed in other versions of the ps_game.exe? Does the last parameter in the new code represent a radius? Wondering if anyone has any input in this.
|
|
|
Similar Threads
|
SV differences
03/03/2007 - Conquer Online 2 - 1 Replies
Hi... some script vessel files are called scriptvessel.exe and some are called agentking.exe .. I cannot decide which version is which. I do know that changing the filename is easy but what I wanted to know is that are these 2 seperate programs ?
Thanks
<hr>Append on Mar 3 2007, 13:17<hr> Well ?
|
Level Differences?
01/04/2007 - Conquer Online 2 - 13 Replies
yo got a question, does it take longer to lvl 1-125 or 1-120-rb-100?
and what if it's being plvled?
|
All times are GMT +1. The time now is 19:05.
|
|