ArcEmu: [lua Help] Reset Spells - ArcEmu

Jump to content

Toggle shoutbox Lastest Announcements

dfighter  : (07 December 2014 - 12:06 PM) Arcemu is in hibernation mode, please read http://arcemu.org/fo...showtopic=26903
dfighter  : (01 January 2013 - 05:56 PM) Arcemu wishes you all a happy new year!
Hasbro  : (12 September 2012 - 10:01 AM) Please excuse our outage from the web! Our web host had a major malfunction!
dfighter  : (01 September 2012 - 04:05 PM) Since the spam bots just don't want to stop, I've enabled admin verification when registering.
dfighter  : (23 January 2012 - 09:56 PM) Please note that from now on you will need to confirm your email on the wiki in order to edit it!
Hasbro  : (31 December 2011 - 12:50 PM) Happy New Years all!
Navid  : (26 December 2011 - 04:09 AM) Merry Christmas !!!!!! Happy holidays all :)
WAmadeus  : (24 December 2011 - 03:54 PM) Merry Christmas to all!
dfighter  : (24 December 2011 - 11:05 AM) The Arcemu team wishes y'all a Merry Christmukkah!
Hasbro  : (05 October 2011 - 12:53 PM) Looking for web designers for upcoming web related project. If you're interested in designing user interfaces contact me
dfighter  : (02 September 2011 - 03:47 PM) So who here wants vehicles in Arcemu? :P http://arcemu.org/fo...showtopic=25440
Hasbro  : (14 August 2011 - 03:25 PM) Join us on irc, grab an irc client and connect to irc.freenode.net join channel #arcemu /server irc.freenode.net:6667 /join #arcemu
jackpoz  : (03 August 2011 - 05:33 AM) to all Lua Engine (old one) users: please check http://arcemu.org/fo...showtopic=25274
Hasbro  : (20 May 2011 - 05:27 PM) Looking for people experienced with CMake configuration and setup! Contact me asap
Hasbro  : (15 May 2011 - 05:03 PM) ArcEmu is recruiting C++ programmers, contact Hasbro if interested.
paroxysm  : (03 May 2011 - 06:26 PM) Updated luabridge gossip example to describe the whole gossip creation process rather than just how to create menu. Gossip tutorial
paroxysm  : (23 April 2011 - 11:35 AM) Lua writers can refer to the Luabridge Tutorials section in the Wiki to learn how to write gossip code correctly.
Hasbro  : (20 April 2011 - 05:22 PM) Thank you for your continuous contribution of bug reports, we are working on them.
Hasbro  : (17 April 2011 - 03:20 AM) Please consider donating to support our bills. Donations can be sent using PayPal to donations@arcemu.org - Thank you for your support.
paroxysm  : (10 April 2011 - 12:43 AM) Refer to the Luabridge Tutorials section in the Wiki to learn the new syntax of luabridge.
Resize Shouts Area

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

[lua Help] Reset Spells

#1 User is offline   exestyle 

  • Newbie
  • Group: Members
  • Posts: 7
  • Joined: 04-September 09

Posted 09 October 2011 - 11:27 AM

Know someone the lua command of resetspells
Something like Player:ResetTalents()
or how i gate to reset spells on character whit lua script ?
Old lua Sistem.
0

#2 User is offline   jackpoz 

  • ArcEmu Lemon Priest
  • PipPipPipPipPipPipPipPip
  • Group: Developers
  • Posts: 2,153
  • Joined: 19-June 08
  • Gender:Male
  • Location:Italy
  • Server OS:Windows

Posted 09 October 2011 - 11:56 AM

could it be Player:UnlearnSpell(spellID) ?
Posted Image We develop dreams. Your dreams ;)
Posted ImagePosted Image
0

#3 User is offline   exestyle 

  • Newbie
  • Group: Members
  • Posts: 7
  • Joined: 04-September 09

Posted 09 October 2011 - 12:19 PM

View Postjackpoz, on 09 October 2011 - 11:56 AM, said:

