Jump to content

V3ct0r

Administrators
  • Content Count

    2,372
  • Joined

  • Last visited

  • Days Won

    412

V3ct0r last won the day on July 28

V3ct0r had the most liked content!

Community Reputation

1,831 Excellent

About V3ct0r

  • Rank
    Sea Captain

Recent Profile Visitors

75,814 profile views
  1. The code above has a bug. Fixed version: -- Player killed monster event GetExp_PKM__Original = GetExp_PKM GetExp_PKM = function(monster, role) -- Call original function GetExp_PKM() GetExp_PKM__Original(monster, role) -- Get killed monster level local level = Lv(monster) -- Gold amount local money = 0 -- Check the monster level if (level < 21) then money = 1000 -- 1,000 g elseif (level < 41) then money = 2000 -- 2,000 g end -- Add gold if (money > 0) then -- Give gold role = TurnToCha(role) local tmp = GetChaAttr(role, ATTR_GD) SetChaAttr(role, ATTR_GD, tmp + money) -- Show a message SystemNotice( role, string.format( "You killed (%s) and got (%d) gold!", GetChaDefaultName(monster), money ) ) end end
  2. Hello, @gunnapong! This script should work fine: -- Player killed monster event GetExp_PKM__Original = GetExp_PKM GetExp_PKM = function(monster, role) -- Call original function GetExp_PKM() GetExp_PKM__Original(monster, role) -- Get killed monster level local level = Lv(monster) -- Gold amount local money = 0 -- Check the monster level if (level < 21) then money = 1000 -- 1,000 g elseif (level < 41) then money = 2000 -- 2,000 g end -- Add gold if (money > 0) then -- Give gold role = TurnToCha(role) local tmp = GetChaAttr(role, ATTR_GD) SetChaAttr(role, ATTR_GD, tmp + money) -- Show a message SystemNotice( role, string.format( "You killed (%s) and got (%d) gold!", GetChaDefaultName(monster), money ) ) end end
  3. Hello @gunnapong, Have you added custom functions to MissionSdk.lua? elseif conditions[i].func == ValentinesRing then PRINT( "ConditionsTest:ValentinesRing, p1 = ", conditions[i].p1 ) local ret = ValentinesRing( character, conditions[i].p1 ) if ret ~= LUA_TRUE then PRINT( "ConditionsTest:ValentinesRing = false" ) return LUA_FALSE end elseif conditions[i].func == ValentinesRingJudge then PRINT( "ConditionsTest:ValentinesRingJudge, p1 = ", conditions[i].p1 ) local ret = ValentinesRingJudge( character, conditions[i].p1 ) if ret ~= LUA_TRUE then PRINT( "ConditionsTest:ValentinesRingJudge = false" ) return LUA_FALSE end elseif actions[i].func == ValentinesRing then PRINT( "ActionsProc:ValentinesRing, p1 = ", actions[i].p1 ) local ret = ValentinesRing( character, actions[i].p1 ) if ret ~= LUA_TRUE then PRINT( "ActionsProc:ValentinesRing failed!" ) SystemNotice( character, "ActionsProc:ValentinesRing failed!" ) return LUA_FALSE end
  4. Hello @joao, Try to set the server IP address for your client using this program:
  5. Hello @Masuka00, You can use the following example, but it covers only two cases: function px_FuncName() InitTrigger() TriggerCondition(1, CheckFunction) -- CheckFunction() is any function that returns LUA_TRUE or LUA_FALSE, accepts role, npc and other given parameters TriggerAction(1, JumpPage, 1) TriggerFailure(1, JumpPage, 2 ) Start(GetMultiTrigger(), 1) Talk( 1, "CheckFunction() returned LUA_TRUE" ) Talk( 2, "CheckFunction() returned LUA_FALSE" ) end Also look at transmittal() function from the file NpcScript02.lua. This code looks interesting: InitTrigger() TriggerCondition( 1, IsMapNpc, "garner", 96 ) TriggerAction( 1, JumpPage, 1 ) TriggerCondition( 2, IsMapNpc, "garner", 94 ) TriggerAction( 2, JumpPage, 2 ) TriggerCondition( 3, IsMapNpc, "garner", 95 ) TriggerAction( 3, JumpPage, 4 ) TriggerCondition( 4, IsMapNpc, "garner", 97 ) TriggerAction( 4, JumpPage, 5 ) TriggerCondition( 5, IsMapNpc, "garner", 55 ) TriggerAction( 5, JumpPage, 6 ) TriggerCondition( 6, IsMapNpc, "garner", 56 ) TriggerAction( 6, JumpPage, 3 ) TriggerCondition( 7, IsMapNpc, "magicsea", 50 ) TriggerAction( 7, JumpPage, 7 ) TriggerCondition( 8, IsMapNpc, "magicsea", 46 ) TriggerAction( 8, JumpPage, 8 ) TriggerCondition( 9, IsMapNpc, "darkblue", 56 ) TriggerAction( 9, JumpPage, 9 ) TriggerCondition( 10, IsMapNpc, "darkblue", 42 ) TriggerAction( 10, JumpPage, 10 ) TriggerCondition( 11, IsMapNpc, "darkblue", 46 ) TriggerAction( 11, JumpPage, 11 ) TriggerCondition( 12, IsMapNpc, "darkblue", 51 ) TriggerAction( 12, JumpPage, 12 ) Start( GetMultiTrigger(), 12 ) You can write your custom function that will check characters type: function CheckRace(role, race_id) local cha_race = GetChaTypeID(role) if cha_race == race_id then return LUA_TRUE end return LUA_FALSE end Don't forget add it in the file MissionSdk.lua: elseif conditions[i].func == CheckRace then PRINT( "ConditionsTest: CheckRace") local ret = CheckRace(character, conditions[i].p1) if ret ~= LUA_TRUE then PRINT( "ConditionsTest: CheckRace = false" ) return LUA_FALSE en Then try to write something like this: function npc_NotTested() InitTrigger() TriggerCondition(1, CheckRace, 1) TriggerAction(1, JumpPage, 1) TriggerCondition(2, CheckRace, 2) TriggerAction(2, JumpPage, 2) TriggerCondition(3, CheckRace, 3) TriggerAction(3, JumpPage, 3) TriggerCondition(4, CheckRace, 4) TriggerAction(4, JumpPage, 4) Start(GetMultiTrigger(), 4) Talk(1, "Lance") Talk(2, "Carsise") Talk(3, "Phyllis") Talk(4, "Ami") end
  6. Look at PushHint() function in the procedures for creating items descriptions. Its second parameter is the color of the line of text (in format: 0xAARRGGBB).
  7. @superNL has not visited us for a long time, the probability that he will answer is very small
  8. Hello @pirate1, Hard to say what is the problem. 1) Try to check GameServer.exe logs; 2) Try to explore GameServer lua-scripts and source code for the presence of code that can disconnect the client in a similar situation.
  9. I don't have a solution for source code, sorry.
  10. Hello @Mario, Unfortunately, I don't provide any services at the moment. You can create a topic with your request here.
  11. Looks like this is someone's private development. At least I haven't seen this before.
  12. Hello friends! Do you can explain in more details what is the problem? @Mario and @anamutz86, check if this problem occurs when using the official server and client executables. If there is no such bug in the official binaries, then someone made a mistake in the source codes. Here I can’t tell, it’s better to contact the developers of the source codes (create an issue in a bug tracker).
  13. Hello @Sharshabel, Do you can explain the problem in more details please?
×
×
  • Create New...