problem with vitals (heavy section, lot of text)

Here you can post threads requesting help on the official POL Ultima Online Emulator Core 097.
Note: Core 097 is no longer officially supported.
Post Reply
phao
Grandmaster Poster
Posts: 129
Joined: Fri Aug 31, 2007 2:25 pm

problem with vitals (heavy section, lot of text)

Post by phao »

The problem was solved, i've asked a guy in IRC chat, the question is here
and i'll post our conversation so if other people have the same question, canjust read, end of post is the conversation

//////////////////////////////////////

well i've fallowed the basic setup for pol097 writen by Kirin ( http://forums.polserver.com/viewtopic.php?t=1178 )

everything was fine, compiled runned, etc.

but i'm doing the all stuff here, like skills and stats, learning how to set them up with the cfg files, and i'm having a problem about setting vitals, you see i have 120 of str and 1 of life. (same if int/mana and dex/stam).

i dont know what files are 'important' to know how to use to solve this 'problem', i'll post the contents of some here, and what i want is to fix it by seting life = str, stam = dex, mana = int;

pol97\pkg\attributes\config\Attributes.cfg

Code: Select all

Attribute Strength
{
	Alias		str
}

Attribute Intelligence
{
	Alias		int
}

Attribute Dexterity
{
	Alias		dex
}

Attribute Alchemy
{
}

Attribute Anatomy
{
    desc anatomy
    Script  :anatomy:anat
    Delay   1
    IntAdv  10 1d1
}

Attribute AnimalLore
{
}

Attribute ItemId
{
}

Attribute ArmsLore
{
    desc    ArmsLore
    Script  :armslore:armsLore
    Delay   1
    IntAdv  10 1d1
}

Attribute Parry
{
}

Attribute Begging
{
}

Attribute Blacksmithy
{
}

Attribute Bowcraft
{
}

Attribute Peacemaking
{
}

Attribute Camping
{
}

Attribute Carpentry
{
}

Attribute Cartography
{
}

Attribute Cooking
{
}

Attribute DetectingHidden
{
	Alias		DetectHidden
}

Attribute Enticiment
{
}

Attribute EvaluatingIntelligence
{
	Alias		EvaluatingInt
	Alias		EvalInt
}

Attribute Healing
{
}

Attribute Fishing
{
}

Attribute ForensicEvaluation
{
	Alias		ForensicEval
	Alias		Forensics
}

Attribute Herding
{
}

Attribute Hiding
{
}

Attribute Provocation
{
}

Attribute Inscription
{
}

Attribute Lockpicking
{
}

Attribute Magery
{
}

Attribute MagicResistance
{
	Alias		MagicResist
	Alias		ResistingSpells
	Alias		Resist
	Alias   ResistSpells
}

Attribute Tactics
{
}

Attribute Snooping
{
}

Attribute Musicianship
{
}

Attribute Poisoning
{
}

Attribute Archery
{
}

Attribute SpiritSpeak
{
}

Attribute Stealing
{
}

Attribute Tailoring
{
}

Attribute AnimalTaming
{
}

Attribute TasteIdentification
{
	Alias		TasteIdent
}

Attribute Tinkering
{
}

Attribute Tracking
{
}

Attribute Veterinary
{
}

Attribute Swordsmanship
{
	Alias		Swords
}

Attribute Macefighting
{
	Alias		Mace
}

Attribute Fencing
{
}

Attribute Wrestling
{
}

Attribute Lumberjacking
{
}

Attribute Mining
{
}

Attribute Meditation
{
}

Attribute Stealth
{
}

Attribute RemoveTrap
{
}
pol97\pkg\attributes\config\uoclient.cfg

Code: Select all

General General
{
	Strength	      Strength
	Intelligence	  Intelligence
	Dexterity	      Dexterity

	Hits		        Life
	Mana		        Mana
	Stamina		      Stamina

	MaxSkillID	    48
}
pol97\pkg\attributes\config\vitals.cfg

Code: Select all

Vital Life
{
	RegenRateFunction	:attributes:hooks/vitalInit:GetLifeRegenRate
	MaximumFunction		:attributes:hooks/vitalInit:GetLifeMaximumValue
}

Vital Mana
{
	RegenRateFunction	:attributes:hooks/vitalInit:GetManaRegenRate
	MaximumFunction		:attributes:hooks/vitalInit:GetManaMaximumValue
}

