Post Reply 
 
Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Role Playing Points System
Author Message
admin phoenix
Master
**

Posts: 354
Likes Given: 1
Likes Received: 23 in 13 posts
Joined: Mar 2012
Reputation: 3



Post: #1
Role Playing Points System
PHP Code:
// ***************************************************************************​***************************************************
// *                            RPP Points System                            *
// * created by Admin Phoenix aka Levanthis from http://www.uo-tools.com                            *
// *                                                                *
// * Feature:                                                            *
// * Give your Players Role Playing Points by using the Ingame Command .rpp <args>                        *
// * With this Points, player can raise up their Stats or Skills                                *
// * The raise up depends on their Skill Cap                                            *
// * GM can also remove RPP Points from the player by using the Command .rpn <args>                        *
// *                                                                *                
// * All this stuff will be saved in a mysql data base                                        *
// * You can read the rpp points the player have, which GM gave him the points and when                        *
// * For this you need a table called "charakter_daten"                                        *
// * and rows called username, UID, RPP, RPP_Gesamt, rpp_name                                    *
// * That is it                                                            *
// * Enjoy it                                                            *
// ***************************************************************************​***************************************************


 
[DEFNAME rpp_messages]
d_faehigkeit_steigern        You can not raise up your Skill again
d_eigenschaften_steigern    You can not raise up your Stat again
d_faehigkeit_grenze        You reach your limit
d_faehigkeit_erhoehen        You raise your Skill up with 0.1 Points
d_eigenschaft_erhoehen        You raise up your Stat with 1 Point
d_keine_punkte            You donĀ“t have enough RPP Points yet
d_rpp_abzug_skills        500
d_rpp_abzug_stats        1000

[FUNCTION f_dialog_rpp]
resizepic 0 0 2620 750 480
gumppictiled 6 7 739 486 2604
resizepic 30 25 2620 580 40
resizepic 30 55 2620 580 400 
resizepic 50 80 2620 200 40
resizepic 50 128 2620 200 40
resizepic 50 175 2620 200 260

resizepic 245 175 2620 100 260
resizepic 245 128 2620 100 40

resizepic 340 128 2620 100 40
resizepic 340 175 2620 100 260

resizepic 435 128 2620 100 40
resizepic 435 175 2620 100 260

resizepic 290 80 2620 300 40

dtext 155 35 2523 RPP Gump 
To spread your Role Playing Points.
dtext 60 90 2523  available Points:
dtext 180 90 025 <dargs>
dtext 120 137 2523 Skill:
dtext 253 137 2523 current Level

    dtext 370 137 2523 Grenze
:
 IF (<
isempty <tag0.rpp_message>>)
     
dtext 300 90 2523 No advert
  
ELSE
    
dtext 300 90 2523 <tag0.rpp_message>
 ENDIF 
dtext 470 137 2523 Up:
 
dtext 615 35 025 Charges:
dtext 615 55 2523 0.1 Skill Raise up 
dtext 615 75 2523 
for 500 RPPs 
dtext 615 105 2523 1 Stat Raise Up
dtext 615 125 2523 
for 1000 RPPs 

dtext 20 454 2523 Seite 
<eval <ctag0.rpp_side>+1>

[
DIALOG d_rpp_1]
0,0
src
.dialogclose d_rpp_1

page 0  
  
IF (<DB.CONNECTED>) 
          
DB.QUERY "SELECT * FROM charakter_daten WHERE username='<account.name>' AND UID='<uid>'";
        
local.rpp_gesamt=<db.row.0.RPP_Gesamt>
  ENDIF
        
f_dialog_rpp <dlocal.rpp_gesamt>
    
page 1
 
 
IF (<ctag0.rpp_side> == 0)
     
local.skill=0
    local
.up=11
  
ELSEIF (<ctag0.rpp_side> == 1)
     
local.skill=12
    local
.up=11
   
ELSEIF (<ctag0.rpp_side> == 2)
     
local.skill=24
    local
.up=11
    
ELSEIF (<ctag0.rpp_side> == 3)
     
local.skill=36
    local
.up=11
   
ELSEIF (<ctag0.rpp_side> == 4)
     
local.skill=48
     local
.up=6    
 
ENDIF
 
 
local.a=20

 
FOR <dlocal.skill> <eval <local.skill>+<local.up>>

   
dtext 60 <eval <local.a>+1642523 <serv.skill.<local.i>.title>
   
dtext 280 <eval <local.a>+164025 <fval <<serv.skill.<dlocal.i>.key>>>
   
dtext 380 <eval <local.a>+164025 <fval <skillclass.<serv.skill.<local.i>.key>>> 

   
button 475 <eval <local.a>+170> <hval 04ba> <hval 04b91 0 <eval <dlocal.i>+1>
   
local.a=<eval <local.a>+18>
 ENDFOR

 IF (<
ctag0.rpp_side> == 4)
    
dtext 60 328 2523 Str
    dtext 280 328 025 
<ostr
    
button 475 333 <hval 04ba> <hval 04b91 0 80
      
    dtext 60 348 2523 Dex
    dtext 280 348 025 
