The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
experience points for finding a site of ore
Author Message
golfin
Banned

Posts: 213
Likes Given: 2
Likes Received: 32 in 28 posts
Joined: Nov 2017

Eranova

Post: #1
experience points for finding a site of ore
Hello,

what's going on? For example, when a character finds copper - he kicks the earth and the system randomly allocates some ore - to receive a certain amount of experience for this first mining event.
I'm going to use the i_worldgem_bit subject by BaseId in ON=@Success, where it is specified in More1 what is being exploited. But it does not work for me. I attach an example script. For any advice, thank you.

PHP Code:
VERSION=0.56d

[SKILL 45]
DEFNAME=Skill_Mining
KEY
=Mining
TITLE
=Miner
PROMPT_MSG
=Where would you like to mine?
FLAGS=skf_gather
DELAY
=1.6
STAT_STR
=85
STAT_DEX
=45
STAT_INT
=30
BONUS_STR
=70
BONUS_DEX
=30
BONUS_INT
=0
BONUS_STATS
=20
ADV_RATE
=2.5,50.0,200.0
VALUES
=1,10,80
RANGE
=2

ON
=@PreStart
    
IF (<SRC.FINDLAYER.layer_horse>)
        
SRC.SYSMESSAGE Na zvířeti nemůžeš těžit!
        return 
1
    
ENDIF
    IF (<
SRC.WEAPON.USESCUR>< 1)
        
SRC.SYSMESSAGE Nářadí je je vybité!
        return 
1
    
ENDIF

ON=@Success
    SRC
.WEAPON.USESCUR --
    IF (<
SRC.WEAPON.USESCUR>==0)
        
SRC.WEAPON.DESTROY 1
    
ENDIF
    
// I'm editing here
    
If (<BaseId> == i_worldgem_bit)
        If (<
Src.More1> == mr_iron)
            
Src.Tag.Exp=<eval <Tag.Exp>> +1
            Src
.Sysmessage=@55,3 Get you are 1 point of experience!
        ElseIf (<
Src.More1> == mr_copper)
            
Src.Tag.Exp=<eval <Tag.Exp>> +2
            Src
.Sysmessage=@55,3 Get you are 2 points of experience!
        EndIf
    EndIf
.
.

02-19-2018 04:42 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #2
RE: experience points for finding a site of ore
You have to use the @RegionResourceGather character trigger

Code:
04-12-2013, XuN
-Added @ResourceGather for RegionResources and @RegionResourceGather for Players:
    This trigger is being fired just before gathering skill has finished (after all animations and timings)
    Local.ResourceID is the ID of the item being gathered (Writable)
    Argn1 is the amount of local.ResourceID being gathered (Writable too)
    Return 1 cancels Gathering

see also:

https://wiki.spherecommunity.net/index.p...urceGather
02-19-2018 06:12 AM
Find all posts by this user Like Post Quote this message in a reply
golfin
Banned

Posts: 213
Likes Given: 2
Likes Received: 32 in 28 posts
Joined: Nov 2017

Eranova

Post: #3
RE: experience points for finding a site of ore
Trigger @RegionResourceGather - I'm not sure, but it will give tag.exp at every mining success. Not at first try. It is so?

Well, I got something wrong. Maybe the wrong type of file I'm putting in. When I try this trigger in sphere_region.scp or sphere_skills.scp, it does not do anything to me.
(This post was last modified: 02-19-2018 04:12 PM by golfin.)
02-19-2018 03:32 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #4
RE: experience points for finding a site of ore
@RegionResourceGather is a character's trigger, so you need to create an event or add it to an already existing event ( or place it under SKILLCLASS 0 in sphere_skill.scp at the bottom of the file)

Example:

Code:
[EVENTS e_player_resources]

ON=@RegionResourceGather
//yourcode

Otherwise, i found that you can get the ore gembit in this way if you want to use the Skill Triggers
Code:
Skill with SKF_GATHER: @(Skill)Start and @(Skill)Stroke now use ACT as a reference for the worldgem.
(This post was last modified: 02-19-2018 07:28 PM by darksun84.)
02-19-2018 07:26 PM
Find all posts by this user Like Post Quote this message in a reply
golfin
Banned

Posts: 213
Likes Given: 2
Likes Received: 32 in 28 posts
Joined: Nov 2017

Eranova

Post: #5
RE: experience points for finding a site of ore
I think I have a badly written code. I'll put it in an event, or SKILLCLASS 0, or @ (Skill) Start and @ (Skill) Stroke - it does not work. But it also does not make mistakes in the Console.

I used this code:
PHP Code:
If (<SRC.FINDTYPE.t_rock>)// Here I do not know whether to look for a type t_rock or object <BaseId>i_worldgem_bit
        
If (<Act.More1> == mr_iron)// More1 <BaseId> i_worldgem_bit determines what ore will benefit
            
Src.Tag.Exp=<eval <Tag.Exp>> +1
            Src
.Sysmessage=@55,3 Get you are 1 point of experience!
        ElseIf (<
Act.More1> == mr_copper)
            
Src.Tag.Exp=<eval <Tag.Exp>> +2
            Src
.Sysmessage=@55,3 Get you are 2 points of experience!
        EndIf
    EndIf 

Thank you darksun84 for taking care of me.
02-20-2018 03:25 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #6
RE: experience points for finding a site of ore
Just made a test and it seems that
Code:
Skill with SKF_GATHER: @(Skill)Start and @(Skill)Stroke now use ACT as a reference for the worldgem.

is wrong or it was removed, so you need to use @RegionResourceGather
Place it under SKILLCLASS 0 or in a player event

