Global_Functions.txt 1.0 KB

123456789101112131415161718192021222324252627
  1. //============================================================
  2. //===== rAthena Script =======================================
  3. //= Global Functions
  4. //===== Description: =========================================
  5. //= General script functions.
  6. //===== Changelogs: ==========================================
  7. //= 1.0 WoeTETimeStart(X) function check if the woe
  8. // will start in X seconds or less. [Capuche]
  9. //============================================================
  10. // WoeTETimeStart(<seconds>) : return true if the woe te will start in X seconds or less, false otherwise
  11. function script WoeTETimeStart {
  12. .@woe_status = agitcheck3();
  13. .@min_today = gettime(DT_MINUTE);
  14. .@hour_today = gettime(DT_HOUR);
  15. .@day_today = gettime(DT_DAYOFWEEK);
  16. if (getvariableofnpc( getd( ".day_"+ .@day_today ),"woe_TE_contoller" )) {
  17. .@h = getvariableofnpc( getd( ".hour_start_"+ .@hour_today ),"woe_TE_contoller" );
  18. if (.@h > .@hour_today) {
  19. .@time = (60 - .@min_today) *60 + ( .@h - .@hour_today -1 ) *3600;
  20. if (.@time <= getarg(0))
  21. return true;
  22. }
  23. }
  24. return false;
  25. }