Allow /Disallow new character
Moderator: POL Developer
Allow /Disallow new character
I am trying to stop a problem on my shard whereby a player will create a new character, store the starter equipment, delete the character, and repeat many times to build up a stash of money and things.
Is there any way in pol we can refuse the client's request to create a new character? Obviously I can record the old character creation time, and use that to decide, but where? By the time oncreate runs, it's already been created.
Is there any way in pol we can refuse the client's request to create a new character? Obviously I can record the old character creation time, and use that to decide, but where? By the time oncreate runs, it's already been created.
Re: Allow /Disallow new character
Don't you create the starting equipment in the OnCreate script? Why not just check it and not create the items if they're doing it too fast? And maybe then do a Start_Script at the very end of the OnCreate, wait about 2 seconds, freeze/paralyze them, SysMessage that they're creating a new char too fast, wait a few more seconds to give them a chance to read the message, disconnect, and delete.
Re: Allow /Disallow new character
There are several ways to do this.
The first thing imho is to set the servspec option StartingGold to zero or
a low value like 1 or 10. The real start value could be given later in the
OnCreate script.
I personally would set a account cprop to make sure that every slot is
getting the starting gold or equipment once.
You could use an array like (e.g. char slot 2, 1200 gp):
You'll have to write a function to determine the charslot, e.g. going through all
slots and compare the names because imho there exist no character.slot member atm.
The first thing imho is to set the servspec option StartingGold to zero or
a low value like 1 or 10. The real start value could be given later in the
OnCreate script.
I personally would set a account cprop to make sure that every slot is
getting the starting gold or equipment once.
You could use an array like (e.g. char slot 2, 1200 gp):
Code: Select all
var gotstartgold := account.getprop("GotStartGold");
if(!gotstartgold)
gotstartgold := {0, 0, 0, 0, 0, 0, 0};
endif
if(!gotstartgold[charslot])
// give 1200 goldpieces and start equipment here
gotstartgold[charslot] := 1200;
account.setprop("GotStartGold", gotstartgold);
endif
slots and compare the names because imho there exist no character.slot member atm.
Re: Allow /Disallow new character
One way I have seen being used alot to stop this is a timer on the character how long you have to wait until you can delete it. For example you can not delete a character you created for 1 day.
Re: Allow /Disallow new character
but how can I make something like this tomi?Tomi wrote:One way I have seen being used alot to stop this is a timer on the character how long you have to wait until you can delete it. For example you can not delete a character you created for 1 day.
Re: Allow /Disallow new character
I wasn't aware I could stop a player from deleting a character in pol.
Re: Allow /Disallow new character
Pachacuti oncreate and candelete scripts in scripts/misc
store a prop on the character in oncreate and check for that against some timer in candelete.
OldnGrey candelete controls if the character can be deleted or not.
store a prop on the character in oncreate and check for that against some timer in candelete.
OldnGrey candelete controls if the character can be deleted or not.
Re: Allow /Disallow new character
Great Tomi.
That solves my problem. I simply won't allow them to delete a new character within a day of creating it.
That solves my problem. I simply won't allow them to delete a new character within a day of creating it.
Re: Allow /Disallow new character
Another idea, i was thinking about ( not sure if it would work but ill throw it out there anyway) ...
Put a property on all the items created in the beginning for a newcharacter...
Like a player serial number and maybe a date of creation...
You would also want to put a property on the player with the same date of creation
var systemtime := time right now
var newbiearray := { newcharacter.serial, systemtime }
SetObjProperty(newbieItem, "newbieitem", newbiearray)
SetObjProperty(newcharacter, "creationdate", systemtime);
Then, in the equip.src or equiptest.src
have it do a quick check for the "newbieitem" property...
if ( "newbieitem" property exists )
....if (currentcharacter.serial != newbiesavedserial)
........Destroy the item.
....endif
....elseif ( currentcharacter.serial == newbiesavedserial)
..........if ( "newbieitem" property system time != currentcharacter property "creation date" )
...............Destroy the item
..........endif
....endif
endif
You could expand on the concept with time delays etc ...
The equip and equiptest ( would be for equipment ) for gold or items that you dont equip maybe in the can insert script....
Just an idea...
Put a property on all the items created in the beginning for a newcharacter...
Like a player serial number and maybe a date of creation...
You would also want to put a property on the player with the same date of creation
var systemtime := time right now
var newbiearray := { newcharacter.serial, systemtime }
SetObjProperty(newbieItem, "newbieitem", newbiearray)
SetObjProperty(newcharacter, "creationdate", systemtime);
Then, in the equip.src or equiptest.src
have it do a quick check for the "newbieitem" property...
if ( "newbieitem" property exists )
....if (currentcharacter.serial != newbiesavedserial)
........Destroy the item.
....endif
....elseif ( currentcharacter.serial == newbiesavedserial)
..........if ( "newbieitem" property system time != currentcharacter property "creation date" )
...............Destroy the item
..........endif
....endif
endif
You could expand on the concept with time delays etc ...
The equip and equiptest ( would be for equipment ) for gold or items that you dont equip maybe in the can insert script....
Just an idea...
-
- Grandmaster Poster
- Posts: 136
- Joined: Thu Feb 02, 2006 7:29 am
- Location: Livorno, Italy
- Contact:
Re: Allow /Disallow new character
In our shard, players must wait 2 days before they can re-create a character after deleting one.
It's done by deleting the new char if the timer on the account hasn't passed (oncreate.ecl)
(I know.. orrible english, sorry)
It's done by deleting the new char if the timer on the account hasn't passed (oncreate.ecl)
(I know.. orrible english, sorry)
Re: Allow /Disallow new character
the only mistake I saw was the "orrible" >_<Gnafu wrote: (I know.. orrible english, sorry)
but mine isn't good too
Re: Allow /Disallow new character
Now I have a slightly more interesting thing...
We are allowing more than one character per account but only after they achieve a certain point in the game. So.... Gnafu's idea is now of interest.
Since we don't have CanCreate (looks at MuadDib), is it really feasible to have OnCreate have a line that deletes the character itself? I would expect that to cause a bit of havoc!
We are allowing more than one character per account but only after they achieve a certain point in the game. So.... Gnafu's idea is now of interest.
Since we don't have CanCreate (looks at MuadDib), is it really feasible to have OnCreate have a line that deletes the character itself? I would expect that to cause a bit of havoc!
-
- Grandmaster Poster
- Posts: 136
- Joined: Thu Feb 02, 2006 7:29 am
- Location: Livorno, Italy
- Contact:
Re: Allow /Disallow new character
I know what you say, I had some trouble deletting a npc within it's own script.
The character deletion is done in this way:
The "deletechar" script it's an utility for deletting chars on a given account, it simply does a "acc.DeleteCharacter(idx);" after some logging and checking. I think that after a detach() the scripts itself can destroy the char, but I never tried.
The Oncreate script can be modified to set a maximum number of characters an account can have, or to allow the creation only on specific condittions, like you said.
The character deletion is done in this way:
Code: Select all
[... bla bla ... hey, you can't create the char! ]
[ Set some property to the char saying it must be deletted]
detach();
DisconnectClient (who);
sleep (2);
// idx = get the character slot in the account
Start_Script (":uty:deletechar", {acc , idx});
Set_Critical(0);
return;
The Oncreate script can be modified to set a maximum number of characters an account can have, or to allow the creation only on specific condittions, like you said.
Re: Allow /Disallow new character
.... packethooks to check prior to even allowing, and if not, create a reply to disallow so client can move on and back to char selection list (and block 0x0 packet)?
Re: Allow /Disallow new character
CanCreate can be done by packethooks and packet 0x00
but having the client going back to character selection is another thing..
but having the client going back to character selection is another thing..
Re: Allow /Disallow new character
Sorry to up an old thread, but I've just done this:
I've create the packethook, and I can block new characters creation. Now I would like to be able to make the client fallback to some point of the login procedure, and not just hang.
The first problem is that SendPacket() need an online character reference to work.
There's some way around this?
Tomi wrote:CanCreate can be done by packethooks and packet 0x00
but having the client going back to character selection is another thing..
I've create the packethook, and I can block new characters creation. Now I would like to be able to make the client fallback to some point of the login procedure, and not just hang.
The first problem is that SendPacket() need an online character reference to work.
There's some way around this?
Re: Allow /Disallow new character
if you build the core from the latest SVN there is the client objref that you can use to send a packet back with, so now this should be fully possible by packethooks.
Re: Allow /Disallow new character
Ah! Ok.
Another reason to upgrade POL version ASAP.
Thank you!
Another reason to upgrade POL version ASAP.
Thank you!