Jump to content
Vasil

[Lua-SQL Extension] Crystal By Mob

Recommended Posts

--[[ IGS Crystal By Mob Extension made By Vasil pkoDev,Please do not claim or redistribute the credits :)
*Requirements:
-LuaSQL by Wrexor
-TradeServer Program
-TradeDB 
-SQL 2008 or higher

*Configuration:
I guess the example i gave is clear
Just if you're going to use .\SQLEXPRESS , make it x2 dashes otherwise it will be as .SQLEXPRESS
e.g : .\\SQLEXPRESS

Just change the map that the function will run inside and the monster ID that will give the IGSP

If encountering any bug or flaw or glitch,please contact me - Vasil

 

 

 

 

 

Download from here:

CrystalByMob.rar

Share this post


Link to post
Share on other sites

There are some flaws because I created a similar function, but in the form of a Card and requires checking some errors:

If the player never enters In-Game Mall, it will never add the points, so you need to check if there is any record in SQL;

If there is an error in SQL, it will be necessary to create logs so that it is resolved by the administrator.

Well, I guess that's just it.

  • Like 1

Share this post


Link to post
Share on other sites
Guest
9 minutes ago, Vasil said:

Hello @GustavoHMA , i am using Xero's TradeServer and i am not facing anything from what you said,you'll only get it if you're using WolfenDev TradeServer

Gustavo was talking about LuaSQL add-on I suppose, also, what's the connection between your script and TradeServer tools?

Share this post


Link to post
Share on other sites
12 minutes ago, qwerty said:

Gustavo was talking about LuaSQL add-on I suppose, also, what's the connection between your script and TradeServer tools?

He is talking about the added points,u won't recieve them unless you open crystals shop,i encountered that error only while using WolfenDev tradeserver,but Xero's one nope

Share this post


Link to post
Share on other sites
33 minutes ago, Vasil said:

Hello @GustavoHMA , i am using Xero's TradeServer and i am not facing anything from what you said,you'll only get it if you're using WolfenDev TradeServer

I think you did not get it. My TradeServer is the same as yours. Make the following test, create a new account and then add points by killing the monsters, after entering the In-game Mall you will realize that no point has been added. That is the question.

  • Like 1

Share this post


Link to post
Share on other sites
On 1/19/2017 at 3:24 AM, Angelix said:

Did you manage to get that working out fine?

Nope,not yet,i was so busy this week,i'll be testing it out so soon.

Share this post


Link to post
Share on other sites
On 22/01/2017 at 10:49 AM, Vasil said:

Hello @GustavoHMA it's working good in here,i don't know what caused your error but i believe you should use "127.0.0.1\\SQLEXPRESS",Thanks to @Wrexor for showing me this one.Allow Pipes too & IP Connection in your SQL.

Glad you're working well there.

Share this post


Link to post
Share on other sites

What I think @GustavoHMA means is that if a newly created account is playing and kills a monster then gets some points, those points won't get added since that account doesn't exist within TradeDB. Accounts created don't synchronize with TradeDB, they get create once a player enters in-game mall for the first time since TradeServer checks whether an account exists, if it doesn't, then it creates a record for it within TradeDB. Your query goes on ahead expecting the account you're trying to access/modify does exist which in reality can or can't exist depending on whether the player has entered or not the in-game mall before getting some points added.

 

Try this:

  1. Create two new accounts, "A" and "B".
  2. Check TradeDB, you'll see that neither accounts exists within it.
  3. Create a new character in each account.
  4. With player "A" access in-game mall and a record for that account will be created within TradeDB while account "B" won't have one.
  5. With both characters kill a monster to add some points to their account.
  6. Account "A" should get points while account "B" shouldn't be getting since it does not exists within TradeDB.
  7. Then with player "B" enter in-game mall and then the record should be created and see if it has points from before.
  • Like 2

Share this post


Link to post
Share on other sites
2 minutes ago, Angelix said:

What I think @GustavoHMA means is that if a newly created account is playing and kills a monster then gets some points, those points won't get added since that account doesn't exist within TradeDB. Accounts created don't synchronize with TradeDB, they get create once a player enters in-game mall for the first time since TradeServer checks whether an account exists, if it doesn't, then it creates a record for it within TradeDB. Your query goes on ahead expecting the account you're trying to access/modify does exist which in reality can or can't exist depending on whether the player has entered or not the in-game mall before getting some points added.

 

Try this:

  1. Create two new accounts, "A" and "B".
  2. Check TradeDB, you'll see that neither accounts exists within it.
  3. Create a new character in each account.
  4. With player "A" access in-game mall and a record for that account will be created within TradeDB while account "B" won't have one.
  5. With both characters kill a monster to add some points to their account.
  6. Account "A" should get points while account "B" shouldn't be getting since it does not exists within TradeDB.
  7. Then with player "B" enter in-game mall and then the record should be created and see if it has points from before.

Finally someone understood me. B|

Share this post


Link to post
Share on other sites
On 10.1.2017 at 4:12 PM, GustavoHMA said:

There are some flaws because I created a similar function, but in the form of a Card and requires checking some errors:

If the player never enters In-Game Mall, it will never add the points, so you need to check if there is any record in SQL;

If there is an error in SQL, it will be necessary to create logs so that it is resolved by the administrator.

Well, I guess that's just it.

That problem u can fix by adding in website when make new account do on it, tradedb account crystals 0

Edited by Onioni

Download: Nightmare Demonic Helm

Dimension Pirates Online files: get now

New map Project: Flag PK

Black Skin 3.1.3 for pko 1: Get now

Share this post


Link to post
Share on other sites

Hey, @johan!

You don't need to worry about the points, it's a "show-only" thing. There's no points exchanger or such functions in the IGS itself. When you click in the "Exchange" button, it will simply take you to IGG's website which had the exchange function in PHP.

Edited by Faller

Share this post


Link to post
Share on other sites

Would it be possible to put to win in quest? without having to use scroll.

Edited by 1g0rS1lv4

Being better than others is for those who are weak; what matters is to be true to yourself.         

 

Share this post


Link to post
Share on other sites
14 hours ago, 1g0rS1lv4 said:

Would it be possible to put to win in quest? without having to use scroll.

@Hello @1g0rS1lv4!

Just add the function which gives crytal to the player at ActionsProc(), located at missionsdk.lua.

 

Eg:

		elseif actions[i].func == GiveCrystal then
			GiveCrystal( character, actions[i].p1 )

Usage on quest:

MisResultAction(GiveCrystal, 10) -- Gives 10 crystal to player

 

  • Like 1

lelouch_signature_by_vahntheknight-d4uafwj.png

Share this post


Link to post
Share on other sites

@Legacy & @hetser.

This is the content within that rar file.
 

print("* Loading CrystalByMob Extension <init.lua>")
--[[ IGS Crystal By Mob Extension made By Vasil pkoDev,Please do not claim or redistribute the credits :)
*Requirements:
-LuaSQL by Wrexor
-TradeServer Program
-TradeDB 
-SQL 2008 or higher

*Configuration:
I guess the example i gave is clear
Just if you're going to use .\SQLEXPRESS , make it x2 dashes otherwise it will be as .SQLEXPRESS
e.g : .\\SQLEXPRESS

Just change the map that the function will run inside and the monster ID that will give the IGSP

If encountering any bug or flaw or glitch,please contact me - Vasil

--]]
SQLConnector = {};
SQLConnector.sql = { host = "127.0.0.1\\SQLEXPRESS", user = "sa", pass = "Y87dc#$98", db = "TradeDB" };