<odex
    
button 475 353 <hval 04ba> <hval 04b91 0 81
   
    dtext 60 368 2523 Int
    dtext 280 368 025 
<oint
    
button 475 373 <hval 04ba> <hval 04b91 0 82
   
    dtext 380 328 025 
<skillclass.str>
    
dtext 380 348 025 <skillclass.dex>
    
dtext 380 368 025 <skillclass.int>

 ENDIF

 
   
button 540 413 4014 4015 1 0 100 
   button 570 413 4005 4006 1 0 200 
 

[DIALOG d_rpp_1 BUTTON]

ON=0
tag0
.rpp_message=

ON=100
 
IF (<dctag0.rpp_side> == 0)
     
ctag0.rpp_side=4
  
ELSE
    
ctag0.rpp_side -= 1
 
ENDIF
     
dialog d_rpp_1

ON
=200
 
IF (<dctag0.rpp_side> == 4)
     
ctag0.rpp_side=0
  
ELSE
    
ctag0.rpp_side += 1
 
ENDIF
     
dialog d_rpp_1
     

ON
=1 55
    local
.skill=<eval <argn>-1>

      
DB.QUERY "SELECT * FROM charakter_daten WHERE username='<account.name>' AND UID='<uid>'";
    
local.rpp_gesamt=<db.row.0.RPP_Gesamt>    
    
 IF (<
dlocal.rpp_gesamt> < <def0.d_rpp_abzug_skills>)
    
tag0.rpp_message = <def0.d_keine_punkte>
  ELSEIF (<<
serv.skill.<dlocal.skill>.key>> > 999)
     
tag0.rpp_message = <def0.d_faehigkeit_steigern>
  ELSEIF (<eval <<
serv.skill.<dlocal.skill>.key>>> >= <eval <skillclass.<serv.skill.<dlocal.skill>.key>>> )
      
tag0.rpp_message = <def0.d_faehigkeit_grenze>
  ELSE
       
tag0.rpp_message = <def0.d_faehigkeit_erhoehen>
    
local.rpp_gesamt -= <def0.d_rpp_abzug_skills>
      
DB.QUERY "UPDATE charakter_daten SET RPP_Gesamt='<dlocal.RPP_Gesamt>' WHERE username='<account.name>' AND UID='<uid>';"
    
try src.<dlocal.skill>=<src.<dlocal.skill>>+1    
 
ENDIF
        
dialog d_rpp_1
   
ON
=80
      DB
.QUERY "SELECT * FROM charakter_daten WHERE username='<account.name>' AND UID='<uid>'";
    
local.rpp_gesamt=<db.row.0.RPP_Gesamt>    
    
 IF (<
dlocal.rpp_gesamt> < <def0.d_rpp_abzug_stats>)
    
tag0.rpp_message = <def0.d_keine_punkte>
  ELSEIF (<
str> > <skillclass.str>)
     
tag0.rpp_message = <def0.d_eigenschaften_steigern>
  ELSE
       
tag0.rpp_message = <def0.d_eigenschaft_erhoehen>
    
local.rpp_gesamt -= <def0.d_rpp_abzug_stats>
      
DB.QUERY "UPDATE charakter_daten SET RPP_Gesamt='<dlocal.RPP_Gesamt>' WHERE username='<account.name>' AND UID='<uid>';"
      
str +=1    
 
ENDIF
     
dialog d_rpp_1
  
ON
=81
      DB
.QUERY "SELECT * FROM charakter_daten WHERE username='<account.name>' AND UID='<uid>'";
    
local.rpp_gesamt=<db.row.0.RPP_Gesamt>    
    
 IF (<
dlocal.rpp_gesamt> < <def0.d_rpp_abzug_stats>)
    
tag0.rpp_message = <def0.d_keine_punkte>
  ELSEIF (<
dex> > <skillclass.dex>)
     
tag0.rpp_message = <def0.d_eigenschaften_steigern>
  ELSE
  
      
tag0.rpp_message = <def0.d_eigenschaft_erhoehen>
    
local.rpp_gesamt -= <def0.d_rpp_abzug_stats>
      
DB.QUERY "UPDATE charakter_daten SET RPP_Gesamt='<dlocal.RPP_Gesamt>' WHERE username='<account.name>' AND UID='<uid>';"
      
dex +=1    
 
ENDIF
     
dialog d_rpp_1

ON
=82
      DB
.QUERY "SELECT * FROM charakter_daten WHERE username='<account.name>' AND UID='<uid>'";
    
local.rpp_gesamt=<db.row.0.RPP_Gesamt>    
    
 IF (<
dlocal.rpp_gesamt> < <def0.d_rpp_abzug_stats>)
    
tag0.rpp_message = <def0.d_keine_punkte>
  ELSEIF (<
int> > <skillclass.int>)
     
tag0.rpp_message = <def0.d_eigenschaften_steigern>
  ELSE
  
      
tag0.rpp_message = <def0.d_eigenschaft_erhoehen>
    
local.rpp_gesamt -= <def0.d_rpp_abzug_stats>
      
