Eclipse
January 05, 2009, 08:44:01 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Chat Help Rules Arcade Search Calendar Gallery Login Register  
 
 
 
Recent Topics +-
THE Cult by Simius Cruentus
Today at 08:43:31 PM

Makai Realms by kira423
Today at 08:41:25 PM

Disparity Recruiting by ʇıunpp ʎqɹıʞ࣭
Today at 08:40:53 PM

My Game by Kreator
Today at 08:40:25 PM

Dreadlord Online v1.2 Beta - Need Moderators and Trustworthy Mappers! by Kreator
Today at 08:38:42 PM

[$$] Paying Paypal - GFX artists [$$] by Baron
Today at 08:36:28 PM

The New Eclipse Raid on Runscape by The Tribal
Today at 08:33:34 PM

SnowCap by Baron
Today at 08:33:04 PM

Server Status by westin444
Today at 08:27:23 PM

Request SVN/GIT by The Tribal
Today at 08:20:31 PM

Members Online +-
13 Guests, 23 Users
Simius Cruentus,
‪‫‬‭‮‪‫‬‭The Admiral,
Baron,
kira423,
Kreator,
The Roujo,
Ninja-Tech,
Peter,
RamBONE,
ʇıunpp ʎqɹıʞ࣭,
Juggernaut,
Marsh,
Cakkrah,
Kainan54,
Amperglyph,
Airscar,
westin444,
thingyguy,
The Tribal,
softbagel14,
Almighty Wing,
l0lz!,
Niko
Pages: [1]
  Print  
Author Topic: level Tokens and storage  (Read 696 times)
0 Members and 1 Guest are viewing this topic.
Cro
Newb
*
Offline Offline

Posts: 22


View Profile Email
« on: January 17, 2006, 09:55:45 PM »

Can someone help me make a script that every time a person levels up they gain a token (the token can be handed in like money to a store that will trade you HP, MP, or SP ups and spells) I almost have it down but I want to see if I can give more tokens out depending on the level
Example: level 2-10 will get 1 token, level 11-20 will get 2 tokens and so on
Also, Is there a way so spots on the map that items are dropped in, those items will never disappear (such as a personal bank vault or a storage room in player owned houses)
Steve
Active Member
***
Offline Offline

Posts: 171


View Profile WWW Email
« Reply #1 on: January 18, 2006, 03:11:09 PM »

Find this in you main.txt
Code: [Select]

Sub PlayerLevelUp(index)
Dim I    
Dim D
Dim C
   
    C = 0
    Do While GetPlayerExp(index) => GetPlayerNextLevel(index)    
        D = GetPlayerExp(index) - GetPlayerNextLevel(index)
        Call SetPlayerLevel(index, GetPlayerLevel(index) + 1)
        I = Int(GetPlayerSPEED(index) / 10)
        If I < 1 Then I = 1
        If I > 3 Then I = 3
           
        Call SetPlayerPOINTS(index, GetPlayerPOINTS(index) + 1)
        Call SetPlayerExp(index, D)      
        C = C + 1
    Loop
    If C > 1 Then
        'Call GlobalMsg(GetPlayerName(index) & " has gained " & C & " levels!", 6)
    Else
        'Call GlobalMsg(GetPlayerName(index) & " has gained a level!", 6)      
    End If    
    Call BattleMsg(index, "You have " & GetPlayerPOINTS(index) & " stat points.", 9, 0)  
End Sub

All you need to do is put this code here:
Code: [Select]

Call GiveItem(index, ITEM NUMBER, ITEM AMOUNT)

You need to put that where it says ------------------HERE-------------------
Code: [Select]

Sub PlayerLevelUp(index)
Dim I    
Dim D
Dim C
   
    C = 0
    Do While GetPlayerExp(index) => GetPlayerNextLevel(index)    
        D = GetPlayerExp(index) - GetPlayerNextLevel(index)
        Call SetPlayerLevel(index, GetPlayerLevel(index) + 1)
--------------------------HERE----------------------------------------------
        I = Int(GetPlayerSPEED(index) / 10)
        If I < 1 Then I = 1
        If I > 3 Then I = 3
           
        Call SetPlayerPOINTS(index, GetPlayerPOINTS(index) + 1)
        Call SetPlayerExp(index, D)      
        C = C + 1
    Loop
    If C > 1 Then
        'Call GlobalMsg(GetPlayerName(index) & " has gained " & C & " levels!", 6)
    Else
        'Call GlobalMsg(GetPlayerName(index) & " has gained a level!", 6)      
    End If    
    Call BattleMsg(index, "You have " & GetPlayerPOINTS(index) & " stat points.", 9, 0)  
End Sub
dbgtrulz
Active Member
***
Offline Offline

Posts: 197


View Profile WWW Email
« Reply #2 on: January 18, 2006, 04:23:15 PM »

Let me see if I remember this correctly, but If you want to give 1 token for each 10 levels, where steve said ITEM AMMOUNT, put:
Code: [Select]
Int(GetPlayerLevel(index)/10)
That takes the players level, divides it by 10, the gets rid of the decimal. For example, if the player leveled to 27, it would divide by 10 (which gives you 2.7) and get rid of the decimal (which will leave you with 2)
Pages: [1]
  Print  
 
 

Powered by EzPortal
Powered by MySQL Powered by PHP Powered by SMF 2.0 Beta 4 | SMF © 2006–2008, Simple Machines LLC | Sitemap Valid XHTML 1.0! Valid CSS!
Page created in 0.339 seconds with 33 queries.