Release Skill Points System

Xplot

Dedicated Member
Dedicated Member
Mar 11, 2012
24
3
30
Hi, I'm new to the community and would like to share some scripts and systems.


About skill points system:


When you kill mobs, depending on your level and difficulty of mob, you will gain Ability points, which could serve to raise your spell level or having some other service that you see fit.

(!)*This is just an example, if you like the system, you must add the rest of magic and it is clear that you can also change prices at will and requirements.


Explanation of the script that will put below:


From level 0 to level 5, when you kill a Hen you raise 1 Skill Point.
From level 5 to level 10, when you kill a Pig you raise 1 Skill Point.
With earned points will learn your first spell.






Practical part:

1.-
The system requires use of SQL. We will create table in Game3G DB, called "TBL_SYSAP" with this fields "FLD_Char , FLD_Points".
Stay like this:
SQL.png

2.-
Now we do that when you kill a monster, you register at the table and add points.

In "Mud3/Envir/MapQuest.txt":
Code:
[COLOR=#ff0000]0[/COLOR]          [0]    0    [MonDie] Hen                * [MapQuest_Def\APSystem] [@Hen]
[COLOR=#FF0000]0[/COLOR]          [0]    0    [MonDie] Pig                * [MapQuest_Def\APSystem] [@Pig]
*The red number is the map ID where it should be the mob Hen, we have to add all the maps where this mob.


In "Mud3/Envir/QuestDiary/MapQuest_Def/APSystem.txt":
Code:
[@Hen]
#IF
CheckLevel 1
!CheckLevel 5
#ACT
SysMsg "You got 1 Skill Point"
goto @addpoints
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

[@Pig]
#IF
CheckLevel 5
!CheckLevel 10
#ACT
SysMsg "You got 1 Skill Point"
goto @addpoints

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

[@addpoints]
#IF
#ACT
FormatStr "FLD_Char='%s'" %USERNAME
ReadValueSql "TBL_SYSAP" %A9 "FLD_Char,FLD_Points" [@check]

[@check()]
#ACT
mov A1 %ARG(1)
mov D1 %ARG(2)
#IF
Equal A1 ""  [COLOR="#FF0000"];;If your name is not on the table, it adds[/COLOR]
#ACT
FormatStr "'%s',%s" %USERNAME 0         
    Mov A8 %A9    
    FormatStr "FLD_Char='%s'" %USERNAME 
    Mov A2 %A9
    WriteValueSql "TBL_SYSAP" %A2 "FLD_Char,FLD_Points" %A8
goto @add
#ELSEACT
goto @add
   
[@add]
#IF
#ACT
Inc D1[COLOR=#FF0000] 1   ;;Number of added points[/COLOR]
FormatStr "FLD_Char='%s'" %USERNAME
Mov A8 %A9
FormatStr "FLD_Points='%s'" %D1
UpdateValueSql "TBL_SYSAP" %A8 %A9
break

3.-
Now let's create an NPC, where you can see your points and use them here to learn your first magic.

NPC script:
Code:
[@main]
#IF
#ACT
FormatStr "FLD_Char='%s'" %USERNAME
ReadValueSql  "TBL_SYSAP"  %A9  "FLD_Char,FLD_Points" [@next]

[@next()]
#ACT
[COLOR=#daa520]Mov  A1      %ARG(1)    ;Retrieves user name[/COLOR]
[COLOR=#0000cd]Mov  D1      %ARG(2)    ;Retrieve user ability points[/COLOR]
goto @menu

[@menu]
#IF
#SAY
Hello[COLOR=#daa520] <$OUTPUT(A1)>[/COLOR], now you have[COLOR=#0000cd] <$OUTPUT(D1)>[/COLOR] Skill Points.\
What do you want to do?\
<Get Spell manuals/@learnmagic>\
<Raise Spell level/@risemagic>\
<Exit/@exit>\

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


[@learnmagic]
#IF
CheckJob Warrior [COLOR="#FF0000"];;Check your Job[/COLOR]
#SAY
Choose the spell:\
<Swordmanship/@get(Swordmanship(Manual),30)> Cost: 30 Skill Points\
<Back/@main>___<Exit/@exit>\
#ELSEACT
goto @other

[@other]
#IF
CheckJob Wizard[COLOR="#FF0000"] ;if you're not a wizard, you are tao[/COLOR]
#SAY
Choose the spell:\
<FireBall/@get(FireBall(Manual),30)> Cost: 30 Skill Points\
<Back/@main>___<Exit/@exit>\
#ELSESAY
Choose the spell:\
<Healing/@get(Healing(Manual),30)> Cost: 30 Skill Points\
<Back/@main>___<Exit/@exit>\

[@get()]
#ACT
mov A4 %ARG(1)  ;Retrieves objects name
mov D2 %ARG(2)  ;Retrieves objects price
goto @getnext


[@getnext]
#IF
ELARGE D1 %D2   [COLOR="#FF0000"];check if the price of the item does not exceed your current points[/COLOR]
#ACT
Dec D1 %D2 [COLOR="#FF0000"] ;Subtract the price of the subject of your points[/COLOR]
   FormatStr "FLD_Char='%s'" %USERNAME
   Mov   A8     %A9
   FormatStr "FLD_Points='%s'" %D1
   UPDATEVALUESQL "TBL_SYSAP" %A8 %A9
Give %A4 1 [COLOR="#FF0000"];Order delivery[/COLOR]
#ELSESAY
You do not have enough skill points.\
<Back/@main>___<Exit/@exit>\

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

[@risemagic]
#IF
CheckJob Warrior
#SAY
Choose the level of magic you want to improve:\
<Swordmanship/@1war>\
<Back/@main>___<Exit/@exit>\
#ELSEACT
goto @riseother

[@riseother]
#IF 
CheckJob Wizard
#SAY
Choose the level of magic you want to improve:\
<FireBall/@1wiz>\
<Back/@main>___<Exit/@exit>\
#ELSESAY
Choose the level of magic you want to improve:\
<Healing/@1tao>\
<Back/@main>___<Exit/@exit>\

[@1war]
#IF
#SAY
At what level you want to promote?\
<1@one(swordmanship,1,30,7)> Cost: 30 Skill Points  Requires: Level 7\
<Back/@main>___<Exit/@exit>\

[@1wiz]
#IF
#SAY
At what level you want to promote?\
<1@one(fireball,1,30,7)>  Cost: 30 Skill Points  Requires: Level 7\
<Back/@main>___<Exit/@exit>\

[@1tao]
#IF
#SAY
At what level you want to promote?\
<1@one([COLOR=#006400]healing[/COLOR],[COLOR=#a52a2a]1[/COLOR],[COLOR=#0000cd]30[/COLOR],[COLOR=#800080]7[/COLOR])>  Cost: 30 Skill Points  Requires: Level 7\
<Back/@main>___<Exit/@exit>\


[@one()]
#ACT
[COLOR=#006400]Mov A5 %ARG(1)  ;Retrieves spell name[/COLOR]
[COLOR=#a52a2a]Mov D3 %ARG(2)  ;Retrieves spell level[/COLOR]
[COLOR=#0000cd]Mov D4 %ARG(3)  ;Retrieves cost[/COLOR]
[COLOR=#800080]Mov D5 %ARG(4)  ;Retrieves char level[/COLOR]
goto @checkd5

[@checkd5]
#IF
Checklevel %D5 [COLOR="#FF0000"] ;check char level[/COLOR]
#ACT
goto @checka5
#ELSESAY
Not enough level.\
<Back/@main>___<Exit/@exit>\

[@checka5]
#IF
!checkmagic %A5 [COLOR="#FF0000"] ;check if you already have learned the spell[/COLOR]
#ACT
goto @checkd4
#ELSESAY
First you have to learn the spell: <$OUTPUT(A5)>.\
<Back/@main>___<Exit/@exit>\

[@checkd4]
#IF
ELARGE D1 %D4   [COLOR="#FF0000"];check if the price of the item does not exceed your current points[/COLOR]
#ACT
Dec D1 %D4 [COLOR="#FF0000"] ;Subtract the price of the subject of your points[/COLOR]
   FormatStr "FLD_Char='%s'" %USERNAME
   Mov   A8     %A9
   FormatStr "FLD_Points='%s'" %D1
   UPDATEVALUESQL "TBL_SYSAP" %A8 %A9
HLSCRIPTCMD changemaglevel %A5 %D2 [COLOR="#FF0000"] ;Rise your spell level[/COLOR]
#ELSESAY
You do not have enough skill points.\
<Back/@main>___<Exit/@exit>\





That's all folks, the system can be perhaps useless, but never cast aside the option of using sample scripts to innovate our own system.


Regards,

 
Last edited:

Phantom

Banned
Banned
Dedicated Member
Feb 4, 2012
255
5
45
Nice release, however this has all ready been done with the VE Envir and without the aid of SQL. But as I said, it's a great release/