Jump to content

Ninja

Members
  • Posts

    513
  • Joined

  • Last visited

  • Days Won

    5

Community Answers

  1. Ninja's post in Priest Soul Link was marked as the answer   
    I think you'd rather put it in status.c instead of skill.c. This is because script.c BUILDIN(sc_start) directly accesses status.c's status_change_start() instead of skill.c's skill_castend_nodamage_id(). So you'll never achieve it if using your current implementation.
    hence:
    status.c
    status_change_start
    case SC_SPIRIT: //1st Transcendent Spirit works similar to Marionette Control if(sd && val2 == SL_HIGH) { int stat,max_stat; struct status_data *status2 = status_get_base_status(bl); val3 = 0; val4 = 0; max_stat = (status_get_lv(bl)-10<50)?status_get_lv(bl)-10:50; stat = max(0, max_stat - status2->str); val3 |= cap_value(stat,0,0xFF)<<16; stat = max(0, max_stat - status2->agi ); val3 |= cap_value(stat,0,0xFF)<<8; stat = max(0, max_stat - status2->vit ); val3 |= cap_value(stat,0,0xFF); stat = max(0, max_stat - status2->int_); val4 |= cap_value(stat,0,0xFF)<<16; stat = max(0, max_stat - status2->dex ); val4 |= cap_value(stat,0,0xFF)<<8; stat = max(0, max_stat - status2->luk ); val4 |= cap_value(stat,0,0xFF); } if (sd && val2 == SL_PRIEST) { int skill_id = val2; int skill_lv = val1; clif_skill_nodamage(src, bl, skill_id, skill_lv, sc_start4(src, bl, SC_REFLECTSHIELD, 100, 7, skill_id, 0, 0, skill_get_time(skill_id, skill_lv))); } break;  
    I noticed that you are still using ".c" which means you're not using the latest rA. I've tested this in latest rA and might not work for you. Try it nonetheless.
  2. Ninja's post in Status Bug (Freeze, Stun,Stone, etc) was marked as the answer   
    Your code would only work IF AND ONLY IF the target has EXACTLY 300 luk. trying using >= instead of ==, also you have to add a check if the target is a player, else, any target, may it be a mob or a player will not be frozen if it has more than or equal to 300 luk.
    case SC_FREEZE: if (bl->type == BL_PC && status->luk >= 300) return 0; sc_def = status->mdef*100; sc_def2 = status->luk*10 + status_get_lv(bl)*10 - status_get_lv(src)*10; tick_def2 = status->luk*10 + status_src->luk*-10; // Caster can increase final duration with luk break;  
  3. Ninja's post in Extrem lags when mobbing was marked as the answer   
    I suggest that this be reported in the issues section of github for investigation
  4. Ninja's post in time left of VIP status was marked as the answer   
    ////////////////////////////////////////////////////////////////////////////////// // Returns time remaining in a readable format. // The argument is subtracted from UNIX epoch time, or 'gettimetick(2)'. // -- callfunc "Time2Str",<tick in UNIX epoch time> // Example: // // Displays "Time left: 1 day, 1 hour, 8 minutes, 20 seconds" // set .@Timer, gettimetick(2) + 90500; // mes "Time left: " + callfunc("Time2Str",.@Timer); //////////////////////////////////////////////////////////////////////////////////  
  5. Ninja's post in Timer that continues when player relogs. was marked as the answer   
    I think a better way to handle this is to add a player variable that holds a timestamp when he last finished a quest you've made.
    example:
    OnQuestFinish: set CustomQuestTimeStamp, gettimetick(2); end; OnQuestCheck: set @TimeDelay, gettimetick(2) - CustomQuestTimeStamp; if (@TimeDelay < (.TimeBeforeAplayerCanDoThisQuestAgain)) mes "Sorry you can't do this quest right now. Please come back later."; close; else { //... quest stuff here } end; OnInit: set .TimeBeforeAplayerCanDoThisQuestAgain, 1 * 86400; //60 secs/min * 60 mins/hr * 24 hrs/day * how many days you want end;  
  6. Ninja's post in Change Damage Cart Termination and Acid Demostration was marked as the answer   
    battle.c :: battle_calc_attack_skill_ratio
    case WS_CARTTERMINATION: i = 10 * (16 - skill_lv); if (i < 1) i = 1; //Preserve damage ratio when max cart weight is changed. if (sd && sd->cart_weight) skillratio += sd->cart_weight / i * 80000 / battle_config.max_cart_weight - 100; else if (!sd) skillratio += 80000 / i - 100; break;  
  7. Ninja's post in Help whosell was marked as the answer   
    Just found out about this "Catalog" feature that RO has and is already supported in rAthena.
    It can open the store that's selling the item right then and there.
    http://www.playragnarok.com/news/updatedetail.aspx?id=183
    in the source they are outlined as 
    /// Search Store System void clif_search_store_info_ack(struct map_session_data* sd); void clif_search_store_info_failed(struct map_session_data* sd, unsigned char reason); void clif_open_search_store_info(struct map_session_data* sd); void clif_search_store_info_click_ack(struct map_session_data* sd, short x, short y); in the script commands
    *searchstores <uses>,<effect>; Invokes the store search window, which allows to search for both vending and buying stores. Parameter uses indicates, how many searches can be started, before the window has to be reopened. Effect value affects, what happens, when a result item is double-clicked and can be one of the following: 0 = Shows the store's position on the mini-map and highlights the shop sign with yellow color, when the store is on same map as the invoking player. 1 = Directly opens the shop, regardless of distance. Example: // Item Universal_Catalog_Gold (10 uses, effect: open shop) searchstores 10,1;  
  8. Ninja's post in Syntax Help. Putting together variables to form a string. was marked as the answer   
    Fixed
    char* temp = "{\"q\":\"\"}"; char *mes1 = malloc(strlen(temp) + strlen(mes) + 1); strcpy(mes1, "{\"q\":\""); strcat(mes1, mes); strcat(mes1, "\"}"); ShowInfo("\nMES1: %s\n",mes1); just a preview of what I'm trying to do.


  9. Ninja's post in Make single strip/full strip at close range was marked as the answer   
    Change the item script of wickebine to.
    bonus5 bAutoSpell,"RG_STRIPARMOR",1,50,BF_SHORT,1; BF_SHORT is only for Melee class weapons. If you want to make it work for bows you will have to find a way to check the distance between the player and target.
  10. Ninja's post in Which part of the source handles the damage output of normal attacks? was marked as the answer   
    Okay. Thanks for the input. I decided to give it a try and figured out that it is indeed 
    int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damage *d,int64 damage,uint16 skill_id,uint16 skill_lv) It's actually the final damage calculation of everything (yes, from normal attacks to skills.)
  11. Ninja's post in How to make loading cutin works? was marked as the answer   
    Loading cutins are just images shown one after the other.
    For example, 
    .
    You have to break it frame by frame depending on how smooth you want the animation to look like (more frames, smoother.)
    then you just loop them in. e.g.
    setarray .@ThisLoadingCutin$[0],"LoadingFrame1", "LoadingFrame2", "LoadingFrame3", "LoadingFrame4", "LoadingFrame5"; for (set @j,0; @ < 10; set @j,@j+1){ for (set @i,0; @i < 5; set @i,@i+1) { cutin .@ThisLoadingCutin$[@i], 3; sleep2 1000; } } cutin "", 255;  
  12. Ninja's post in Bragi problem was marked as the answer   
    You should try to check if you compiled your server with  RENEWAL_CAST enabled.
    mmo.h
    /// Renewal cast time /// (disable by commenting the line) /// /// Leave this line to enable renewal casting time algorithms and enable fixed cast bonuses. /// See also default_fixed_castrate in conf/battle/skill.conf for default fixed cast time (default is 20%). /// Cast time is altered be 2 portion, Variable Cast Time (VCT) and Fixed Cast Time (FCT). /// By default FCT is 20% of VCT (some skills aren't) /// - VCT is decreased by DEX * 2 + INT. /// - FCT is NOT reduced by stats, reduced by equips or buffs. /// Example: /// On a skill whos cast time is 10s, only 8s may be reduced. the other 2s are part of a FCT #define RENEWAL_CAST It causes a FCT of 20%VCT. Casting time reduction items only affect VCT in this mode.
    Just comment out the last line to achieve no cast time. 
  13. Ninja's post in change auto woe reward to koe reward was marked as the answer   
    please try this
    //===== Hercules Script =========================================== //= King of Emperium Hill //===== By: ======================================================= //= AnnieRuru //===== Current Version: ========================================== //= 1.1 //===== Compatible With: ========================================== //= hercules 2015-12-19 //===== Description: ============================================== //= defends the emperium in the middle of the map until times up //===== Topic ===================================================== //= http://hercules.ws/board/topic/4495-gvg-king-of-emperium-hill/ //===== Additional Comments: ====================================== //= Finally there is a topic for this ! //================================================================= - script KoE FAKE_NPC,{ OnInit: disablenpc "The King#KoE"; disablenpc "Exit#KoE"; bindatcmd "koe", strnpcinfo(0)+"::OnCommand", 99,100; // Rewards .include_offline = 0; // Include offline guild members? ( 1 = Enabled | 0 = Disabled ) setarray .Items[0],7779,1; // Item Id, Item Amount end; OnCommand: if ( compare( .@atcmd_parameters$, "on" ) ) goto L_Start; else if ( compare( .@atcmd_parameters$, "off" ) ) goto L_End; else { dispbottom "type - '@koe on' to start the event"; dispbottom "type - '@koe off' to end the event"; } end; L_Start: OnClock2015: // everyday 8pm starts if ( .start ) end; gvgon "guild_vs1"; announce "The King of Emperium Hill has begun!", bc_all; .start = true; enablenpc "The King#KoE"; disablenpc "Exit#KoE"; $koegid = 0; donpcevent "::OnRevKoE"; maprespawnguildid "guild_vs1", $koegid, 3; killmonster "guild_vs1", "KoE::OnEmpDead"; monster "guild_vs1",49,49, "EMPERIUM", EMPELIUM, 1, "KoE::OnEmpDead"; end; L_End: OnClock2045: // everyday 8:30pm ends gvgoff "guild_vs1"; announce "The King of Emperium Hill is over!", bc_all; .start = 0; enablenpc "Exit#KoE"; disablenpc "The King#KoE"; killmonster "guild_vs1", "KoE::OnEmpDead"; // maprespawnguildid "guild_vs1", $koegid, 2; // uncomment this line to kick non-owner off the map when event ends query_sql "SELECT `account_id`, `char_id` FROM `guild_member` WHERE `guild_id` = '" + $koegid + "'",.@aid,.@cid; for ( .@i = 0; .@i < getarraysize( .@aid ); .@i++ ) { if ( isloggedin( .@aid[ .@i ], .@cid[ .@i ] ) ) { if ( attachrid( .@aid[ .@i ] ) ) { if ( !checkvending() ) { for ( .@x = 0; .@x < getarraysize( .Items ); .@x+=2 ) getitem .Items[ .@x ], .Items[ .@x + 1 ]; } } } if ( .include_offline ) { for ( .@x = 0; .@x < getarraysize( .Items ); .@x+=2 ) { if ( query_sql( "SELECT `nameid` FROM `inventory` WHERE `char_id` = '" + .@cid[ .@i ] + "' AND `nameid` = '" +.Items[ .@x ]+ "'" ) ) query_sql "UPDATE `inventory` SET `amount` = `amount` + " + .Items[ .@x + 1 ] + " WHERE `char_id` = '" + .@cid[ .@i ] + "' AND `nameid` = '" +.Items[ .@x ]+ "'"; else query_sql "INSERT INTO `inventory` ( `char_id`, `nameid`, `amount`, `identify` ) VALUES ( '" +.@cid[ .@i ]+ "' , '" +.Items[ .@x ]+ "', '" +.Items[ .@x + 1 ]+ "', '1')"; } } } end; OnEmpDead: $koegid = getcharid(2); announce "The current King of Emperium Hill is the ["+ strcharinfo(2) +"] guild.", bc_all; donpcevent "::OnRevKoE"; maprespawnguildid "guild_vs1", $koegid, 2; killmonster "guild_vs1", "KoE::OnEmpDead"; sleep 500; if ( .start ) monster "guild_vs1",49,49, "EMPERIUM", EMPELIUM, 1, "KoE::OnEmpDead"; end; } // KoE Entrance doubrius,86,112,4 script The King#KoE 4_M_CHNGENERL,{ mes "[The King]"; if ( !getcharid(2) ) { mes "You must have a guild to participate in the ^FF0000King of Emperium Hill Tournament^000000."; close; } mes "Hello."; mes "Would you like to participate in the ^FF0000King of Emperium Hill Tournament^000000?"; if ( select ( "Yes", "No" ) == 2 ) close; if ( !getvariableofnpc( .start, "KoE" ) ) close; switch( rand(1,4) ){ case 1: warp "guild_vs1", 50, 88; end; case 2: warp "guild_vs1", 88, 50; end; case 3: warp "guild_vs1", 50, 11; end; case 4: warp "guild_vs1", 11, 50; end; } } // KoE Exit guild_vs1,49,56,5 script Exit#KoE 1_M_BARD,{ mes "[Exit]"; mes "See ya."; if ( getcharid(2) == $koegid ) getitem 20032,2; getitem 14232,3; getitem 20033,1; getitem 20034,3; getitem 7227,10; // configure prize here close2; warp "Save",0,0; end; } // Flags doubrius,77,108,5 script King of Emperium Hill#1::koe_flag GUILD_FLAG,{ if ( !$koegid ) end; mes "[King of Emperium Hill]"; mes "The Current King of Emperium Hill is the ["+ getguildname($koegid) +"] guild."; close; //OnInit: // Uncomment this line to make the emblem stay after @reloadscript OnRevKoE: flagemblem $koegid; end; } guild_vs1,61,49,6 duplicate(koe_flag) King of Emperium Hill#2 GUILD_FLAG guild_vs1,38,49,2 duplicate(koe_flag) King of Emperium Hill#3 GUILD_FLAG guild_vs1,49,61,0 duplicate(koe_flag) King of Emperium Hill#4 GUILD_FLAG guild_vs1 mapflag nobranch guild_vs1 mapflag nomemo guild_vs1 mapflag nopenalty guild_vs1 mapflag noreturn guild_vs1 mapflag nosave SavePoint guild_vs1 mapflag noteleport guild_vs1 mapflag gvg_noparty guild_vs1 mapflag nowarp guild_vs1 mapflag nowarpto guild_vs1 mapflag guildlock
  14. Ninja's post in Server status and Online player for wordpress web theme was marked as the answer   
    You need to do an sql query from your web to your server. Try this one.
    <?php
    $ServerIP = "1.1.1.1";
    $DBName = "RagnarokDB";
    $DBTable = "login";
    $DBUser = "SQLUsername";
    $DBPass = "SQLPassword";
    $query = 'SELECT COUNT(`char_id`) FROM `char` WHERE `online` = 1';
    $connection = mysql_connect($servername, $username, $password);
    $db_selected = mysql_select_db($dbname, $connection);
    if(!mysql_query( $query ,$connection))
    {
    echo "Failed to do SQL query. Please check your settings.";
    } else {
    echo "Online Players: ". $query;
    }
    ?>

  15. Ninja's post in How to install github in centos 6.5? was marked as the answer   
    you only need to issue
    yum install git*
  16. Ninja's post in [FluxCP] How to require a user to login first before seeing a page was marked as the answer   
    Thanks man, I snooped around some php files and found this:
     
    $this->loginRequired();   solved my problem
  17. Ninja's post in one at a time was marked as the answer   
    Try this.

    prontera,154,178,4 script Hati 835,{ if(.CanTalk == 0) { set .CanTalk,1; mes "hello, world!"; close2; set .CanTalk,0; end; } else { mes "I'm talking to someone, please back in a moment"; end; } while (.CanTalk == 1) { specialeffect EF_BEGINSPELL6; sleep 425; } end; OnInit: set .CanTalk,1; end; }
  18. Ninja's post in I have some question about server installation was marked as the answer   
    Try looking at this model:

     
    basically the idea is to maintain only 1 database and naming char servers as "channels" (aka EU Channel, US E Channel, etc.) 
    then have the PVP channel somewhere geographically in the middle of everyone.
     
    //edit
    the pvp channel also uses the same sql database and you can just limit the maps loaded there to your pvp maps.
  19. Ninja's post in cap asura strike sp damage was marked as the answer   
    case MO_EXTREMITYFIST: if(sstatus->sp <= 7000) skillratio += 100 * (7 + sstatus->sp / 10); else skillratio += 100 * (7 + 7000 / 10); skillratio = min(500000,skillratio); //We stop at roughly 50k SP for overflow protection break; You can also comment out the last skill ratio statement because you have already set the max sp in the computation
×
×
  • Create New...