Page 1 of 1

How to Change Class?

Posted: Fri Jan 03, 2014 6:21 pm
by Lamkefyned
How to Change Class?

How to Change Class Mage - Priest and Priest - Mage?

Re: How to Change Class?

Posted: Sat Jan 04, 2014 2:27 am
by rock5
It depends. But if you just have 2 classes and just want to switch between your primary and secondary class, you can use an addon that automates it for you like "streamline". Then all you have to do is target the npc and select the option, eg.

Code: Select all

player:target_NPC("npc name")
RoMScript("ChoiceOption(4)")
If you are going to do any other code in that waypoint you should also do a player:update() before any other code.

Re: How to Change Class?

Posted: Sat Jan 04, 2014 7:24 pm
by BlubBlab
If you have the add-on ClassExchangeHelper (support only 3 classes private have more)
Thier is a way to remote control it:

example:

Code: Select all

player:target_NPC("Marliss-Schwester");
	if(my condition)then
		--From class 1/3 to 3/1
		sendMacro("ChoiceOption(3);")
		yrest(500);
		RoMScript("CEH.func.ExchangeClass(CEH.Data.class1.ID,CEH.Data.class2.ID)");	
		yrest(100);
		RoMScript("SwapEquipmentItem(3)");
		yrest(2000);
		player:update() 
	end
the reversed way:

Code: Select all

player:target_NPC("Marliss-Schwester");
	if(my condition)then
		--From class 3/1 to 1/3
		sendMacro("ChoiceOption(3);")
		yrest(100);
		RoMScript("CEH.func.ExchangeClass(CEH.Data.class2.ID,CEH.Data.class1.ID)");	
		yrest(100);
		RoMScript("SwapEquipmentItem(1)");
		yrest(2000);
		player:update() 
	end

Re: How to Change Class?

Posted: Sat Jan 04, 2014 11:36 pm
by Bill D Cat
And if you don't use any add-ons to help with class swapping, you can use this command to swap your current classes. If you want to swap classes with a third class, then you can specify the class names as described in the comments.

Code: Select all

--==[ Simple function to swap classes at housekeeper inside house ]==--
-- mainClass = CLASS_WARRIOR, CLASS_SCOUT, etc. to become your primary class. No quotes around the class name.
-- secClass  = CLASS_WARRIOR, CLASS_SCOUT, etc. to become your secondary class. No quotes around the class name.
-- If no arguments are given, then the player's current classes will be swapped.

function swapClass(mainClass, secClass)
	player:target_NPC(110758) -- ID for housemaid inside house
	yrest(1000)
	ChoiceOptionByName(getTEXT("HOUSE_MAID_HOUSE_CHANGEJOB"))
	yrest(3000)
	player:update()
	local pri, sec
	if mainClass == nil then
		pri = player.Class2 + 1
		sec = player.Class1 + 1
	else
		pri = mainClass + 1
		sec = secClass + 1
	end
	RoMScript("ExchangeClass("..pri..","..sec..")")
end
Example:

Code: Select all

swapClass(CLASS_MAGE,CLASS_WARRIOR)

Re: How to Change Class?

Posted: Sun Jan 05, 2014 8:05 am
by Lamkefyned
Thank you so much

Re: How to Change Class?

Posted: Fri Jan 10, 2014 7:06 pm
by Lamkefyned
error

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
<!-- Demonstration Battle daily quest -->
<!-- v1.0 -->
<!-- by: lolita -->
<!-- Do Demonstration Battle daily quest in Rorazan, and use daily reset tickets if you have some -->
<onLoad>
settings.profile.mobs = {106474,106475,106476};
function checkCondition()
	queststate = getQuestStatus(425124);
	if queststate == "complete" then
		__WPL:setWaypointIndex(__WPL:findWaypointTag("complete"));
	end
end

function checkLoopCondition()
	queststate = getQuestStatus(425124);
	if queststate ~= "complete" then
	__WPL:setWaypointIndex(__WPL:findWaypointTag("incomplete"));
	end
end

