Jump to content

evilpuncker

Community Contributors
  • Content Count

    2178
  • Joined

  • Last visited

  • Days Won

    66

Posts posted by evilpuncker


  1. I tried creating a command that will execute different actions on different intervals, and using the command will turn them ON/OFF, but it is just not working, what am I doing wrong?

     

    -	script	test	FAKE_NPC,{
    OnInit:
    	bindatcmd("test", strnpcinfo(NPC_NAME)+"::OnAtcommand", 0, 99);
    	end;
    
    OnAtcommand:
    	atcommand("@test"); // executes the "test" command ON/OFF
    	if (.@on == 1) {
    		.@on = 0;
    		deltimer(strnpcinfo(NPC_NAME_UNIQUE)+"::OnEvent1");
    		deltimer(strnpcinfo(NPC_NAME_UNIQUE)+"::OnEvent2");
    		deltimer(strnpcinfo(NPC_NAME_UNIQUE)+"::OnEvent3");
    		end;
    	} else {
    		.@on = 1;
    		// 1000 = 1 second | 60000 = 1 min | 3600000 = 1 hour
    		addtimer(10000, strnpcinfo(NPC_NAME_UNIQUE)+"::OnEvent1");
    		addtimer(5000, strnpcinfo(NPC_NAME_UNIQUE)+"::OnEvent2");
    		addtimer(300, strnpcinfo(NPC_NAME_UNIQUE)+"::OnEvent3");
    		end;
    	}
    	end;
    
    OnEvent1:
    	if (.@on == 0) {
    		deltimer(strnpcinfo(NPC_NAME_UNIQUE)+"::OnEvent1");
    		end;
    	}
    	// do something X
    	addtimer(10000, strnpcinfo(NPC_NAME_UNIQUE)+"::OnEvent1");
    	end;
    
    OnEvent2:
    	if (.@on == 0) {
    		deltimer(strnpcinfo(NPC_NAME_UNIQUE)+"::OnEvent2");
    		end;
    	}
    	// do something Y
    	addtimer(5000, strnpcinfo(NPC_NAME_UNIQUE)+"::OnEvent2");
    	end;
    
    OnEvent3:
    	if (.@on == 0) {
    		deltimer(strnpcinfo(NPC_NAME_UNIQUE)+"::OnEvent3");
    		end;
    	}
    	// do something Z
    	addtimer(300, strnpcinfo(NPC_NAME_UNIQUE)+"::OnEvent3");
    	end;
    }

     


  2. 10 minutes ago, Waken said:

    Hello there, i'm not an expert but i'm gonna try to help.
    1. About your warning, i got zero errors compiling your plugin in linux so i have no idea why it gives you the warning.
    2. Since now you are using a preHook, you don't need to use **retVal**. This is only used when it's a postHook, because sometimes you want to know the returned value from the original execution (for example... stop your hook if you need it when returning an error).

    Is it your "little version" related to the warning, or there's more code somewhere?

     

    thanks! the "full" code is here on this paste (its missing the showScript part thought)

     

    so I can just remove these three lines? since now the code is using preHook

    if (!mannersize || pc_has_permission(*sd, bypass_chat_filter) || !pc->can_talk(*sd))
    //return retVal;
    return true;

     

    yeah I forgot to say my OS is windows, this is the warning:

    Wkgq4pg.png

     

    when I click the warning it sends the cursor directly to the *sd part


  3. Hello everyone! thanks for stopping by. I have zero source/programing knowledge but I was able to make this code to work (yes, it works), but there are two things bothering me:

     

    1. the clif->ShowScript part works but its throw a warning when compiling
      the warning is: 
      Quote

      warning C4133: 'function': incompatible types - from 'map_session_data *' to 'block_list *'

    2. the return retVal; that I commented out and changed it to return true;, is it okay? I made these changes to old code following these changes to make the code work on newer hercules

     

    (yes I know I can ignore warnings, but maybe its something really easy that I'm missing and can be fixed)

     

     

    this is the code:

     

    bool filter_chat(struct map_session_data **sd, const char **message_)
    {
    	const char* message = *message_;
    
    	unsigned int i;
    	char output[254]; // Compiler supposed to reuse the pre-allocated space but who knows, those few bytes doesn't worth lowering the speed.
    
    	if (!message)
    		return false;
    
    	if (!mannersize || pc_has_permission(*sd, bypass_chat_filter) || !pc->can_talk(*sd))
    		//return retVal;
    		return true;
    
    	for (i = 0; i < mannersize; ++i) {
    		if (libpcre->exec(mannerlist[i].regex, mannerlist[i].extra, message, (int)strlen(message), 0, 0, NULL, 0) != PCRE_ERROR_NOMATCH) {
    			sprintf(output, "i've been saying bad stuff");
    			clif->messagecolor_self((*sd)->fd, COLOR_RED, output);
    			clif->ShowScript(*sd, "watch out for your mouth", AREA);
    			hookStop();
    			return false;
    		}
    	}
    
    	return true;
    }

     

    its part of this plugin (the lite version)


  4. I was able to make the lite version work, except that I don't know what to return in place of return retVal;... I just changed it to return true but I don't know if its the correct way :D

     

    here is the "working" lite version in case anyone wants! unfortunately, the full version was too complicated for me to try fixing it

     

     

    WARNING: players can bypass it by simply using an uppercase letter, since the check is not case sensitive and the filter doesn't seem to support "/i" to ignore case sensitiveness


  5. something like this:

     

    prontera,150,150,3	script	NPC NAME	1_F_SIGNZISK,{
    	if (strcharinfo(PC_GUILD) != "Guild Name") {
    		mes "Sorry, you are not allowed to talk to me.";
    		close;
    	}
    	// rest of the code that will be executed by the players
    }

     


  6. 3 hours ago, AnnieRuru said:

    Officially, Golden_Bug_Card can defend against Coma effect
    which is bonus bNoMagicDamage,100;

     

    after reading the source code, it seems adding something like Eff_Coma is kinda tough

    but if just adding a bonus to defend against SC_COMA is kinda easier

    https://github.com/AnnieRuru/Release/blob/master/plugins/Request %26 Answer/bComaResist.c

    tested with a Club[3] with add bonus2 bWeaponComaRace,RC_All,10000;

     

    so anyway, if you just want to add another bonus for coma effect, just check with SC_COMA

    still stubborn want to use Eff_Coma ? sry can't help with this

     

    that is perfect! thank you so much


  7. So I was thinking about a mercenary to help new players, but our database is kinda limited on that, they are not really useful as "buffers", they don't even heal, so I was thinking about using the:

     

    Quote

    clone("<map name>", <x>, <y>, "<event>", <char id>{, <master_id>{, <mode>{, <flag>, <duration>}}})

     

    I wanted to use it to copy, for example, one of the following: an acolyte, a priest, a high priest or an archbishop...

    but since the player (support that will be cloned) must exist and be online, I have no idea how to do that...

     

    any ideas?


  8. On 9/25/2020 at 2:09 AM, AnnieRuru said:

    { Id: 1132 AegisName: "Edge" Name: "Edge" Type: "IT_WEAPON" Buy: 20 Weight: 700 Atk: 115 Range: 1 Job: { Swordsman: true Merchant: true Thief: true Knight: true Blacksmith: true Assassin: true Crusader: true Rogue: true Alchemist: true } Loc: "EQP_WEAPON" WeaponLv: 4 EquipLv: 40 Subtype: "W_1HSWORD" Script: <" bonus2 bAddEff,Eff_Curse,30; bonus2 bWeaponComaRace,RC_NonBoss,10; "> },

    
    {
    	Id: 1132
    	AegisName: "Edge"
    	Name: "Edge"
    	Type: "IT_WEAPON"
    	Buy: 20
    	Weight: 700
    	Atk: 115
    	Range: 1
    	Job: {
    		Swordsman: true
    		Merchant: true
    		Thief: true
    		Knight: true
    		Blacksmith: true
    		Assassin: true
    		Crusader: true
    		Rogue: true
    		Alchemist: true
    	}
    	Loc: "EQP_WEAPON"
    	WeaponLv: 4
    	EquipLv: 40
    	Subtype: "W_1HSWORD"
    	Script: <"
    		bonus2 bAddEff,Eff_Curse,30;
    		bonus2 bWeaponComaRace,RC_NonBoss,10;
    	">
    },

    I am scratching my head or did I misunderstood your question ?

    bonus2 bWeaponComaRace,RC_NonBoss,10; sc_start SC_COMA, 1,1;

    
    	bonus2 bWeaponComaRace,RC_NonBoss,10;
    	sc_start SC_COMA, 1,1;

     

     

    sorry annie, I completely forgot this topic and didn't got a notification either!

     

    let me try to be a little more clear:

    - right now we can only use the coma effect by using the bWeaponComaRace and nothing else. (or no?!)

     

    what I want to achieve is to be able to have a "custom" Eff_Coma instead of the bWeaponComaRace

    so I could make use of the useful bonuses bAddEff, bResEff, bAddEffOnSkill, bAddEff2, bAddEffWhenHit and etc

     

     

    right now we only have these:

    ### Status effects
    
    - `Eff_Stone`: 0
    - `Eff_Freeze`: 1
    - `Eff_Stun`: 2
    - `Eff_Sleep`: 3
    - `Eff_Poison`: 4
    - `Eff_Curse`: 5
    - `Eff_Silence`: 6
    - `Eff_Confusion`: 7
    - `Eff_Blind`: 8
    - `Eff_Bleeding`: 9
    - `Eff_DPoison`: 10
    - `Eff_Fear`: 11
    - `Eff_Cold`: 12
    - `Eff_Burning`: 13
    - `Eff_Deepsleep`: 14

     


  9. On 10/23/2020 at 4:06 PM, AnnieRuru said:

    2.0 - script

    - completely revamp the formula, now each bodystyle can have its own cloth color range

     

    and you dummy baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka baka

    WOW, just WOW 😮 this is splendid!!!


  10. there is no need to use SQL, a simple vip system will do the trick, like this one (found via google):

     

    vip system by brianL from eAthena:

    ticks = how long their VIP will last, in seconds.

     

    // usage: callfunc "F_VIPstart", <ticks>;
    function script F_VIPstart {
    set .@ticks, getarg(0); // getarg(0) = ticks (seconds)
    if (.@ticks <= 0) {
    debugmes "F_VIPstart - tried to set a timer in the past";
    end;
    }
    // set a variable, #VIP_expire, as the Unixtime when this expires
    set #VIP_expire, gettimetick(2) + .@ticks;
    // add a timer with that tick (in case they stay logged in that long)
    if (.@ticks < 2147483) { // prevent overflow error
    addtimer .@ticks *1000, "vip_rental::OnVIPend";
    } else {
    addtimer 2147483, "vip_rental::OnVIPcheck";
    }
    // change them to GM level 1
    atcommand "@adjgroup 1 "+strcharinfo(0);
    dispbottom "You now have access to VIP commands!";
    return;
    }
    
    - script vip_rental -1,{
    OnPCLoginEvent:
    if (#VIP_expire > gettimetick(2)) {
    // timer in future
    dispbottom "VIP Rental : expires in " + callfunc("Time2Str",#VIP_expire);
    atcommand "@adjgroup 1 "+strcharinfo(0);
    }
    OnVIPcheck:
    if (#VIP_expire > gettimetick(2)) {
    if ((#VIP_expire - gettimetick(2)) < 2147483) { // prevent overflow error
    addtimer (#VIP_expire - gettimetick(2)) *1000, strnpcinfo(3)+"::OnVIPend";
    } else {
    addtimer 2147483, strnpcinfo(3)+"::OnVIPcheck";
    }
    } else if (#VIP_expire) {
    // timer already expired
    doevent strnpcinfo(3)+"::OnVIPend";
    }
    end;
    
    OnVIPend:
    // change them to GM level 0
    atcommand "@adjgroup 0 "+strcharinfo(0);
    set #VIP_expire, 0; // clear timer
    dispbottom "Your VIP Rental has expired.";
    end;
    }

     


  11. On 10/16/2020 at 3:31 AM, AnnieRuru said:

    so you guys make a new custom body style for that job but don't have enough cloth color to match it ?

    where can I download those things then ?

     

    I didn't made a custom one, I just copied the soul reaper and star gladiator new jobs to the costume folder to make my players be able to change into them until hercules implement them (I can dream, right? 😀)

     

    5xNE65U.png

    that is why I asked that time to make the body style option show for them too

     

     

    (my body palette issue I explained here)

×
×
  • Create New...

Important Information

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