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
Question bout <local.mob>
Author Message
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #5
RE: Question bout <local.mob>
Reading the script helps:

Quote:Custom elementals can be added easily for your custom ores, just ensure that their reads [DEFNAME c_elem_<ore name>]

The script looks to see what ore you just dug up and spawns an elemental based upon it, taking the ore name.
The ore name becomes <local.mob> allowing you to summon c_elem_<local.mob>

Where <local.mob> is for example iron, if you just dug up iron then the script would summon c_elem_iron

Code:
//paste this to each [REGIONRESOURCE <oretype>] section in sphere_items_provisions_ore.scp
ON=@RESOURCEFOUND  
    ref1=<argo>
    local.more1=<ref1.more1> //<---- read the ore type
    local.mob= <strsub 3 4 <local.more1>>    //  <----- isolate the ore type
    local.mob= c_elem_<local.mob> //<--- create a summonable elemental name
    call f_earth_mob_spawn
//end paste

[FUNCTION f_earth_mob_spawn]
IF (<eval RAND(100)> < 10)
    DORAND 3
        SERV.NEWNPC c_elem_earth
        SERV.NEWNPC c_elem_granite
        SERV.NEWNPC <local.mob>  //<--- summon elemental if the rand falls here
    ENDDO
    NEW.UPDATEX
    NEW.ANIM 12
    NEW.ATTACK <SRC>
ENDIF

There is an error that crept in there somewhere which I have now corrected. the last serv.newnpc contained the name c_elem_<local.mob> instead of just <local.mob>

[Image: 2nis46r.jpg]
(This post was last modified: 11-03-2013 05:59 AM by Mordaunt.)
11-03-2013 04:27 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
Question bout <local.mob> - seafish - 11-03-2013, 12:27 AM
RE: Question bout <local.mob> - Extreme - 11-03-2013, 12:29 AM
RE: Question bout <local.mob> - seafish - 11-03-2013, 12:30 AM
RE: Question bout <local.mob> - XuN - 11-03-2013, 02:26 AM
RE: Question bout <local.mob> - Mordaunt - 11-03-2013 04:27 AM
RE: Question bout <local.mob> - seafish - 11-03-2013, 05:57 AM

Forum Jump:


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