Example
Code:
ON=@RegionResourceGather
if (<argo.type> == t_rock) && (<tag0.uidOre> != <argo>) // we check if the worldgem bit is a rock
    tag.uidOre = <argo> // we store the worldgem uid on the player
    if <argo.more1> == mr_iron
        sysmessage @50 you gain an additional point of experience.
        tag0.exp += 1
    elseif <argo.more1> == mr_copper
        sysmessage @50 you gain two additional points of experience.
        tag0.exp += 2
    else
        sysmessage @50 you gain three additional points of experience
        tag0.exp +=3
    endif
endif

When a player mines successfully, it enters in the RegionResourceGather trigger (it's called after @skillsuccess/@success)
Then it checks if the resource gathered is a "mineral one" (t_rock) and it checks if the player has already attempted to mine this gembit (tag.uidOre != <argo)
If the check are ok, the gembit uid is stored on a player tag.

Of course it's not a good check because the player can switch between spots and get additional experiences Tongue
(This post was last modified: 02-20-2018 04:44 AM by darksun84.)
02-20-2018 04:44 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes darksun84's post
golfin
Banned

Posts: 213
Likes Given: 2
Likes Received: 32 in 28 posts
Joined: Nov 2017

Eranova

Post: #7
RE: experience points for finding a site of ore
Thank you, it works exactly the way I planned. I'm learning to script from the beginning, for free shard I've only created with mul files. Graphics and so on.

Well, I plan to get points of experience not only from combat activities, but mainly from production. That is why I consider it a good job. Ultima Online is transformed into another Dragon Dungeon system, originally a board game with tin figure, dice and paper. But Ultima Online, with its graphics, is the most similar to the game. That's why I think it's a good job. Getting experience points is the basis.

Thank you Smile
02-20-2018 05:40 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #8
RE: experience points for finding a site of ore
If you check in the sphere.ini there is a built-in experience system.
02-20-2018 05:47 AM
Find all posts by this user Like Post Quote this message in a reply
golfin
Banned

Posts: 213
Likes Given: 2
Likes Received: 32 in 28 posts
Joined: Nov 2017

Eranova

Post: #9
RE: experience points for finding a site of ore
I know about it. However, it will not be enough for my purposes. it's built on Ultima Online and I did not really understand how craft works. However, I do not want to use the experience only for craft and combat, but also for other events that UO does not solve.

But, I'm going to study it like the whole sphere system. I'm working with this system, I do not want to go to RunUo or ServUo.

I can not speak English, the translation is made using google translator
02-21-2018 01:13 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
golfin
Banned

Posts: 213
Likes Given: 2
Likes Received: 32 in 28 posts
Joined: Nov 2017

Eranova

Post: #10
RE: experience points for finding a site of ore
I have a little bit of fun with it and adjusted the experience gaining points for finding a certain amount of ore in the skill range. For example, for finding clay, the player receives a 1 point experience from a skill level of 0.0 to 10.0. When the clay finds out with a higher skill above 10.0%, the point for experience does not get. And so I create it for all kinds of ores.

PHP Code:
[EVENTS e_all_player]

// Gaining points for mining experience
ON=@RegionResourceGather
if (<argo.type> == t_rock) && (<tag0.uidOre> != <argo>)
    
tag.uidOre = <argo>
    if (<
Mining> > 0) && (<Mining> < 100)
    if <
argo.more1> == mr_clay
        sysmessage 
@55,3 Gained jsi 1 point experience!
        
tag0.exp += 1
    
endif
    elseif (<
Mining> > 99) && (<Mining> < 200)
    if <
argo.more1> == mr_coal
        sysmessage 
@55,3 Gained 1 point experience!
        
tag0.exp += 1
    
elseif <argo.more1> == mr_iron
        sysmessage 
@55,3 Gained 1 point experience!
        
tag0.exp += 1
    
endif
    elseif (<
Mining> > 99) && (<Mining> < 300)
    if <
argo.more1> == mr_iron
        sysmessage 
@55,3 Gained 1 point experience!
        
tag0.exp += 1
    
endif
    elseif (<
Mining> > 299) && (<Mining> < 550)
    if <
argo.more1> == mr_copper
        sysmessage 
@55,3 Gained 2 point experience!
        
tag0.exp += 2
    
endif
    elseif (<
Mining> > 549) && (<Mining> < 650)
    if <
argo.more1> == mr_silver
        sysmessage 
@55,3 Gained 3 point experience!
        
tag0.exp += 3
    
endif
    elseif (<
Mining> > 649) && (<Mining> < 900)
    if <
argo.more1> == mr_gold
        sysmessage 
@55,3 Gained 5 point experience!
        
tag0.exp += 5
    
endif
    elseif (<
Mining> > 899) && (<Mining> < 1201)
    if <
argo.more1> == mr_mytheril
        sysmessage 
@55,3 Gained 10 point experience!
        
tag0.exp += 10
    
endif
    endif
endif 

**********************************************

PHP Code:
// Amount of experience to raise to the next level
//LevelNextAt=450 

Then I have a question. By default, the sphere has an experience system. Can the LevelNextAt entry be adjusted so that for each level there is another value needed for a transfer? And because I do different professions and races, another value for a profession?

Example: A third-level magician will need 2456 points of experience, but a third-level warrior 3250. Both professions will have a higher value when moving to the fifth level.

Code:
Level    Mage    Warior
1        450    500
2        800    950
3        1540    1850
4        3000    3800

If I create my own experience system, it is possible. But I wonder if it can be built into the default system.
(This post was last modified: 02-26-2018 03:38 AM by golfin.)
02-26-2018 03:37 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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