could it be Player:UnlearnSpell(spellID) ?


i know theat but wanna be like command resetspells to reset or remove all spells once

or maibe you can help me whit this(one of idea)

function UnLearnSpells(event, player)
Player:UnlearnSpell(id)
Player:UnlearnSpell(id)
Player:UnlearnSpell(id)
...etc
end

to execute in

function ResetCharacter(pUnit, event, Player, id, intid, code)
if(intid == 1) then
Player:UnlearnSpell(..HERE..)
Player:ResetTalents()
Player:GossipComplete()
Player:SendBroadcastMessage(TEXT)
end
end

thank you :)
0

#4 User is offline   jackpoz 

  • ArcEmu Lemon Priest
  • PipPipPipPipPipPipPipPip
  • Group: Developers
  • Posts: 2,153
  • Joined: 19-June 08
  • Gender:Male
  • Location:Italy
  • Server OS:Windows

Posted 09 October 2011 - 01:02 PM

I'm not sure resetting all spells is a good idea, as there are some passive spells learnt when creating the character (like Parry for example) that you probably don't want to remove. What are you trying to accomplish resetting the spells? Maybe we can find a better solution for what you want (your UnLearnSpells() function could even accept a table as parameter with all the spell ids that it should remove).
Posted Image We develop dreams. Your dreams ;)
Posted ImagePosted Image
0

#5 User is offline   exestyle 

  • Newbie
  • Group: Members
  • Posts: 7
  • Joined: 04-September 09

Posted 09 October 2011 - 01:18 PM

Script is about change class and race ,theat is the reson of this reset of spells.

Becose when you change the class or race you have the old spells.
This script can be used by player to fix his character if have problems on him.
Whit talents was easy...
0

#6 User is offline   jackpoz 

  • ArcEmu Lemon Priest
  • PipPipPipPipPipPipPipPip
  • Group: Developers
  • Posts: 2,153
  • Joined: 19-June 08
  • Gender:Male
  • Location:Italy
  • Server OS:Windows

Posted 09 October 2011 - 04:14 PM

Right now each player class has its own C++ type so changing class ingame will require at least to logout and login. What you are trying to do goes beyond the scope and meaning of a scripting engine as it requires knowledge of how ArcEmu works and ability to edit the sources to add the "change class" functionality you want.
Posted Image We develop dreams. Your dreams ;)
Posted ImagePosted Image
0

#7 User is offline   exestyle 

  • Newbie
  • Group: Members
  • Posts: 7
  • Joined: 04-September 09

Posted 09 October 2011 - 04:53 PM

Whit your permison and whit Releaser of this script i can link you the script to know what is about.
He make but is not finish yet soo i thing maybe someone more good of as we can help to finish him.
Is a funny thing and dont see something like this before.
Is no problem if dont wanna help us and im sorry if make or sed something wrong becose you know betther of us.
I make or fix many scripts, but this is little harder, i find a way to fix a little but by remove spels(skills) and learn again of every race and class after used, make my script like more then 15k lines...
Thank you
0

#8 User is offline   jackpoz 

  • ArcEmu Lemon Priest
  • PipPipPipPipPipPipPipPip
  • Group: Developers
  • Posts: 2,153
  • Joined: 19-June 08
  • Gender:Male
  • Location:Italy
  • Server OS:Windows

Posted 10 October 2011 - 03:15 AM

you don't have to ask my permission to post your script, I was just giving you some more informations on the issues you may come up. But as I said , if you look at void WorldSession::LoadPlayerFromDBProc(QueryResultVector & results) there's
switch(_class)
	{
		case WARRIOR:
			plr = new Warrior(playerGuid);
			break;
		case PALADIN:
			plr = new Paladin(playerGuid);
			break;
		case HUNTER:
			plr = new Hunter(playerGuid);
			break;
		case ROGUE:
			plr = new Rogue(playerGuid);
			break;
		case PRIEST:
			plr = new Priest(playerGuid);
			break;
		case DEATHKNIGHT:
			plr = new DeathKnight(playerGuid);
			break;
		case SHAMAN:
			plr = new Shaman(playerGuid);
			break;
		case MAGE:
			plr = new Mage(playerGuid);
			break;
		case WARLOCK:
			plr = new Warlock(playerGuid);
			break;
		case DRUID:
			plr = new Druid(playerGuid);
			break;
	}

