Eclipse
January 05, 2009, 07:28:49 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 +-
Azkanan's Workshop (Graphics) by Devogen
Today at 07:28:02 PM

New DezireSoft forums by The BanHammer! [Thor!]
Today at 07:27:15 PM

Makai Realms by Sʎ|3><(_)z
Today at 07:25:28 PM

Lostica [Project Revamp] by Sʎ|3><(_)z
Today at 07:23:54 PM

Teh Cult by Teh_General
Today at 07:17:35 PM

Phantasy Forum by Sʎ|3><(_)z
Today at 07:16:16 PM

Will do custom graphics using Photoshop (GUI/Banners/Logos/PD Sprites/ect..) by Sʎ|3><(_)z
Today at 07:15:30 PM

[E++] Fun with sprites! by Hikaru
Today at 07:11:35 PM

The New Eclipse Raid on Runscape by Teh Jna
Today at 07:10:00 PM

Disparity Recruiting by Peter
Today at 07:08:30 PM

Members Online +-
14 Guests, 26 Users
Hikaru,
shrig94,
2guns,
Xavi,
Sʎ|3><(_)z,
Devogen,
karminezr0x,
‪‫‬‭‮‪‫‬‭Admiral Refuge,
The BanHammer! [Thor!],
Echo ♥ Pie,
Simius Cruentus,
dragonlord52,
Kreator,
Keebler Elf,
Southern,
Niko,
MrAreth,
Syner,
Electrokinesis,
Elixix,
westin444,
grenegg1,
Teh_General,
colby250,
kira423,
l0lz!
Pages: [1]
  Print  
Author Topic: GiveSpell/TakeSpell  (Read 943 times)
0 Members and 1 Guest are viewing this topic.
Pickle
REBEL SCUM
Veteran
Advanced Eclipser
*
Offline Offline

Posts: 1,765


So, a baby seal walks into a club...


View Profile Email
« on: July 28, 2006, 04:47:04 PM »

Wrote these a while back for a different script. Hope someone finds them useful :)

Copy into your main (bottom works fine):

Code: [Select]

'GiveSpell/TakeSpell subs
'Written by PICKLE :O
'**************************
Sub GiveSpell(index, spell)
'**************************
Dim slot
slot = 1
Do while slot <= 20
If GetPlayerSpell(index, Int(slot)) < 1 Then
Call SetPlayerSpell(index, Int(slot), spell)
Exit Sub
End If
slot = slot + 1
Loop
End Sub

'**************************
Sub TakeSpell(index, spell)
'**************************
Dim slot
slot = 1
Do while slot <= 20
If GetPlayerSpell(index, Int(slot)) < 1 Then
Call SetPlayerSpell(index, Int(slot), 0)
Exit Sub
End If
slot = slot + 1
Loop
End Sub

'***********************
Sub ClearSpells(index)
'***********************
Dim slot
slot = 1
Do while slot <= 20
Call SetPlayerSpell(index, Int(slot), 0)
slot = slot + 1
Loop
Call PlayerMsg(index, "Spells cleared.", 14)
End Sub


Usage:

Call GiveSpell(index, spell)

Sets a player's spell slot to the spell number you specify

Call TakeSpell(index, spell)

Removes one of the spells you specify from the player's spell list

Call ClearSpells(index)

Completely clears the spell list

Note: TakeSpell isn't tested so if someone could tell me if that works that'd be great.
unixfr3ak
Member
**
Offline Offline

Posts: 74


Green Dixy The Source is Your End


View Profile Email
« Reply #1 on: October 25, 2007, 11:54:24 PM »

with this one wouldint you need something like


Code: [Select]
If LCase(Mid(TextSay, 1, 6)) = "/takespell" Then
   Call GiveSpell(index, spell)
 end sub
end if

sorry just learning so if i compleetly messed up ....  you know what i mean thoe
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.704 seconds with 33 queries.