DB.QUERY "UPDATE charakter_daten SET RPP_Gesamt='<dlocal.RPP_Gesamt>' WHERE username='<account.name>' AND UID='<uid>';"
      
int +=1    
 
ENDIF
     
dialog d_rpp_1
               


// ***************************************************************************​***************************************************
// *                             GM command                                *
// ***************************************************************************​***************************************************


[PLEVEL 2]
rpp
rpn

// ***************************************************************************​***************************************************
// * Give Player RPP Points                                                    *
// ***************************************************************************​***************************************************


[FUNCTION rpp]
IF (<
dargs> > 1000)
    
smsg @<def.def_smsg_sys>,3 This are too much amoung of points!
ELSEIF (<
dargs> == 0)
    
smsg @<def.def_smsg_sys>,3 Zero is a little bit to low.
ELSE
    
smsg @<def.def_smsg_info>,3 Choose a playerwho will get <dargsRPPs.
    
targetfg f_rpp <dargs>,0
ENDIF


// ***************************************************************************​***************************************************
// * Remove Player RPP Points                                                    *
// ***************************************************************************​***************************************************


[FUNCTION rpn]
IF (<
dargs> > 1000)
    
smsg @<def.def_smsg_sys>,3 This are too much amoung of points!
ELSEIF (<
dargs> == 0)
    
smsg @<def.def_smsg_sys>,3 Zero is a little bit to low.
ELSE
    
smsg @<def.def_smsg_info>,3 Choose a playerwho will remove <dargsRPPs.
    
targetfg f_rpp <dargs>,1
ENDIF

[FUNCTION 
f_rpp]
ref1=<argo.uid>
local.rpps=<argv[0]>
local.p=<argv[1]>

IF !(<
ref1.isplayer>)
    
smsg @<def.def_smsg_sys>,3 That is not a player!
ELSE
    
DB.CONNECT
    
IF (<DB.CONNECTED>)
        
DB.QUERY SELECT FROM charakter_daten WHERE username='<ref1.account.name>' AND UID='<ref1.uid>';
        
local.rpp_gesamt=<db.row.0.RPP_Gesamt>
        IF (<
dlocal.p> == 0)
            
local.RPP_Gesamt += <local.rpps>
            
local.RPP = <dlocal.rpps>
        ELSEIF (<
dlocal.p> == 1)
            
local.RPP_Gesamt -= <local.rpps>
            
local.RPP -= <dlocal.rpps>
        ENDIF
        
        IF (<
dlocal.p> == 0)
            IF (<
ref1.tag0.rpp_on>)
                
ref1.smsg @<def.def_smsg_good>,3 You got <dlocal.rppsRPP points.
            ENDIF
            
serv.log <namegave <dlocal.rppsRPPs to player <ref1.name>.
            
smsg @<def.def_smsg_info>,3 You gave <dlocal.rppsRPPs to player <ref1.name>.
            
local.rpp_name="<name> gave <dlocal.rpps> RPP Points to the account <ref1.account.name> and player name <ref1.name> at <serv.rtime><def.br>"
            
        
ELSEIF (<dlocal.p> == 1)
            IF (<
ref1.tag0.rpp_on>)
                
ref1.smsg @<def.def_smsg_info>,3 The Staff removed <dlocal.rppsfrom you!
            ENDIF
            
serv.log <nameremoveed <dlocal.rppsRPPs from player <ref1.name>.
            
smsg @<def.def_smsg_info>,3 You removed <dlocal.rppsRPPs from player <ref1.name>.
            
local.rpp_name="<name> removed <dlocal.rpps> RPP Points from the account <ref1.account.name> and player name <ref1.name> at <serv.rtime> <def.br>"
        
ENDIF
        
DB.QUERY UPDATE charakter_daten SET RPP='<dlocal.RPP>',RPP_Gesamt='<dlocal.RPP_Gesamt>',rpp_name='<local.rpp_name>' WHERE username='<ref1.account.name>' AND UID='<ref1.uid>';
    ELSE
        
smsg @<def.def_smsg_sys>,3 SQl Server is unavailable. Try it again later.
        
serv.log MySQLConnection FAILED!
    ENDIF
    
DB.CLOSE
ELSE
    
smsg @<def.def_smsg_sys>,3 You can only give Players RPP Points.
ENDIF

// ***************************************************************************​***************************************************
// *                             Player command                                *
// ***************************************************************************​***************************************************

[PLEVEL 1]
role
rpps


[FUNCTION role]
IF (<
dtag0.rpp_on>)
    
tag0.rpp_on=
    
smsg @<def.def_smsg_info>,3 Now you will get no News about getting new RPP Points.
ELSE
    
tag0.rpp_on 1
    smsg 
@<def.def_smsg_info>,3 Now you will get News about getting new RPP Points.
ENDIF

[FUNCTION 
rpps]
dialog d_rpp_1


                                                                                                                               
[EOF
08-13-2014 08:14 PM
Find all posts by this user Like Post Quote this message in a reply
[+] 2 users Like admin phoenix's post
Post Reply 


Forum Jump:


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

This forum uses Lukasz Tkacz MyBB addons.