Poison not working

Need help with your JScripts? Got questions concerning the DFNs? Come forward, step inside :)
Post Reply
psychozen
UOX3 Newbie
Posts: 7
Joined: Sun Jul 15, 2007 5:53 am
Has thanked: 0
Been thanked: 0

Poison not working

Post by psychozen »

Can someone tell me why when my toon drinks any of the poison potions it does not poison him also when poison is applied to a weapon the weapon never poisons the target? This is non admin or gm characters
I am talking about regular toons


And if anyone could help me out with a website that has js script that is compatble with uox cause sphere has all the script for just about everything but not sure if it compatible with uox


Thanks a head of time

ALso I would run sphere but for some reason I can never get the internet part of it working and this community seems more friendly then the sphere community
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

Hello psychozen, and welcome to the UOX3 forums =)

Your characters do not get poisoned because there's a bug in the potion.js file (uox3/js/item/potion.js). There's a fix coming for the next version, but if you want to fix it yourself, open potion.js in a text-editor, and locate the section that looks like this:

Code: Select all

			case 6:		// Poison Potion
				if( pUser.poison < iUsed.morez )
					[color=red]pUser.poison = iUsed.morez;
				
				pUser.SetTimer( 5, (180*1000) );	// Poison Wearoff Timer[/color]
				pUser.SoundEffect( 0x0246, true );
				socket.SysMessage( GetDictionaryEntry( 1352, socket.Language ) ); //You poisoned yourself! *sigh*
				break;
then change it to look like this:

Code: Select all

			case 6:		// Poison Potion
				if( pUser.poison < iUsed.morez )
					[color=red]pUser.SetPoisoned( iUsed.morez, 180*1000 );[/color]
								
				pUser.SoundEffect( 0x0246, true );
				socket.SysMessage( GetDictionaryEntry( 1352, socket.Language ) ); //You poisoned yourself! *sigh*
				break;
Note that the poisons will last for 3 minutes or until they're cured. If you want to change the duration, change 180 from the script to a different value. It's in seconds, multiplied with 1000 to get milliseconds.

I am not sure why poisoned weapons do not apply their posion to targets in combat though.

As for sphere-scripts, they are all incompatible with UOX3 as they are written in a different scripting-language. Some scripts may be possible to convert to JS-script though.
-= Ho Eyo He Hum =-
psychozen
UOX3 Newbie
Posts: 7
Joined: Sun Jul 15, 2007 5:53 am
Has thanked: 0
Been thanked: 0

Post by psychozen »

Thanks a ton I am having alot fun with this and I am learnign alot I figuring outmost things and will try to keep the noob questions to a minimim.
psychozen
UOX3 Newbie
Posts: 7
Joined: Sun Jul 15, 2007 5:53 am
Has thanked: 0
Been thanked: 0

Post by psychozen »

ok that works for the poison when drinked

on the weapon that are poisoned that are not poisoning they are going to the corret poison level just not ever doing the effect any place where i can exactly check that part of the code out?

if i set players poison level to 4 they will poison the mob even if the weapon has no poison on them but i don't want to flag everyone with poison like that cause i would assume it would never wear off like that.


also you mentioned about another release will that include script for pally necro and what not

when the next release due out?
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

The poison-setting for characters is there to be used by monsters with poisoning-abilities, like spiders, scorpions and the like. Though it apparently also works for player-characters, it is a permanent setting and does not wear off.

By browsing through the source-code it appears to me that there is actually no code for applying poison from weapons to targets in combat, only for poisonous creatures to poison their targets, like mentioned above.

The actual poisoning of weapons work, and the correct level of poison is applied to the weapon, but there is apparently no code that actually makes us of it! I will post this as a bug in the bug-forum, hopefully one of the resident code-wizards can cook something up.

There is currently no ETA on the next actual release, though grimson has been keeping the experimental UOX3 builds up-to-date with the CVS, so I'd download that one if you haven't already, as it contains all the updates and fixes since the previous release.
-= Ho Eyo He Hum =-
Post Reply