Jump to content
  • 0

Admin Command: Hero For A Limited Time..!


Question

Posted

Hello Maxcheaters!

 

So I need a code that i can make ap layer hero for a limited time or forever..!

for example if i'll use the admin command //makehero forever [target] the player will become hero for ever..!

and if I'll press //makehero 30 [target] the player will become hero for 30 days!

 

I know i need a database table, a code on EnterWorld.java and a code in admincommandhandlers folder... any knowledge on how to create and merge those codes to make this thing i want? :D

Recommended Posts

  • 0
Posted

Which devlin posted still misses sql queries and so. Try this one...

 

http://pastebin.com/FWVTjQi4

 

Should work, u must add the line in MasterHandler.java to load the admincommand and modify your characters table adding customherotime field, at the end.

The command should work like //admin customhero 30   -> 30 or any number (hero days) 0 to make it unlimited or without any number.

  • 0
Posted

Its neither easy nor oh so hard to be made, none is gonna give it to you for free by the way. If you want it send me a pm

  • 0
Posted (edited)

You can add one filed in characters table like "customherotime" (long) then you can create a variable in L2PcInstance with the same name, make it default -1, then you must add that variable in the UPDATE,RESTORE,CREATE character sql methods of L2PcInstance.

 

Finally you create a command that will change the variable value of X player to X time "player.customherotime = 0;" (0 unlimited for example) and your "player.setHero(true);" or whatever it's called in your pack. To make it 30 days limited, instead of making the variable value 0, make it like

player.customherotime = Calendar.getInstance().getTimeInMillis()+2592000000;
Then you must create a check inside EnterWorld.java like

if(player.customherotime == 0 || player.customherotime > Calendar.getInstance().getTimeInMillis())
{
player.setHero(true);
}
else
{
 player.customherotime = -1;
}
If your server is restarting every day u would be fine, if not, u coul create a task every 2-3hours that will check all players online, using the check of enterworld, modified like

if(player.customherotime != 0 && player.customherotime != -1 && player.customherotime < Calendar.getInstance().getTimeInMillis())
{
player.customherotime = -1;
player.setHero(false);
}
Edited by ^Wyatt
  • 0
Posted

without database ? lol

O.o?

You can add one filed in characters table like "customherotime" (long) then you can create a variable in L2PcInstance with the same name, make it default -1, then you must add that variable in the UPDATE,RESTORE,CREATE character sql methods of L2PcInstance.

 
  • 0
Posted

I believe you could use my aio system as a base. Since everything that you ask is done, you just need to midify it a lil bit :P

  • 0
Posted

Its neither easy nor oh so hard to be made, none is gonna give it to you for free by the way. If you want it send me a pm

will you give it me for free? :D

 

 

You can add one filed in characters table like "customherotime" (long) then you can create a variable in L2PcInstance with the same name, make it default -1, then you must add that variable in the UPDATE,RESTORE,CREATE character sql methods of L2PcInstance.

 

Finally you create a command that will change the variable value of X player to X time "player.customherotime = 0;" (0 unlimited for example) and your "player.setHero(true);" or whatever it's called in your pack. To make it 30 days limited, instead of making the variable value 0, make it like

player.customherotime = Calendar.getInstance().getTimeInMillis()+2592000000;
Then you must create a check inside EnterWorld.java like

if(player.customherotime == 0 || player.customherotime > Calendar.getInstance().getTimeInMillis())
{
player.setHero(true);
}
else
{
 player.customherotime = -1;
}
If your server is restarting every day u would be fine, if not, u coul create a task every 2-3hours that will check all players online, using the check of enterworld, modified like

if(player.customherotime != 0 && player.customherotime != -1 && player.customherotime < Calendar.getInstance().getTimeInMillis())
{
player.customherotime = -1;
player.setHero(false);
}

hmm... thank you very much for your help... i will check it if i will not found someone to give it to me! :P

 

 

 

I believe you could use my aio system as a base. Since everything that you ask is done, you just need to midify it a lil bit :P

can you show me the link of this "AIO"? :)

  • 0
Posted (edited)

since i know where you got that idea from and i was dev there for a while i will give you a tip ;)

in l2sexi there are 2 kind of heroes ...
real one and

fake one

 

fake heroes just have the hero aura and the hero skills ;) in addition there are not real heroes ;)

eg. their name will not be listed on olympiad manager...

they are normal player with an aura and the hero skills ;)

 

so you can easily remake one "VIP" system to a "fakehero" system ;)

Edited by NeverMore™
  • 0
Posted

fake heroes just have the hero aura and the hero skills ;) in addition there are not real heroes ;)

eg. their name will not be listed on olympiad manager...

they are normal player with an aura and the hero skills ;)

 

so you can easily remake one "VIP" system to a "fakehero" system ;)

Well that was obvious and we told him that, just setHero(true) to make "fake heros", not a big deal  :rage:

Btw @author I explained u how to do it, practically at all, u could try to do it instead of waiting for someone to give it to you already done  :rage:

  • 0
Posted

thank you my friend..!

 

 

since i know where you got that idea from and i was dev there for a while i will give you a tip ;)

in l2sexi there are 2 kind of heroes ...

real one and

fake one

 

fake heroes just have the hero aura and the hero skills ;) in addition there are not real heroes ;)

eg. their name will not be listed on olympiad manager...

they are normal player with an aura and the hero skills ;)

 

so you can easily remake one "VIP" system to a "fakehero" system ;)

i know that..! but i think ^Wyatt's pack is something like this..!

 

 

Well that was obvious and we told him that, just setHero(true) to make "fake heros", not a big deal  :rage:

Btw @author I explained u how to do it, practically at all, u could try to do it instead of waiting for someone to give it to you already done  :rage:

you are right... i will try to put your code and if i will couldn't, i will check the other shares..!

 

btw thank you all of you.!

  • 0
Posted

Well that was obvious and we told him that, just setHero(true) to make "fake heros", not a big deal  :rage:

Btw @author I explained u how to do it, practically at all, u could try to do it instead of waiting for someone to give it to you already done  :rage:

Didnt read the rest replies at all :P 

  • 0
Posted (edited)

^Wyatt..!

 

am i putting this as a field?

 


player.customherotime = Calendar.getInstance().getTimeInMillis()+2592000000;

 

cause i have error on customherotime (Syntax error on token "customherotime", VariableDeclaratorId expected after this token)

 

edit: i've made it like this:

private long customherotime = Calendar.getInstance().getTimeInMillis()+456;

and i have no errors... is it ok?!

Edited by xXObanXx
Guest
This topic is now closed to further replies.
×
×
  • Create New...