Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 351016 - Player Poisoning
Summary: Player Poisoning
Status: CLOSED NOT_ECLIPSE
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: ACTF (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-03 04:04 EDT by bart CLA
Modified: 2023-03-27 14:27 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bart CLA 2011-07-03 04:04:08 EDT
As I tried to add poisoning to a Strykewyrm I noticed there's no poisoning yet.

We need to make this in order to have a perfect server ;)
Comment 1 bart CLA 2011-07-03 04:12:02 EDT
Quote from wikia:

"For instance, if a player is hit by another player wielding a poisoned dagger, they would be hit for 48 damage after 18 seconds (or 30 game ticks), then 46 damage after 18 seconds, then 44, 42, etc., until the damage is reduced to 10 and then the poison would be gone."

Should be enough info to fix that.
Ima try.
Comment 2 bart CLA 2011-07-03 04:40:12 EDT
I think I made it 100%.

Could you test it out if there are any bugs?

CODE:
public boolean canBePoisoned() {
		return canBePoisoned;
	}
	
	public void setCanBePoisoned(boolean bool){
		canBePoisoned = bool;
	}
	
	
	public int poisonDamage = 0;
	public boolean canBePoisoned = true;

	public void poisonPlayer(final int damage){
		if (poisonDamage >= damage)
			return;
		poisonDamage = damage;
		hit(poisonDamage, HitType.POISON_DAMAGE);
		sendMessage("You have been poisoned.");
		ActionSender.sendConfig(this, 102, 1);
		World.getWorld().submit(new Event(18000){
			@Override
			public void run() {
				if (poisonDamage <= 10){
					poisonDamage = 0;
					sendMessage("The effects of poison wore off.");
					ActionSender.sendConfig(getPlayer(), 102, 0);
					stop();
				} else {
					poisonDamage -= 2;
					ActionSender.sendConfig(getPlayer(), 102, 1);
					hit(poisonDamage, HitType.POISON_DAMAGE);
				}				
			}
		});
	}
	
	
	
Just paste somewhere in the Player class.
To call it, just do player.poisonPlayer(int damaga);
Comment 3 bart CLA 2011-07-03 19:26:50 EDT
This works 100% now.
Comment 4 Kentarou Fukuda CLA 2011-09-23 12:09:35 EDT
not for Eclipse