Jump to content
  • 0

Request - Script to counter bugs/exploits


Veracious

Question


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  179
  • Reputation:   17
  • Joined:  04/24/14
  • Last Seen:  

Hello!

 

I want a NPC script with the following details :-

 

Script 1 or Script 2 or Script 3 - any one out of these will work for me.

 

-----Script 1-----

 

1) i will give Guild Names of guilds who claim guild package to the NPC. (it just has to store data of Guild Names and has nothing to do with Guild Package)

 

2) it will store any number of guild names i'll give.

 

3) What i want is to ban the Guild Masters of these guilds(for some period like 1 month without deleting anything from their id) as soon as they break their guild.

 

-----Script 2-----

 

1) when a guild breaks, the items created by guild bound (getitembound) will automatically become account bound items from the guild master's account & also those items in the guild storage.

 

-----Script 3-----

 

1) when a guild breaks, the items created by guild bound (getitembound)  will be automatically be deleted from the guild master's account.

Edited by Veracious
Link to comment
Share on other sites

15 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  41
  • Reputation:   0
  • Joined:  05/18/20
  • Last Seen:  

Hello,

 

I tried getitembound on npc and command, it works but there is no restriction ( trading etc...)

I Know that it's an old topic but i have some question about sql. 

On 5/26/2014 at 1:36 PM, Emistry said:

try this

http://upaste.me/r/5ec739

 

load the sql, and modify your guild package script.

Is it a specific sql file in server folder or should i open with mysql Work bench and after, edit this file? I don't see guild package script ( trunk/sql-files)

 

After that, this script should be added in the same file?? :

 

On 6/22/2014 at 1:54 AM, Skorm said:

- script guildbreak -1,{ OnGuildBreak: if( countitem(512) ) delitem 512,1; end; }

Same question for the OnLeaveGuild, if it exist.

Thank you

Edited by kilow
Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

3 hours ago, kilow said:

Same question for the OnLeaveGuild, if it exist.

Thank you

Really questions like this should be asked on their own so it's easier for other users to find and search them...

But as far as I know there is not.

To add one that has an rid for an online character and would only run in that case you would add it in this statement.

https://github.com/rathena/rathena/blob/master/src/map/guild.cpp#L983

npc_event_doall_id("OnLeaveGuild", account_id);

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  41
  • Reputation:   0
  • Joined:  05/18/20
  • Last Seen:  

15 minutes ago, Skorm said:

Really questions like this should be asked on their own so it's easier for other users to find and search them...

But as far as I know there is not.

To add one that has an rid for an online character and would only run in that case you would add it in this statement.

https://github.com/rathena/rathena/blob/master/src/map/guild.cpp#L983


npc_event_doall_id("OnLeaveGuild", account_id);

 

