Crusader 
Master
 
Posts: 254
Likes Given: 7
Likes Received: 19 in 12 posts
Joined: Apr 2012
Reputation: 6
Erehwon New Hera

|
RE: Some issues (horse poop, vendor distance, makeitem)
Ok i found how to do it! Any improvements will be appreciated!
Code:
[FUNCTION NEW_CRAFT]
//argn1 id_item
//argn2 skilltest
// Changed SKILLMAKE to allow getting an individual resource in the list. SKILLMAKE.1 gets the first,
// SKILLMAKE.1.VAL gets the value and SKILLMAKE.1.KEY gets the associated resource key.
LOCAL.IDITEM = <ARGV[0]>
LOCAL.DIFFICULTY = <FVAL <ARGV[1]>>+10.0
LOCAL.SKILLREQVAL = <FVAL <SERV.ITEMDEF.<LOCAL.IDITEM>.SKILLMAKE.1.VAL> + <LOCAL.DIFFICULTY>>
LOCAL.MYSKILL = <SRC.<STREAT <SERV.ITEMDEF.<LOCAL.IDITEM>.SKILLMAKE.1.NAME>>>
LOCAL.CHANCETOSUCCESS = <FVAL (<LOCAL.SKILLREQVAL> - <LOCAL.MYSKILL>)*9>
LOCAL.CHANCETOSUCCESS = <FVAL (100.0 - <FVAL <LOCAL.CHANCETOSUCCESS>>)>
IF (0<ARGV[2]>)
LOCAL.DIFFICULTY2 = <FVAL <ARGV[2]>>+10.0
LOCAL.SKILLREQVAL2 = <FVAL <SERV.ITEMDEF.<LOCAL.IDITEM>.SKILLMAKE.2.VAL> + <LOCAL.DIFFICULTY2>>
LOCAL.MYSKILL2 = <SRC.<STREAT <SERV.ITEMDEF.<LOCAL.IDITEM>.SKILLMAKE.2.NAME>>>
LOCAL.CHANCETOSUCCESS2 = <FVAL (<LOCAL.SKILLREQVAL2> - <LOCAL.MYSKILL2>)*9>
LOCAL.CHANCETOSUCCESS2 = <FVAL (100.0 - <FVAL <LOCAL.CHANCETOSUCCESS2>>)>
ENDIF
SRC.CTAG.CRAFTCHANCE = <LOCAL.CHANCETOSUCCESS>
SRC.CTAG.CRAFTCHANCE2 = <LOCAL.CHANCETOSUCCESS2>
//SERV.LOG <SERV.ITEMDEF.<LOCAL.IDITEM>.SKILLMAKE.1.VAL>, <SERV.ITEMDEF.<LOCAL.IDITEM>.SKILLMAKE.1>
//SERV.LOG My Skill: <LOCAL.MYSKILL> Item Skillmake: <LOCAL.SKILLREQVAL> Chance to Success: <LOCAL.CHANCETOSUCCESS>
MAKEITEM <LOCAL.IDITEM>
RETURN 1
under crafting skills u put actdiff=0, example:
Code:
[SKILL 7]
DEFNAME=SKILL_Blacksmith
KEY=Blacksmithing
TITLE=Blacksmith
PROMPT_MSG=
DELAY=1.0
STAT_STR=95
STAT_INT=15
STAT_DEX=25
BONUS_STR=75
BONUS_DEX=20
BONUS_INT=5
BONUS_STATS=10
ADV_RATE=2.5,50.0,200.0
VALUES=1,20,100
ON=@Start
actdiff = 0
return 0
then, under char events u put:
Code:
ON=@SKILLMAKEITEM
//ACT The item that was crafted.
//ARGO The item that the item was crafted from.
//I The character who crafted the item.
//SRC The character who crafted the item.
//ARGN1 The amount of skill used to craft the item.
//ARGN2 The quality of the crafted item.
LOCAL.RANDCRAFTDICE = <FVAL (RAND(100.0))>
Serv.log <LOCAL.RANDCRAFTDICE>
IF !(<SRC.CTAG0.CRAFTCHANCE2>)
IF (<LOCAL.RANDCRAFTDICE> <= <SRC.CTAG0.CRAFTCHANCE>) && (<EVAL RAND(100)> != 1)
ARGN2 = <SRC.CTAG0.CRAFTCHANCE>
RETURN
ELSE
RETURN 1
ENDIF
ELSE
LOCAL.RANDCRAFTDICE2 = <FVAL (RAND(100.0))>
IF (<LOCAL.RANDCRAFTDICE> <= <SRC.CTAG0.CRAFTCHANCE>) && (<LOCAL.RANDCRAFTDICE2> <= <SRC.CTAG0.CRAFTCHANCE2>) && (<EVAL RAND(100)> != 1)
ARGN2 = <SRC.CTAG0.CRAFTCHANCE>
RETURN
ELSE
RETURN 1
ENDIF
ENDIF
SRC.CTAG0.CRAFTCHANCE =
SRC.CTAG0.CRAFTCHANCE2 =
and finally u have to replace ur crafting menus like this:
Code:
[SKILLMENU sm_shields]
Shields
ON=i_shield_buckler <name> (<resmake>)
NEW_CRAFT=i_shield_buckler
ON=i_shield_round_bronze <name> (<resmake>)
NEW_CRAFT=i_shield_round_bronze
ON=i_shield_round_metal <name> (<resmake>)
NEW_CRAFT=i_shield_round_metal
[...]
So that's it! comment pls!
The stuff below was my old edited post asking for infos when i was making all my tries...it's quite useless now, but still some questions remains opened.
Quote:After a couple of tries:
if i put
Code:
ON=i_shield_buckler <name> (<resmake>)
TEST=BLACKSMITHING 50.0
MAKEITEM=i_shield_buckler
and i put skillmake of the item: blacksmith 60.0
The item is NOT shown on the menu.
______________
If i comment the skillmake line then the item is visible at 'test' value.
______________
What i want to do is:
i have a skillmake which is the 'difficulty' to make the item.
but all the items are showed 10.0 points BEFORE of the skillmake req.
The difficulty to make the item is very hard when a char tries to make the item and there are this 10.0 points of 'gap'.
So, example is:
my blacksmith has 50.0 blacksmith
he can see in his menu the buckler which has skillmake 60.0
he tries at least 10 times before craft the buckler with success.
HOW could i do this?
edit: in the meantime i'm scripting a version of the script that do what i want, i found this:
22-11-2003, Kell
- Attempted to fix the bug where setting ACT in a @Hit trigger stops
the swing, by restoring it after the trigger.
- Added SKIPDIFFICULTY (0 by default, or 1) to SKILL sections. Setting it to 1
skips the hardcoded difficulty check and allows one to do their own skill difficulty
checks in @Success, and "return 1" in there for a failure.
but putting skipdifficulty under 'skill' section like this:
Code:
[SKILL 7]
DEFNAME=SKILL_Blacksmith
KEY=Blacksmithing
TITLE=Blacksmith
PROMPT_MSG=
DELAY=1.0
STAT_STR=95
STAT_INT=15
STAT_DEX=25
BONUS_STR=75
BONUS_DEX=20
BONUS_INT=5
BONUS_STATS=10
ADV_RATE=2.5,50.0,200.0
VALUES=1,20,100
SKIPDIFFICULTY=1
doesn't work, any clues?
(This post was last modified: 01-12-2013 07:17 PM by Crusader.)
|
|
01-12-2013 05:33 PM |
|
|