Jump to content

Billy

Community
  • Content Count

    120
  • Joined

  • Days Won

    28

Posts posted by Billy


  1. 47 minutes ago, Angelix said:

    When using effects like those and possession, you'll always get decreasing stats. Since possession always sets attributes to 0 when finished and other effects just remove their X bonus since it's static, it will remove them even if you don't have them, resulting in negative stats.

    Not always, since you can add the amount from poss to your current attrv and record the amount you added. Then when poss is removed check the recorded value and set attrv to attrv - recorded value.

    • Like 1

  2. Since the packet sent from client to server when you use the exchange npc contains the item ID, the ChangeItemList table is required as it contains all the valid exchanges and compares the IDs in the packet received to it.

     

    You can edit ExchangeData function to contain something like:

     

    table.insert(ChangeItemList,{srcID, srcNum, tarID, tarNum})

     

    To automaticly make this table for you, then you can just use:

     

    ExchangeData( srcID, srcNum, tarID, tarNum, timeNum )

    • Like 1

  3. 2 minutes ago, Faller said:

    @Billy Hello! I tried installing your extension but I got a problem. I put the ActionProc and added the lua to my extension folder, but whenever I start the gameserver, it just hangs loading the plugin. It loads all the others and then freezes on Boss Record NPC. Any ideas of what could be happening? 

    Btw, great work! :)

    Did you make sure that the path to BossRecord.SavePath exists, but the file itself doesnt?

    • Like 1

  4. Something like this? (untested)

     

    Spoiler
    
    --[[
    	elseif RandomExchange ~= nil and item.func == RandomExchange.Exchange then
    		return RandomExchange.Exchange( character, item.p1 )
    ]]
    RandomExchange = {
    	Give = {
    		{
    			ID = 885,
    			Num = 1,
    		},
    		{
    			ID = 854,
    			Num = 10,
    		},
    		{
    			ID = 192,
    			Num = 1,
    		},
    		{
    			ID = 150,
    			Num = 1,
    		},
    		{
    			ID = 272,
    			Num = 1,
    		},
    	},
    	Take = {
    		{
    			ID = 855,
    			Num = 99,
    		},
    		{
    			ID = 854,
    			Num = 1,
    		},
    		{
    			ID = 2588,
    			Num = 10,
    		},
    		{
    			ID = 2589,
    			Num = 1,
    		},
    	},
    }
    
    function RandExNpc()
    	local page = 1
    	local count = -1
    	Talk(page,'Here you can exchange for random items.')
    	for i,v in pairs(RandomExchange.Take) do
    		if count == 6 then
    			Text(page,'Next',JumpPage,page + 1)
    			page = page + 1
    			Talk(page,'Here you can exchange for random items.')
    			Text(page ,'Previous',JumpPage,page-1)
    			count = 0
    		end
    		Text(page,string.format('Exchange %sx %s',v.Num,GetItemName(v.ID)),RandomExchange.Exchange,v)
    		count = count + 1
    	end
    end
    
    function RandomExchange.Exchange(role,Take)
    	local Amount = CheckBagItem(role,Take.ID)
    	if  Amount < Take.Num then
    		SystemNotice(role,string.format('Requires %s %s(s) to exchange.', Take.Num, GetItemName(Take.ID)))
    	elseif GetChaFreeBagGridNum(role) < 1 then
    		SystemNotice(role,'Requires atleast 1 free slot in bag to exchange.')
    	else		
    		local item = RandomExchange.Give[math.random(1,#RandomExchange.Give)]
    		RemoveChaItem( role , Take.ID , Take.Num , 2 , -1, 0 , 1  )
    		local Amount2 = CheckBagItem(role,Take.ID)
    		if Amount2 == Amount - Take.Num then
    			GiveItem ( role , 0 , item.ID  , item.Num , 4 )
    			SystemNotice(role,string.format('Obtained %sx %s(s)',item.Num,GetItemName(item.ID)))
    		else
    			SystemNotice(role,'Something went wrong.')
    		end
    	end
    end

     

     

    • Like 1

  5. Using character names as an identifier is never a good idea, since you can make a boat with that name and GetChaDefaultName(role) would return the boats name. That means you could make the system think someone else was duping, and have them be punished. You should use GetRoleID(role) instead. 

    • Like 2

  6. A way to easily tell which GS you are on is too rename the system NPC in the .cfg off each GS to be differance (System1, System2 etc), then use 

    local ret, npc = GetEudemon()
    local GSName = GetChaDefaultName(npc)

    to get the GS.

     

    With your ( @Home ) method, you will have issues with players with a full inv, 

     

    I had started trying to record a players inv/bank/temp/equips into a file when they leave a map, and then checking this against their current inv/bank/temp/equips when they enter a map, but idk if that would fully work due to order of disconnecting if they enter the same map as their clone. (and web based malls would need to be replaced with IGS)

    • Like 2

  7. I think he means feed as in boosting score by killing alts, not feed as in fairy fruits.

     

    Main issue you will have is working out if thy are actually boosting, or of its just a coincidence that the same person keeps looking the same person.

    One solution is just adding a cool down if the same person kills the same person too many times, but his is not perfect.

    You might be able to set up a SQL trigger to write cha I'd and IP/MAC to a file on row update, and then check on kill, but the issue is Mac can be changed in login packet and IP by proxy

    • Like 1

  8. 1 hour ago, Totoka said:

     

    - skill upgrade, I'll try by using a lua function, kind of proxy/middleware between each skill execution to know if the 'role'/'character' has the skill, dunno if thats going to work  properly.

     

    http://pastebin.com/awx5fydQ

     

    I made that a while ago (just tried to make it less messy now), it might be useful. (havent tested it in a while, so might be buggy, but is a good base)

     

    Whenever a player uses a skill, it check if the level is >10 or if the level is > their stored level, and if it is then the player is jailed. (you need to manually edit poss skillbook/ rb skillbook/ rb npc etc to record the skill once it is given)

    • Like 1

  9. If you look in CA ctrl.lua at the function that is called when map is closing, there is a function DealAllActiveInMap(map,func). Make you can add something like this before announcing players: 

    function GetPlayerNames (role)
    	table. insert(PlayersInMap,GetChaDefaultName(role))
    end
    
    --
    	PlayersInMap = {}
    	DealAllActiveInMap (map,'GetPlayerNames')
    	local ListPlayers = ''
    	for i,v in pairs(PlayersInMap) do
    		ListPlayers = string.format('%s [%s],',ListPlayers,v)
    	end
    	local msg = string.format('MAPNAME has [%s] players remaining: %s' , GetMapActivePlayer(map) , ListPlayers)
    	Notice(msg)
    --

     

     


  10. KickToMap is the map the player is kicked to if they enter in an allowed equip, then change to another equip.

     

     Maps = { --Maps is the table of maps
            ['map1'] = {
                Fusable = true,
                KickToMap = 'garner',
                Equips = {
                    Head = nil,
                    Armour = {2549,192,2920},
                    Gloves = {2550,1234,678},
                    Boots = {2551},
                    LeftHand = nil,
                    RightHand = nil,
                    LeftRing = {82},
                    RightRing = nil,
                    Necklace =nil,
                }
            },
       
            ['map2'] = {
                Fusable = false,
                KickToMap = 'garner',
                Equips = {
                    Head = nil,
                    Armour = {2549},
                    Gloves = {2550,999},
                    Boots = {2551},
                    LeftHand = nil,
                    RightHand = nil,
                    LeftRing = nil,
                    RightRing = nil,
                    Necklace =nil,
                }
            },
        }
    }

    Is the map config, so if you wanted PKmap to only allow people in kylin set, you would add:

     

     Maps = { --Maps is the table of maps
            ['map1'] = {
                Fusable = true,
                KickToMap = 'garner',
                Equips = {
                    Head = nil,
                    Armour = {2549,192,2920},
                    Gloves = {2550,1234,678},
                    Boots = {2551},
                    LeftHand = nil,
                    RightHand = nil,
                    LeftRing = {82},
                    RightRing = nil,
                    Necklace =nil,
                }
            },
       
            ['map2'] = {
                Fusable = false,
                KickToMap = 'garner',
                Equips = {
                    Head = nil,
                    Armour = {2549},
                    Gloves = {2550,999},
                    Boots = {2551},
                    LeftHand = nil,
                    RightHand = nil,
                    LeftRing = nil,
                    RightRing = nil,
                    Necklace =nil,
                }
            },
    
    	 ['PKmap'] = {
                Fusable = false,
                KickToMap = 'garner',
                Equips = {
                    Head = nil,
                    Armour = {825},
                    Gloves = {826},
                    Boots = {827},
                    LeftHand = nil,
                    RightHand = nil,
                    LeftRing = nil,
                    RightRing = nil,
                    Necklace =nil,
                }
            },
        }
    }

     

    • Like 1
×
×
  • Create New...