function getclass()
	-- those 3 class can be main or secoundary
	if (player.Class1 == 4 or player.Class2 == 4) then -- mage
		SlashCommand("/cast Fireball")
	elseif (player.Class1 == 2 or player.Class2 == 2) then -- scout
		SlashCommand("/cast Shot")
	elseif (player.Class1 == 3 or player.Class2 == 3)  then 	-- rogue
		SlashCommand("/cast Shadowstab")
	-- class who can do daily
	elseif player.Class1 == 5 then 			-- priest
		SlashCommand("/cast Chain of Light")
	elseif player.Class1 == 6 then 			-- knight
		SlashCommand("/cast Holy Strike")
	elseif player.Class1 == 7 then 			-- warden
		SlashCommand("/cast Charged Chop")
	elseif player.Class1 == 9 then 			-- warlock
		SlashCommand("/cast Surge of Malice")
	-- for those 3 class didnt found useful skill for doing this daily
	-- so you must use them with mage, scout or rogue as secoundary class
	elseif player.Class1 == 8 then 			-- druid
		printf("Pls change your secondary class to Mage or Scout or Rogue");
		player:sleep()
	elseif player.Class1 == 10 then 		-- champion
		printf("Pls change your secondary class to Mage or Scout or Rogue");
		player:sleep()
	elseif player.Class1 == 1 then 			-- warrior
		printf("Pls change your secondary class to Mage or Scout or Rogue");
		player:sleep()
	end
end
function doquest()
	LockedOn = RoMScript("UnitExists('target')")
	enemy = RoMScript("UnitCanAttack('player','target')")
	if (not LockedOn) or (not enemy) then
		for i=1,5 do
			if getQuestStatus(425124) == "complete" then
				break
			end
			RoMScript("TargetNearestEnemy()")
			getclass()
			yrest(500)
		end
	end
end
</onLoad>	
	<!-- #  1 --><waypoint x="-18346" z="-22692" y="469">
	checkCondition()	
	local dailyQuestCount, dailyQuestsPerDay= RoMScript("Daily_count()");
			if 10 == dailyQuestCount then
				if inventory:itemTotalCount(202434) > 0 then
					printf("We will use Daily Quest Reset Ticket");
					inventory:useItem(202434)
					yrest(1000)
					loadPaths(__WPL.FileName)
				elseif inventory:itemTotalCount(202434) == 0 then
					error("Ending script",2)
				end
			else
      			printf("Done "..dailyQuestCount.." of " .. dailyQuestsPerDay ..    " Left " .. dailyQuestsPerDay - dailyQuestCount .. " Quests.");
      		end
			player:target_NPC(119856)
			AcceptQuestByName(425124)
	</waypoint>
	<!-- #  2 --><waypoint x="-18346" z="-22692" y="469" tag="incomplete">
			player:target_NPC(119856)
			sendMacro("ChoiceOption(1);")
	</waypoint>
	<!-- #  3 --><waypoint x="-18331" z="-22677" y="469">
			doquest()
			checkLoopCondition()
	</waypoint>
	<!-- #  4 --><waypoint x="-18346" z="-22692" y="469" tag="complete">	</waypoint>
	<!-- #  5 --><waypoint x="-18356" z="-22767" y="459">	</waypoint>
	<!-- #  6 --><waypoint x="-18405" z="-22943" y="459">	</waypoint>
	<!-- #  7 --><waypoint x="-18263" z="-22960" y="459">	</waypoint>
	<!-- #  8 --><waypoint x="-17936" z="-23020" y="471">	</waypoint>
	<!-- #  9 --><waypoint x="-17610" z="-23325" y="552">	</waypoint>
	<!-- # 10 --><waypoint x="-17601" z="-23528" y="552">	</waypoint>
	<!-- # 11 --><waypoint x="-17264" z="-23427" y="620">
