Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
FUNCTION f_onchar_create not working?
Author Message
x77x
Master
**

Posts: 488
Likes Given: 0
Likes Received: 15 in 15 posts
Joined: Mar 2012
Reputation: -4



Post: #1
FUNCTION f_onchar_create not working?
Code:
[FUNCTION f_onchar_create]
// This function is called before an account character got created.
// Variables:
//    SRC   --> Character being created
//    ARGN1 --> Feature flags sent by client
//    ARGN2 --> Character profession (0=Advanced, 1=Warrior, 2=Mage, 3=Blacksmith, 4=Necromancer, 5=Paladin, 6=Samurai, 7=Ninja)
//    ARGN3 --> Character race (1=Human, 2=Elf, 3=Gargoyle)
//    ARGS  --> Account name
//    ARGO  --> Client creating the character
// Return:
//    0 --> Allow character creation (default action)
//    1 --> Deny character creation

//f_meditation_setup    //Uncomment this line to enable passive meditation (more info on sphere_skills.scp)
SRC.Alchemy=50.0
SRC.Anatomy=50.0
SRC.AnimalLore=50.0
SRC.ItemId=50.0
SRC.ArmsLore=50.0
SRC.Parrying=50.0
SRC.Begging=50.0
SRC.Blacksmithing=50.0
SRC.Bowcraft=50.0
SRC.Peacemaking=50.0
SRC.Camping=50.0
SRC.Carpentry=50.0
SRC.Cartography=50.0
SRC.Cooking=50.0
SRC.DetectingHidden=50.0
SRC.Enticement=50.0
SRC.EvaluatingIntel=50.0
SRC.Healing=50.0
SRC.Fishing=50.0
SRC.Forensics=50.0
SRC.Herding=50.0
SRC.Hiding=50.0
SRC.Provocation=50.0
SRC.Inscription=50.0
SRC.LockPicking=50.0
SRC.Magery=50.0
SRC.MagicResistance=50.0
SRC.Tactics=50.0
SRC.Snooping=50.0
SRC.Musicianship=50.0
SRC.Poisoning=50.0
SRC.Archery=50.0
SRC.SpiritSpeak=50.0
SRC.Stealing=50.0
SRC.Tailoring=50.0
SRC.Taming=50.0
SRC.TasteId=50.0
SRC.Tinkering=50.0
SRC.Tracking=50.0
SRC.Veterinary=50.0
SRC.Swordsmanship=50.0
SRC.Macefighting=50.0
SRC.Fencing=50.0
SRC.Wrestling=50.0
SRC.Lumberjacking=50.0
SRC.Mining=50.0
SRC.Meditation=50.0
SRC.Stealth=50.0
SRC.RemoveTrap=50.0
SRC.Necromancy=0
SRC.Focus=0
SRC.Chivalry=0
SRC.Bushido=0
SRC.Ninjitsu=0
SRC.Spellweaving=0
SRC.Mysticism=0
SRC.Imbuing=0
SRC.Throwing=50.0
SRC.SPELLEFFECT 6 1
SRC.GO 5183,1167,0
SRC.EVENTS +e_players

no skills, no go, no events

Dragons of Time 2000-2020
http://dragonsoftime.com
(This post was last modified: 06-01-2017 09:35 AM by x77x.)
06-01-2017 09:34 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes x77x's post
WRWR
Journeyman
*

Posts: 212
Likes Given: 30
Likes Received: 1 in 1 posts
Joined: Mar 2012
Reputation: 1



Post: #2
RE: FUNCTION f_onchar_create not working?
looks like not work for me too
06-01-2017 10:01 AM
Find all posts by this user Like Post Quote this message in a reply
x77x
Master
**

Posts: 488
Likes Given: 0
Likes Received: 15 in 15 posts
Joined: Mar 2012
Reputation: -4



Post: #3
RE: FUNCTION f_onchar_create not working?
anytime i use the latest i spend more problems fixing new errors

Dragons of Time 2000-2020
http://dragonsoftime.com
06-01-2017 11:07 AM
Find all posts by this user Like Post Quote this message in a reply
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #4
RE: FUNCTION f_onchar_create not working?
f_onchar_create is working fine here
I tested using SRC.NAME=Testing and the char got created with NAME=Testing without any problems

but set stats/skills doesn't make effect on f_onchar_create because sphere will set default stats/skills for selected profession/skills after f_onchar_create, so if you set custom values on f_onchar_create they will be replaced with default values later. So the most recommended solution is replace all these 60 lines with this simple code

Code:
[FUNCTION f_onchar_create]
...
SRC.TIMERF 1,ALLSKILLS 50.0
SRC.SPELLEFFECT s_night_sight 100.0
SRC.GO 5183,1167,0
SRC.EVENTS +e_player
PS: "SRC.EVENTS +e_player" can be replaced with "EventsPlayer=e_player" on sphere.ini

maybe when I get some free time I can take a look on the code to check if the default stats/spells can be set before f_onchar_create to avoid values being replaced later, but for now TIMERF 1 is the best solution
(This post was last modified: 06-01-2017 02:47 PM by Coruja.)
06-01-2017 02:45 PM
Find all posts by this user Like Post Quote this message in a reply
Abysmalice
Apprentice
*

Posts: 5
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Jan 2021
Reputation: 0



Post: #5
RE: FUNCTION f_onchar_create not working?
Where can this script be found at? I've looked through everything I'm sure of and haven't found it.

w=fs
01-28-2021 05:03 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)