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-nmm7 (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-nmm7 (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-nmm7 (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
want to dig sand
Author Message
golfin
Banned

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

Eranova

Post: #9
RE: want to dig sand
I played a little and modified your script. DarkSun. It's not done, but works partially outside the hardcod sphere settings on all the terrain I choose. That's what I wanted. Here's a sample.

PHP Code:
//****************************************************************************
// Saved in ANSI encoding
//****************************************************************************
// Drd Online
// Dragon & Dungeon - Extraction of sand and clay
// Create Golfin (Czech)
//****************************************************************************
// Last file update: Saturday, May 4, 2019

VERSION=0.56d

[DEFNAME skills_msgs]
/// mining ///
lopata_musi_byt        "Shovel must be in the backpack!"
hodil            "He threw"
hodila            "She threw"
hornictvi        "mining"
fatal_neuspech        "Fatal Failure !!!"
chvili            "For a moment ye are in the earth,"
nenachazis        "but you don't find much."
znicena            "it was destroyed."
poskozena        "it was damaged."
fatal_uspech        "Fatal success"
nasel            "He found"
nasla            "She found"

[DEFNAME Resources_type]
REGIONRESOURCE_mr_clay                "clay"
REGIONRESOURCE_mr_sand                "sand"

[TYPEDEF t_Mining_Sand]
ON=@Dclick
if ( !<Cont> ) && ( <TopObj> != <Src> )
   
// Shovel must be in the backpack
   
Src.f_Sys_Orange <Def.lopata_musi_byt>    
   return 
1
endif

On=@Targon_Ground
// we target sand, grass and clay (clay roads and fields - modified scp sphere_types.scp)
   
If ( <Serv.map(<Src.TargP>).TYPE> == t_sand ) || (<Serv.map(<Src.TargP>).TYPE> == t_grass ) || (<Serv.map(<Src.TargP>).TYPE> == t_dirt )
      
// distance scoop from player by skill mining
      
If <Src.distance <Src.TargP>> <= <Serv.skill.skill_mining.range>    
         
Serv.Newitem=i_memory
         
New.f_Harvest_Sand_Clay <Src.UID>,"<Src.TargP>"
      
EndIf
   EndIf

[function 
f_Harvest_Sand_Clay]
Local.Harvest_Sand_Clay 0
= <Src.TargP>
Updatex
Foritems 0
// verify that worldgem_bit already exists
   
If ((<baseid> == i_worldgem_bit) && ( <type> == t_rock )
      
Local.Harvest_Sand_Clay = <UID>
   EndIf
EndFor
// When worldgem_bit does not exist, a new dice roll is created per percent (According to D&D rules)
If <Local.Harvest_Sand_Clay> = 0
   
// Source selection by terrain type 
   // Here I had to place a skill condition because of the resources in the sphere_region file it doesn't work
   
If ( <Src.Mining> > 0.0 ) && ( (<Serv.map(<Src.TargP>).TYPE> = t_grass) || (<Serv.map(<Src.TargP>).TYPE> = t_dirt) )
      
Local.Regionresource mr_clay
      Local
.Amount = <Serv.REGIONRESOURCE.<Local.Regionresource>.AMOUNT>
      
Local.Timer = <Serv.REGIONRESOURCE.<Local.Regionresource>.REGEN>
   ElseIf ( <
Src.Mining> > 4.9 ) && ( <Serv.map(<Src.TargP>).TYPE> = t_sand )
      
Local.Regionresource mr_sand
      Local
.Amount = <Serv.REGIONRESOURCE.<Local.Regionresource>.AMOUNT>
      
Local.Timer = <Serv.REGIONRESOURCE.<Local.Regionresource>.REGEN>
   EndIf
   
// 1K10 Dice Throw (1 to 100% Percent - According to D&D rules)
   
Local.desitka = <Eval rand(1100)>
   If (<
local.desitka> > 19)
      
Src.f_1k10_100
      Serv
.newitem i_worldgem_bit,<R<Local.Amount>>
      New.
Attr Attr_decay|Attr_invis|Attr_move_never
      
New.TYPE t_rock
      
New.More1 = <Local.Regionresource>
      New.
Timer = <DLocal.Timer>
      New.
= <P>
      
Local.Harvest_Sand_Clay = <New.UID>
      
// Timerf 2 is needed due to delay - otherwise it would give the player material 
      // before creating the worldgembit
      
Src.Timerf 2,Src.skill 45        
      Src
.f_Msg_Cyan <Src.Sex <Def.hodil>/<Def.hodila>> jsi na <Def.hornictvi> <Eval <Local.desitka>>
      If (<
local.desitka> = 100)
         
Src.f_Sys_Green <Def.fatal_uspech>
     
Tag0.Exp += f_1k10_100        // bonus exps per level per 1k10 at 100% - Fatal success
      
EndIf
   ElseIf (<
local.desitka> > 1) && (<local.desitka> < 20)
   
// Fail mining
      
Src.f_Msg_Cyan <Src.Sex <Def.hodil>/<Def.hodila>> jsi na <Def.hornictvi> <Eval <Local.desitka>>
      
Src.f_Msg_Gray <Def.chvili>
      
Src.f_Msg_Gray <Def.nenachazis>
   ElseIf (<
local.desitka> < 2)
   
// Fatal Failure
      // Here I want to finish the bucket break when I set it in def files for equip
      
Src.f_Msg_Cyan <Src.Sex <Def.hodil>/<Def.hodila>> jsi na <Def.hornictvi> <Eval <Local.desitka>>
      
Src.f_Msg_Red <Def.fatal_neuspech>
      
Serv.Log Hrac hodil Fatalni neuspech v <Src.TargP.Region.Namea zlamal si lopatu.
   EndIf
EndIf

[
ITEMDEF i_Shovel_Sand]
id=i_Shovel
name
=Shovel for sand
TYPE
=t_weapon_mace_pick
FLIP
=1
VALUE
=20
WEIGHT
=6.0
RESOURCES
=4 i_ingot_iron,2 i_Log
SKILLMAKE
=Tinkering 20.0,t_tinker_tools

CATEGORY
=Provisions Tools D&D
SUBSECTION
=Mining
DESCRIPTION
=Shovel for sand
ReqStr
=1
DUPELIST
=0f3a
//CanUse=can_u_human|can_u_elf
TEVENTS=t_Mining_Sand

ON
=@Create
   HITPOINTS
={150 250}
   
UsesMax=100
   Color
=color_o_mytheril

[Eof
(This post was last modified: 05-05-2019 02:39 AM by golfin.)
05-05-2019 02:37 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
want to dig sand - WRWR - 05-12-2017, 03:17 AM
RE: want to dig sand - darksun84 - 05-12-2017, 03:40 AM
RE: want to dig sand - WRWR - 05-12-2017, 04:31 AM
RE: want to dig sand - darksun84 - 05-12-2017, 06:41 AM
RE: want to dig sand - WRWR - 05-12-2017, 07:02 AM
RE: want to dig sand - darksun84 - 05-12-2017, 07:18 AM
RE: want to dig sand - darksun84 - 05-12-2017, 08:50 AM
RE: want to dig sand - WRWR - 05-12-2017, 10:24 AM
RE: want to dig sand - golfin - 05-05-2019 02:37 AM

Forum Jump:


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