Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 06/11/18 in all areas

  1. 1 point
    luizragna

    Custom Unit HP Bar System

    Hello guys, i'm making a custom hp bar system for mob units. The command show the HP of the mob for all players in the map. I am using the cutin command, the problem is that I do not think so many files are necessary. In the case 1 image for each percentage of hp I would like your opnion and help to improve this system and make it lighter. Test yourselves :). HP Bar System: payon,147,229,4 script Test#HPbar 1_F_MARIA,{ if (.HP_Bar == 0) { .HP_Bar = 1; .mobGID = monster ("payon",148,226,"[T] HP Test",POPORING,1,strnpcinfo(0)+"::OnDie"); setunitdata .mobGID,UDT_MAXHP,4000; setunitdata .mobGID,UDT_HP,4000; .@count = getunits(BL_PC, .@units, false, "payon"); for (.@i = 0; .@i < .@count; .@i++) addtimer(0,strnpcinfo(0)+"::OnHPBar", .@units[.@i]); } end; OnDie: .HP_Bar = 0; end; OnHPBar: .U_MAXHP = getunitdata (.mobGID,UDT_MAXHP); while (.HP_Bar != 0) { .U_HP = getunitdata (.mobGID,UDT_HP); .P_HP = (.U_HP*100)/.U_MAXHP; cutin(""+.P_HP+"", 1); sleep2 100; } cutin("0", 1); sleep2 5000; //Delay to hide HP Bar cutin("", 255); end; } Donwload of the data folder files: HP Bar System (2018-06-26).rar
  2. 1 point
    Habilis

    [AutoEvent] Trivia

    Thanks Annie, 1 is not me, it is from way back ... eA days 2 will be redone, I will follow Dastgir`s advice and use an array instead of bit manipulation (will make the script easier to understand for beginners) I Already coded it, need to test it
  3. 1 point
    AnnieRuru

    [AutoEvent] Trivia

    function GetQuestion { return getd(".question_" + (getarg(0) % 128) + "$[" + (getarg(0) / 128) + "]"); } function GetAnswer { return getd(".answer_" + (getarg(0) % 128) + "$[" + (getarg(0) / 128) + "]"); } function GetHint { return getd(".hint_" + (getarg(0) % 128) + "$[" + (getarg(0) / 128) + "]"); } I believe you made it opposite ? assuming that you are still using eathena, when script engine was still 128 elements it should be return getd(".question_" + (getarg(0) / 128) + "$[" + (getarg(0) % 128) + "]"); although there is no need to do like this anymore because our script engine no longer has such limitation 2nd thing is ... L_loop: do set .@i, rand( .numQuestions ); // Randomly picks a fact. while( .Q_session & 1 << .@i && .Q_session && .count < .numQuestions ); set .Q_session, .Q_session | 1 << .@i;// max 32 questions rather than using a loop, can use shuffle algorithm EDIT: for below
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.