Jump to content

meko

Core Developers
  • Content Count

    363
  • Joined

  • Days Won

    46

Posts posted by meko


  1. You could add to the mob database a new pacific monster (one that does not attack if not provoked) and give it Assist mode. Then you would spawn a few of those in the map with the monster() command (to get the GID) and use unitattack() to force them to attack non-guild members. And since they would have Assist, every nearby mob would join the fray and attack too.


  2. Hercules currently doesn't trigger events when a mob is hit by an attack, only on-death events. Although I think there's a plugin that has OnNPCAttacked or something like that, but triggering an event on every hit would badly affect performance... A workaround could be to spawn a mob with the monster() command, retrieve its ID and then setting a npc timer that checks every second the UDT_HP of the monster and if (HP <= (MaxHP / 2)) you use unitwalk on it. The NPC should also check the death event in case an attack is powerful enough to kill it


  3. 19 minutes ago, Legend said:

     

    @Disgaea

    Replace

    
    .request_item = Apple;

    .to

    
    .request_item = 512;

     

    Hercules should automatically generate constants based on the AegisName of items in your database. If Apple evaluates to 0 it means you are either using a very old version of Hercules, or you don't have an item named Apple in your item db

     

    13 minutes ago, Disgaea said:

    wow dude it worked thx <3, only 1 question more to finish, when I say in the beginning "no" he dont say nothing, its blank, it stay like this @Legend

     

    ssssssssssssssssssssssssssssssss.png

    Simply add a mes("your message here") before the close; that is above the OnInit


  4. That's just two missing next() statements...

     

    Here you go:

    einbroch,55,200,4	script	Herald	123,{
    
    	if (#onetimeitem) {
    		mes("I hope you like your reward.");
    		close;
    	}
    
    	mes("Hello youngster.");
    	mex("Want to know a secret?");
    	next();
    
    	if (select("Yes", "No") == 1) {
    		mes("[Herald]");
    		mes("You made the right choice.");
    		mes("Do you know that the toughest material in Rune Midgard is called Mithril?");
    		mes("The best part is, I know how to get it.");
    		next();
    		mes("If you're willing to prove me you can handle a tough excursion, I'll direct you to my friend, and from that moment on, you're his problem.");
    		mes("Will you do it?");
    		next();
    
    		do {
    			if (select("Yes I will do it!", "Wait, what's the material for?") == 1) {
    				mes("[Herald]");
    				mes("Outstanding!");
    				mesf("I will need you to collect %i pieces of %s, an excellent mineral from Bradium Golems in Manuk Fields.", .request_amount, getitemname(.request_item));
    				mes("Bring me these, and I will give you something so that my friend grants you passage to the mines.");
    				next();
    				mes("So, do you have the items?");
    				next();
    
    				switch(select("Yes, Here They are", "No")) {
    				case 1:
    					if (countitem(.request_item) < .request_amount) {
    						mes("[Herald]");
    						mes("Don't make me regret this.");
    						mesf("Bring me the damn %s!", getitemname(.request_item));
    						close;
    					}
    
    					mes("[Herald]");
    					mes("Well done, I wasn't thinking you could do it.");
    					mes("But be careful, the place where you'll be headed is very tough.");
    
    					delitem(.request_item, .request_amount);
    					getitembound(.reward_item, .reward_amount, 1);
    					#onetimeitem = 1;
    					break;
    
    				case 2:
    					mes("[Herald]");
    					mes("Let me know when you're done. I will reward you for your efforts.");
    					break;
    				}
    				close;
    
    			} else {
    				mes("[Herald]");
    				mes("I can't properly answer that.");
    				mes("You will have to find someone willing to use it on anything.");
    				mes("But hey, it's the toughest material in Rune-Midgard, it's gotta be useful, right?");
    				next();
    			}
    		} while (true);
    	}
    	close;
    
    
    OnInit:
    
    	// << YOUR CONFIGURATION GOES HERE >>
    	.request_item = Apple;
    	.request_amount = 20;
    
    	.reward_item = Holy_Dagger;
    	.reward_amount = 1;
    	// << END OF CONFIGURATION >>
    }

     

    Make sure to change the items and amounts in OnInit to the items you want


  5. I tried to re-construct your script as best as I could, but it's one of the messiest I have ever seen.

    Here goes:

    einbroch,55,200,4	script	Herald	123,{
    
    	if (#onetimeitem) {
    		mes("I hope you like your reward.");
    		close;
    	}
    
    	mes("Hello youngster. Want to know a secret?");
    	next();
    
    	if (select("Yes:No") == 1) {
    		mes("[Herald]");
    		mes("You made the right choice. Do you know that the toughest material in Rune Midgard is called Mithril? The best part is, I know how to get it.");
    		next();
    		mes("If you're willing to prove me you can handle a tough excursion, I'll direct you to my friend, and from that moment on, you're his problem. Will you do it?");
    		next();
    
    		do {
    			if (select("Yes I will do it!:Wait, what's the material for?") == 1) {
    				mes("[Herald]");
    				mes("Outstanding! I will need you to collect two pieces of Pure Bradium, an excellent mineral from Bradium Golems in Manuk Fields. Bring me these two, and I will give you something so that my friend grants you passage to the mines.");
    				next();
    				mes("So ,do you have the items?");
    				next();
    
    				switch(select("Yes, Here They are:No")) {
    				case 1:
    					mes("[Herald]");
    					mes("Well done, I wasn't thinking you could do it. But be careful, the place where you'll be headed is very tough.");
    
    					if (countitem(512) < 20) {
    						mes("[Herald]");
    						mes("Don't make me regret this. Bring me the damn Bradium!");
    						close;
    					}
    
    					delitem(512, 20);
    					getitembound(1244, 1, 1);
    					#onetimeitem = 1;
    					break;
    
    				case 2:
    					mes("[Herald]");
    					mes("Let me know when you're done. I will reward you for your efforts.");
    					break;
    				}
    				close;
    
    			} else {
    				mes("[Herald]");
    				mes("I can't properly answer that. You will have to find someone willing to use it on anything. But hey, it's the toughest material in Rune-Midgard, it's gotta be useful, right?");
    			}
    		} while (true);
    	}
    }

     


  6. 	// this assumes the target player is online and those variables are filled:
    	// .@char_name$
    	// .@account_id
    	// .Rates
    
    	.@kill_counter = getvariableofpc(KILL_COUNTER, .@account_id);
    	.@cost = .Rates * .@kill_counter;
    
    	mesf("Are you sure you want to bail %s out of jail for %d zeny?", .@char_name$, .@cost);
    	next();
    
    	if (select("Confirm", "Cancel") == 1) {
    		if (Zeny < .@cost) {
    			mes("You didn't have enough Zeny.");
    		} else {
    			Zeny -= .@cost; // remove zeny
    			set(getvariableofpc(KILL_COUNTER, .@account_id), 0); // reset counter to zero
    
    			// {{ ADD YOUR UNJAILING LOGIC HERE }}
    
    			mes("Kabooom!");
    		}
    	}
    	close;
    
    
    
    OnPCKillEvent:
    	if (readparam(BaseLevel, killedrid) < 50) {
    		++KILL_COUNTER; // increase the kill counter
    
    		// {{ ADD YOUR JAILING LOGIC HERE }}
    	}
    	end;

     


  7. 4 minutes ago, MikZ said:

    I also want someone to bail him out , in the event that player is out of zeny.

    That's exactly what my script does, it assumes .@char_name$ and .@account_id are of the player in jail, not the player paying the bail. It checks the kill counter of the other player by using getvariableofpc(). You just need to add your release logic where it says Kaboom, and to add your dialog before the "Are you sure ..."


  8. If you want both punching bags to respawn when one of them is killed, you would add this in OnDummyKill right before you use monster()

    killmonster("rebel_mt", "Punching Bag::OnDummyKill");

     

    If you want only one to respawn you will have to split OnDummyKill into two separate events


  9. You don't need to use SQL at all for this; it can all be done in the script engine:

    	// this assumes the target player is online and those variables are filled:
    	// .@char_name$
    	// .@account_id
    	// .Rates
    
    	mesf("Are you sure you want to bail %s out of jail?", .@char_name$);
    	next();
    
    	if (select("Confirm", "Cancel") == 1) {
    		.@kill_counter = getvariableofpc(KILL_COUNTER, .@account_id);
    		.@cost = .Rates * .@kill_counter;
    
    		if (Zeny < .@cost) {
    			mes("You didn't have enough Zeny.");
    		} else {
    			Zeny -= .@cost;
    			mes("Kabooom!");
    		}
    	}
    	close;
    
    
    
    OnPCKillEvent:
    	if (readparam(BaseLevel, killedrid) < 50) {
    		++KILL_COUNTER;
    	}
    	end;

     


  10. 1 minute ago, Habilis said:

    En fait les checks comem ca ya pas de protocole fonction utiliséé c'est fsockopen

    pas mal standart....

    Yeah that much I know, I meant when using the CP, not checking if it is online. Ie if you need the CP to login to an admin account and send a KICK or BAN packet to map server or use an atcommand


  11. Quand tu vois "Closed connection" ça veut seulement dire qu'un joueur s'est déconnecté de ton serveur de connection (Login), ce qui est normal car le joueur passe de Login à Char puis à Map mais ne maintient pas la connection du server précédent, donc quand il est rendu à Char il se déconnecte de Login.

    Les scripts qui vérifient si ton serveur fonctionne (ON/OFF) se connectent momentannément à login/char/map pour vérifier si le serveur répond, puis se déconnectent aussitôt

    Pour ce qui est de CeresCP je ne l'utilise pas donc je ne peux pas t'aider, mais tu pourrais essayer FluxCP


  12. OnTalkNearby:
    	.@str$ = $@p0$;
    
    	if (.@str$ ~= "your regex here") {
    		// do something
    	} else if (.@str$ ~= "another regex") {
    		// do something else
    	}
    	// etc
    	end;
    
    OnInit:
    	.pid = 1; // regex pattern id
    	defpattern(.pid, "^(.*)$", "OnTalkNearby");
    	activatepset(.pid);

     

×
×
  • Create New...

Important Information

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