Lua Scripting
General Discussion of Lua Scripting Language and possible modifications to the server scripts
Lua Scripting Forums content is excluded from support scope. It is only monitored against potentially harmful materials. Script modifications from this forum are prepared by Customers who liked to share their work. No warranty of proper functionality is guaranteed, nor official support provided to the issues caused by the modifications. Use at own risk.
32 topics in this forum
-
-
- 1 reply
- 565 views
Hello, Many of you wonders how to bite new Lua Scripts that we introduced in 8.0.4.5 version of IGC.Server Suite. Lets's introduce the Lua then.. What is Lua? How to Bite it? For less experienced users good start is to use LuaEdit editor which has ability to check for valid syntax of Lua code what is good advantage in avoiding potential issues coming from code modifications Next step is having a read about Lua - at least basic - guides for lua programming, at start we would recommend FOR and IF functions and getting used to available operators. LuaEdit - DownloadLua Programming Guide - pdf format - Download Have fun!
Last reply by linuxlinux, -
-
-
- 4 followers
- 5 replies
- 257 views
============================================================ -- // == INTERNATIONAL GAMING CENTER NETWORK -- // == www.igcn.mu -- // == (C) 2020-2023 IGC-Network (R) -- // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- // == File is a part of IGCN Group MuOnline Server files. -- // ============================================================ -- MasterSkillCalc Control Script, Lua v5.2 -- Regular and Master Experience formulas, - Can be modified to adjust for own needs -- Regular Exp Table formula - used to calculate exp required for next regular level function SetExpTable_Normal(Level) local Exp = 10 * Level * Level * (Level + 9); if (Level > …
Last reply by zander1989, -
-
-
- 1 reply
- 132 views
I agree to forum rules and posting guidance: Hi, Tried to find somewhere but, it's not available or I didn't find it. I would like to ask the documentation of the functions based in .lua and the definitions to get my scripts working. Something like that, or anything that can help me to work on: UserGetConnected (aIndex) -> Tells the state the user is in (Offline, Login, Online) UserSetConnected (aIndex, State) -> Will change the user's state UserGetType (aIndex) -> Returns number 1 = User 2 = Monster 3 = NPC UserSetType (aIndex, Type) -> Change the type UserGetLive (aIndex) -> Tells if the user is normal UserSetLive (aIndex, State) -> Change t…
Last reply by Wizzy, -
-
-
- 3 replies
- 139 views
I agree to forum rules and posting guidance: Dear IGC community, Does "ElfAttack" bonus work on elf's summoned monster? The LUA has conditions for each class but the summned monster does not have a class. Or am I wrong, and the summoned monster has a class? Here is the code from RegularSkillCalc.lua: -- SkillID: 28, Greater Damage - (Fairy Elf, Muse Elf, High Elf) function ElfAttack(Class, Index, TargetIndex, Energy) local SkillEffect = 0 local SkillTime = 60 if (Index ~= TargetIndex) then if (Class == CLASS_WIZARD) then SkillEffect = 3 + Energy / 7 elseif (Class == CLASS_KNIGHT) then SkillEffect = 3 + Energy / 7 elseif (Class == CLASS_ELF) then …
Last reply by Wizzy, -
-
- 1 follower
- 1 reply
- 204 views
I agree to forum rules and posting guidance: Hi there, i was looking in this script, managed to add custom itembags, but cant find anything about coin type, as my knowledge of lua = to 0, i wonder if its even possible to add a option/script to add custom coin type, i mean 0 = Wcoin, 1 = Goblin Point, 2 = MyCustom Coin. thanks
Last reply by MrJunior, -
-
- 8 replies
- 227 views
I agree to forum rules and posting guidance: Need to modify drop config for empty socket. If in config files ItemBag SocketCount="5" - need to drop 100% 5 empty socket and if SocketCount="4" - need to drop random quantity socket max 4
Last reply by Murphiks, -
-
-
- 1 follower
- 5 replies
- 182 views
Ca sommeone to help edit summoner dmg ? Its to high . -- SkillID: 218, Berserker - (Summoner, Bloody Summoner, Dimension Master) function SummonerBerserker(Energy) local SkillEffectUP = Energy / 30 local SkillEffectDOWN = Energy / 60 local SkillTime = Energy / 20 + 30 return SkillEffectUP, SkillEffectDOWN, SkillTime end -- SkillID: 218, BuffID: 81, 150, 151, 152 - (Summoner, Bloody Summoner, Dimension Master) function SummonerBerserkerAttackDamage(Strength, Dexterity) local AttackMin = (Strength+Dexterity) / 9 local AttackMax = (Strength+Dexterity) / 4 return AttackMin, AttackMax end -- SkillID: 218, Berserker - Magic Damage - (Summoner, Bloody Summoner, Di…
Last reply by fasolita87, -
-
- 2 replies
- 147 views
I agree to forum rules and posting guidance: How to reload or run (if required) Lua scripts? Should I save the file and restart gameserver (is there any reload option to not shutdown the gameserver?) or should I run a query in the SQL? Thanks.
Last reply by Arkaniz, -
LUA Scripts
by Elif- 3 replies
- 185 views
Hello. Do we need to do something .lua scripts in IGCData\Scripts to take some .xml outputs? Or they just stay in that folder enough ? If we need to run them and get output files, how ? Couldn't find any useful guide or something around.
Last reply by Maiev, -
-
- 1 reply
- 124 views
Hi guys, i make a topic at Lua Scripting forum but i see that here customers show functional formulas, and i need help to make functional my formula or check if is correct first (Sorry if i miss the forum section) i am scripting a .lua who limite increase of PVM Defense success Rate to Max 400 So Original Formula: -- Character Defense Success Rate - PvM function CalcDefenseSuccessRate_PvM(Class, Dexterity) local DefenseSuccessRate = 0 if(Class == CLASS_WIZARD) then DefenseSuccessRate = Dexterity / 3 elseif(Class == CLASS_KNIGHT) then DefenseSuccessRate = Dexterity / 3 elseif(Class == CLASS_ELF) then DefenseSuccessRate = Dexterity / 4 elseif(Class == CLAS…
Last reply by Wizzy, -
-
- 0 replies
- 105 views
Hi I've Seen This Clip and Wanna Make Skill Like This (See 11 Min 37 Sec) and With This Code -- SkillID: 565, Blood Howling - (Fist Master) function BloodHowl_Level1(TargetHP) local SkillEffect = TargetHP * 5 / 100 local SkillSuccessRate = 10 local SkillTime = 10 return SkillEffect, SkillSuccessRate, SkillTime end -- SkillID: 567, Blood Howling Strengthener - (Fist Master) function BloodHowl_Level2(TargetHP) local SkillEffect = TargetHP * 5 / 100 local SkillSuccessRate = 10 local SkillTime = 10 return SkillEffect, SkillSuccessRate, SkillTime end let me guess i must change local SkillEffect = 100 but i don't know how to make 0.5 sec damage hit for…
Last reply by Mpsmith, -
-
- 1 follower
- 5 replies
- 341 views
So we have made some modifications on CalcCharacter.lua in regards of base damage, defense and magic damage and in Skills we changed soul barrier(highly increased) RegularSkillCalc.lua: -- SkillID: 16, Soul Barrier - (Dark Wizard, Soul Master, Grand Master) function WizardMagicDefense(Index, TargetIndex, Dexterity, Energy) local SkillEffect = Dexterity / 30 + Energy / 100 + 10 local SkillTime = Energy / 40 + 60 if(Index == TargetIndex and SkillEffect > 3000) then -- casting spell on yourself SkillEffect = 3000 elseif (Index ~= TargetIndex and SkillEffect > 3000) then -- casting spell on others SkillEffect = 3000 end return SkillEffect, SkillTim…
Last reply by Wizzy, -
-
-
- 2 replies
- 46 views
I agree to forum rules and posting guidance: -- Character Classes CLASS_WIZARD = 0 -- Fairy Elf, Muse Elf, High Elf CLASS_KNIGHT = 1 -- Dark Wizard, Soul Master, Grand Master CLASS_ELF = 2 -- Dark Knight, Blade Knight, Blade Master CLASS_GLADIATOR = 3 -- Magic Gladiator, Duel Master CLASS_DARKLORD = 4 -- Dark Lord, Lord Emperor CLASS_SUMMONER = 5 -- Summoner, Bloody Summoner, Dimension Master CLASS_RAGEFIGHTER …
Last reply by benczek, -
-
-
- 1 reply
- 194 views
one question abaut edit script exist formula -- Character Classes CLASS_WIZARD = 0 CLASS_KNIGHT = 1 CLASS_ELF = 2 CLASS_GLADIATOR = 3 CLASS_DARKLORD = 4 CLASS_SUMMONER = 5 CLASS_RAGEFIGHTER = 6 -- SkillID: 28, Greater Damage - (Fairy Elf, Muse Elf, High Elf) function ElfAttack(Class, Index, TargetIndex, Energy) local SkillEffect = 0 local SkillTime = Energy / 10 + 60 if (Index ~= Target…
Last reply by Wizzy, -
-
-
- 1 reply
- 92 views
Server Season: Season 6 Files Version: 9.1.0.54 Database Type: MuOnline Hello. Can someone help us to modify query for 3 exc options from lord mix ? function MakeExcOptForLordMix() local OptionLoop = GetRandomValue(3) + 2 local ExcOpt = 0 while OptionLoop > 0 do local RandOp = GetRandomValue(6) local Option = bit32.lshift(1, RandOp) if bit32.band(ExcOpt, Option) ~= Option then ExcOpt = bit32.bor(ExcOpt, Option) OptionLoop = OptionLoop - 1 end end return ExcOpt end
Last reply by Dudi, -
-
- 1 reply
- 167 views
I want edit some functions and i need more data.. Example: CalcCharacter.lua function CalcDefenseSuccessRate_PvM(Class, Dexterity, Level) local DefenseSuccessRate = 0 if(Class == CLASS_WIZARD) then DefenseSuccessRate = Dexterity / 3 end return DefenseSuccessRate end I want get Level and Resets... like function CalcDefenseSuccessRate_PvM(Class, Dexterity, Level, Resets) local DefenseSuccessRate = 0 if(Class == CLASS_WIZARD) then if(Level > 300 && Resets > 500) DefenseSuccessRate = Dexterity / 12 else DefenseSuccessRate = Dexteri…
Last reply by jacubb, -
- 0 replies
- 79 views
Where can Innovation be edited, I want to reduce Innovation buff magic damage by :2 (/2), I tried to edit also Weakness but no results..I changed all these four PvM and PvP for Innovation and Weakness, but Innovation damage is same: -- SkillID: 221, Weakness - MvP - (Summoner, Bloody Summoner, Dimension Master) function SummonerWeakness_Monster(Energy, Curse, MonsterLevel) local SkillSuccessRate = Energy / 50 + Curse / 6 + 32 local SkillEffect = Energy / 58 + 4 local SkillTime = Energy / 100 + 4 - MonsterLevel / 20 return SkillSuccessRate, SkillEffect, SkillTime end -- SkillID: 221, Weakness - PvP - (Summoner, Bloody Summoner, Dimension Master) function SummonerWe…
Last reply by RobiZ, -
- 8 replies
- 166 views
<?xml version="1.0" encoding="utf-8"?> <!-- // ============================================================ // == INTERNATIONAL GAMING CENTER NETWORK // == www.igc-network.com // == (C) 2010-2015 IGC-Network (R) // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // == File is a part of IGCN Group MuOnline Server files. // ============================================================ // // BAG ITEM: NO LIMIT // // ### ItemBag::BagConfig ### // Name: Name of the Item or Monster // ItemRate: Drop rate of an Item, n/10000 // SetItemRate: Drop Rate of random set item, system replicates drawn regular items with random set ancient item, n/10000, can be 0 // Mo…
Last reply by linuxlinux, -
- 2 replies
- 176 views
Hello, i just want to know which line that need edit about exc max option (such as 1-5 exc option) Could you please explain?, how many default max exc option from wz and how to edits Thanks function MakeExcOptForLordMix() local OptionLoop = GetRandomValue(3) + 2 local ExcOpt = 0 while OptionLoop > 0 do local RandOp = GetRandomValue(6) local Option = bit32.lshift(1,RandOp) if bit32.band(ExcOpt, Option) ~= Option then bit32.bor(ExcOpt, Option) OptionLoop = OptionLoop - 1 end end return ExcOpt end and if (ItemInfo.Exc > 0) then -- sets item with options of configured exc mask IsExc = ItemInfo.Exc elseif (ItemInfo.Exc == -1) then -- random exc option(s) IsExc = G…
Last reply by linuxlinux, -
- 2 replies
- 93 views
Good night friends someone could help me, I'm racking my brain to configure lordmix to secure to leave one exc item with 3 additional opt (fixed). Already moved on all lines, am I doing it right? [itemBagScript file] if (ItemInfo.Exc> 0) then - item sets with options of configured exc mask IsExc = ItemInfo.Exc elseif (ItemInfo.Exc == -2) then - random exc option (s) IsExc = GetExcellentOpt (ItemID); elseif (ItemInfo.Exc == -2) then - Original Mix setting is Lord IsExc = MakeExcOptForLordMix () - random exc option, up to 5 IsSkill = 1 - + Skill if (GetRandomValue (100) <20) then - drawn value from range, 20% chance IsLuck = 1 - Then get Luck else IsLuc…
Last reply by linuxlinux, -
-
- 1 reply
- 43 views
Im getting CalcTwoDiffrentWeaponBonus lua Error when using 2 diffirent weapon while using BK. also, never touched any lua files. http://imgur.com/4yAbW1y -- Only for Dark Knight, Magic Gladiator and Dark Lord function CalcTwoDiffrentWeaponBonus(AtkMinLeft, AtkMaxLeft, AtkMinRight, AtkMaxRight) local OutDamageMinLeft = 0 local OutDamageMaxLeft = 0 local OutDamageMinRight = 0 local OutDamageMaxRight = 0 OutDamageMinLeft = AtkMinLeft * 55 / 100 OutDamageMinRight = AtkMinRight * 55 / 100 OutDamageMaxLeft = AtkMaxLeft * 55 / 100 OutDamageMaxRight = AtkMaxRight * 55 / 100 return OutDamageMinLeft, OutDamageMinRight, OutDamageMaxLeft, OutDamageMaxRight end
Last reply by Wizzy, -
-
-
- 1 reply
- 119 views
Where to edit how many contribution points user receives for example in this quest reward file http://pastebin.com/W5hnh7fb.
Last reply by Wizzy, -
-
- 1 reply
- 126 views
Hi all. I have somme issues Help please understend: 1) then put only 1 points per master lvl Soul Barrier Proeficiente all time have miss then hit a character. 2) what it diference in this scipts? Maybe its mistake ? Proeficinete need only increase time not a dmg too. all 3 scripts some formula -- SkillID: 403, Soul Barrier Strengthener - (Grand Master) function WizardMagicDefense_Level1(Dexterity, Energy) local SkillEffect = Dexterity / 50 + Energy / 200 + 10 local SkillTime = Energy / 40 + 60 return SkillEffect, SkillTime end -- SkillID: 404, Soul Barrier Proficiency - (Grand Master) function WizardMagicDefense_Level2(Dexterity, Energy) local SkillEffect = Dexte…
Last reply by matiasmassironi, -
-
- 1 reply
- 107 views
Could you help me with some issues. 1.I want to configure interval time of maya event.I can't understand where i have to set the interval time desire. 2.I want to decrease the time duration of some buffs like , sleep,inovation,weakness. -- SkillID: 219, Sleep - PvP - (Summoner, Bloody Summoner, Dimension Master) function Sleep_PvP(Energy, Curse, PlayerLevel, TargetLevel) local SkillSuccessRate = Energy / 37 + Curse / 6 + 15 local SkillTime = Energy / 250 + (PlayerLevel - TargetLevel) / 100 + 4 return SkillSuccessRate, SkillTime end After this formula,the sleep should stay active aroun 135 seconds if both characters are 400 lvl. I try to replace that 250 with 9000 ,…
Last reply by Wizzy, -
-
-
- 11 replies
- 227 views
What in this script its lvl 255? if I have max lvl 400 need to change? -- MasterSkillCalc Control Script, Lua v5.2 -- Regular and Master Experience formulas, - Can be modified to adjust for own needs -- Regular Exp Table formula - used to calculate exp required for next regular level function SetExpTable_Normal(Level) local Exp = 10 * Level * Level * (Level + 9); if ( Level > 255 ) then Exp = Exp + ( 1000 * (Level-255) * (Level-255) * ((Level-255) + 9)) end return Exp end -- Master Exp Table formula - used to calculate exp required for next regular level function SetExpTable_Master(MasterLevel, MaxNormalLevel) local TotalLevel = MasterLevel + MaxNormalLeve…
Last reply by Wizzy, -
-
- 0 replies
- 86 views
Need to add Swell Life to summoner need only add this skil in config or need and edit lua script? -- SkillID: 48, Swell Life - (Dark Knight, Blade Knight, Blade Master) function KnightSkillAddLife(Vitality, Energy, PartyBonus) local SkillEffect = Vitality / 100 + 12 + Energy / 20 + PartyBonus local SkillTime = Energy / 10 + 60 return SkillEffect, SkillTime end some like this -- SkillID: 48, Swell Life - (Dark Knight, Blade Knight, Blade Master, Summoner, Bloody Summoner, Dimension Master) function KnightSkillAddLife(Vitality, Energy, PartyBonus) local SkillEffect = Vitality / 100 + 12 + Energy / 20 + PartyBonus local SkillTime = Energy / 10 + 60 return Skill…
Last reply by Murphiks, -
-
- 3 replies
- 68 views
Hi i have in some scripts comma after 100; its ok ? becouse some scrits don't have -- SkillID: 60 ,61, 62, 65, 74, 78, Force, Fire Burst, Earthshake, Electric Spike, Fire Blast, Fire Scream - (Dark Lord, Lord Emperor) function Lord_CalcSkillBonus(InDamage, Energy) local OutDamage = ( InDamage * ( ( Energy / 20 + 200 ) ) ) / 100; return OutDamage end
Last reply by Wizzy, -
-
-
- 1 follower
- 1 reply
- 108 views
Can we use decimals like 3.00? because we were using on last cal character but cal character lua only has value like 3 not 3.00 Thanks.
Last reply by Wizzy, -
-
-
- 4 replies
- 148 views
Hello, I wanted to ask if there is a possibility to increase experience rate on specific days via Lua scripting, if so what is the function to determine specific day? Thanks
Last reply by netzo, -
-
-
- 1 reply
- 186 views
Hello wizzy again... i have a questions here... i was checking new formulas to balancing character: for example: -- Character Damage - Fist Fighting - (Dark Wizard, Soul Master, Grand Master) function WizardDamageCalc(Strength, Dexterity, Vitality, Energy) local AttackDamageMinLeft = 0 local AttackDamageMaxLeft = 0 local AttackDamageMinRight = 0 local AttackDamageMaxRight = 0 AttackDamageMinLeft = Strength / 8 -- Minimum Left Hand Damage AttackDamageMinRight = Strength / 8 -- Minimum Right Hand Damage AttackDamageMaxLeft = Strength / 4 -- Maximum Left Hand Damage AttackDamageMaxRight = Strength / 4 -- Maximum Right Hand Damage return AttackDamageMinLeft, Attac…
Last reply by Wizzy, -
-
-
- 11 replies
- 171 views
-- SkillID: 263, Dark Side - (Rage Fighter, Fist Master) function RageFighterDarkSideIncDamage(InDamage, Dexterity, Energy) local OutDamage = (Dexterity / 8 + InDamage + Energy / 10) * (Dexterity / 8 + Energy / 10 + 100)/100.0 return OutDamage end Anybady modify this formula? Write please how its ok
Last reply by Wizzy, -
-
-
- 6 replies
- 188 views
This is the default value and im running a NON RESET SERVER thank you -- SkillID: 217, Damage Reflection - (Summoner, Bloody Summoner, Dimension Master) function SummonerDamageReflect(Energy) local Reflect = 30 + (Energy / 42) local Time = 30 + (Energy / 25) if (Reflect > 25) then Reflect = 25 end return Reflect, Time end
Last reply by starozzmu, -