player:target_NPC(120185);
   if(my condition)then
      sendMacro("ChoiceOption(3);")
      yrest(500);
      RoMScript("CEH.func.ExchangeClass(CEH.Data.class1.ID,CEH.Data.class2.ID)");   
      yrest(100);
      RoMScript("SwapEquipmentItem(3)");
      yrest(2000);
      player:update() 
   end
	</waypoint>
	<!-- # 12 --><waypoint x="-17341" z="-23542" y="624">	</waypoint>
	<!-- # 13 --><waypoint x="-18244" z="-23356" y="458">	</waypoint>
	<!-- # 14 --><waypoint x="-18518" z="-23124" y="425">	</waypoint>
	<!-- # 15 --><waypoint x="-18380" z="-22777" y="459">	</waypoint>
	<!-- # 16 --><waypoint x="-18352" z="-22714" y="472">
			player:target_NPC(119856);
			CompleteQuestByName(425124);
	</waypoint>
	<!-- # 17 --><waypoint x="-18095" z="-23006" y="471">	</waypoint>
	<!-- # 18 --><waypoint x="-17759" z="-23134" y="471">	</waypoint>
	<!-- # 19 --><waypoint x="-17634" z="-23378" y="552">	</waypoint>
	<!-- # 20 --><waypoint x="-17610" z="-23546" y="552">	</waypoint>
	<!-- # 21 --><waypoint x="-17262" z="-23415" y="620">
player:target_NPC(120185);
   if(my condition)then
      sendMacro("ChoiceOption(3);")
      yrest(100);
      RoMScript("CEH.func.ExchangeClass(CEH.Data.class2.ID,CEH.Data.class1.ID)");   
      yrest(100);
      RoMScript("SwapEquipmentItem(1)");
      yrest(2000);
      player:update() 
   end
	</waypoint>
	<!-- # 22 --><waypoint x="-17334" z="-23554" y="624">	</waypoint>
	<!-- # 23 --><waypoint x="-18181" z="-23394" y="458">	</waypoint>
	<!-- # 24 --><waypoint x="-18500" z="-23144" y="425">	</waypoint>
	<!-- # 25 --><waypoint x="-18361" z="-22717" y="473">	</waypoint>
</waypoints>
Sin título.png

Re: How to Change Class?

Posted: Fri Jan 10, 2014 10:34 pm
by rock5
if(my condition)then
You probably copied this code from some example. "my condition" is supposed to be replaced with your condition, ie. under what circumstances you want to execute that code.

Re: How to Change Class?

Posted: Fri Jan 10, 2014 10:45 pm
by Lamkefyned
And I have to put?

code put it up our friend BlubBlab

Re: How to Change Class?

Posted: Sat Jan 11, 2014 12:50 am
by BlubBlab
my condition was something like:

Code: Select all

player.Name=="mychar" and player.Level > 70
if you want to use it without any condition simple erase the code around it

Code: Select all

if()then 
.<= Let that stay
.<= until end
end

Re: How to Change Class?

Posted: Sat Jan 11, 2014 4:55 am
by Lamkefyned
thanks

Re: How to Change Class?

Posted: Fri Jan 17, 2014 2:51 pm
by 883Dman
Been trying to get this work for an hour. Tried half a dozen different methods. I just want to swap between my two classes to turn in drake bones. Dont need to swap gear or mess with skills.

Code: Select all

	<!-- #  1 --><waypoint x="-6621" z="-8128" y="1466">
			
	player:target_NPC("Sahaly Leitin");
   if()then
      
      sendMacro("ChoiceOption(3);")
      yrest(500);
      RoMScript("CEH.func.ExchangeClass(CEH.Data.class1.ID,CEH.Data.class2.ID)");   
      yrest(100);
    
      player:update() 
   end
	</waypoint>
I tried removing the if statement altogether, pasting it exactly as shown above, tried just doing a choose option 3, choose option 2 etc to change class. What's shown just crashes. Doing simple option selection doesn't do anything, which is odd.

Re: How to Change Class?

Posted: Fri Jan 17, 2014 4:10 pm
by BlubBlab

Code: Select all

<!-- #  1 --><waypoint x="-6621" z="-8128" y="1466">
         
   player:target_NPC("Sahaly Leitin");
  
     
      sendMacro("ChoiceOption(3);")
      yrest(500);
      RoMScript("CEH.func.ExchangeClass(CEH.Data.class1.ID,CEH.Data.class2.ID)");   
      yrest(100);
   
      player:update()
   
   </waypoint>
you should have deleted if and end completely.

Re: How to Change Class?

Posted: Sat Jan 18, 2014 7:47 pm
by 883Dman
I knew it was something simple. Thx.