so if you change the class while logged in it will most likely cause issues to the Player. Maybe same goes for race, like setting the right factions and passive spells (for example Humans get a 10% reputation bonus).
Maybe you didn't see anything like what you want to do before because it's more complicated than how it looks, but hey, good luck^^
Posted Image We develop dreams. Your dreams ;)
Posted ImagePosted Image
0

#9 User is offline   Belias 

  • Member
  • Pip
  • Group: Members
  • Posts: 48
  • Joined: 12-October 08
  • Gender:Male
  • Server OS:Linux

Posted 12 October 2011 - 04:59 AM

hey guys^^

first if u wanna delete more then 1 spell, build tables for each class, build some function(use 2 simple loops...) like this ;)

local rogue = {12345,112233,...} -- table ;D

unlearnall = function(_table,_plr)
local swap = {}
   for v, w in pairs (_table)do
	swap[w] = v
   end
   for _spell, c in pairs(swap) do
	_plr:UnlearnSpell(_spell)
   end
end


but i think jackpoz is right.. u need to know how it work before u start to work :D

anyway maybe my func wana help you^^

mfg Belias
0

#10 User is offline   exestyle 

  • Newbie
  • Group: Members
  • Posts: 7
  • Joined: 04-September 09

Posted 12 October 2011 - 07:10 AM

View PostBelias, on 12 October 2011 - 04:59 AM, said:

hey guys^^

first if u wanna delete more then 1 spell, build tables for each class, build some function(use 2 simple loops...) like this ;)

local rogue = {12345,112233,...} -- table ;D

unlearnall = function(_table,_plr)
local swap = {}
   for v, w in pairs (_table)do
	swap[w] = v
   end
   for _spell, c in pairs(swap) do
	_plr:UnlearnSpell(_spell)
   end
end


but i think jackpoz is right.. u need to know how it work before u start to work :D

anyway maybe my func wana help you^^

mfg Belias


need old lua
0

#11 User is offline   Belias 

  • Member
  • Pip
  • Group: Members
  • Posts: 48
  • Joined: 12-October 08
  • Gender:Male
  • Server OS:Linux

Posted 12 October 2011 - 10:43 AM

well its is only some example but why it need the old lua Oo u can change the lua cmd in the second loop if u want
0

#12 User is offline   Darren 

  • Occasional Poster
  • PipPip
  • Group: Members
  • Posts: 104
  • Joined: 18-June 08

Posted 12 October 2011 - 12:25 PM

you can look at the spells used in .char learnall
1

#13 User is offline   jackpoz 

  • ArcEmu Lemon Priest
  • PipPipPipPipPipPipPipPip
  • Group: Developers
  • Posts: 2,153
  • Joined: 19-June 08
  • Gender:Male
  • Location:Italy
  • Server OS:Windows

Posted 12 October 2011 - 01:51 PM

View PostDarren, on 12 October 2011 - 12:25 PM, said:

you can look at the spells used in .char learnall

I suggest to test them anyway, I wouldn't trust much that old command^^
Posted Image We develop dreams. Your dreams ;)
Posted ImagePosted Image
1

#14 User is offline   Darren 

  • Occasional Poster
  • PipPip
  • Group: Members
  • Posts: 104
  • Joined: 18-June 08

Posted 12 October 2011 - 02:45 PM

True, true!
0

#15 User is offline   exestyle 

  • Newbie
  • Group: Members
  • Posts: 7
  • Joined: 04-September 09

Posted 16 October 2011 - 01:00 AM

Im Sorry the script is finished, thank you for your help and ideas :)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users