Vital Stamina
{
	RegenRateFunction	:attributes:hooks/vitalInit:GetStaminaRegenRate
	MaximumFunction		:attributes:hooks/vitalInit:GetStaminaMaximumValue
}
pol97\pkg\attributes\hooks\vitalInit.src

Code: Select all

program Install()
	print("INSTALLING: Exported Vital - RegenRate and MaxValue functions ...");
	return 1;
endprogram

exported function GetLifeRegenRate(mobile)
	return 100;
endfunction

exported function GetLifeMaximumValue(mobile)
	return 100;
endfunction

exported function GetManaRegenRate(mobile)
	return 100;
endfunction

exported function GetManaMaximumValue(mobile)
	return 100;
endfunction

exported function GetStaminaRegenRate(mobile)
	return 100;
endfunction

exported function GetStaminaMaximumValue(mobile)
	return 100;
endfunction

exported function GetHitsRegenRate(mobile)
   return 10000;
endfunction

exported function GetHitsMaximumValue(mobile)
   return 10000;
endfunction 

well if you want to help me and need other files, just ask

//////////////////////////////
conversation:

Code: Select all

[19:46] <phao> if you can read this: http://forums.polserver.com/viewtopic.php?p=9313#9313
[19:55] <decal> look at pol97\pkg\attributes\hooks\vitalInit.src 
[19:56] <decal> you have exported function GetHitsMaximumValue(mobile) 
[19:56] <decal>    return 10000; 
[19:56] <decal> endfunction 
[19:56] <decal> its percent
[19:56] <decal> so
[19:56] <decal> your hits is 10000/100=100
[19:57] <decal> LIFE
[19:57] <decal> exported function GetLifeMaximumValue(mobile) 
[19:57] <decal>    return 100; 
[19:57] <decal> endfunction 
[19:57] <decal> so 100/100=1
[19:59] <phao> Hmm, thank you
[20:00] <phao> thank you a lot
[20:01] <decal> no problem
[20:02] <phao> cant i make something like
[20:02] <phao> hmm forget
[20:02] <phao> :)
[20:04] <phao> decal can you explain me one more thing
[20:04] <phao> ?
[20:04] <phao> i've read in the docs about 
[20:04] <phao> regenrate
[20:05] <phao> and when it's 100, the regen is 1 point for 5 secs, and when its 1200 the regen is 12 points per min.
[20:05] <phao> sorry but for me it makes no sense... can you explain to me how it works?
[20:14] <decal> "when it's 100, the regen is 1 point for 5 secs" that is not true
[20:14] <decal> true is: when it's 1200, the regen is 1 point for 5 secs
[20:15] <decal> regen rates are in hundredths of points per minute
[20:15] <decal> so 100 = 1/min
[20:17] <phao> hmm ok, thank you
Last edited by phao on Fri Aug 31, 2007 3:34 pm, edited 1 time in total.
User avatar
ncrsn
Grandmaster Poster
Posts: 255
Joined: Fri Feb 10, 2006 12:15 am

Re: problem with vitals

Post by ncrsn »

What you want can be modified in the vitalInit.src.

In there are the exported function Get[vital]MaximumValue-functions that return - as the name suggests - the maximum value each vital can have.

Maybe studying this code will help you to get the idea.

pol97\pkg\attributes\hooks\vitalInit.src

Code: Select all


use attributes;

program Install()
	print("INSTALLING: Exported Vital - RegenRate and MaxValue functions ...");
	return 1;
endprogram

exported function GetLifeRegenRate(mobile)
	return 100;
endfunction

exported function GetLifeMaximumValue(mobile)
	var str := GetAttribute(mobile, "Strength");

	return 100 * str;
endfunction

exported function GetManaRegenRate(mobile)
	return 100;
endfunction

exported function GetManaMaximumValue(mobile)
	var int := GetAttribute(mobile, "Intelligence");

	return 100 * int;
endfunction

exported function GetStaminaRegenRate(mobile)
	return 100;
endfunction

exported function GetStaminaMaximumValue(mobile)
	var dex := GetAttribute(mobile, "Dexterity");

	return 100 * dex;
endfunction
Note that NPC's may have vitals configured in npcdesc.cfg. There may be something like

Code: Select all

NPCTemplate Troll1
{
	---
	Strength      300
	Dexterity     120
	Intelligence  10

	Hits          200
	Mana          0
	Stamina       200
	---
}
If that's the case you may want to modify the above functions to read vital values from npc's config element instead of using the attribute * 100 -method.
Post Reply