ok, ( i made an other topic that i will update if it's answered here).
That's for leaving guild but a char need to be online to leave guild so it's ok ( item will be destroyed but it's not a problem for what i want) .
Finally, i think the real problem is if the char is kicked from a guild the event can't work when the kicked player is offline, in case that i add an event OnKickGuild.

Thx Skorm

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  179
  • Reputation:   17
  • Joined:  04/24/14
  • Last Seen:  

On 5/26/2014 at 7:36 PM, Emistry said:

try this

Its not deleting items or turning them into account bound after the guild breaks.

bump bump bump bump bump

Edited by Emistry
Merged bump posts.
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2346
  • Joined:  10/28/11
  • Last Seen:  

try this

http://upaste.me/r/5ec739

 

load the sql, and modify your guild package script.

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

I think the if must be

if( .@aid == 0 ){

/?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  179
  • Reputation:   17
  • Joined:  04/24/14
  • Last Seen:  

0 4 19:55:33 CREATE TABLE IF NOT EXISTS `guild_package_log` ( `id` int(11) unsigned NOT NULL auto_increment, `guild_id` int(11) unsigned NOT NULL, `name` varchar(30) NOT NULL DEFAULT '', `account_id` int(11) unsigned NOT NULL, `time` datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY ( `id` ) Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 7 0.000 sec

 

Error at these two lines.

PRIMARY KEY ( `id` );
) ENGINE=MyISAM;
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2346
  • Joined:  10/28/11
  • Last Seen:  

thx for pointing out.

 

updated the content.

http://upaste.me/r/5ec739

( CTRL + F5 )

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  179
  • Reputation:   17
  • Joined:  04/24/14
  • Last Seen:  

thx for pointing out.

 

updated the content.

http://upaste.me/r/5ec739

( CTRL + F5 )

 

 

I'm getting errors each time i talk to the npc

[SQL]: DB error - Unknown column 'aid' in 'field list'
[Debug]: at ..\src\map\script.c:15156 - SELECT `aid`,`master`,`time` FROM `guild
_package_log` WHERE `guild_id` = 0 LIMIT 1
[Debug]: Source (NPC): Guild Package Giver at prontera (151,185)
[SQL]: DB error - Column count doesn't match value count at row 1
[Debug]: at ..\src\map\script.c:15156 - INSERT INTO `guild_package_log` VALUES (
 0,'GM Veracious',2000000,NOW() )
[Debug]: Source (NPC): Guild Package Giver at prontera (151,185)
Edited by Veracious
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2346
  • Joined:  10/28/11
  • Last Seen:  

updated again

thx for pointing out.

 

updated the content.

http://upaste.me/r/5ec739

( CTRL + F5 )

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  179
  • Reputation:   17
  • Joined:  04/24/14
  • Last Seen:  

updated again

thx for pointing out.

 

updated the content.

http://upaste.me/r/5ec739

( CTRL + F5 )

 

Getting error again when i recieve the items

[SQL]: DB error - Unknown column 'master' in 'field list'
[Debug]: at ..\src\map\script.c:15156 - SELECT `account_id`,`master`,`time` FROM
 `guild_package_log` WHERE `guild_id` = 0 LIMIT 1
[Debug]: Source (NPC): Guild Package Giver at prontera (151,185)

Script that i used for testing

prontera,151,185,3 script Guild Package Giver 78,{
mes "Claim Guild Package";
query_sql( "SELECT `account_id`,`master`,`time` FROM `guild_package_log` WHERE `guild_id` = "+.@guild_id+" LIMIT 1",.@aid,.@master$,.@time$ );
if( !.@aid ){
// get guild packet
getitem 512,1;
getitem 512,2;
getitem 512,3;
query_sql( "INSERT INTO `guild_package_log` VALUES ( "+gettimetick(0)+","+.@guild_id+",'"+escape_sql( strcharinfo(0) )+"',"+getcharid(3)+",NOW() )" );
    close;
}
else{
mes "Already claimed by "+.@master$+" on "+.@time$;
    close;
}
}

at sql

CREATE TABLE IF NOT EXISTS `guild_package_log` (
`id` int(11) unsigned NOT NULL,
`guild_id` int(11) unsigned NOT NULL,
`name` varchar(30) NOT NULL DEFAULT '',
`account_id` int(11) unsigned NOT NULL,
`time` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY ( `id` )
) ENGINE=MyISAM;
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2346
  • Joined:  10/28/11
  • Last Seen:  

`name` varchar(30) NOT NULL DEFAULT '',

change to

`master` varchar(30) NOT NULL DEFAULT '',
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  179
  • Reputation:   17
  • Joined:  04/24/14
  • Last Seen:  

Its working without errors, need to test the script now.

Edited by Veracious
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

bump

 

There isn't an event trigger for guilds being broken.

 

So we have to make one...

onguildbreak.patch

-    script    guildbreak    -1,{
OnGuildBreak:
	if( countitem(512) )
		delitem 512,1;
	end;
}
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  179
  • Reputation:   17
  • Joined:  04/24/14
  • Last Seen:  

There isn't an event trigger for guilds being broken.

 

So we have to make one...

attachicon.gifonguildbreak.patch

-    script    guildbreak    -1,{
OnGuildBreak:
	if( countitem(512) )
		delitem 512,1;
	end;
}

 

Thanks!

I want to know :-

how to turn the guild bound items into account bound items as soon as the guild breaks (would prefer this one over the deleting of items)

OR

how to delete the guild bound items which loose their bound after guild breaks (only those items which were guild bound items should be deleted or else players will loose cards if they've some MVP/other cards eg :- 1 Jacket [1] with Tao Gunka Card and other Jacket [1] with Marc card what if the MVP Card gets deleted?)

Link to comment
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
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  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...