Jump to content

Derceto

Members
  • Posts

    43
  • Joined

  • Last visited

Everything posted by Derceto

  1. I hope you know that any player can kill your server with this script.
  2. What did you want it to display in the first place?
  3. More like, it was a null reference exception (dereferencing a null pointer). (sd->gmlevel == 1) is same as (*sd).gmlevel; in this case, if (sd == null), you're doing a forbidden operation (*null) The expression (sd && sd->gmlevel ==1) is true only when both statements "sd" and "sd->gmlevel==1" are true, so when program encounters "sd" being false (sd == null) it stops reading the expression and gets it as false, thus not doing the *null operation in the next part of expression. Hope I'm clear enough.
  4. //===== Hourly Points Script ========================================= //===== By: ========================================================== //= nostafu //===== Current Version: ============================================= //= 1.3 //===== Compatible With: ============================================= //= Any eAthena Version //===== Description: ================================================= //= Get Points every successful hours of gameplay, you cannot get //= the points even if you miss a second or a minute. A player will //= get a very big bonus if they played 12 hours consecutively //= or without logging out of the game. If the player is vending //= the script will then stop. //==================================================================== - script hourlypoints -1,{ //--Start of the Script OnPCLoginEvent: attachnpctimer ""+strcharinfo(0)+""; initnpctimer; end; OnTimer30000: //Check if Vending (normal or @at) if(checkvending() >= 1 || checkchatting() == 1) { dispbottom "The hourly points event stopped because you were vending / chatting. Please relog if you wish to start again."; stopnpctimer; end; } //Check if Idle getmapxy( .@map$, .@x, .@y, 0 ); if(@map$ == .@map$ && @x == .@x && @y == .@y) { //================================================================= if(@map$ == "some_map" || @map$ == "some_other_map" || @map$ == "some_yet_another_map") // (...) set @afk, @afk + 1; //================================================================= } //If move timer resets else { set @afk, 0; } set @map$, .@map$; set @x, .@x; set @y, .@y; //Idle Check for 5 Minutes if(@afk == 10) { dispbottom "The hourly points event stopped because you were idle for 5 minutes. Please relog if you wish to start again."; stopnpctimer; end; } end; OnTimer60000: set @minute, @minute + 1; //Check for 1 Minute if(@minute == 60){ set @minute,0; set .@point_amt, 1; //Points to get every hour (default: 10) set #KAFRAPOINTS, #KAFRAPOINTS + .@point_amt; dispbottom "You received "+.@point_amt+" Kafrapoints by staying ingame for 1 hour"; dispbottom "Current Balance = "+#KAFRAPOINTS+" Kafrapoints"; set @consecutive_hour, @consecutive_hour + 1; } //Check for 12 hours consecutive if(@consecutive_hour == 12) { set @consecutive_hour,0; set .@cpoint_amt, 10; //Points to get for 12 Consecutive hours (default: 50) set #KAFRAPOINTS, #KAFRAPOINTS + .@cpoint_amt; dispbottom "You receive "+.@cpoint_amt+" Kafrapoints in playing for 12 consecutive hours"; dispbottom "Current Balance = "+#KAFRAPOINTS+" Kafrapoints"; } stopnpctimer; initnpctimer; end; } //--End of the Script
  5. Or Rather, make "OnPCLoadMapEvent" that checks for a GM level and current location. If current map is the map you want restricted and GM's level is less than 99 warp to savepoint.
  6. Check your battle.h for its declaration: // eAthena additions int night_at_start; // added by [Yor] int day_duration; // added by [Yor] int night_duration; // added by [Yor] int ban_hack_trade; // added by [Yor] int hack_info_GM_level; // added by [Yor] int any_warp_GM_min_level; // added by [Yor] <<< here it is int packet_ver_flag; // added by [Yor] More context: and this line in battle.c for assignment. { "any_warp_GM_min_level", &battle_config.any_warp_GM_min_level, 20, 0, 100, },
  7. If anyone's interested, here.
  8. Was just suggesting where you can get some client files from.
  9. Declare the function prototypes as static.
  10. md.damage = (int)((int64)7*tstatus->vit*sstatus->int_*sstatus->int_ / (10*(tstatus->vit+sstatus->int_))); That's the formula you have. If you just want to nerf the damage, you can divide it by 2 whatnot. If you mean that damage gets too high and it goes into healing, then it's already fixed below: if (md.damage < 0 || md.damage > INT_MAX>>1) //Overflow prevention, will anyone whine if I cap it to a few billion? //Not capped to INT_MAX to give some room for further damage increase. md.damage = INT_MAX>>1; break; Instead of INT_MAX/2 you can limit the whole thing to a different cap, like 123456 damage: if (md.damage < 0 || md.damage > 123456) //Overflow prevention, will anyone whine if I cap it to a few billion? //Not capped to INT_MAX to give some room for further damage increase. md.damage = 123456; break;
  11. It's implemented on russian official though.
  12. I only noticed it at one server where it didn't show anything at all, but worked same as the original one (So the task was a little harder - go through an INVISIBLE bridge that changes.) I don't seem to have any problems with it, though.
  13. - You don't have "Job_change" function in this script, apparently. You probably removed it while editing the "other" script. - On a side note, you can safely remove the "variable sets" in the bottom of the script - On a side note, the NPC can be freely abused by trying to change and saying "No" to "Do you really want to change?" (You can get infinite amount of the items from 'getitem' there.) "Can't level past 99 even though I'm a third job" is not related to this script.
  14. //===== Hourly Points Script ========================================= //===== By: ========================================================== //= nostafu //===== Current Version: ============================================= //= 1.3 //===== Compatible With: ============================================= //= Any eAthena Version //===== Description: ================================================= //= Get Points every successful hours of gameplay, you cannot get //= the points even if you miss a second or a minute. A player will //= get a very big bonus if they played 12 hours consecutively //= or without logging out of the game. If the player is vending //= the script will then stop. //==================================================================== - script hourlypoints -1,{ //--Start of the Script OnPCLoginEvent: attachnpctimer ""+strcharinfo(0)+""; initnpctimer; end; OnTimer60000: set @minute, @minute + 1; //Check for 1 Minute if(@minute == 60){ set @minute,0; set .@point_amt, 1; //Points to get every hour (default: 10) set #KAFRAPOINTS, #KAFRAPOINTS + .@point_amt; dispbottom "You received "+.@point_amt+" Kafrapoints by staying ingame for 1 hour"; dispbottom "Current Balance = "+#KAFRAPOINTS+" Kafrapoints"; set @consecutive_hour, @consecutive_hour + 1; } //Check for 12 hours consecutive if(@consecutive_hour == 12) { set @consecutive_hour,0; set .@cpoint_amt, 10; //Points to get for 12 Consecutive hours (default: 50) set #KAFRAPOINTS, #KAFRAPOINTS + .@cpoint_amt; dispbottom "You receive "+.@cpoint_amt+" Kafrapoints in playing for 12 consecutive hours"; dispbottom "Current Balance = "+#KAFRAPOINTS+" Kafrapoints"; } stopnpctimer; initnpctimer; end; } //--End of the Script
  15. 1. set .@duration, 10; set .@delay, 1000; set .@timeToEnd, gettimetick(2) + while (gettimetick(2)<.@timeToEnd) { specialeffect whatever; sleep2 .@delay; } 2. set .working, 1; set .@delay, 1000; initnpctimer; while (.working) { specialeffect whatever; sleep2 .@delay; } end; OnTimer[something]: .working = 0; end; Needless to mention the 1) is much better, but you can choose the one is more convenient for you.
×
×
  • Create New...