CrystalByMobHook = GetExp_PKM
GetExp_PKM = function( dead , atk , money  )
	CrystalByMobHook(dead,atk, money)
	local DeadMonster = GetChaID(dead)
	local accountName = GetActName(atk)
	local Money = Money
	local Rum = { };
	Rum['Money'] = Money;

	if(GetChaMapName(atk) == "garner" or GetChaMapName(atk) == "crystal") then
		if(DeadMonster == 1526)then
			QueryAsync(
			SQLConnector.sql['host'],
			SQLConnector.sql['user'],
			SQLConnector.sql['pass'],
			"UPDATE "..SQLConnector.sql['db']..".dbo.AccountInfo SET Money = Money + 1 WHERE accName = '"..accountName.."'"
	);
			BickerNotice( atk, "[IGSP]:You have obtained 1 IGS Crystal from "..GetChaDefaultName(dead) )
		end 
	end
end

Please take into consideration this: 

On 1/24/2017 at 7:28 PM, Angelix said:

What I think @GustavoHMA means is that if a newly created account is playing and kills a monster then gets some points, those points won't get added since that account doesn't exist within TradeDB. Accounts created don't synchronize with TradeDB, they get create once a player enters in-game mall for the first time since TradeServer checks whether an account exists, if it doesn't, then it creates a record for it within TradeDB. Your query goes on ahead expecting the account you're trying to access/modify does exist which in reality can or can't exist depending on whether the player has entered or not the in-game mall before getting some points added.

 

Try this:

  1. Create two new accounts, "A" and "B".
  2. Check TradeDB, you'll see that neither accounts exists within it.
  3. Create a new character in each account.
  4. With player "A" access in-game mall and a record for that account will be created within TradeDB while account "B" won't have one.
  5. With both characters kill a monster to add some points to their account.
  6. Account "A" should get points while account "B" shouldn't be getting since it does not exists within TradeDB.
  7. Then with player "B" enter in-game mall and then the record should be created and see if it has points from before.

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...